From 8deabb79451d3141f182b35714c83d186c811803 Mon Sep 17 00:00:00 2001 From: lly Date: Sat, 9 May 2020 10:07:45 +0800 Subject: [PATCH] ble_mesh: Fix not update prov addr in fast prov When using fast provisioning, the Provisioner functionality will be enabled. Unicast addresses within the pre-allocated range will be used for provisioning nodes. And during the address assignment, the allocated unicast address will be checked that if it's duplicated with other nodes addresses and the Provisioner's own addresses. So before starting using fast provisioning, we need to update the Provisioner address. --- components/bt/esp_ble_mesh/mesh_core/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/bt/esp_ble_mesh/mesh_core/main.c b/components/bt/esp_ble_mesh/mesh_core/main.c index 601a3c8d3..f728ebf34 100644 --- a/components/bt/esp_ble_mesh/mesh_core/main.c +++ b/components/bt/esp_ble_mesh/mesh_core/main.c @@ -661,6 +661,7 @@ u8_t bt_mesh_set_fast_prov_action(u8_t action) if (IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) { bt_mesh_provisioner_pb_gatt_enable(); } + bt_mesh_provisioner_set_primary_elem_addr(bt_mesh_primary_addr()); bt_mesh_provisioner_set_prov_bearer(BLE_MESH_PROV_ADV, false); bt_mesh_provisioner_fast_prov_enable(true); bt_mesh_atomic_or(bt_mesh.flags, BIT(BLE_MESH_PROVISIONER) | BIT(BLE_MESH_VALID_PROV));