diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp index 2b7575d2f7..06709287b0 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp @@ -277,7 +277,7 @@ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPA /** * Disconnect from the network (close AP) * @param wifioff disable mode? - * @return one value of wl_status_t enum + * @return operation success */ bool ESP8266WiFiAPClass::softAPdisconnect(bool wifioff) { bool ret; diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp index bf96eb376d..d45627e9cf 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp @@ -222,8 +222,14 @@ void ESP8266WiFiGenericClass::_eventCallback(void* arg) System_Event_t* event = reinterpret_cast(arg); DEBUG_WIFI("wifi evt: %d\n", event->event); - if(event->event == EVENT_STAMODE_DISCONNECTED) { + if (event->event == EVENT_STAMODE_DISCONNECTED) { DEBUG_WIFI("STA disconnect: %d\n", event->event_info.disconnected.reason); + // workaround for https://github.com/esp8266/Arduino/issues/7432 + // still delivers the event, just handle this specific case + if ((wifi_station_get_connect_status() == STATION_GOT_IP) && !wifi_station_get_reconnect_policy()) { + DEBUG_WIFI("forcibly stopping the station connection manager\n"); + wifi_station_disconnect(); + } } if (event->event == EVENT_STAMODE_AUTHMODE_CHANGE) {