Skip to content

Commit d59cd2e

Browse files
LingaoMjhedberg
authored andcommitted
Bluetooth: Host: Fix Periodic Advertising random address update
update random address when periodic adv enabled. Signed-off-by: Lingao Meng <[email protected]>
1 parent f902f2a commit d59cd2e

File tree

1 file changed

+4
-2
lines changed
  • subsys/bluetooth/host

1 file changed

+4
-2
lines changed

subsys/bluetooth/host/adv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,12 +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_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) {
1512+
(atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) ||
1513+
!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) {
15131514
bt_id_set_adv_private_addr(adv);
15141515
}
15151516
} else {
15161517
if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) &&
1517-
!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) {
1518+
(atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) ||
1519+
!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) {
15181520
bt_id_set_adv_private_addr(adv);
15191521
}
15201522
}

0 commit comments

Comments
 (0)