swap SCANNING/IDLE bits weather ap found or not

This commit is contained in:
Morgan 'ARR\!' Allen 2018-10-11 13:48:16 -07:00
parent ccffb2229f
commit f1ff7079fa

View file

@ -102,11 +102,12 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event) {
} }
found: found:
if(ap_store.last != -1) {
ESP_LOGI(TAG, "Got matching ESSID: %s", ap_store.aps[ap_store.last].ssid);
xEventGroupClearBits(wm_event_group, WIFI_SCANNING); xEventGroupClearBits(wm_event_group, WIFI_SCANNING);
xEventGroupSetBits(wm_event_group, WIFI_IDLE); xEventGroupSetBits(wm_event_group, WIFI_IDLE);
if(ap_store.last != -1) {
ESP_LOGI(TAG, "Got matching ESSID: %s", ap_store.aps[ap_store.last].ssid);
wifi_manager_connect(); wifi_manager_connect();
} else { } else {
ESP_LOGI(TAG, "No matching APs found"); ESP_LOGI(TAG, "No matching APs found");