Bluetooth: BAP: Broadcast sync fail receive state bis sync value fixed

In the case that a broadcast sync fails for any reason, we need to
set the BIS_Sync value for all subgroups to 0xFFFFFFFF
(BT_BAP_BIS_SYNC_FAILED) as per the BAP spec.

This commit adds a new define for this and modifies
both the scan delegator and broadcast sink to support this.

The change is validated by a modification to the broadcast
assistant test that verifies that the value is set in the
case of an invalid broadcast code (which indicates a
failed BIG sync).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2024-08-28 14:36:26 +02:00 committed by Carles Cufí
commit b800be3430
4 changed files with 34 additions and 13 deletions

View file

@ -147,6 +147,16 @@ static void bap_broadcast_assistant_recv_state_cb(
FAIL("Bad code is not what we sent");
return;
}
for (uint8_t i = 0; i < state->num_subgroups; i++) {
const struct bt_bap_bass_subgroup *subgroup = &state->subgroups[i];
if (subgroup->bis_sync != BT_BAP_BIS_SYNC_FAILED) {
FAIL("Invalid BIS sync value 0x%08X for failed sync",
subgroup->bis_sync);
return;
}
}
}
for (uint8_t i = 0; i < state->num_subgroups; i++) {