Skip to content

Commit 379e4d7

Browse files
committed
feat(wifi): Update wifi scan to support passive & active scan
internal: 3cb655c7
1 parent af08298 commit 379e4d7

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

include/espressif/esp_sta.h

+26-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define __ESP_STA_H__
2727

2828
#include "queue.h"
29-
29+
#include "esp_wifi.h"
3030
#ifdef __cplusplus
3131
extern "C" {
3232
#endif
@@ -142,11 +142,32 @@ bool wifi_station_connect(void);
142142
*/
143143
bool wifi_station_disconnect(void);
144144

145+
typedef enum {
146+
WIFI_SCAN_TYPE_ACTIVE = 0, /**< active scan */
147+
WIFI_SCAN_TYPE_PASSIVE, /**< passive scan */
148+
} wifi_scan_type_t;
149+
150+
/** @brief Range of active scan times per channel */
151+
typedef struct {
152+
uint32_t min; /**< minimum active scan time per channel, units: millisecond */
153+
uint32_t max; /**< maximum active scan time per channel, units: millisecond, values above 1500ms may
154+
cause station to disconnect from AP and are not recommended. */
155+
} wifi_active_scan_time_t;
156+
157+
/** @brief Aggregate of active & passive scan time per channel */
158+
typedef union {
159+
wifi_active_scan_time_t active; /**< active scan time per channel, units: millisecond. */
160+
uint32_t passive; /**< passive scan time per channel, units: millisecond, values above 1500ms may
161+
cause station to disconnect from AP and are not recommended. */
162+
} wifi_scan_time_t;
163+
145164
struct scan_config {
146-
uint8 *ssid; /**< SSID of AP */
147-
uint8 *bssid; /**< MAC address of AP */
148-
uint8 channel; /**< channel, scan the specific channel */
149-
uint8 show_hidden; /**< enable to scan AP whose SSID is hidden */
165+
uint8 *ssid; /**< SSID of AP */
166+
uint8 *bssid; /**< MAC address of AP */
167+
uint8 channel; /**< channel, scan the specific channel */
168+
uint8 show_hidden; /**< enable to scan AP whose SSID is hidden */
169+
wifi_scan_type_t scan_type; /**< scan type, active or passive */
170+
wifi_scan_time_t scan_time; /**< scan time per channel */
150171
};
151172

152173
typedef enum {

0 commit comments

Comments
 (0)