1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Without autoreconnect, forcibly stop station connection manager (#8607)

This commit is contained in:
Max Prokhorov 2022-06-27 02:21:40 +03:00 committed by GitHub
parent f0d8f33d83
commit 0bff52fe55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -222,8 +222,14 @@ void ESP8266WiFiGenericClass::_eventCallback(void* arg)
System_Event_t* event = reinterpret_cast<System_Event_t*>(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) {