diff mbox series

[BlueZ,v5,3/7] adapter: Do not filter out broadcast advertiser

Message ID 20230808115040.4403-4-claudia.rosu@nxp.com
State New
Headers show
Series Add support for BAP broadcast sink | expand

Commit Message

Claudia Draghicescu Aug. 8, 2023, 11:50 a.m. UTC
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(+)

Comments

Luiz Augusto von Dentz Aug. 8, 2023, 11:20 p.m. UTC | #1
Hi Claudia,

On Tue, Aug 8, 2023 at 9:45 AM Claudia Draghicescu <claudia.rosu@nxp.com> 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
>
diff mbox series

Patch

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;