feat(wifi): Update wifi scan to support passive & active scan
internal:
#define __ESP_STA_H__
#include "queue.h"
-
+#include "esp_wifi.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -142,11 +142,32 @@ bool wifi_station_connect(void);
*/
bool wifi_station_disconnect(void);
+typedef enum {
+ WIFI_SCAN_TYPE_ACTIVE = 0, /**< active scan */
+ WIFI_SCAN_TYPE_PASSIVE, /**< passive scan */
+} wifi_scan_type_t;
+
+/** @brief Range of active scan times per channel */
+typedef struct {
+ uint32_t min; /**< minimum active scan time per channel, units: millisecond */
+ uint32_t max; /**< maximum active scan time per channel, units: millisecond, values above 1500ms may
+ cause station to disconnect from AP and are not recommended. */
+} wifi_active_scan_time_t;
+
+/** @brief Aggregate of active & passive scan time per channel */
+typedef union {
+ wifi_active_scan_time_t active; /**< active scan time per channel, units: millisecond. */
+ uint32_t passive; /**< passive scan time per channel, units: millisecond, values above 1500ms may
+ cause station to disconnect from AP and are not recommended. */
+} wifi_scan_time_t;
+
struct scan_config {
uint8 *ssid; /**< SSID of AP */
uint8 *bssid; /**< MAC address of AP */
uint8 channel; /**< channel, scan the specific channel */
uint8 show_hidden; /**< enable to scan AP whose SSID is hidden */
+ wifi_scan_type_t scan_type; /**< scan type, active or passive */
+ wifi_scan_time_t scan_time; /**< scan time per channel */
};
typedef enum {
