Skip to content

Commit

Permalink
Use more agressive disconnect on wifi connect error
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev committed Dec 28, 2018
1 parent 28ea39c commit 6dd8be3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libraries/WiFi/src/WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ typedef struct WiFiEventCbList {
WiFiEventSysCb scb;
system_event_id_t event;

WiFiEventCbList() : id(current_id++) {}
WiFiEventCbList() : id(current_id++), cb(NULL), fcb(NULL), scb(NULL), event(SYSTEM_EVENT_WIFI_READY) {}
} WiFiEventCbList_t;
wifi_event_id_t WiFiEventCbList::current_id = 1;

Expand Down Expand Up @@ -371,8 +371,7 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
(reason >= WIFI_REASON_BEACON_TIMEOUT && reason != WIFI_REASON_AUTH_FAIL)) &&
WiFi.getAutoReconnect())
{
WiFi.enableSTA(false);
WiFi.enableSTA(true);
WiFi.disconnect(true);
WiFi.begin();
}
} else if(event->event_id == SYSTEM_EVENT_STA_GOT_IP) {
Expand Down

0 comments on commit 6dd8be3

Please sign in to comment.