mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-12-10 15:22:21 +08:00
feat(example): set authmode threshold to WPA2 when password set
This commit is contained in:
@@ -122,6 +122,14 @@ void wifi_init_sta()
|
||||
},
|
||||
};
|
||||
|
||||
/* Setting a password implies station will connect to all security modes including WEP/WPA.
|
||||
* However these modes are deprecated and not advisable to be used. Incase your Access point
|
||||
* doesn't support WPA2, these mode can be enabled by commenting below line */
|
||||
|
||||
if (strlen(EXAMPLE_ESP_WIFI_PASS)) {
|
||||
wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
|
||||
ESP_ERROR_CHECK(esp_wifi_start() );
|
||||
|
||||
Reference in New Issue
Block a user