diff mbox series

[BlueZ,2/6] shared/bass: Add API to set sync state

Message ID 20241220143106.27443-3-iulia.tanasescu@nxp.com
State New
Headers show
Series bass: Handle Modify Source opcode | expand

Commit Message

Iulia Tanasescu Dec. 20, 2024, 2:31 p.m. UTC
This adds an API to set the PA sync state of o Broadcast Receive State
characteristic.
---
 src/shared/bass.c | 10 ++++++++++
 src/shared/bass.h |  1 +
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/bass.c b/src/shared/bass.c
index 1ab1a0a44..0651f9a40 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -1781,6 +1781,16 @@  int bt_bass_set_pa_sync(struct bt_bcast_src *bcast_src, uint8_t sync_state)
 	return 0;
 }
 
+int bt_bass_get_pa_sync(struct bt_bcast_src *bcast_src, uint8_t *sync_state)
+{
+	if (!bcast_src)
+		return -EINVAL;
+
+	*sync_state = bcast_src->sync_state;
+
+	return 0;
+}
+
 int bt_bass_set_bis_sync(struct bt_bcast_src *bcast_src, uint8_t bis)
 {
 	struct iovec *iov;
diff --git a/src/shared/bass.h b/src/shared/bass.h
index d256b920d..f39ed7dad 100644
--- a/src/shared/bass.h
+++ b/src/shared/bass.h
@@ -130,6 +130,7 @@  unsigned int bt_bass_cp_handler_register(struct bt_bass *bass,
 bool bt_bass_cp_handler_unregister(struct bt_bass *bass,
 				unsigned int id);
 int bt_bass_set_pa_sync(struct bt_bcast_src *bcast_src, uint8_t sync_state);
+int bt_bass_get_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);