Group ID cannot save with mdf_info_save
Posted: Fri Nov 12, 2021 9:46 am
Hi, I am using mdf_info_save a group_id, but the group_id seem cannot save to flash and the value become Null after reboot. I am no sure if my code have miss some configuration or the logic is wrong.
I use the following function for saving the group id
and using the follow to load the group id
I found that the value seem become null after reboot. Any way to check or suggestion?
I use the following function for saving the group id
Code: Select all
uint8_t dest_addr[6] = {0x0};
MDF_LOGI("the groupid have length of %d", groupid_args.groupid->count);
if (groupid_args.groupid->count) {
ret = mac_str2hex(groupid_args.groupid->sval[0], dest_addr);
MDF_ERROR_CHECK(ret == false, ESP_ERR_INVALID_ARG,
"The format of the address is incorrect. Please enter the format as xx:xx:xx:xx:xx:xx");
}
//groupid_cmd_handler(dest_addr);
ret = esp_mesh_set_group_id((mesh_addr_t *)dest_addr, 1);
ret = mdf_info_save("group_id", (mesh_addr_t *)dest_addr, sizeof(mesh_addr_t));
Code: Select all
groupid_args.groupid = arg_str0("s", "send", "<addr (xx:xx:xx:xx:xx:xx)>", "delete the group id of the node");
groupid_args.end = arg_end(1);
const esp_console_cmd_t cmd = {
.command = "groupid_del",
.help = "delete the node group id",
.hint = NULL,
.func = &delete_groupid_func,
.argtable = &groupid_args
};
ESP_ERROR_CHECK(esp_console_cmd_register(&cmd));