This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ec99e11  esp32/softap: Enable the WPA2 by default to ask user password
ec99e11 is described below

commit ec99e11f5efddf08b37c9ccb54450ef57b8e1e64
Author: Kapil Gupta <[email protected]>
AuthorDate: Wed Aug 25 14:56:25 2021 -0300

    esp32/softap: Enable the WPA2 by default to ask user password
    
    Signed-off-by: Kapil Gupta <[email protected]>
    Co-author: Alan Carvalho de Assis <[email protected]>
---
 arch/xtensa/src/esp32/esp32_wifi_adapter.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c 
b/arch/xtensa/src/esp32/esp32_wifi_adapter.c
index 84af102..20c441e 100644
--- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c
+++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c
@@ -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)
         {

Reply via email to