mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
WiFi: optimize scan feature
1. Add all channel scan feature 2. Add sort matched SSID by authmode feature
This commit is contained in:
@@ -132,6 +132,16 @@ typedef struct {
|
||||
uint32_t reserved:31; /**< bit: 1..31 reserved */
|
||||
} wifi_ap_record_t;
|
||||
|
||||
typedef enum {
|
||||
WIFI_FAST_SCAN = 0, /**< Do fast scan, scan will end after find SSID match AP */
|
||||
WIFI_ALL_CHANNEL_SCAN, /**< All channel scan, scan will end after scan all the channel */
|
||||
}wifi_scan_method_t;
|
||||
|
||||
typedef enum {
|
||||
WIFI_CONNECT_AP_BY_SIGNAL = 0, /**< Sort match AP in scan list by RSSI */
|
||||
WIFI_CONNECT_AP_BY_SECURITY, /**< Sort match AP in scan list by security mode */
|
||||
}wifi_sort_method_t;
|
||||
|
||||
typedef enum {
|
||||
WIFI_PS_NONE, /**< No power save */
|
||||
WIFI_PS_MODEM, /**< Modem power save */
|
||||
@@ -161,9 +171,11 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint8_t ssid[32]; /**< SSID of target AP*/
|
||||
uint8_t password[64]; /**< password of target AP*/
|
||||
wifi_scan_method_t scan_method; /**< do all channel scan or fast scan */
|
||||
bool bssid_set; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/
|
||||
uint8_t bssid[6]; /**< MAC address of target AP*/
|
||||
uint8_t channel; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/
|
||||
wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */
|
||||
} wifi_sta_config_t;
|
||||
|
||||
typedef union {
|
||||
|
Submodule components/esp32/lib updated: a3c8f349fe...1a06dd1671
@@ -68,7 +68,7 @@ static void wifi_power_save(void)
|
||||
wifi_config_t wifi_config = {
|
||||
.sta = {
|
||||
.ssid = DEFAULT_SSID,
|
||||
.password = DEFAULT_PWD
|
||||
.password = DEFAULT_PWD,
|
||||
},
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
|
||||
|
Reference in New Issue
Block a user