tests: Bluetooth: BAP: Add retry with correct broadcast code

Expand test_sink_encrypted_incorrect_code to retry the sync with
the correct broadcast code after failing the initial sync
with the incorrect broadcast code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2024-08-27 15:27:02 +02:00 committed by Benjamin Cabé
parent 64442ae5cd
commit c5fc9a2b17

View file

@ -1082,6 +1082,18 @@ static void test_sink_encrypted_incorrect_code(void)
/* Wait for MIC failure */
WAIT_FOR_FLAG(flag_big_sync_mic_failure);
test_broadcast_sync(BROADCAST_CODE);
/* Wait for all to be started */
printk("Waiting for streams to be started\n");
for (size_t i = 0U; i < ARRAY_SIZE(streams); i++) {
k_sem_take(&sem_started, K_FOREVER);
}
printk("Waiting for data\n");
WAIT_FOR_FLAG(flag_audio_received);
printk("Data received\n");
backchannel_sync_send_all(); /* let other devices know we have received data */
backchannel_sync_send_all(); /* let the broadcast source know it can stop */