#ifndef WIFI_CFG_H #define WIFI_CFG_H #include "esp_wifi.h" #include #ifdef __cplusplus extern "C" { #endif /** * @brief Initialize the WiFi configuration system * * Spawns listener tasks for both UART and USB-Serial/JTAG interfaces * to receive configuration commands. */ void wifi_cfg_init(void); /** * @brief Apply WiFi configuration from NVS * * @return true if configuration was found and applied, false otherwise */ bool wifi_cfg_apply_from_nvs(void); /** * @brief Force DHCP mode enable/disable * * @param enable true to enable DHCP, false to disable */ void wifi_cfg_force_dhcp(bool enable); /** * @brief Get the configured power save mode from NVS * * @return wifi_ps_type_t Power save mode (WIFI_PS_NONE, WIFI_PS_MIN_MODEM, or WIFI_PS_MAX_MODEM) */ wifi_ps_type_t wifi_cfg_get_power_save_mode(void); /** * @brief Get the configured bandwidth from NVS * * @param buf Buffer to store bandwidth string (e.g., "HT20", "HT40", "VHT80") * @param buf_size Size of buffer * @return true if bandwidth was retrieved, false otherwise */ bool wifi_cfg_get_bandwidth(char *buf, size_t buf_size); /** * @brief Ensure WiFi driver is initialized (thread-safe, idempotent) * * @return ESP_OK on success, error code otherwise */ esp_err_t wifi_ensure_inited(void); #ifdef __cplusplus } #endif #endif // WIFI_CFG_H