fix WL_IDLE_STATUS return values for compatibility

This might need better handling in future, since we only get back a bool
of wether or not we are connected, not if configportal was saved etc.
might be a problem.
This commit is contained in:
Shawn A
2017-02-10 15:13:48 -06:00
parent e9b36f9084
commit 65349cb546
+5 -2
View File
@@ -209,9 +209,12 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
// blocking loop waiting for config
while(1){
// check if timed out
if(configPortalHasTimeout()) return stopConfigPortal();
if(configPortalHasTimeout()){
stopConfigPortal();
return WiFi.status() == WL_CONNECTED; //returns connected bool, ok I guess
}
ret = handleConfigPortal();
if(ret == WL_CONNECTED || ret == WL_CONNECT_FAILED) return ret;
if(ret != WL_IDLE_STATUS) return ret == WL_CONNECTED;
yield();
}
return false;