tests: Bluetooth: Tester: More logging and verification for ISO RX

Add additional data to the logs and only send the event once we have
receive a successful SDU.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2024-12-06 13:20:08 +01:00 committed by Benjamin Cabé
parent 8c38d1b9a3
commit fb1fcec983
2 changed files with 19 additions and 8 deletions

View file

@ -11,6 +11,7 @@
#include <errno.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/iso.h>
#include <zephyr/types.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/ring_buffer.h>
@ -187,11 +188,16 @@ static void stream_recv(struct bt_bap_stream *stream,
/* For now, send just a first packet, to limit the number
* of logs and not unnecessarily spam through btp.
*/
LOG_DBG("Incoming audio on stream %p len %u", stream, buf->len);
LOG_DBG("Incoming audio on stream %p len %u flags 0x%02X seq_num %u and ts %u",
stream, buf->len, info->flags, info->seq_num, info->ts);
if ((info->flags & BT_ISO_FLAGS_VALID) == 0) {
b_stream->already_sent = true;
broadcaster = &remote_broadcast_sources[b_stream->source_id];
send_bis_stream_received_ev(&broadcaster->address, broadcaster->broadcast_id,
b_stream->bis_id, buf->len, buf->data);
send_bis_stream_received_ev(&broadcaster->address,
broadcaster->broadcast_id, b_stream->bis_id,
buf->len, buf->data);
}
}
}

View file

@ -9,6 +9,7 @@
#include <stddef.h>
#include <errno.h>
#include <zephyr/bluetooth/iso.h>
#include <zephyr/types.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/ring_buffer.h>
@ -711,11 +712,15 @@ static void stream_recv(struct bt_bap_stream *stream,
/* For now, send just a first packet, to limit the number
* of logs and not unnecessarily spam through btp.
*/
LOG_DBG("Incoming audio on stream %p len %u", stream, buf->len);
LOG_DBG("Incoming audio on stream %p len %u flags 0x%02X seq_num %u and ts %u",
stream, buf->len, info->flags, info->seq_num, info->ts);
if ((info->flags & BT_ISO_FLAGS_VALID) == 0) {
u_stream->already_sent = true;
send_stream_received_ev(stream->conn, stream->ep, buf->len, buf->data);
}
}
}
static struct bt_bap_stream_ops stream_ops = {
.configured = stream_configured,