tests: bsim: Bluetooth: CAP broadcast AC testing
Add testing of the Audio Configurations from the BAP spec using the CAP API. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
9310b34b44
commit
79af154ae7
12 changed files with 558 additions and 36 deletions
|
@ -1134,9 +1134,9 @@ static int cmd_cap_ac_13(const struct shell *sh, size_t argc, char **argv)
|
|||
static int cmd_cap_ac_14(const struct shell *sh, size_t argc, char **argv)
|
||||
{
|
||||
const struct bap_broadcast_ac_param param = {
|
||||
.name = "AC_13",
|
||||
.name = "AC_14",
|
||||
.stream_cnt = 2U,
|
||||
.chan_cnt = 1U,
|
||||
.chan_cnt = 2U,
|
||||
};
|
||||
|
||||
return cap_ac_broadcast(sh, argc, argv, ¶m);
|
||||
|
|
|
@ -277,8 +277,8 @@ static void recv_cb(struct bt_bap_stream *stream,
|
|||
struct audio_test_stream *test_stream = audio_test_stream_from_bap_stream(stream);
|
||||
|
||||
if ((test_stream->rx_cnt % 100U) == 0U) {
|
||||
printk("Incoming audio on stream %p len %u and ts %u\n", stream, buf->len,
|
||||
info->ts);
|
||||
printk("[%zu]: Incoming audio on stream %p len %u and ts %u\n", test_stream->rx_cnt,
|
||||
stream, buf->len, info->ts);
|
||||
}
|
||||
|
||||
if (test_stream->rx_cnt > 0U && info->ts == test_stream->last_info.ts) {
|
||||
|
@ -313,7 +313,7 @@ static void recv_cb(struct bt_bap_stream *stream,
|
|||
SET_FLAG(flag_received);
|
||||
}
|
||||
} else {
|
||||
FAIL("Unexpected data received");
|
||||
FAIL("Unexpected data received\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,10 @@ static void stream_recv_cb(struct bt_bap_stream *stream, const struct bt_iso_rec
|
|||
{
|
||||
struct audio_test_stream *test_stream = audio_test_stream_from_bap_stream(stream);
|
||||
|
||||
printk("Incoming audio on stream %p len %u and ts %u\n", stream, buf->len, info->ts);
|
||||
if ((test_stream->rx_cnt % 100U) == 0U) {
|
||||
printk("[%zu]: Incoming audio on stream %p len %u and ts %u\n", test_stream->rx_cnt,
|
||||
stream, buf->len, info->ts);
|
||||
}
|
||||
|
||||
if (test_stream->rx_cnt > 0U && info->ts == test_stream->last_info.ts) {
|
||||
FAIL("Duplicated timestamp received: %u\n", test_stream->last_info.ts);
|
||||
|
@ -146,7 +149,7 @@ static void stream_recv_cb(struct bt_bap_stream *stream, const struct bt_iso_rec
|
|||
if (memcmp(buf->data, mock_iso_data, buf->len) == 0) {
|
||||
test_stream->rx_cnt++;
|
||||
} else {
|
||||
FAIL("Unexpected data received");
|
||||
FAIL("Unexpected data received\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -254,7 +254,10 @@ static void stream_recv_cb(struct bt_bap_stream *stream, const struct bt_iso_rec
|
|||
{
|
||||
struct audio_test_stream *test_stream = audio_test_stream_from_bap_stream(stream);
|
||||
|
||||
printk("Incoming audio on stream %p len %u and ts %u\n", stream, buf->len, info->ts);
|
||||
if ((test_stream->rx_cnt % 100U) == 0U) {
|
||||
printk("[%zu]: Incoming audio on stream %p len %u and ts %u\n", test_stream->rx_cnt,
|
||||
stream, buf->len, info->ts);
|
||||
}
|
||||
|
||||
if (test_stream->rx_cnt > 0U && info->ts == test_stream->last_info.ts) {
|
||||
FAIL("Duplicated timestamp received: %u\n", test_stream->last_info.ts);
|
||||
|
@ -279,7 +282,7 @@ static void stream_recv_cb(struct bt_bap_stream *stream, const struct bt_iso_rec
|
|||
if (memcmp(buf->data, mock_iso_data, buf->len) == 0) {
|
||||
test_stream->rx_cnt++;
|
||||
} else {
|
||||
FAIL("Unexpected data received");
|
||||
FAIL("Unexpected data received\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static struct bt_le_scan_recv_info broadcaster_info;
|
|||
static bt_addr_le_t broadcaster_addr;
|
||||
static struct bt_le_per_adv_sync *pa_sync;
|
||||
static uint32_t broadcaster_broadcast_id;
|
||||
static struct bt_cap_stream broadcast_sink_streams[CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT];
|
||||
static struct audio_test_stream broadcast_sink_streams[CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT];
|
||||
|
||||
static const struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP_LC3(
|
||||
BT_AUDIO_CODEC_LC3_FREQ_ANY, BT_AUDIO_CODEC_LC3_DURATION_ANY,
|
||||
|
@ -260,7 +260,47 @@ static void stopped_cb(struct bt_bap_stream *stream, uint8_t reason)
|
|||
static void recv_cb(struct bt_bap_stream *stream, const struct bt_iso_recv_info *info,
|
||||
struct net_buf *buf)
|
||||
{
|
||||
SET_FLAG(flag_received);
|
||||
struct audio_test_stream *test_stream = audio_test_stream_from_bap_stream(stream);
|
||||
|
||||
if ((test_stream->rx_cnt % 100U) == 0U) {
|
||||
printk("[%zu]: Incoming audio on stream %p len %u and ts %u\n", test_stream->rx_cnt,
|
||||
stream, buf->len, info->ts);
|
||||
}
|
||||
|
||||
if (test_stream->rx_cnt > 0U && info->ts == test_stream->last_info.ts) {
|
||||
FAIL("Duplicated timestamp received: %u\n", test_stream->last_info.ts);
|
||||
return;
|
||||
}
|
||||
|
||||
if (test_stream->rx_cnt > 0U && info->seq_num == test_stream->last_info.seq_num) {
|
||||
FAIL("Duplicated PSN received: %u\n", test_stream->last_info.seq_num);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info->flags & BT_ISO_FLAGS_ERROR) {
|
||||
/* Fail the test if we have not received what we expected */
|
||||
if (!TEST_FLAG(flag_received)) {
|
||||
FAIL("ISO receive error\n");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (info->flags & BT_ISO_FLAGS_LOST) {
|
||||
FAIL("ISO receive lost\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (memcmp(buf->data, mock_iso_data, buf->len) == 0) {
|
||||
test_stream->rx_cnt++;
|
||||
|
||||
if (test_stream->rx_cnt >= MIN_SEND_COUNT) {
|
||||
/* We set the flag is just one stream has received the expected */
|
||||
SET_FLAG(flag_received);
|
||||
}
|
||||
} else {
|
||||
FAIL("Unexpected data received\n");
|
||||
}
|
||||
}
|
||||
|
||||
static struct bt_bap_stream_ops broadcast_stream_ops = {
|
||||
|
@ -604,8 +644,9 @@ static void init(void)
|
|||
UNSET_FLAG(flag_pa_synced);
|
||||
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_sink_streams); i++) {
|
||||
bt_cap_stream_ops_register(&broadcast_sink_streams[i],
|
||||
&broadcast_stream_ops);
|
||||
bt_cap_stream_ops_register(
|
||||
cap_stream_from_audio_test_stream(&broadcast_sink_streams[i]),
|
||||
&broadcast_stream_ops);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -678,6 +719,7 @@ static int pa_sync_create(void)
|
|||
static void test_cap_acceptor_broadcast(void)
|
||||
{
|
||||
static struct bt_bap_stream *bap_streams[ARRAY_SIZE(broadcast_sink_streams)];
|
||||
size_t stream_count;
|
||||
int err;
|
||||
|
||||
init();
|
||||
|
@ -724,10 +766,17 @@ static void test_cap_acceptor_broadcast(void)
|
|||
WAIT_FOR_FLAG(flag_syncable);
|
||||
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_sink_streams); i++) {
|
||||
bap_streams[i] = &broadcast_sink_streams[i].bap_stream;
|
||||
bap_streams[i] = bap_stream_from_audio_test_stream(&broadcast_sink_streams[i]);
|
||||
}
|
||||
|
||||
printk("Syncing the sink\n");
|
||||
stream_count = 0;
|
||||
for (int i = 1; i < BT_ISO_MAX_GROUP_ISO_COUNT; i++) {
|
||||
if ((bis_index_bitfield & BIT(i)) != 0) {
|
||||
stream_count++;
|
||||
}
|
||||
}
|
||||
|
||||
err = bt_bap_broadcast_sink_sync(g_broadcast_sink, bis_index_bitfield, bap_streams, NULL);
|
||||
if (err != 0) {
|
||||
FAIL("Unable to sync the sink: %d\n", err);
|
||||
|
@ -735,13 +784,14 @@ static void test_cap_acceptor_broadcast(void)
|
|||
}
|
||||
|
||||
/* Wait for all to be started */
|
||||
printk("Waiting for broadcast_sink_streams to be started\n");
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_sink_streams); i++) {
|
||||
printk("Waiting for %zu streams to be started\n", stream_count);
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
k_sem_take(&sem_broadcast_started, K_FOREVER);
|
||||
}
|
||||
|
||||
printk("Waiting for data\n");
|
||||
WAIT_FOR_FLAG(flag_received);
|
||||
backchannel_sync_send_all(); /* let other devices know we have received what we wanted */
|
||||
|
||||
/* The order of PA sync lost and BIG Sync lost is irrelevant
|
||||
* and depend on timeout parameters. We just wait for PA first, but
|
||||
|
@ -750,8 +800,8 @@ static void test_cap_acceptor_broadcast(void)
|
|||
printk("Waiting for PA disconnected\n");
|
||||
WAIT_FOR_FLAG(flag_pa_sync_lost);
|
||||
|
||||
printk("Waiting for streams to be stopped\n");
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_sink_streams); i++) {
|
||||
printk("Waiting for %zu streams to be stopped\n", stream_count);
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
k_sem_take(&sem_broadcast_stopped, K_FOREVER);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2023 Nordic Semiconductor ASA
|
||||
* Copyright (c) 2022-2024 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -12,11 +12,15 @@
|
|||
#include <zephyr/bluetooth/audio/cap.h>
|
||||
#include <zephyr/bluetooth/audio/bap.h>
|
||||
#include <zephyr/bluetooth/audio/lc3.h>
|
||||
#include "bap_common.h"
|
||||
#include "common.h"
|
||||
|
||||
#define BROADCAST_STREMT_CNT CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT
|
||||
#define BROADCAST_ENQUEUE_COUNT 2U
|
||||
#define TOTAL_BUF_NEEDED (BROADCAST_ENQUEUE_COUNT * BROADCAST_STREMT_CNT)
|
||||
#define CAP_AC_MAX_STREAM 2
|
||||
#define LOCATION (BT_AUDIO_LOCATION_FRONT_LEFT | BT_AUDIO_LOCATION_FRONT_RIGHT)
|
||||
#define CONTEXT (BT_AUDIO_CONTEXT_TYPE_MEDIA)
|
||||
|
||||
BUILD_ASSERT(CONFIG_BT_ISO_TX_BUF_COUNT >= TOTAL_BUF_NEEDED,
|
||||
"CONFIG_BT_ISO_TX_BUF_COUNT should be at least "
|
||||
|
@ -25,15 +29,60 @@ BUILD_ASSERT(CONFIG_BT_ISO_TX_BUF_COUNT >= TOTAL_BUF_NEEDED,
|
|||
NET_BUF_POOL_FIXED_DEFINE(tx_pool, TOTAL_BUF_NEEDED, BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU),
|
||||
CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL);
|
||||
|
||||
struct cap_initiator_ac_param {
|
||||
char *name;
|
||||
size_t stream_cnt;
|
||||
size_t chan_cnt;
|
||||
const struct named_lc3_preset *named_preset;
|
||||
};
|
||||
static const struct named_lc3_preset *named_preset;
|
||||
|
||||
extern enum bst_result_t bst_result;
|
||||
static struct audio_test_stream broadcast_source_streams[BROADCAST_STREMT_CNT];
|
||||
static struct bt_cap_stream *broadcast_streams[ARRAY_SIZE(broadcast_source_streams)];
|
||||
static struct bt_bap_lc3_preset broadcast_preset_16_2_1 = BT_BAP_LC3_BROADCAST_PRESET_16_2_1(
|
||||
BT_AUDIO_LOCATION_FRONT_LEFT, BT_AUDIO_CONTEXT_TYPE_MEDIA);
|
||||
static struct bt_bap_lc3_preset broadcast_preset_16_2_1 =
|
||||
BT_BAP_LC3_BROADCAST_PRESET_16_2_1(LOCATION, CONTEXT);
|
||||
static size_t stream_count;
|
||||
|
||||
static K_SEM_DEFINE(sem_broadcast_started, 0U, ARRAY_SIZE(broadcast_streams));
|
||||
static K_SEM_DEFINE(sem_broadcast_stopped, 0U, ARRAY_SIZE(broadcast_streams));
|
||||
|
||||
static const struct named_lc3_preset lc3_broadcast_presets[] = {
|
||||
{"8_1_1", BT_BAP_LC3_BROADCAST_PRESET_8_1_1(LOCATION, CONTEXT)},
|
||||
{"8_2_1", BT_BAP_LC3_BROADCAST_PRESET_8_2_1(LOCATION, CONTEXT)},
|
||||
{"16_1_1", BT_BAP_LC3_BROADCAST_PRESET_16_1_1(LOCATION, CONTEXT)},
|
||||
{"16_2_1", BT_BAP_LC3_BROADCAST_PRESET_16_2_1(LOCATION, CONTEXT)},
|
||||
{"24_1_1", BT_BAP_LC3_BROADCAST_PRESET_24_1_1(LOCATION, CONTEXT)},
|
||||
{"24_2_1", BT_BAP_LC3_BROADCAST_PRESET_24_2_1(LOCATION, CONTEXT)},
|
||||
{"32_1_1", BT_BAP_LC3_BROADCAST_PRESET_32_1_1(LOCATION, CONTEXT)},
|
||||
{"32_2_1", BT_BAP_LC3_BROADCAST_PRESET_32_2_1(LOCATION, CONTEXT)},
|
||||
{"441_1_1", BT_BAP_LC3_BROADCAST_PRESET_441_1_1(LOCATION, CONTEXT)},
|
||||
{"441_2_1", BT_BAP_LC3_BROADCAST_PRESET_441_2_1(LOCATION, CONTEXT)},
|
||||
{"48_1_1", BT_BAP_LC3_BROADCAST_PRESET_48_1_1(LOCATION, CONTEXT)},
|
||||
{"48_2_1", BT_BAP_LC3_BROADCAST_PRESET_48_2_1(LOCATION, CONTEXT)},
|
||||
{"48_3_1", BT_BAP_LC3_BROADCAST_PRESET_48_3_1(LOCATION, CONTEXT)},
|
||||
{"48_4_1", BT_BAP_LC3_BROADCAST_PRESET_48_4_1(LOCATION, CONTEXT)},
|
||||
{"48_5_1", BT_BAP_LC3_BROADCAST_PRESET_48_5_1(LOCATION, CONTEXT)},
|
||||
{"48_6_1", BT_BAP_LC3_BROADCAST_PRESET_48_6_1(LOCATION, CONTEXT)},
|
||||
/* High-reliability presets */
|
||||
{"8_1_2", BT_BAP_LC3_BROADCAST_PRESET_8_1_2(LOCATION, CONTEXT)},
|
||||
{"8_2_2", BT_BAP_LC3_BROADCAST_PRESET_8_2_2(LOCATION, CONTEXT)},
|
||||
{"16_1_2", BT_BAP_LC3_BROADCAST_PRESET_16_1_2(LOCATION, CONTEXT)},
|
||||
{"16_2_2", BT_BAP_LC3_BROADCAST_PRESET_16_2_2(LOCATION, CONTEXT)},
|
||||
{"24_1_2", BT_BAP_LC3_BROADCAST_PRESET_24_1_2(LOCATION, CONTEXT)},
|
||||
{"24_2_2", BT_BAP_LC3_BROADCAST_PRESET_24_2_2(LOCATION, CONTEXT)},
|
||||
{"32_1_2", BT_BAP_LC3_BROADCAST_PRESET_32_1_2(LOCATION, CONTEXT)},
|
||||
{"32_2_2", BT_BAP_LC3_BROADCAST_PRESET_32_2_2(LOCATION, CONTEXT)},
|
||||
{"441_1_2", BT_BAP_LC3_BROADCAST_PRESET_441_1_2(LOCATION, CONTEXT)},
|
||||
{"441_2_2", BT_BAP_LC3_BROADCAST_PRESET_441_2_2(LOCATION, CONTEXT)},
|
||||
{"48_1_2", BT_BAP_LC3_BROADCAST_PRESET_48_1_2(LOCATION, CONTEXT)},
|
||||
{"48_2_2", BT_BAP_LC3_BROADCAST_PRESET_48_2_2(LOCATION, CONTEXT)},
|
||||
{"48_3_2", BT_BAP_LC3_BROADCAST_PRESET_48_3_2(LOCATION, CONTEXT)},
|
||||
{"48_4_2", BT_BAP_LC3_BROADCAST_PRESET_48_4_2(LOCATION, CONTEXT)},
|
||||
{"48_5_2", BT_BAP_LC3_BROADCAST_PRESET_48_5_2(LOCATION, CONTEXT)},
|
||||
{"48_6_2", BT_BAP_LC3_BROADCAST_PRESET_48_6_2(LOCATION, CONTEXT)},
|
||||
};
|
||||
|
||||
static void broadcast_started_cb(struct bt_bap_stream *stream)
|
||||
{
|
||||
printk("Stream %p started\n", stream);
|
||||
|
@ -328,6 +377,8 @@ static void test_broadcast_audio_create(struct bt_cap_broadcast_source **broadca
|
|||
|
||||
printk("Broadcast source created with %zu broadcast_streams\n",
|
||||
ARRAY_SIZE(broadcast_streams));
|
||||
|
||||
stream_count = ARRAY_SIZE(broadcast_streams);
|
||||
}
|
||||
|
||||
static void test_broadcast_audio_start_inval(struct bt_cap_broadcast_source *broadcast_source,
|
||||
|
@ -456,7 +507,7 @@ static void test_broadcast_audio_stop_inval(void)
|
|||
|
||||
static void test_broadcast_audio_tx_sync(void)
|
||||
{
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_streams); i++) {
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
struct bt_cap_stream *cap_stream = broadcast_streams[i];
|
||||
struct bt_iso_tx_info info;
|
||||
int err;
|
||||
|
@ -480,7 +531,7 @@ static void test_broadcast_audio_stop(struct bt_cap_broadcast_source *broadcast_
|
|||
{
|
||||
int err;
|
||||
|
||||
printk("Stopping broadcast metadata\n");
|
||||
printk("Stopping broadcast source\n");
|
||||
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_source_streams); i++) {
|
||||
broadcast_source_streams[i].tx_active = false;
|
||||
|
@ -494,11 +545,11 @@ static void test_broadcast_audio_stop(struct bt_cap_broadcast_source *broadcast_
|
|||
|
||||
/* Wait for all to be stopped */
|
||||
printk("Waiting for broadcast_streams to be stopped\n");
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_streams); i++) {
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
k_sem_take(&sem_broadcast_stopped, K_FOREVER);
|
||||
}
|
||||
|
||||
printk("Broadcast metadata stopped\n");
|
||||
printk("Broadcast source stopped\n");
|
||||
|
||||
/* Verify that it cannot be stopped twice */
|
||||
err = bt_cap_initiator_broadcast_audio_stop(broadcast_source);
|
||||
|
@ -526,7 +577,7 @@ static void test_broadcast_audio_delete(struct bt_cap_broadcast_source *broadcas
|
|||
{
|
||||
int err;
|
||||
|
||||
printk("Stopping broadcast metadata\n");
|
||||
printk("Deleting broadcast source\n");
|
||||
|
||||
err = bt_cap_initiator_broadcast_audio_delete(broadcast_source);
|
||||
if (err != 0) {
|
||||
|
@ -534,7 +585,7 @@ static void test_broadcast_audio_delete(struct bt_cap_broadcast_source *broadcas
|
|||
return;
|
||||
}
|
||||
|
||||
printk("Broadcast metadata stopped\n");
|
||||
printk("Broadcast source deleted\n");
|
||||
|
||||
/* Verify that it cannot be deleted twice */
|
||||
err = bt_cap_initiator_broadcast_audio_delete(broadcast_source);
|
||||
|
@ -568,22 +619,23 @@ static void test_main_cap_initiator_broadcast(void)
|
|||
|
||||
/* Wait for all to be started */
|
||||
printk("Waiting for broadcast_streams to be started\n");
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_streams); i++) {
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
k_sem_take(&sem_broadcast_started, K_FOREVER);
|
||||
}
|
||||
|
||||
/* Initialize sending */
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(broadcast_streams); i++) {
|
||||
for (unsigned int j = 0U; j < BROADCAST_ENQUEUE_COUNT; j++) {
|
||||
struct audio_test_stream *test_stream = &broadcast_source_streams[i];
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
struct audio_test_stream *test_stream = &broadcast_source_streams[i];
|
||||
|
||||
test_stream->tx_active = true;
|
||||
broadcast_sent_cb(&broadcast_streams[i]->bap_stream);
|
||||
test_stream->tx_active = true;
|
||||
|
||||
for (unsigned int j = 0U; j < BROADCAST_ENQUEUE_COUNT; j++) {
|
||||
broadcast_sent_cb(bap_stream_from_audio_test_stream(test_stream));
|
||||
}
|
||||
}
|
||||
|
||||
/* Keeping running for a little while */
|
||||
k_sleep(K_SECONDS(5));
|
||||
/* Wait for other devices to have received what they wanted */
|
||||
backchannel_sync_wait_any();
|
||||
|
||||
test_broadcast_audio_update_inval(broadcast_source);
|
||||
test_broadcast_audio_update(broadcast_source);
|
||||
|
@ -606,6 +658,171 @@ static void test_main_cap_initiator_broadcast(void)
|
|||
PASS("CAP initiator broadcast passed\n");
|
||||
}
|
||||
|
||||
static int test_cap_initiator_ac(const struct cap_initiator_ac_param *param)
|
||||
{
|
||||
struct bt_cap_initiator_broadcast_stream_param stream_params[CAP_AC_MAX_STREAM] = {0};
|
||||
uint8_t stereo_data[] = {
|
||||
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CONFIG_LC3_CHAN_ALLOC,
|
||||
BT_AUDIO_LOCATION_FRONT_RIGHT | BT_AUDIO_LOCATION_FRONT_LEFT)};
|
||||
uint8_t right_data[] = {BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CONFIG_LC3_CHAN_ALLOC,
|
||||
BT_AUDIO_LOCATION_FRONT_RIGHT)};
|
||||
uint8_t left_data[] = {BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CONFIG_LC3_CHAN_ALLOC,
|
||||
BT_AUDIO_LOCATION_FRONT_LEFT)};
|
||||
struct bt_cap_initiator_broadcast_subgroup_param subgroup_param = {0};
|
||||
struct bt_cap_initiator_broadcast_create_param create_param = {0};
|
||||
struct bt_cap_broadcast_source *broadcast_source;
|
||||
struct bt_audio_codec_cfg codec_cfg;
|
||||
struct bt_audio_codec_qos qos;
|
||||
struct bt_le_ext_adv *adv;
|
||||
int err;
|
||||
|
||||
for (size_t i = 0U; i < param->stream_cnt; i++) {
|
||||
stream_params[i].stream =
|
||||
cap_stream_from_audio_test_stream(&broadcast_source_streams[i]);
|
||||
|
||||
if (param->stream_cnt == 1U) {
|
||||
stream_params[i].data_len = ARRAY_SIZE(stereo_data);
|
||||
stream_params[i].data = stereo_data;
|
||||
} else if (i == 0U) {
|
||||
stream_params[i].data_len = ARRAY_SIZE(left_data);
|
||||
stream_params[i].data = left_data;
|
||||
} else if (i == 1U) {
|
||||
stream_params[i].data_len = ARRAY_SIZE(right_data);
|
||||
stream_params[i].data = right_data;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&codec_cfg, &named_preset->preset.codec_cfg, sizeof(codec_cfg));
|
||||
memcpy(&qos, &named_preset->preset.qos, sizeof(qos));
|
||||
qos.sdu *= param->chan_cnt;
|
||||
|
||||
subgroup_param.stream_count = param->stream_cnt;
|
||||
subgroup_param.stream_params = stream_params;
|
||||
subgroup_param.codec_cfg = &codec_cfg;
|
||||
create_param.subgroup_count = 1U;
|
||||
create_param.subgroup_params = &subgroup_param;
|
||||
create_param.qos = &qos;
|
||||
|
||||
init();
|
||||
setup_extended_adv(&adv);
|
||||
|
||||
err = bt_cap_initiator_broadcast_audio_create(&create_param, &broadcast_source);
|
||||
if (err != 0) {
|
||||
FAIL("Failed to create broadcast source: %d\n", err);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
stream_count = param->stream_cnt;
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
struct audio_test_stream *test_stream = &broadcast_source_streams[i];
|
||||
|
||||
test_stream->tx_sdu_size = create_param.qos->sdu;
|
||||
}
|
||||
|
||||
test_broadcast_audio_start(broadcast_source, adv);
|
||||
setup_extended_adv_data(broadcast_source, adv);
|
||||
start_extended_adv(adv);
|
||||
|
||||
/* Wait for all to be started */
|
||||
printk("Waiting for broadcast_streams to be started\n");
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
k_sem_take(&sem_broadcast_started, K_FOREVER);
|
||||
}
|
||||
|
||||
/* Initialize sending */
|
||||
for (size_t i = 0U; i < stream_count; i++) {
|
||||
struct audio_test_stream *test_stream = &broadcast_source_streams[i];
|
||||
|
||||
test_stream->tx_active = true;
|
||||
|
||||
for (unsigned int j = 0U; j < BROADCAST_ENQUEUE_COUNT; j++) {
|
||||
broadcast_sent_cb(bap_stream_from_audio_test_stream(test_stream));
|
||||
}
|
||||
}
|
||||
|
||||
/* Wait for other devices to have received what they wanted */
|
||||
backchannel_sync_wait_any();
|
||||
|
||||
test_broadcast_audio_stop(broadcast_source);
|
||||
|
||||
test_broadcast_audio_delete(broadcast_source);
|
||||
broadcast_source = NULL;
|
||||
|
||||
stop_and_delete_extended_adv(adv);
|
||||
adv = NULL;
|
||||
|
||||
PASS("CAP initiator broadcast passed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_cap_initiator_ac_12(void)
|
||||
{
|
||||
const struct cap_initiator_ac_param param = {
|
||||
.name = "ac_12",
|
||||
.stream_cnt = 1U,
|
||||
.chan_cnt = 1U,
|
||||
.named_preset = named_preset,
|
||||
};
|
||||
|
||||
test_cap_initiator_ac(¶m);
|
||||
}
|
||||
|
||||
#if BROADCAST_STREMT_CNT >= CAP_AC_MAX_STREAM
|
||||
static void test_cap_initiator_ac_13(void)
|
||||
{
|
||||
const struct cap_initiator_ac_param param = {
|
||||
.name = "ac_13",
|
||||
.stream_cnt = 2U,
|
||||
.chan_cnt = 1U,
|
||||
.named_preset = named_preset,
|
||||
};
|
||||
|
||||
test_cap_initiator_ac(¶m);
|
||||
}
|
||||
#endif /* BROADCAST_STREMT_CNT >= CAP_AC_MAX_STREAM */
|
||||
|
||||
static void test_cap_initiator_ac_14(void)
|
||||
{
|
||||
const struct cap_initiator_ac_param param = {
|
||||
.name = "ac_14",
|
||||
.stream_cnt = 1U,
|
||||
.chan_cnt = 2U,
|
||||
.named_preset = named_preset,
|
||||
};
|
||||
|
||||
test_cap_initiator_ac(¶m);
|
||||
}
|
||||
|
||||
static const struct named_lc3_preset *cap_get_named_preset(const char *preset_arg)
|
||||
{
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(lc3_broadcast_presets); i++) {
|
||||
if (strcmp(preset_arg, lc3_broadcast_presets[i].name) == 0) {
|
||||
return &lc3_broadcast_presets[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void test_args(int argc, char *argv[])
|
||||
{
|
||||
for (size_t argn = 0; argn < argc; argn++) {
|
||||
const char *arg = argv[argn];
|
||||
|
||||
if (strcmp(arg, "preset") == 0) {
|
||||
const char *preset_arg = argv[++argn];
|
||||
|
||||
named_preset = cap_get_named_preset(preset_arg);
|
||||
if (named_preset == NULL) {
|
||||
FAIL("Failed to get preset from %s\n", preset_arg);
|
||||
}
|
||||
} else {
|
||||
FAIL("Invalid arg: %s\n", arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const struct bst_test_instance test_cap_initiator_broadcast[] = {
|
||||
{
|
||||
.test_id = "cap_initiator_broadcast",
|
||||
|
@ -613,6 +830,29 @@ static const struct bst_test_instance test_cap_initiator_broadcast[] = {
|
|||
.test_tick_f = test_tick,
|
||||
.test_main_f = test_main_cap_initiator_broadcast,
|
||||
},
|
||||
{
|
||||
.test_id = "cap_initiator_ac_12",
|
||||
.test_post_init_f = test_init,
|
||||
.test_tick_f = test_tick,
|
||||
.test_main_f = test_cap_initiator_ac_12,
|
||||
.test_args_f = test_args,
|
||||
},
|
||||
#if BROADCAST_STREMT_CNT >= CAP_AC_MAX_STREAM
|
||||
{
|
||||
.test_id = "cap_initiator_ac_13",
|
||||
.test_post_init_f = test_init,
|
||||
.test_tick_f = test_tick,
|
||||
.test_main_f = test_cap_initiator_ac_13,
|
||||
.test_args_f = test_args,
|
||||
},
|
||||
#endif /* BROADCAST_STREMT_CNT >= CAP_AC_MAX_STREAM */
|
||||
{
|
||||
.test_id = "cap_initiator_ac_14",
|
||||
.test_post_init_f = test_init,
|
||||
.test_tick_f = test_tick,
|
||||
.test_main_f = test_cap_initiator_ac_14,
|
||||
.test_args_f = test_args,
|
||||
},
|
||||
BSTEST_END_MARKER,
|
||||
};
|
||||
|
||||
|
|
|
@ -918,7 +918,7 @@ static void test_cap_initiator_unicast_timeout(void)
|
|||
PASS("CAP initiator unicast timeout passed\n");
|
||||
}
|
||||
|
||||
const struct named_lc3_preset *cap_get_named_preset(const char *preset_arg)
|
||||
static const struct named_lc3_preset *cap_get_named_preset(const char *preset_arg)
|
||||
{
|
||||
for (size_t i = 0U; i < ARRAY_SIZE(lc3_unicast_presets); i++) {
|
||||
if (strcmp(preset_arg, lc3_unicast_presets[i].name) == 0) {
|
||||
|
|
|
@ -48,6 +48,23 @@ static const uint8_t mock_iso_data[] = {
|
|||
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1,
|
||||
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0,
|
||||
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
|
||||
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
|
||||
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c,
|
||||
0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
|
||||
0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
|
||||
0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
|
||||
0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
|
||||
0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
||||
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5,
|
||||
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
|
||||
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3,
|
||||
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2,
|
||||
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1,
|
||||
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0,
|
||||
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
};
|
||||
|
||||
#define MIN_SEND_COUNT 100
|
||||
|
|
|
@ -13,6 +13,9 @@ $dir_path/cap_unicast_inval.sh
|
|||
$dir_path/cap_unicast.sh
|
||||
|
||||
$dir_path/cap_broadcast.sh
|
||||
$dir_path/cap_broadcast_ac_12.sh
|
||||
$dir_path/cap_broadcast_ac_13.sh
|
||||
$dir_path/cap_broadcast_ac_14.sh
|
||||
|
||||
$dir_path/cap_unicast_ac_1.sh
|
||||
$dir_path/cap_unicast_ac_2.sh
|
||||
|
|
69
tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh
Executable file
69
tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh
Executable file
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2024 Nordic Semiconductor ASA
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
SIMULATION_ID="cap_unicast_ac_12"
|
||||
VERBOSITY_LEVEL=2
|
||||
EXECUTE_TIMEOUT=60
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
function Execute_AC_12() {
|
||||
printf "\n\n======== Running CAP AC_12 with %s =========\n\n" $1
|
||||
|
||||
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
|
||||
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=cap_initiator_ac_12 \
|
||||
-RealEncryption=1 -rs=23 -D=2 -argstest preset $1
|
||||
|
||||
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
|
||||
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=cap_acceptor_broadcast \
|
||||
-RealEncryption=1 -rs=46 -D=2
|
||||
|
||||
# Simulation time should be larger than the WAIT_TIME in common.h
|
||||
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
|
||||
-D=2 -sim_length=60e6 ${@:2}
|
||||
|
||||
wait_for_background_jobs
|
||||
}
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Low latency tests
|
||||
Execute_AC_12 8_1_1
|
||||
Execute_AC_12 8_2_1
|
||||
Execute_AC_12 16_1_1
|
||||
Execute_AC_12 16_2_1
|
||||
Execute_AC_12 24_1_1
|
||||
Execute_AC_12 24_2_1
|
||||
Execute_AC_12 32_1_1
|
||||
Execute_AC_12 32_2_1
|
||||
# Execute_AC_12 441_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_12 441_2_1
|
||||
# Execute_AC_12 48_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_12 48_2_1
|
||||
# Execute_AC_12 48_3_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_12 48_4_1
|
||||
# Execute_AC_12 48_5_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_12 48_6_1
|
||||
|
||||
# High reliability
|
||||
# Execute_AC_12 8_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 8_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 16_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 16_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 24_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 24_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 32_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 32_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 441_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 441_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 48_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 48_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 48_3_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 48_4_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 48_5_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_12 48_6_2 # BT_ISO_FLAGS_ERROR
|
68
tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_13.sh
Executable file
68
tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_13.sh
Executable file
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2024 Nordic Semiconductor ASA
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
SIMULATION_ID="cap_unicast_ac_13"
|
||||
VERBOSITY_LEVEL=2
|
||||
EXECUTE_TIMEOUT=60
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
function Execute_AC_13() {
|
||||
printf "\n\n======== Running CAP AC_13 with %s =========\n\n" $1
|
||||
|
||||
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
|
||||
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=cap_initiator_ac_13 \
|
||||
-RealEncryption=1 -rs=23 -D=2 -argstest preset $1
|
||||
|
||||
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
|
||||
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=cap_acceptor_broadcast \
|
||||
-RealEncryption=1 -rs=46 -D=2
|
||||
|
||||
# Simulation time should be larger than the WAIT_TIME in common.h
|
||||
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
|
||||
-D=2 -sim_length=60e6 ${@:2}
|
||||
|
||||
wait_for_background_jobs
|
||||
}
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Execute_AC_13 8_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_13 8_2_1
|
||||
# Execute_AC_13 16_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_13 16_2_1
|
||||
# Execute_AC_13 24_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_13 24_2_1
|
||||
# Execute_AC_13 32_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_13 32_2_1
|
||||
# Execute_AC_13 441_1_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 441_2_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_1_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_2_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_3_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_4_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_5_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_6_1 # BT_ISO_FLAGS_ERROR
|
||||
|
||||
# High reliability
|
||||
# Execute_AC_13 8_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 8_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 16_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 16_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 24_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 24_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 32_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 32_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 441_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 441_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_3_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_4_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_5_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_13 48_6_2 # BT_ISO_FLAGS_ERROR
|
69
tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh
Executable file
69
tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh
Executable file
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2024 Nordic Semiconductor ASA
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
SIMULATION_ID="cap_unicast_ac_14"
|
||||
VERBOSITY_LEVEL=2
|
||||
EXECUTE_TIMEOUT=60
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
function Execute_AC_14() {
|
||||
printf "\n\n======== Running CAP AC_14 with %s =========\n\n" $1
|
||||
|
||||
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
|
||||
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=cap_initiator_ac_14 \
|
||||
-RealEncryption=1 -rs=23 -D=2 -argstest preset $1
|
||||
|
||||
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
|
||||
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=cap_acceptor_broadcast \
|
||||
-RealEncryption=1 -rs=46 -D=2
|
||||
|
||||
# Simulation time should be larger than the WAIT_TIME in common.h
|
||||
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
|
||||
-D=2 -sim_length=60e6 ${@:2}
|
||||
|
||||
wait_for_background_jobs
|
||||
}
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Low latency tests
|
||||
Execute_AC_14 8_1_1
|
||||
Execute_AC_14 8_2_1
|
||||
Execute_AC_14 16_1_1
|
||||
Execute_AC_14 16_2_1
|
||||
Execute_AC_14 24_1_1
|
||||
Execute_AC_14 24_2_1
|
||||
Execute_AC_14 32_1_1
|
||||
Execute_AC_14 32_2_1
|
||||
# Execute_AC_14 441_1_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 441_2_1 # Failed to create BIG: -22
|
||||
# Execute_AC_14 48_1_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_14 48_2_1
|
||||
# Execute_AC_14 48_3_1 # BT_ISO_FLAGS_ERROR
|
||||
Execute_AC_14 48_4_1
|
||||
# Execute_AC_14 48_5_1 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_6_1 # Failed to create BIG: -22
|
||||
|
||||
# High reliability
|
||||
# Execute_AC_14 8_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 8_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 16_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 16_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 24_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 24_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 32_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 32_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 441_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 441_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_1_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_2_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_3_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_4_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_5_2 # BT_ISO_FLAGS_ERROR
|
||||
# Execute_AC_14 48_6_2 # BT_ISO_FLAGS_ERROR
|
Loading…
Add table
Add a link
Reference in a new issue