samples: Bluetooth: Add broadcast sink data validation

Add validation of incoming ISO data for the broadcast sink
sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2023-09-25 17:32:20 +02:00 committed by Carles Cufí
commit 34c9587539

View file

@ -90,6 +90,16 @@ static void stream_recv_cb(struct bt_bap_stream *stream,
{ {
static uint32_t recv_cnt; static uint32_t recv_cnt;
if (info->flags & BT_ISO_FLAGS_ERROR) {
printk("ISO receive error\n");
return;
}
if (info->flags & BT_ISO_FLAGS_LOST) {
printk("ISO receive lost\n");
return;
}
recv_cnt++; recv_cnt++;
if ((recv_cnt % 1000U) == 0U) { if ((recv_cnt % 1000U) == 0U) {
printk("Received %u total ISO packets\n", recv_cnt); printk("Received %u total ISO packets\n", recv_cnt);