mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
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:
@@ -6297,9 +6297,17 @@ int esp_wifi_softap_password(struct iwreq *iwr, bool set)
|
|||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
{
|
{
|
||||||
|
/* Clear the password field and copy the user password to it */
|
||||||
|
|
||||||
memset(wifi_cfg.ap.password, 0x0, PWD_MAX_LEN);
|
memset(wifi_cfg.ap.password, 0x0, PWD_MAX_LEN);
|
||||||
memcpy(wifi_cfg.ap.password, pdata, 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);
|
ret = esp_wifi_set_config(WIFI_IF_AP, &wifi_cfg);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user