important correction in README

This commit is contained in:
Morgan Allen 2018-09-21 21:38:36 -07:00
parent eb59d7877a
commit 3051420dde
2 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,7 @@ esp32-wifi-manager
WiFi Manager for ESP32. That's it. No captive portal, no fallback if AP is not available. Just WiFi Management. WiFi Manager for ESP32. That's it. No captive portal, no fallback if AP is not available. Just WiFi Management.
# What *does* it do? # What ~~*does*~~*will* it do?
* Stores info for multiple APs * Stores info for multiple APs
* Connects to "best" AP available * Connects to "best" AP available

View File

@ -65,6 +65,13 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event) {
break; break;
case SYSTEM_EVENT_STA_DISCONNECTED: case SYSTEM_EVENT_STA_DISCONNECTED:
ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED");
// TODO: handle multiple attempt
ap_store.last++;
if(ap_store.count == ap_store.last) ap_store.last = 0;
wifi_manager_connect();
ESP_ERROR_CHECK(esp_wifi_connect()); ESP_ERROR_CHECK(esp_wifi_connect());
xEventGroupClearBits(wm_event_group, WIFI_CONNECTED); xEventGroupClearBits(wm_event_group, WIFI_CONNECTED);