* @attention If this API is called, the found APs are stored in WiFi driver dynamic allocated memory and the
* will be freed in esp_wifi_get_ap_list, so generally, call esp_wifi_get_ap_list to cause
* the memory to be freed once the scan is done
+ * @attention The values of maximum active scan time and passive scan time per channel are limited to 1500 milliseconds.
+ * Values above 1500ms may cause station to disconnect from AP and are not recommended.
*
* @param config configuration of scanning
* @param block if block is true, this API will block the caller until the scan is done, otherwise
WIFI_SECOND_CHAN_BELOW, /**< the channel width is HT40 and the second channel is below the primary channel */
} wifi_second_chan_t;
+typedef enum {
+ WIFI_SCAN_TYPE_ACTIVE = 0, /**< active scan */
+ WIFI_SCAN_TYPE_PASSIVE, /**< passive scan */
+} wifi_scan_type_t;
+
+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;
+
+typedef union {
+ wifi_active_scan_time_t active; /**< active scan time per channel */
+ 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;
+
typedef struct {
- uint8_t *ssid; /**< SSID of AP */
- uint8_t *bssid; /**< MAC address of AP */
- uint8_t channel; /**< channel, scan the specific channel */
- bool show_hidden; /**< enable to scan AP whose SSID is hidden */
+ uint8_t *ssid; /**< SSID of AP */
+ uint8_t *bssid; /**< MAC address of AP */
+ uint8_t channel; /**< channel, scan the specific channel */
+ bool 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 */
} wifi_scan_config_t;
typedef struct {