I let the ESP8266 to be the softAP, use one mobilephone to connect it , then use another mobilephone to connect it. So currently there are 2 client connected.
How can I get the IP of two clients?
my code is:
Code: Select all
number_client= wifi_softap_get_station_num();
stat_info = wifi_softap_get_station_info();
while(stat_info==NULL)
{
vTaskDelay(100/ portTICK_RATE_MS);
stat_info = wifi_softap_get_station_info();
}
for(i=0;i<number_client;i++)
{
os_printf("the client info is :[bssid : "MACSTR", ip : "IPSTR"]\n", MAC2STR(stat_info->bssid), IP2STR(&stat_info->ip));
if(i<(number_client-1))
{
stat_info_bakup=stat_info;
stat_info = STAILQ_NEXT(stat_info_bakup, next);
while(stat_info==NULL)
{
vTaskDelay(200/ portTICK_RATE_MS);
stat_info = STAILQ_NEXT(stat_info_bakup, next);
}
}
}
wifi_softap_free_station_info();[/color][/color]
I can get the number_client is 2, and it can printf the first client IP information.
But after
stat_info = STAILQ_NEXT(stat_info_bakup, next);
the stat_info is always NULL.
I have no idea about the STAILQ_NEXT.
Could somebody help me?