ble_mesh: Add an API to get Provisioner node table entry

This commit is contained in:
lly
2020-03-02 15:58:39 +08:00
committed by baohongde
parent b6bcdad3db
commit bad97eb1f9
6 changed files with 32 additions and 0 deletions

View File

@@ -500,6 +500,11 @@ uint16_t esp_ble_mesh_provisioner_get_prov_node_count(void)
return btc_ble_mesh_provisioner_get_prov_node_count();
}
esp_ble_mesh_node_t **esp_ble_mesh_provisioner_get_node_list_entry(void)
{
return btc_ble_mesh_provisioner_get_node_list_entry();
}
#if CONFIG_BLE_MESH_USE_MULTIPLE_NAMESPACE
esp_err_t esp_ble_mesh_provisioner_open_settings_with_index(uint8_t index)
{

View File

@@ -370,6 +370,19 @@ const uint8_t *esp_ble_mesh_provisioner_get_local_net_key(uint16_t net_idx);
*/
uint16_t esp_ble_mesh_provisioner_get_prov_node_count(void);
/**
* @brief This function is called by Provisioner to get the entry of the table of nodes.
*
* @note After invoking the function to get the entry of nodes, users can use the "for"
* loop combined with the macro CONFIG_BLE_MESH_MAX_PROV_NODES to get each node's
* information. But before trying to read the node's information, users need to
* check if the node exists, i.e. if the *(esp_ble_mesh_node_t **node) is NULL.
*
* @return Pointer to the start of nodes table.
*
*/
esp_ble_mesh_node_t **esp_ble_mesh_provisioner_get_node_list_entry(void);
/**
* @brief This function is called by Provisioner to open the corresponding
* flash section for storing mesh provisioning information.

View File

@@ -788,6 +788,11 @@ u16_t btc_ble_mesh_provisioner_get_prov_node_count(void)
return bt_mesh_provisioner_get_prov_node_count();
}
esp_ble_mesh_node_t **btc_ble_mesh_provisioner_get_node_list_entry(void)
{
return (esp_ble_mesh_node_t **)bt_mesh_provisioner_get_node_list_entry();
}
#if CONFIG_BLE_MESH_USE_MULTIPLE_NAMESPACE
const char *btc_ble_mesh_provisioner_get_settings_user_id(uint8_t index)
{

View File

@@ -346,6 +346,8 @@ const esp_ble_mesh_comp_t *btc_ble_mesh_comp_get(void);
u16_t btc_ble_mesh_provisioner_get_prov_node_count(void);
esp_ble_mesh_node_t **btc_ble_mesh_provisioner_get_node_list_entry(void);
const char *btc_ble_mesh_provisioner_get_settings_user_id(uint8_t index);
uint8_t btc_ble_mesh_provisioner_get_settings_index(const char *user_id);
uint8_t btc_ble_mesh_provisioner_get_free_settings_user_id_count(void);

View File

@@ -825,6 +825,11 @@ int bt_mesh_provisioner_store_node_comp_data(u16_t addr, const u8_t *data, u16_t
return 0;
}
struct bt_mesh_node **bt_mesh_provisioner_get_node_list_entry(void)
{
return mesh_nodes;
}
/* Provisioner DevKey, NetKey and AppKey related functions */
const u8_t *bt_mesh_provisioner_net_key_get(u16_t net_idx)

View File

@@ -93,6 +93,8 @@ u16_t bt_mesh_provisioner_get_node_index(const char *name);
int bt_mesh_provisioner_store_node_comp_data(u16_t addr, const u8_t *data, u16_t length);
struct bt_mesh_node **bt_mesh_provisioner_get_node_list_entry(void);
const u8_t *bt_mesh_provisioner_net_key_get(u16_t net_idx);
struct bt_mesh_subnet *bt_mesh_provisioner_subnet_get(u16_t net_idx);