58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
#pragma once
|
|
|
|
#include "esp_err.h"
|
|
#include "esp_wifi.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
WIFI_CTL_MODE_STA,
|
|
WIFI_CTL_MODE_MONITOR
|
|
} wifi_ctl_mode_t;
|
|
|
|
/**
|
|
* @brief Initialize the WiFi Controller
|
|
*/
|
|
void wifi_ctl_init(void);
|
|
|
|
/**
|
|
* @brief Switch operation mode to Monitor (Sniffer)
|
|
* @param channel WiFi channel (1-165)
|
|
* @param bandwidth Bandwidth (usually WIFI_BW_HT20 for monitor)
|
|
*/
|
|
esp_err_t wifi_ctl_switch_to_monitor(uint8_t channel, wifi_bandwidth_t bandwidth);
|
|
|
|
/**
|
|
* @brief Switch operation mode to Station (Client)
|
|
* @param band_mode Band preference (Auto, 2G only, 5G only)
|
|
*/
|
|
esp_err_t wifi_ctl_switch_to_sta(wifi_band_mode_t band_mode);
|
|
|
|
/**
|
|
* @brief Start the auto-monitor task
|
|
* Waits for connection, waits for GPS, then switches to monitor mode.
|
|
* @param channel Channel to monitor
|
|
*/
|
|
void wifi_ctl_auto_monitor_start(uint8_t channel);
|
|
|
|
/**
|
|
* @brief Get current operation mode
|
|
*/
|
|
wifi_ctl_mode_t wifi_ctl_get_mode(void);
|
|
|
|
/**
|
|
* @brief Get the current monitor channel
|
|
*/
|
|
uint8_t wifi_ctl_get_monitor_channel(void);
|
|
|
|
/**
|
|
* @brief Get total frames captured in monitor mode
|
|
*/
|
|
uint32_t wifi_ctl_get_monitor_frame_count(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|