Skip to content

Commit 537203f

Browse files
committed
lib: bluetooth: ble_adv: fix allow list advertising without directed
With allow-list enabled, and directed and/or directed high duty advertising disabled in Kconfig, the allow-list for use in fast and slow advertising did not take effect when advertising was started with mode directed or directed high duty. This made it possible for non-paired/non-allow-listed devices to connect after a paired/allow-listed device had disconnected and advertising had been automatically restarted in the directed high duty mode. This fixes two internal checks in the ble_adv library that was the source of the issue. These checks will now correctly return the "capabilities" of the advertising mode to be started so that the configuration will be correct. Signed-off-by: Andreas Moltumyr <[email protected]>
1 parent 1fc97e6 commit 537203f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

doc/nrf-bm/release_notes/release_notes_changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Libraries
139139
* The ``slave_conn_int`` member in the :c:struct:`ble_adv_data` structure to :c:member:`ble_adv_data.periph_conn_int`.
140140
* The ``CONFIG_BLE_ADV_USE_WHITELIST`` Kconfig option to :kconfig:option:`CONFIG_BLE_ADV_USE_ALLOW_LIST`.
141141

142+
* Fixed an issue with the allow list functionality that made it possible for non-allow-listed devices to connect if advertising was started in either directed or directed high duty mode, but the directed modes had been disabled with Kconfig options.
143+
142144
* :ref:`lib_ble_conn_params` library:
143145

144146
* Added:

lib/bluetooth/ble_adv/ble_adv.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ static bool adv_mode_is_directed(enum ble_adv_mode mode)
4545
{
4646
switch (mode) {
4747
case BLE_ADV_MODE_DIRECTED_HIGH_DUTY:
48+
if (IS_ENABLED(CONFIG_BLE_ADV_DIRECTED_ADVERTISING_HIGH_DUTY)) {
49+
return true;
50+
} __fallthrough;
4851
case BLE_ADV_MODE_DIRECTED:
49-
return true;
52+
if (IS_ENABLED(CONFIG_BLE_ADV_DIRECTED_ADVERTISING)) {
53+
return true;
54+
} __fallthrough;
5055
default:
5156
return false;
5257
}
@@ -55,6 +60,14 @@ static bool adv_mode_is_directed(enum ble_adv_mode mode)
5560
static bool adv_mode_has_allow_list(enum ble_adv_mode mode)
5661
{
5762
switch (mode) {
63+
case BLE_ADV_MODE_DIRECTED_HIGH_DUTY:
64+
if (IS_ENABLED(CONFIG_BLE_ADV_DIRECTED_ADVERTISING_HIGH_DUTY)) {
65+
return false;
66+
} __fallthrough;
67+
case BLE_ADV_MODE_DIRECTED:
68+
if (IS_ENABLED(CONFIG_BLE_ADV_DIRECTED_ADVERTISING)) {
69+
return false;
70+
} __fallthrough;
5871
case BLE_ADV_MODE_FAST:
5972
case BLE_ADV_MODE_SLOW:
6073
return true;

0 commit comments

Comments
 (0)