]> granicus.if.org Git - esp-idf/commitdiff
wifi scan: add wifi scan type and time config
authorXiaXiaotian <xiaxiaotian@espressif.com>
Thu, 16 Mar 2017 08:20:19 +0000 (16:20 +0800)
committerXiaXiaotian <xiaxiaotian@espressif.com>
Thu, 30 Mar 2017 12:36:52 +0000 (20:36 +0800)
components/esp32/include/esp_wifi.h
components/esp32/include/esp_wifi_types.h
components/esp32/lib

index a9b072200fd6c741c366d7d86e7e5a82ffb88428..f48146b25b759f26137fdbfeba0f38c96638c0bc 100755 (executable)
@@ -296,6 +296,8 @@ esp_err_t esp_wifi_deauth_sta(uint16_t aid);
   * @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
index 2b30f5b8ba381ca8415c3962b19f94156d0f4bc3..be5435da0ed330c1b0a05749c55b54dd6ea43a10 100755 (executable)
@@ -96,11 +96,30 @@ typedef enum {
     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 {
index 5c98c5a8b93dbf181849b40c6d6cd164a52bfc4c..bd53ad194dd85885d3d41f455e9debeb9409aef9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5c98c5a8b93dbf181849b40c6d6cd164a52bfc4c
+Subproject commit bd53ad194dd85885d3d41f455e9debeb9409aef9