Bluetooth: host: Scanner must be disabled to update to NRPA address
When advertiser is disabled we should update the random address for both passive and active scanner back to an NRPA. But this command will fail because the if the scanner is an active scanner, we must disable and re-enabled the active scanner after setting the random address. This behavior should not be there when scanner is configured to scan with identity address. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
499b4e0ce0
commit
d977282514
1 changed files with 8 additions and 4 deletions
|
@ -6179,13 +6179,17 @@ int bt_le_adv_stop(void)
|
|||
return err;
|
||||
}
|
||||
|
||||
if (!IS_ENABLED(CONFIG_BT_PRIVACY)) {
|
||||
/* If active scan is ongoing set NRPA */
|
||||
if (atomic_test_bit(bt_dev.flags, BT_DEV_SCANNING) &&
|
||||
atomic_test_bit(bt_dev.flags, BT_DEV_ACTIVE_SCAN)) {
|
||||
#if defined(CONFIG_BT_OBSERVER)
|
||||
if (!IS_ENABLED(CONFIG_BT_PRIVACY) &&
|
||||
!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY)) {
|
||||
/* If scan is ongoing set back NRPA */
|
||||
if (atomic_test_bit(bt_dev.flags, BT_DEV_SCANNING)) {
|
||||
set_le_scan_enable(BT_HCI_LE_SCAN_DISABLE);
|
||||
le_set_private_addr(bt_dev.adv_id);
|
||||
set_le_scan_enable(BT_HCI_LE_SCAN_ENABLE);
|
||||
}
|
||||
}
|
||||
#endif /* defined(CONFIG_BT_OBSERVER) */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue