moving apcallback after sosftap()

apcallback used to only indicate that mode was softap, moved untikl after actually starting the ap, so it can be used to check status and get ip etc.
This commit is contained in:
tablatronix
2018-10-12 14:10:16 -05:00
parent bef46b9e72
commit 1d0970a882
+5 -5
View File
@@ -326,11 +326,6 @@ bool WiFiManager::startAP(){
bool ret = true;
DEBUG_WM(F("StartAP with SSID: "),_apName);
// do AP callback if set
if ( _apcallback != NULL) {
_apcallback(this);
}
#ifdef ESP8266
// @bug workaround for bug #4372 https://github.com/esp8266/Arduino/issues/4372
if(!WiFi.enableAP(true)) {
@@ -375,6 +370,11 @@ bool WiFiManager::startAP(){
if(!ret) DEBUG_WM(DEBUG_ERROR,"[ERROR] There was a problem starting the AP");
// @todo add softAP retry here
// do AP callback if set
if ( _apcallback != NULL) {
_apcallback(this);
}
delay(500); // slight delay to make sure we get an AP IP
DEBUG_WM(F("AP IP address:"),WiFi.softAPIP());