mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
ble_mesh: stack: Using the latest iv_index for provisioning
This commit is contained in:
@@ -538,18 +538,18 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
|
|||||||
return -EALREADY;
|
return -EALREADY;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = bt_mesh_provisioner_set_prov_info();
|
|
||||||
if (err) {
|
|
||||||
BT_ERR("%s, Failed to set provisioning info", __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__);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = bt_mesh_provisioner_init_prov_info();
|
||||||
|
if (err) {
|
||||||
|
BT_ERR("%s, Failed to init provisioning info", __func__);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
bt_mesh_atomic_set_bit(bt_mesh.flags, BLE_MESH_PROVISIONER);
|
bt_mesh_atomic_set_bit(bt_mesh.flags, BLE_MESH_PROVISIONER);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_BLE_MESH_SETTINGS)) {
|
if (IS_ENABLED(CONFIG_BLE_MESH_SETTINGS)) {
|
||||||
|
@@ -236,7 +236,7 @@ struct bt_mesh_prov_ctx {
|
|||||||
u16_t curr_net_idx;
|
u16_t curr_net_idx;
|
||||||
|
|
||||||
/* Current flags going to be used in provisioning data */
|
/* Current flags going to be used in provisioning data */
|
||||||
u16_t curr_flags;
|
u8_t curr_flags;
|
||||||
|
|
||||||
/* Current iv_index going to be used in provisioning data */
|
/* Current iv_index going to be used in provisioning data */
|
||||||
u16_t curr_iv_index;
|
u16_t curr_iv_index;
|
||||||
@@ -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_set_prov_info(void)
|
int bt_mesh_provisioner_init_prov_info(void)
|
||||||
{
|
{
|
||||||
const struct bt_mesh_comp *comp = NULL;
|
const struct bt_mesh_comp *comp = NULL;
|
||||||
|
|
||||||
@@ -1168,8 +1168,9 @@ int bt_mesh_provisioner_set_prov_info(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
prov_ctx.curr_net_idx = BLE_MESH_KEY_PRIMARY;
|
prov_ctx.curr_net_idx = BLE_MESH_KEY_PRIMARY;
|
||||||
prov_ctx.curr_flags = prov->flags;
|
struct bt_mesh_subnet *sub = bt_mesh_provisioner_subnet_get(BLE_MESH_KEY_PRIMARY);
|
||||||
prov_ctx.curr_iv_index = prov->iv_index;
|
prov_ctx.curr_flags = bt_mesh_net_flags(sub);
|
||||||
|
prov_ctx.curr_iv_index = bt_mesh.iv_index;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -286,7 +286,7 @@ int bt_mesh_provisioner_set_prov_data_info(struct bt_mesh_prov_data_info *info);
|
|||||||
*
|
*
|
||||||
* @return Zero - success, otherwise - fail
|
* @return Zero - success, otherwise - fail
|
||||||
*/
|
*/
|
||||||
int bt_mesh_provisioner_set_prov_info(void);
|
int bt_mesh_provisioner_init_prov_info(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function sets the provisioning bearer type used by Provisioner.
|
* @brief This function sets the provisioning bearer type used by Provisioner.
|
||||||
|
Reference in New Issue
Block a user