wlanif.c添加:
#define MAX_ID_STRING (32)
char *platform_create_id_string()
{
uint8_t mac[6];
char *id_string = calloc(1, MAX_ID_STRING);
esp_read_mac(mac, ESP_MAC_WIFI_STA);
sprintf(id_string, "ESP_%02X%02X%02X", mac[3], mac[4], mac[5]);
return id_string;
}
修改:
netif->hostname = platform_create_id_string();//CONFIG_LWIP_LOCAL_HOSTNAME;