mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Merge branch 'bugfix/lpn_not_recv_message_to_all_node_5.0' into 'release/v5.0'
ble_mesh: stack: Add option for lpn auto sub all-nodes(v5.0) See merge request espressif/esp-idf!20260
This commit is contained in:
commit
58afbf71ae
@ -803,6 +803,13 @@ if BLE_MESH
|
||||
help
|
||||
Maximum number of groups to which the LPN can subscribe.
|
||||
|
||||
config BLE_MESH_LPN_SUB_ALL_NODES_ADDR
|
||||
bool "Automatically subscribe all nodes address"
|
||||
default n
|
||||
help
|
||||
Automatically subscribe all nodes address when friendship
|
||||
established.
|
||||
|
||||
endif # BLE_MESH_LOW_POWER
|
||||
|
||||
config BLE_MESH_FRIEND
|
||||
|
@ -78,6 +78,11 @@ int bt_mesh_provision(const uint8_t net_key[16], uint16_t net_idx,
|
||||
|
||||
memcpy(bt_mesh.dev_key, dev_key, 16);
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER) &&
|
||||
IS_ENABLED(CONFIG_BLE_MESH_LPN_SUB_ALL_NODES_ADDR)) {
|
||||
bt_mesh_lpn_group_add(BLE_MESH_ADDR_ALL_NODES);
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_SETTINGS)) {
|
||||
BT_DBG("Storing network information persistently");
|
||||
bt_mesh_store_net();
|
||||
@ -110,6 +115,12 @@ void bt_mesh_node_reset(void)
|
||||
bt_mesh_tx_reset();
|
||||
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER)) {
|
||||
if (IS_ENABLED(CONFIG_BLE_MESH_LPN_SUB_ALL_NODES_ADDR)) {
|
||||
uint16_t group = BLE_MESH_ADDR_ALL_NODES;
|
||||
|
||||
bt_mesh_lpn_group_del(&group, 1);
|
||||
}
|
||||
|
||||
bt_mesh_lpn_disable(true);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user