Skip to content

Commit e6beeee

Browse files
anhmolteivindj-nordic
authored andcommitted
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 c9c858d commit e6beeee

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
@@ -148,6 +148,8 @@ Libraries
148148
* The ``slave_conn_int`` member in the :c:struct:`ble_adv_data` structure to :c:member:`ble_adv_data.periph_conn_int`.
149149
* The ``CONFIG_BLE_ADV_USE_WHITELIST`` Kconfig option to :kconfig:option:`CONFIG_BLE_ADV_USE_ALLOW_LIST`.
150150

151+
* 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.
152+
151153
* :ref:`lib_ble_conn_params` library:
152154

153155
* 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)