52 lines
1.0 KiB
C
52 lines
1.0 KiB
C
#ifndef WIFI_CFG_H
|
|
#define WIFI_CFG_H
|
|
|
|
#include "esp_wifi.h"
|
|
#include <stdbool.h>
|
|
|
|
#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 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
|