Skip to content

Commit aa4e6ac

Browse files
olivier-le-sagedanieldegrasse
authored andcommitted
bluetooth: host: Handle failure to disable scan when updating own_addr
It wasn't taken into account that bt_le_scan_set_enable() has a return value. It's not likely that the controller rejects the command when BT_DEV_SCANNING is set, however. Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
1 parent ef7ede6 commit aa4e6ac

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,8 +2005,8 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options,
20052005
if (!IS_ENABLED(CONFIG_BT_PRIVACY) &&
20062006
!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) &&
20072007
dev_scanning) {
2008-
scan_disabled = true;
2009-
bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE);
2008+
err = bt_le_scan_set_enable(BT_HCI_LE_SCAN_DISABLE);
2009+
scan_disabled = err == 0;
20102010
}
20112011

20122012
/* If we are scanning with the identity address, it does

0 commit comments

Comments
 (0)