From 1ba21da6cbc63c0c549fb92731e25bedc482eb51 Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Thu, 4 Sep 2025 22:25:39 +0200 Subject: Unify the directory, add new analysis methods, unify the code style Signed-off-by: Filip Wandzio --- src/wifi.c | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/wifi.c (limited to 'src/wifi.c') diff --git a/src/wifi.c b/src/wifi.c deleted file mode 100644 index 8d6b29d..0000000 --- a/src/wifi.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "wifi.h" -#include "config.h" -#include "esp_event.h" -#include "esp_netif.h" -#include "esp_wifi.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include - -#define WIFI_SCAN_DELAY_MS 3000 - -/** - * @brief Initialize WiFi in station mode. - * - * This function performs the following steps: - * - Creates the default WiFi station network interface. - * - Initializes the WiFi driver with default configuration. - * - Sets WiFi mode to station. - * - Starts WiFi. - * - Starts scanning for available WiFi networks. - * - Waits for a predefined delay to allow scanning to complete. - * - Configures the WiFi station with SSID and password. - * - Connects to the configured WiFi network. - * - * The SSID and password are defined in the configuration headers. - */ -void wifi_init_sta(void) { - esp_netif_create_default_wifi_sta(); - - wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); - if (esp_wifi_init(&cfg) != ESP_OK) { - return; - } - - esp_wifi_set_mode(WIFI_MODE_STA); - esp_wifi_start(); - - wifi_scan_start(); - vTaskDelay(pdMS_TO_TICKS(WIFI_SCAN_DELAY_MS)); - - wifi_config_t wifi_config = {0}; - strncpy((char *)wifi_config.sta.ssid, WIFI_SSID, - sizeof(wifi_config.sta.ssid) - 1); - strncpy((char *)wifi_config.sta.password, WIFI_PASS, - sizeof(wifi_config.sta.password) - 1); - - esp_wifi_set_config(WIFI_IF_STA, &wifi_config); - esp_wifi_connect(); -} -- cgit v1.2.3