mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
ble_mesh: stack: split primary addr & prov info init
This commit is contained in:
@@ -538,6 +538,12 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
|
|||||||
return -EALREADY;
|
return -EALREADY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = bt_mesh_provisioner_init_primary_addr();
|
||||||
|
if (err) {
|
||||||
|
BT_ERR("%s, Failed to init primary addr", __func__);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
err = bt_mesh_provisioner_net_create();
|
err = bt_mesh_provisioner_net_create();
|
||||||
if (err) {
|
if (err) {
|
||||||
BT_ERR("%s, Failed to create network", __func__);
|
BT_ERR("%s, Failed to create network", __func__);
|
||||||
|
@@ -1128,7 +1128,7 @@ int bt_mesh_provisioner_set_prov_data_info(struct bt_mesh_prov_data_info *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bt_mesh_provisioner_init_prov_info(void)
|
int bt_mesh_provisioner_init_primary_addr(void)
|
||||||
{
|
{
|
||||||
const struct bt_mesh_comp *comp = NULL;
|
const struct bt_mesh_comp *comp = NULL;
|
||||||
|
|
||||||
@@ -1167,6 +1167,12 @@ int bt_mesh_provisioner_init_prov_info(void)
|
|||||||
bt_mesh_store_prov_info(prov_ctx.primary_addr, prov_ctx.curr_alloc_addr);
|
bt_mesh_store_prov_info(prov_ctx.primary_addr, prov_ctx.curr_alloc_addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int bt_mesh_provisioner_init_prov_info(void)
|
||||||
|
{
|
||||||
prov_ctx.curr_net_idx = BLE_MESH_KEY_PRIMARY;
|
prov_ctx.curr_net_idx = BLE_MESH_KEY_PRIMARY;
|
||||||
struct bt_mesh_subnet *sub = bt_mesh_provisioner_subnet_get(BLE_MESH_KEY_PRIMARY);
|
struct bt_mesh_subnet *sub = bt_mesh_provisioner_subnet_get(BLE_MESH_KEY_PRIMARY);
|
||||||
prov_ctx.curr_flags = bt_mesh_net_flags(sub);
|
prov_ctx.curr_flags = bt_mesh_net_flags(sub);
|
||||||
|
@@ -280,6 +280,8 @@ int bt_mesh_provisioner_adv_pkt_cb_register(unprov_adv_pkt_cb_t cb);
|
|||||||
*/
|
*/
|
||||||
int bt_mesh_provisioner_set_prov_data_info(struct bt_mesh_prov_data_info *info);
|
int bt_mesh_provisioner_set_prov_data_info(struct bt_mesh_prov_data_info *info);
|
||||||
|
|
||||||
|
int bt_mesh_provisioner_init_primary_addr(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function sets the provisioning information needed by Provisioner,
|
* @brief This function sets the provisioning information needed by Provisioner,
|
||||||
* including unicast address, IV Index, etc.
|
* including unicast address, IV Index, etc.
|
||||||
|
Reference in New Issue
Block a user