tests: Bluetooth: bsim_test: tests periodic adv enable/disable

Update bsim test to test Periodic Advertising Enable and
Disable alongwith Extended Advertising Enable/Disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-07-06 15:43:32 +05:30 committed by Carles Cufí
parent 139fbb0f4d
commit 42ea52c39f

View file

@ -202,7 +202,6 @@ static void test_advx_main(void)
}
printk("success.\n");
k_sleep(K_MSEC(400));
printk("Stopping advertising...");
@ -331,15 +330,18 @@ static void test_advx_main(void)
k_sleep(K_MSEC(1000));
printk("Starting non-conn non-scan with aux 1M advertising...");
err = ll_adv_aux_ad_data_set(handle, AD_OP, AD_FRAG_PREF,
sizeof(adv_data), (void *)adv_data);
printk("Enabling non-conn non-scan without aux 1M advertising...");
err = ll_adv_enable(handle, 1, 0, 0);
if (err) {
goto exit;
}
printk("success.\n");
printk("enabling...");
err = ll_adv_enable(handle, 1, 0, 0);
k_sleep(K_MSEC(400));
printk("Adding data, so non-conn non-scan with aux 1M advertising...");
err = ll_adv_aux_ad_data_set(handle, AD_OP, AD_FRAG_PREF,
sizeof(adv_data), (void *)adv_data);
if (err) {
goto exit;
}
@ -376,6 +378,15 @@ static void test_advx_main(void)
k_sleep(K_MSEC(1000));
printk("Enabling extended...");
err = ll_adv_enable(handle, 1, 0, 0);
if (err) {
goto exit;
}
printk("success.\n");
k_sleep(K_MSEC(400));
printk("Starting periodic 1M advertising...");
err = ll_adv_sync_param_set(handle, ADV_INTERVAL_PERIODIC, 0);
if (err) {
@ -387,12 +398,6 @@ static void test_advx_main(void)
if (err) {
goto exit;
}
printk("enabling extended...");
err = ll_adv_enable(handle, 1, 0, 0);
if (err) {
goto exit;
}
printk("success.\n");
k_sleep(K_MSEC(400));
@ -436,6 +441,40 @@ static void test_advx_main(void)
}
printk("success.\n");
k_sleep(K_MSEC(1000));
printk("enabling periodic...");
err = ll_adv_sync_enable(handle, 1);
if (err) {
goto exit;
}
printk("success.\n");
printk("Enabling extended...");
err = ll_adv_enable(handle, 1, 0, 0);
if (err) {
goto exit;
}
printk("success.\n");
k_sleep(K_MSEC(400));
printk("Disabling periodic...");
err = ll_adv_sync_enable(handle, 0);
if (err) {
goto exit;
}
printk("success.\n");
k_sleep(K_MSEC(400));
printk("Disabling...");
err = ll_adv_enable(handle, 0, 0, 0);
if (err) {
goto exit;
}
printk("success.\n");
printk("Removing adv aux set that's created and disabled ...");
err = ll_adv_aux_set_remove(handle);
if (err) {