Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions subsys/bluetooth/host/adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv,
atomic_set_bit_to(adv->flags, BT_ADV_EXT_ADV,
param->options & BT_LE_ADV_OPT_EXT_ADV);

atomic_set_bit_to(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED,
own_addr_type == BT_HCI_OWN_ADDR_RANDOM);

return 0;
}

Expand Down Expand Up @@ -1507,11 +1510,13 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv,

if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) {
if (IS_ENABLED(CONFIG_BT_PRIVACY) &&
!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) {
!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) &&
!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) {
bt_id_set_adv_private_addr(adv);
}
} else {
if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) {
if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) &&
!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) {
bt_id_set_adv_private_addr(adv);
}
}
Expand Down
4 changes: 4 additions & 0 deletions subsys/bluetooth/host/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ enum {
BT_ADV_PARAMS_SET,
/* Advertising data has been set in the controller. */
BT_ADV_DATA_SET,
/* Advertising random address has been updated in the controller before
* enabling advertising.
*/
BT_ADV_RANDOM_ADDR_UPDATED,
/* Advertising random address pending to be set in the controller. */
BT_ADV_RANDOM_ADDR_PENDING,
/* The private random address of the advertiser is valid for this cycle
Expand Down
2 changes: 2 additions & 0 deletions tests/bsim/bluetooth/mesh/src/test_advertiser.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,9 @@ static void test_tx_send_relay(void)
net_buf_simple_add_u8(&relay_second->b, 0x02);

bt_mesh_adv_send(local, &local_send_cb, NULL);
k_sleep(K_MSEC(1));
bt_mesh_adv_send(relay_first, &relay_first_send_cb, NULL);
k_sleep(K_MSEC(1));
bt_mesh_adv_send(relay_second, &relay_second_send_cb, NULL);

bt_mesh_adv_unref(local);
Expand Down
Loading