2023-08-08 16:45:40

by Claudia Draghicescu

[permalink] [raw]
Subject: [PATCH BlueZ v5 3/7] adapter: Do not filter out broadcast advertiser

This allows a broadcast advertiser to be passed up to application,
if the adapter has the capability of being a Synchronized Receiver.

---
src/adapter.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index 491bd7031..fa15030e0 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7029,6 +7029,13 @@ static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data,
return got_match;
}

+static bool accept_bcast_adv(struct btd_adapter *adapter)
+{
+ if ((btd_adapter_has_settings(adapter, MGMT_SETTING_ISO_SYNC_RECEIVER)))
+ return true;
+
+ return false;
+}
static void filter_duplicate_data(void *data, void *user_data)
{
struct discovery_client *client = data;
@@ -7152,6 +7159,9 @@ void btd_adapter_device_found(struct btd_adapter *adapter,
return;
}

+ if (accept_bcast_adv(adapter))
+ monitoring = true;
+
if (!discoverable && !monitoring && !eir_data.rsi) {
eir_data_free(&eir_data);
return;
--
2.34.1



2023-08-09 01:08:20

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ v5 3/7] adapter: Do not filter out broadcast advertiser

Hi Claudia,

On Tue, Aug 8, 2023 at 9:45 AM Claudia Draghicescu <[email protected]> wrote:
>
> This allows a broadcast advertiser to be passed up to application,
> if the adapter has the capability of being a Synchronized Receiver.

We probably need a proper method to check if there is any profile with
probe_on_discover that matches the advertising before we allow every
broadcaster to be added as a new device.

> ---
> src/adapter.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index 491bd7031..fa15030e0 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -7029,6 +7029,13 @@ static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data,
> return got_match;
> }
>
> +static bool accept_bcast_adv(struct btd_adapter *adapter)
> +{
> + if ((btd_adapter_has_settings(adapter, MGMT_SETTING_ISO_SYNC_RECEIVER)))
> + return true;
> +
> + return false;
> +}
> static void filter_duplicate_data(void *data, void *user_data)
> {
> struct discovery_client *client = data;
> @@ -7152,6 +7159,9 @@ void btd_adapter_device_found(struct btd_adapter *adapter,
> return;
> }
>
> + if (accept_bcast_adv(adapter))
> + monitoring = true;
> +
> if (!discoverable && !monitoring && !eir_data.rsi) {
> eir_data_free(&eir_data);
> return;
> --
> 2.34.1
>


--
Luiz Augusto von Dentz