diff --git a/main/esp32-wifi-manager.c b/main/esp32-wifi-manager.c index 146ed6a..7fcd377 100644 --- a/main/esp32-wifi-manager.c +++ b/main/esp32-wifi-manager.c @@ -96,13 +96,7 @@ uint8_t wifi_manager_add_ap(char *ssid, char *password) { return ap_store.count; }; -void wifi_manager_connect() { - ESP_ERROR_CHECK(esp_wifi_start()); - - wifi_config_t wifi_config = { - .sta = { - } - }; +void wifi_manager_scan() { wifi_scan_config_t scan_config = { 0 }; ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, false)); @@ -110,8 +104,13 @@ void wifi_manager_connect() { ESP_LOGI(TAG, "setting WIFI_SCANNING bit"); xEventGroupSetBits(wm_event_group, WIFI_SCANNING); xEventGroupClearBits(wm_event_group, WIFI_IDLE); +}; - return; +void wifi_manager_connect() { + wifi_config_t wifi_config = { + .sta = { + } + }; ESP_LOGI(TAG, "connecting to AP %d of %d", ap_store.last + 1, ap_store.count);