[PATCH BlueZ 12/14] shared/bass: Add API to check BIS required for sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds a shared/bass API to check if a BIS index of a Broadcast Source
has been requested by the Broadcast Assistant to be synced with. This will
be used by BAP after parsing the BASE, to filter out the streams that don't
need to be created.
---
 src/shared/bass.c | 14 ++++++++++++++
 src/shared/bass.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/src/shared/bass.c b/src/shared/bass.c
index 8f02086a1..76287cfbc 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -1818,3 +1818,17 @@ int bt_bass_clear_bis_sync(struct bt_bcast_src *bcast_src, uint8_t bis)
 
 	return 0;
 }
+
+bool bt_bass_check_bis(struct bt_bcast_src *bcast_src, uint8_t bis)
+{
+	for (uint8_t i = 0; i < bcast_src->num_subgroups; i++) {
+		struct bt_bass_subgroup_data *sgrp =
+				&bcast_src->subgroup_data[i];
+		uint32_t bitmask = 1 << (bis - 1);
+
+		if (sgrp->pending_bis_sync & bitmask)
+			return true;
+	}
+
+	return false;
+}
diff --git a/src/shared/bass.h b/src/shared/bass.h
index f3f708246..b21256efd 100644
--- a/src/shared/bass.h
+++ b/src/shared/bass.h
@@ -132,3 +132,4 @@ bool bt_bass_cp_handler_unregister(struct bt_bass *bass,
 int bt_bass_set_pa_sync(struct bt_bcast_src *bcast_src, uint8_t sync_state);
 int bt_bass_set_bis_sync(struct bt_bcast_src *bcast_src, uint8_t bis);
 int bt_bass_clear_bis_sync(struct bt_bcast_src *bcast_src, uint8_t bis);
+bool bt_bass_check_bis(struct bt_bcast_src *bcast_src, uint8_t bis);
-- 
2.39.2





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux