I use ESP8266 in AP-Mode.
server.handleClient(); //update no of clients
MDNS.update();
byte Number_of_Client =wifi_softap_get_station_num();
stat_info = wifi_softap_get_station_info();
while (stat_info != NULL)
{
ip4_addr *stationAddress;
stationAddress = &stat_info->ip;
u32_t address = stationAddress->addr;
stat_info = STAILQ_NEXT(stat_info, next);
Serial.printf(" address : ");
Serial.printf("%d" , address);
Serial.println("");
}
wifi_softap_free_station_info();
When PC is connected, Number_of_Client is one.
Sometimes , PC automatically connects to another SSID.
However, Number_of_Client is still getting the value one.
Address is still the value before disconnected.
How to solve this problem?
Thanks a lot!
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.