mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
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:
+5
-5
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user