diff mbox series

[BlueZ,13/14] bass: Add API to check BIS required for sync

Message ID 20240821145602.92083-14-iulia.tanasescu@nxp.com (mailing list archive)
State Superseded
Headers show
Series Add Scan Delegator support for Add Source op | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS

Commit Message

Iulia Tanasescu Aug. 21, 2024, 2:56 p.m. UTC
This adds a wrapper over bt_bass_check_bis, which receives a Broadcaster
device and a BIS index and checks is the Delegator has been instructed
to sync with the specific BIS transmitted by the Source.
---
 profiles/audio/bass.c | 14 ++++++++++++++
 profiles/audio/bass.h |  2 ++
 2 files changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index 47445b4b5..1c63bc163 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -125,6 +125,20 @@  static bool delegator_match_device(const void *data, const void *match_data)
 	return dg->device == device;
 }
 
+bool bass_check_bis(struct btd_device *device, uint8_t bis)
+{
+	struct bass_delegator *dg;
+
+	dg = queue_find(delegators, delegator_match_device, device);
+	if (!dg)
+		return true;
+
+	if (!bt_bass_check_bis(dg->src, bis))
+		return false;
+
+	return true;
+}
+
 static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state,
 				uint8_t new_state, void *user_data)
 {
diff --git a/profiles/audio/bass.h b/profiles/audio/bass.h
index 7e20385e5..5e34db90a 100644
--- a/profiles/audio/bass.h
+++ b/profiles/audio/bass.h
@@ -14,3 +14,5 @@  void bass_remove_stream(struct btd_device *device);
 
 bool bass_bcast_probe(struct btd_device *device, struct bt_bap *bap);
 bool bass_bcast_remove(struct btd_device *device);
+
+bool bass_check_bis(struct btd_device *device, uint8_t bis);