From c7b1269223cb9f4615f37ee1c7b4d0a5d2e14417 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 25 Nov 2024 13:17:02 +0100 Subject: [PATCH] fixup! tests: Bluetooth: ISO: BIS: Use controller buffer size as SDU size Modify the test to use the controller buffer size as the maximum SDU size, so per default we can send up to the maximum size the controller supports. This ensures that the tests will never do fragmentation over HCI. This also adds verification of the received data on the ISO sync receiver. Signed-off-by: Emil Gydesen --- tests/bsim/bluetooth/host/iso/bis/prj.conf | 2 +- .../host/iso/bis/src/bis_broadcaster.c | 20 ++++++------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/bsim/bluetooth/host/iso/bis/prj.conf b/tests/bsim/bluetooth/host/iso/bis/prj.conf index f8e9afcefa6c15..358a06ef14e108 100644 --- a/tests/bsim/bluetooth/host/iso/bis/prj.conf +++ b/tests/bsim/bluetooth/host/iso/bis/prj.conf @@ -13,7 +13,7 @@ CONFIG_BT_ISO_SYNC_RECEIVER=y CONFIG_BT_ISO_MAX_CHAN=4 CONFIG_BT_ISO_TX_BUF_COUNT=4 -CONFIG_BT_ISO_TX_MTU=200 +CONFIG_BT_ISO_TX_MTU=180 CONFIG_BT_ISO_RX_BUF_COUNT=4 # The broadcaster may send 3 x CONFIG_BT_ISO_TX_MTU in a single SDU diff --git a/tests/bsim/bluetooth/host/iso/bis/src/bis_broadcaster.c b/tests/bsim/bluetooth/host/iso/bis/src/bis_broadcaster.c index ee696910c344e3..4a0051b574fcdc 100644 --- a/tests/bsim/bluetooth/host/iso/bis/src/bis_broadcaster.c +++ b/tests/bsim/bluetooth/host/iso/bis/src/bis_broadcaster.c @@ -241,19 +241,6 @@ static void terminate_big(struct bt_iso_big *big) big = NULL; } -static void reset_bluetooth(void) -{ - int err; - - LOG_INF("Resetting Bluetooth"); - - err = bt_disable(); - TEST_ASSERT(err == 0, "Failed to disable: %d", err); - - err = bt_enable(NULL); - TEST_ASSERT(err == 0, "Failed to re-enable: %d", err); -} - static void test_main(void) { struct bt_le_ext_adv *adv; @@ -280,6 +267,7 @@ static void test_main_disable(void) { struct bt_le_ext_adv *adv; struct bt_iso_big *big; + int err; init(); @@ -288,12 +276,16 @@ static void test_main_disable(void) create_big(adv, ARRAY_SIZE(iso_chans), &big); /* Reset BT to see if we can set it up again */ - reset_bluetooth(); + LOG_INF("Resetting Bluetooth"); + err = bt_disable(); + TEST_ASSERT(err == 0, "Failed to disable: %d", err); /* After a disable, all advertising sets and BIGs are removed */ big = NULL; adv = NULL; + init(); + /* Set everything up again to see if everything still works as expected */ create_ext_adv(&adv); create_big(adv, ARRAY_SIZE(iso_chans), &big);