Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Without autoreconnect, forcibly stop station connection manager #8607

Merged
merged 2 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down