I'm currently trying to make my provisioner unprovision a node that I achieved to provision earlier. I think this needs to be done through the configuration model but I'm unable to find the right function in the api/parameters to do so. I'm currently trying to do it using the following code but it doesn't work:
Code: Select all
int err;
esp_ble_mesh_client_common_param_t common = {0};
esp_ble_mesh_cfg_client_set_state_t set_state = {0};
esp_ble_mesh_set_msg_common(&common, node, config_client.model, ESP_BLE_MESH_MODEL_OP_NODE_RESET);
set_state.net_key_delete.net_idx = node->node_idx;
ESP_LOGI(TAGPROV, "Reseting node...");
err = esp_ble_mesh_config_client_set_state(&common, &set_state);
if (err) {
ESP_LOGE(TAGPROV, "%s: failed", __func__);
return;
}