From 65349cb54629c6431366ecc9066cd58cab614e93 Mon Sep 17 00:00:00 2001 From: Shawn A Date: Fri, 10 Feb 2017 15:13:48 -0600 Subject: [PATCH] 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. --- WiFiManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 7089b4a..ec2c806 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -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;