From 3051420dde6936cec9c784e8501baad1cab74f39 Mon Sep 17 00:00:00 2001 From: Morgan Allen Date: Fri, 21 Sep 2018 21:38:36 -0700 Subject: [PATCH] important correction in README --- README.md | 2 +- main/esp32-wifi-manager.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 579d942..87c9ba7 100644 --- a/README.md +++ b/README.md @@ -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. -# What *does* it do? +# What ~~*does*~~*will* it do? * Stores info for multiple APs * Connects to "best" AP available diff --git a/main/esp32-wifi-manager.c b/main/esp32-wifi-manager.c index 0fa18d3..2dd8d2b 100644 --- a/main/esp32-wifi-manager.c +++ b/main/esp32-wifi-manager.c @@ -65,6 +65,13 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event) { break; case 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()); xEventGroupClearBits(wm_event_group, WIFI_CONNECTED);