mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-04 11:00:58 +02:00
esp_wifi: Fix handling of multiple AP credentials in WPS
WPS can send multiple AP credentials, while existing implementation will only use the first credentials which could be for the 5G band. Fix this by passing these credentials to the App and attempting to connect using each of those. Older Apps will remain compatible without breaking WPS, but the issue will remain.
This commit is contained in:
@@ -106,6 +106,9 @@ typedef struct {
|
||||
tcpip_adapter_ip6_info_t ip6_info;
|
||||
} system_event_got_ip6_t;
|
||||
|
||||
/** Argument structure of SYSTEM_EVENT_STA_WPS_ER_SUCCESS event */
|
||||
typedef wifi_event_sta_wps_er_success_t system_event_sta_wps_er_success_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t mac[6]; /**< MAC address of the station connected to ESP32 soft-AP */
|
||||
uint8_t aid; /**< the aid that ESP32 soft-AP gives to the station connected to */
|
||||
@@ -133,6 +136,7 @@ typedef union {
|
||||
system_event_sta_got_ip_t got_ip; /**< ESP32 station got IP, first time got IP or when IP is changed */
|
||||
system_event_sta_wps_er_pin_t sta_er_pin; /**< ESP32 station WPS enrollee mode PIN code received */
|
||||
system_event_sta_wps_fail_reason_t sta_er_fail_reason;/**< ESP32 station WPS enrollee mode failed reason code received */
|
||||
system_event_sta_wps_er_success_t sta_er_success; /*!< ESP32 station WPS enrollee success */
|
||||
system_event_ap_staconnected_t sta_connected; /**< a station connected to ESP32 soft-AP */
|
||||
system_event_ap_stadisconnected_t sta_disconnected; /**< a station disconnected to ESP32 soft-AP */
|
||||
system_event_ap_probe_req_rx_t ap_probereqrecved; /**< ESP32 soft-AP receive probe request packet */
|
||||
|
@@ -502,6 +502,19 @@ typedef enum {
|
||||
WIFI_IOCTL_MAX,
|
||||
} wifi_ioctl_cmd_t;
|
||||
|
||||
#define MAX_SSID_LEN 32
|
||||
#define MAX_PASSPHRASE_LEN 64
|
||||
#define MAX_WPS_AP_CRED 3
|
||||
|
||||
/** Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event */
|
||||
typedef struct {
|
||||
uint8_t ap_cred_cnt; /**< Number of AP credentials received */
|
||||
struct {
|
||||
uint8_t ssid[MAX_SSID_LEN]; /**< SSID of AP */
|
||||
uint8_t passphrase[MAX_PASSPHRASE_LEN]; /**< Passphrase for the AP */
|
||||
} ap_cred[MAX_WPS_AP_CRED]; /**< All AP credentials received from WPS handshake */
|
||||
} wifi_event_sta_wps_er_success_t;
|
||||
|
||||
/**
|
||||
* @brief Configuration for STA's HT2040 coexist management
|
||||
*
|
||||
|
Reference in New Issue
Block a user