File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
tests/bsim/bluetooth/audio/src Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -1509,14 +1509,14 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv,
15091509 if (atomic_test_bit (adv -> flags , BT_ADV_CONNECTABLE )) {
15101510 if (IS_ENABLED (CONFIG_BT_PRIVACY ) &&
15111511 !atomic_test_bit (adv -> flags , BT_ADV_USE_IDENTITY ) &&
1512- (atomic_test_bit (adv -> flags , BT_PER_ADV_ENABLED ) ||
1513- ! atomic_test_and_clear_bit (adv -> flags , BT_ADV_RANDOM_ADDR_UPDATED ))) {
1512+ (! atomic_test_and_clear_bit (adv -> flags , BT_ADV_RANDOM_ADDR_UPDATED ) ||
1513+ atomic_test_bit (adv -> flags , BT_PER_ADV_ENABLED ))) {
15141514 bt_id_set_adv_private_addr (adv );
15151515 }
15161516 } else {
15171517 if (!atomic_test_bit (adv -> flags , BT_ADV_USE_IDENTITY ) &&
1518- (atomic_test_bit (adv -> flags , BT_PER_ADV_ENABLED ) ||
1519- ! atomic_test_and_clear_bit (adv -> flags , BT_ADV_RANDOM_ADDR_UPDATED ))) {
1518+ (! atomic_test_and_clear_bit (adv -> flags , BT_ADV_RANDOM_ADDR_UPDATED ) ||
1519+ atomic_test_bit (adv -> flags , BT_PER_ADV_ENABLED ))) {
15201520 bt_id_set_adv_private_addr (adv );
15211521 }
15221522 }
Original file line number Diff line number Diff line change @@ -264,20 +264,20 @@ void start_broadcast_adv(struct bt_le_ext_adv *adv)
264264 return ;
265265 }
266266
267- if (info .ext_adv_state == BT_LE_EXT_ADV_STATE_DISABLED ) {
268- /* Start extended advertising */
269- err = bt_le_ext_adv_start (adv , BT_LE_EXT_ADV_START_DEFAULT );
267+ if (info .per_adv_state == BT_LE_PER_ADV_STATE_DISABLED ) {
268+ /* Enable Periodic Advertising */
269+ err = bt_le_per_adv_start (adv );
270270 if (err != 0 ) {
271- FAIL ("Failed to start extended advertising: %d\n" , err );
271+ FAIL ("Failed to enable periodic advertising: %d\n" , err );
272272 return ;
273273 }
274274 }
275275
276- if (info .per_adv_state == BT_LE_PER_ADV_STATE_DISABLED ) {
277- /* Enable Periodic Advertising */
278- err = bt_le_per_adv_start (adv );
276+ if (info .ext_adv_state == BT_LE_EXT_ADV_STATE_DISABLED ) {
277+ /* Start extended advertising */
278+ err = bt_le_ext_adv_start (adv , BT_LE_EXT_ADV_START_DEFAULT );
279279 if (err != 0 ) {
280- FAIL ("Failed to enable periodic advertising: %d\n" , err );
280+ FAIL ("Failed to start extended advertising: %d\n" , err );
281281 return ;
282282 }
283283 }
You can’t perform that action at this time.
0 commit comments