diff mbox series

[BlueZ,5/7] shared/bass: Set correct BIG enc state after sync

Message ID 20241008080126.48703-6-iulia.tanasescu@nxp.com
State New
Headers show
Series Add Scan Delegator support for Set Broadcast Code op | expand

Commit Message

Iulia Tanasescu Oct. 8, 2024, 8:01 a.m. UTC
A Scan Delegator might set the BIG encryption state of a Broadcast
Receive State characteristic to "Broadcast Code Required", to notify
Broadcast Assistants that the value is needed to decrypt the streams.

If the Broadcast Code was received and BIG sync was established, the
BIG encryption state must be transitioned to "Decrypting" state, to
inform Assistants that BIG sync was successfully established with the
correct Code.
---
 src/shared/bass.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/bass.c b/src/shared/bass.c
index 6efacb2da..d99a140a1 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -1793,6 +1793,9 @@  int bt_bass_set_bis_sync(struct bt_bcast_src *bcast_src, uint8_t bis)
 		if (sgrp->pending_bis_sync & bitmask) {
 			sgrp->bis_sync |= bitmask;
 
+			if (bcast_src->enc == BT_BASS_BIG_ENC_STATE_BCODE_REQ)
+				bcast_src->enc = BT_BASS_BIG_ENC_STATE_DEC;
+
 			iov = bass_parse_bcast_src(bcast_src);
 			if (!iov)
 				return -ENOMEM;