Not sure if happens to anyone else, but one of my devices is reporting a shorter base mac address when converted to a string.
I feel the problem is with conversion, here is the code. Similar code is displayed in example so I'm confused
Code: Select all
uint8_t mac[6];
esp_err_t result;
result = esp_efuse_mac_get_default(mac);
if(result != ESP_OK)
{
ESP_LOGE(TAG, "Failed to get mac address. Error code: '%d'", result);
// TODO: restart device
}
char deviceId[13];
sprintf(deviceId,"%x%x%x%x%x%x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
Have no idea what is happening.