Open
Description
ESP32's WiFI.waitForConnectResult() has a counter to try 100 times.
Wish ESP8266 has the same behavior too.
Thank you.
// ESP32's WiFi.waitForConnectionResult()
uint8_t WiFiSTAClass::waitForConnectResult()
{
//1 and 3 have STA enabled
if((WiFiGenericClass::getMode() & WIFI_MODE_STA) == 0) {
return WL_DISCONNECTED;
}
int i = 0;
while((!status() || status() >= WL_DISCONNECTED) && i++ < 100) {
delay(100);
}
return status();
}
ESP8266 v2.4.1 core
uint8_t ESP8266WiFiSTAClass::waitForConnectResult() {
//1 and 3 have STA enabled
if((wifi_get_opmode() & 1) == 0) {
return WL_DISCONNECTED;
}
while(status() == WL_DISCONNECTED) {
delay(100);
}
return status();
}