Skip to content

Commit 18285a0

Browse files
Balaklakarlubos
authored andcommitted
[nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets
Disable processing of extended ADV packets by mesh scanner. This is done to prevent loss of scan time due to reception of pointer packets while scanning for mesh packets. Signed-off-by: Ingar Kulbrandstad <[email protected]>
1 parent baf552c commit 18285a0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

subsys/bluetooth/mesh/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE
152152
messages as close to the start of the ReceiveWindow as possible,
153153
thus reducing the scanning time on the Low Power node.
154154

155+
config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS
156+
bool "Reject or accept extended advertising packets"
157+
depends on BT_LL_SOFTDEVICE
158+
help
159+
Configure the scanner and initiator to either reject or accept extended
160+
advertising packets by the SoftDevice Controller. This is set to false
161+
by default, to prevent loss of scan time when receiving a pointer packet
162+
while scanning for Bluetooth Mesh packets. Set to true if extended
163+
advertising packets are to be received by the SoftDevice Controller for
164+
purposes other than Bluetooth Mesh.
165+
155166
endif # BT_MESH_ADV_EXT
156167

157168
endchoice

subsys/bluetooth/mesh/adv_ext.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,18 @@ void bt_mesh_adv_init(void)
448448
for (int i = 0; i < ARRAY_SIZE(advs); i++) {
449449
(void)memcpy(&advs[i].adv_param, &adv_param, sizeof(adv_param));
450450
}
451+
452+
#if defined(CONFIG_BT_LL_SOFTDEVICE)
453+
const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = {
454+
.accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS),
455+
};
456+
457+
int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params);
458+
459+
if (err) {
460+
LOG_ERR("Failed to set accept_ext_adv_packets: %d", err);
461+
}
462+
#endif
451463
}
452464

453465
static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance)

0 commit comments

Comments
 (0)