From c764683542c90fd6b4aa7875940dda87590bf188 Mon Sep 17 00:00:00 2001 From: xiaxiaotian Date: Mon, 5 Sep 2016 21:13:20 +0800 Subject: [PATCH 1/4] Add get station auth mode --- components/esp32/include/esp_wifi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index 357788225a..972b07b24a 100755 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -214,6 +214,7 @@ typedef struct { char password[64]; /**< password of target AP*/ 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 authmode; } wifi_sta_config_t; typedef union { From 035a48f102d12e01afa45d4f08f0842c770c7c35 Mon Sep 17 00:00:00 2001 From: xiaxiaotian Date: Tue, 6 Sep 2016 15:28:09 +0800 Subject: [PATCH 2/4] Post station's auth mode event after it is connected to AP. --- components/esp32/event.c | 4 ++-- components/esp32/include/esp_event.h | 1 + components/esp32/include/esp_wifi.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp32/event.c b/components/esp32/event.c index 737a8a604c..d8e5c0a4fb 100644 --- a/components/esp32/event.c +++ b/components/esp32/event.c @@ -190,9 +190,9 @@ static esp_err_t esp_system_event_debug(system_event_t *event) { system_event_sta_connected_t *connected; connected = &event->event_info.connected; - WIFI_DEBUG("SYSTEM_EVENT_STA_CONNECTED\nssid:%s, ssid_len:%d, bssid:%02x:%02x:%02x:%02x:%02x:%02x, channel:%d\n", \ + WIFI_DEBUG("SYSTEM_EVENT_STA_CONNECTED\nssid:%s, ssid_len:%d, bssid:%02x:%02x:%02x:%02x:%02x:%02x, channel:%d, authmode:%d\n", \ connected->ssid, connected->ssid_len, connected->bssid[0], connected->bssid[0], connected->bssid[1], \ - connected->bssid[3], connected->bssid[4], connected->bssid[5], connected->channel); + connected->bssid[3], connected->bssid[4], connected->bssid[5], connected->channel, connected->authmode); break; } case SYSTEM_EVENT_STA_DISCONNECTED: diff --git a/components/esp32/include/esp_event.h b/components/esp32/include/esp_event.h index fa3135d9cc..e305e70d2f 100755 --- a/components/esp32/include/esp_event.h +++ b/components/esp32/include/esp_event.h @@ -56,6 +56,7 @@ typedef struct { uint8_t ssid_len; /**< SSID length of connected AP */ uint8_t bssid[6]; /**< BSSID of connected AP*/ uint8_t channel; /**< channel of connected AP*/ + uint8_t authmode; } system_event_sta_connected_t; typedef struct { diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index 972b07b24a..357788225a 100755 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -214,7 +214,6 @@ typedef struct { char password[64]; /**< password of target AP*/ 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 authmode; } wifi_sta_config_t; typedef union { From 8622fda76412819164b43325f22c5bad30a3d45a Mon Sep 17 00:00:00 2001 From: xiaxiaotian Date: Tue, 6 Sep 2016 16:14:40 +0800 Subject: [PATCH 3/4] Change the type of authmode --- components/esp32/include/esp_event.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp32/include/esp_event.h b/components/esp32/include/esp_event.h index e305e70d2f..733aee6739 100755 --- a/components/esp32/include/esp_event.h +++ b/components/esp32/include/esp_event.h @@ -56,7 +56,7 @@ typedef struct { uint8_t ssid_len; /**< SSID length of connected AP */ uint8_t bssid[6]; /**< BSSID of connected AP*/ uint8_t channel; /**< channel of connected AP*/ - uint8_t authmode; + wifi_auth_mode_t authmode; } system_event_sta_connected_t; typedef struct { @@ -67,8 +67,8 @@ typedef struct { } system_event_sta_disconnected_t; typedef struct { - uint8_t old_mode; /**< the old auth mode of AP */ - uint8_t new_mode; /**< the new auth mode of AP */ + wifi_auth_mode_t old_mode; /**< the old auth mode of AP */ + wifi_auth_mode_t new_mode; /**< the new auth mode of AP */ } system_event_sta_authmode_change_t; typedef struct { From 43d441d0f47d7e8e72e04040fcefc409c5e4f1ad Mon Sep 17 00:00:00 2001 From: xiaxiaotian Date: Tue, 6 Sep 2016 16:15:47 +0800 Subject: [PATCH 4/4] Change the type of authmode --- components/esp32/include/esp_event.h | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp32/include/esp_event.h b/components/esp32/include/esp_event.h index 733aee6739..ec9affe137 100755 --- a/components/esp32/include/esp_event.h +++ b/components/esp32/include/esp_event.h @@ -19,6 +19,7 @@ #include #include "esp_err.h" +#include "esp_wifi.h" #ifdef __cplusplus extern "C" {