diff --git a/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c b/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c index 07090cdaad..2875f7fa93 100644 --- a/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c +++ b/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c @@ -296,6 +296,15 @@ esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_info(const uint8_t uuid[1 return (esp_ble_mesh_node_t *)bt_mesh_provisioner_get_prov_node_info(uuid); } +esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_info_with_addr(uint16_t unicast_addr) +{ + if (!ESP_BLE_MESH_ADDR_IS_UNICAST(unicast_addr)) { + return NULL; + } + + return (esp_ble_mesh_node_t *)bt_mesh_provisioner_get_node_info(unicast_addr); +} + esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16], uint16_t net_idx, uint16_t app_idx) { diff --git a/components/bt/esp_ble_mesh/api/core/include/esp_ble_mesh_networking_api.h b/components/bt/esp_ble_mesh/api/core/include/esp_ble_mesh_networking_api.h index 2b38041596..a8521e0c5a 100644 --- a/components/bt/esp_ble_mesh/api/core/include/esp_ble_mesh_networking_api.h +++ b/components/bt/esp_ble_mesh/api/core/include/esp_ble_mesh_networking_api.h @@ -213,7 +213,8 @@ const char *esp_ble_mesh_provisioner_get_node_name(uint16_t index); uint16_t esp_ble_mesh_provisioner_get_node_index(const char *name); /** - * @brief This function is called to get the provisioned node information. + * @brief This function is called to get the provisioned node information + * with the node device uuid. * * @param[in] uuid: Device UUID of the node * @@ -222,6 +223,17 @@ uint16_t esp_ble_mesh_provisioner_get_node_index(const char *name); */ esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_info(const uint8_t uuid[16]); +/** + * @brief This function is called to get the provisioned node information + * with the node unicast address. + * + * @param[in] unicast_addr: Unicast address of the node + * + * @return Pointer of the node info struct or NULL on failure. + * + */ +esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_info_with_addr(uint16_t unicast_addr); + /** * @brief This function is called to store the Composition Data of the node. *