From: Claudia Draghicescu <claudia.rosu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: Claudia Draghicescu <claudia.rosu@nxp.com>
Subject: [PATCH BlueZ 1/1] adapter: Allow broadcaster to be passed up to application
Date: Wed, 5 Jul 2023 10:32:19 +0300 [thread overview]
Message-ID: <20230705073219.5357-2-claudia.rosu@nxp.com> (raw)
In-Reply-To: <20230705073219.5357-1-claudia.rosu@nxp.com>
Allow a broadcast advertiser to be passed up to application,
if the scanner is an ISO Sync Receiver capable device.
This allows for a broadcast sink to discover broadcast sources.
---
src/adapter.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index 2679d4302..dbc469651 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7031,6 +7031,16 @@ 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,
+ struct eir_data *eir_data)
+{
+ if ((btd_adapter_has_settings(adapter, MGMT_SETTING_ISO_SYNC_RECEIVER))
+ && !(eir_data->flags & (EIR_LIM_DISC | EIR_GEN_DISC)))
+ return true;
+
+ return false;
+}
+
static void filter_duplicate_data(void *data, void *user_data)
{
struct discovery_client *client = data;
@@ -7154,12 +7164,18 @@ void btd_adapter_device_found(struct btd_adapter *adapter,
return;
}
+ if (accept_bcast_adv(adapter, &eir_data))
+ monitoring = true;
+
if (!discoverable && !monitoring && !eir_data.rsi) {
eir_data_free(&eir_data);
return;
}
dev = adapter_create_device(adapter, bdaddr, bdaddr_type);
+
+ if (accept_bcast_adv(adapter, &eir_data))
+ btd_device_set_temporary(dev, false);
}
if (!dev) {
--
2.34.1
next prev parent reply other threads:[~2023-07-05 7:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 7:32 [PATCH BlueZ 0/1] adapter: Allow broadcaster to be passed up to application Claudia Draghicescu
2023-07-05 7:32 ` Claudia Draghicescu [this message]
2023-07-05 8:37 ` bluez.test.bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230705073219.5357-2-claudia.rosu@nxp.com \
--to=claudia.rosu@nxp.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox