esp32/softap: Enable the WPA2 by default to ask user password

Signed-off-by: Kapil Gupta <kapil.gupta@espressif.com>
Co-author: Alan Carvalho de Assis <alan.carvalho@espressif.com>
This commit is contained in:
Kapil Gupta
2021-08-25 14:56:25 -03:00
committed by Xiang Xiao
parent f1aec38ffa
commit ec99e11f5e
@@ -6297,9 +6297,17 @@ int esp_wifi_softap_password(struct iwreq *iwr, bool set)
if (set)
{
/* Clear the password field and copy the user password to it */
memset(wifi_cfg.ap.password, 0x0, PWD_MAX_LEN);
memcpy(wifi_cfg.ap.password, pdata, len);
/* Enable the WPA2 password by default */
wifi_cfg.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK;
/* Setup the config to the SoftAP */
ret = esp_wifi_set_config(WIFI_IF_AP, &wifi_cfg);
if (ret)
{