Tag Archives: ESP32

ESP32获取MAC地址

uint8_t efuse_mac[6];
char mac[30];
esp_read_mac(efuse_mac,ESP_MAC_ETH);
sprintf(mac,"%02X%02X%02X%02X%02X%02X", efuse_mac[0],efuse_mac[1],efuse_mac[2],efuse_mac[3],efuse_mac[4],efuse_mac[5]);
ESP_LOGI(TAG, "[APP] Startup..");
ESP_LOGI(TAG, "[APP] MAC: %s",mac);
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size());
ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());