LE Audio: bt_bap_broadcast_sink_cb.syncable should provide the BIGInfo

Modify bt_bap_broadcast_sink_cb.syncable to provide the BIGInfo
instead of just the encryption field.

Signed-off-by: Chang An <chang.an_1@nxp.com>
This commit is contained in:
Chang An 2024-03-04 14:02:33 +08:00 committed by Fabio Baltieri
commit 3605d57ae1
10 changed files with 17 additions and 17 deletions

View file

@ -1814,9 +1814,9 @@ struct bt_bap_broadcast_sink_cb {
* bt_bap_broadcast_sink_sync() to synchronize to the audio stream(s). * bt_bap_broadcast_sink_sync() to synchronize to the audio stream(s).
* *
* @param sink Pointer to the sink structure. * @param sink Pointer to the sink structure.
* @param encrypted Whether or not the broadcast is encrypted * @param biginfo The BIGInfo report.
*/ */
void (*syncable)(struct bt_bap_broadcast_sink *sink, bool encrypted); void (*syncable)(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo);
/* Internally used list node */ /* Internally used list node */
sys_snode_t _node; sys_snode_t _node;

View file

@ -543,11 +543,11 @@ static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap
k_sem_give(&sem_base_received); k_sem_give(&sem_base_received);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
k_sem_give(&sem_syncable); k_sem_give(&sem_syncable);
if (!encrypted) { if (!biginfo->encryption) {
/* Use the semaphore as a boolean */ /* Use the semaphore as a boolean */
k_sem_reset(&sem_broadcast_code_received); k_sem_reset(&sem_broadcast_code_received);
k_sem_give(&sem_broadcast_code_received); k_sem_give(&sem_broadcast_code_received);

View file

@ -258,7 +258,7 @@ static void broadcast_pa_recv(struct bt_le_per_adv_sync *sync,
bt_data_parse(buf, pa_decode_base, NULL); bt_data_parse(buf, pa_decode_base, NULL);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
k_sem_give(&sem_syncable); k_sem_give(&sem_syncable);
} }

View file

@ -242,7 +242,7 @@ static void broadcast_pa_recv(struct bt_le_per_adv_sync *sync,
bt_data_parse(buf, pa_decode_base, NULL); bt_data_parse(buf, pa_decode_base, NULL);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
k_sem_give(&sem_syncable); k_sem_give(&sem_syncable);
} }

View file

@ -900,7 +900,7 @@ static void biginfo_recv(struct bt_le_per_adv_sync *sync,
SYS_SLIST_FOR_EACH_CONTAINER(&sink_cbs, listener, _node) { SYS_SLIST_FOR_EACH_CONTAINER(&sink_cbs, listener, _node) {
if (listener->syncable != NULL) { if (listener->syncable != NULL) {
listener->syncable(sink, biginfo->encryption); listener->syncable(sink, biginfo);
} }
} }
} }

View file

@ -2251,7 +2251,7 @@ static void base_recv(struct bt_bap_broadcast_sink *sink, const struct bt_bap_ba
} }
} }
static void syncable(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
if (default_broadcast_sink.bap_sink == sink) { if (default_broadcast_sink.bap_sink == sink) {
if (default_broadcast_sink.syncable) { if (default_broadcast_sink.syncable) {
@ -2259,7 +2259,7 @@ static void syncable(struct bt_bap_broadcast_sink *sink, bool encrypted)
} }
shell_print(ctx_shell, "Sink %p is ready to sync %s encryption", sink, shell_print(ctx_shell, "Sink %p is ready to sync %s encryption", sink,
encrypted ? "with" : "without"); biginfo->encryption ? "with" : "without");
default_broadcast_sink.syncable = true; default_broadcast_sink.syncable = true;
} }
} }

View file

@ -680,7 +680,7 @@ static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap
LOG_DBG("bis_index_bitfield 0x%08x", broadcaster->bis_index_bitfield); LOG_DBG("bis_index_bitfield 0x%08x", broadcaster->bis_index_bitfield);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
int err; int err;
uint32_t index_bitfield; uint32_t index_bitfield;
@ -692,10 +692,10 @@ static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted)
return; return;
} }
LOG_DBG("Broadcaster PA found, encrypted %d, requested_bis_sync %d", encrypted, LOG_DBG("Broadcaster PA found, encrypted %d, requested_bis_sync %d", biginfo->encryption,
broadcaster->requested_bis_sync); broadcaster->requested_bis_sync);
if (encrypted) { if (biginfo->encryption) {
/* Wait for Set Broadcast Code and start sync at broadcast_code_cb */ /* Wait for Set Broadcast Code and start sync at broadcast_code_cb */
return; return;
} }

View file

@ -238,10 +238,10 @@ static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap
SET_FLAG(flag_base_received); SET_FLAG(flag_base_received);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
printk("Broadcast sink %p syncable with%s encryption\n", printk("Broadcast sink %p syncable with%s encryption\n",
sink, encrypted ? "" : "out"); sink, biginfo->encryption ? "" : "out");
SET_FLAG(flag_syncable); SET_FLAG(flag_syncable);
} }

View file

@ -150,10 +150,10 @@ static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap
SET_FLAG(flag_base_received); SET_FLAG(flag_base_received);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
printk("Broadcast sink %p syncable with%s encryption\n", printk("Broadcast sink %p syncable with%s encryption\n",
sink, encrypted ? "" : "out"); sink, biginfo->encryption ? "" : "out");
SET_FLAG(flag_syncable); SET_FLAG(flag_syncable);
} }

View file

@ -69,7 +69,7 @@ static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap
k_sem_give(&sem_base_received); k_sem_give(&sem_base_received);
} }
static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
{ {
k_sem_give(&sem_syncable); k_sem_give(&sem_syncable);
} }