tests bsim: Add tests for unicast client/server samples

Add a test based on the unicase client/server samples
which runs them together and after waiting for a predefined
amount of time, checks how many audio packets has the
client received, and if over a threshold, passes the test.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-10-30 16:01:24 +01:00 committed by Alberto Escolar
commit a0ed29409b
15 changed files with 257 additions and 1 deletions

View file

@ -19,6 +19,8 @@
static void start_scan(void);
uint64_t unicast_audio_recv_ctr; /* This value is exposed to test code */
static struct bt_bap_unicast_client_cb unicast_client_cbs;
static struct bt_conn *default_conn;
static struct k_work_delayable audio_send_work;
@ -564,7 +566,9 @@ static void stream_recv(struct bt_bap_stream *stream,
struct net_buf *buf)
{
if (info->flags & BT_ISO_FLAGS_VALID) {
printk("Incoming audio on stream %p len %u\n", stream, buf->len);
unicast_audio_recv_ctr++;
printk("Incoming audio on stream %p len %u (%"PRIu64")\n", stream, buf->len,
unicast_audio_recv_ctr);
}
}