Skip to content

Commit c024645

Browse files
cvinayakcarlescufi
authored andcommitted
tests: bluetooth: bsim: Updated advx test to verify previous sync data
Updated advx test to verify previous sync data when no extended header flags are set in the PDU. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent c877385 commit c024645

File tree

1 file changed

+25
-1
lines changed
  • tests/bluetooth/bsim_bt/bsim_test_advx/src

1 file changed

+25
-1
lines changed

tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,16 @@ static void test_advx_main(void)
500500

501501
k_sleep(K_MSEC(400));
502502

503+
printk("Update periodic advertising back to data 2...");
504+
err = ll_adv_sync_ad_data_set(handle, AD_OP, sizeof(per_adv_data2),
505+
(void *)per_adv_data2);
506+
if (err) {
507+
goto exit;
508+
}
509+
printk("success.\n");
510+
511+
k_sleep(K_MSEC(400));
512+
503513
printk("Disabling...");
504514
err = ll_adv_enable(handle, 0, 0, 0);
505515
if (err) {
@@ -1281,6 +1291,20 @@ static void test_scanx_main(void)
12811291
FAIL("Incorrect Periodic Advertising Report data.");
12821292
}
12831293

1294+
printk("Waiting for Periodic Advertising Report of %u bytes...",
1295+
sizeof(per_adv_data1));
1296+
sync_report_len_prev = sync_report_len;
1297+
while (!is_sync_report || (sync_report_len == sync_report_len_prev)) {
1298+
is_sync_report = false;
1299+
k_sleep(K_MSEC(100));
1300+
}
1301+
printk("done.\n");
1302+
1303+
if ((sync_report_len != sizeof(per_adv_data2)) ||
1304+
memcmp(sync_report_data, per_adv_data2, sizeof(per_adv_data2))) {
1305+
FAIL("Incorrect Periodic Advertising Report data.");
1306+
}
1307+
12841308
printk("Waiting for sync loss...");
12851309
while (!is_sync_lost) {
12861310
k_sleep(K_MSEC(100));
@@ -1340,7 +1364,7 @@ static void test_scanx_main(void)
13401364

13411365
static void test_advx_init(void)
13421366
{
1343-
bst_ticker_set_next_tick_absolute(20e6);
1367+
bst_ticker_set_next_tick_absolute(30e6);
13441368
bst_result = In_progress;
13451369
}
13461370

0 commit comments

Comments
 (0)