mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble_mesh: stack: split primary addr & prov info init
This commit is contained in:
parent
0f0e48facb
commit
c440c26449
@ -538,6 +538,12 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
|
||||
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();
|
||||
if (err) {
|
||||
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;
|
||||
}
|
||||
|
||||
int bt_mesh_provisioner_init_prov_info(void)
|
||||
int bt_mesh_provisioner_init_primary_addr(void)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bt_mesh_provisioner_init_prov_info(void)
|
||||
{
|
||||
prov_ctx.curr_net_idx = 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);
|
||||
|
@ -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_init_primary_addr(void);
|
||||
|
||||
/**
|
||||
* @brief This function sets the provisioning information needed by Provisioner,
|
||||
* including unicast address, IV Index, etc.
|
||||
|
Loading…
x
Reference in New Issue
Block a user