From c2472e8baef59404398ef3f4a3e150776ee74279 Mon Sep 17 00:00:00 2001 From: Hui Bai Date: Thu, 27 Jun 2024 15:49:25 +0800 Subject: [PATCH] net: l2: wifi: Fix issue command wifi connect fail. Increase wifi connect input parameters max count to 13. Previous count 7 is not enough if other security type is supported. When enabling softAP, the parameter cnx_params in cmd_wifi_ap_enable() is with static key word. Then the parameter will always save configurations of last time. Remove static keyword to eliminate effects of configs from last tim and do memset before setting up softAP. Signed-off-by: Hui Bai --- subsys/net/l2/wifi/wifi_shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index e4f882306c04e5..9b25f2f65f838e 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1382,7 +1382,7 @@ static int cmd_wifi_ap_enable(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = net_if_get_wifi_sap(); - static struct wifi_connect_req_params cnx_params; + struct wifi_connect_req_params cnx_params = {0}; int ret; context.sh = sh; @@ -2666,7 +2666,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "[-K, --key-passwd]: Private key passwd for enterprise mode.\n" "[-h, --help]: Print out the help for the connect command.\n", cmd_wifi_connect, - 2, 7), + 2, 13), SHELL_CMD_ARG(disconnect, NULL, "Disconnect from the Wi-Fi AP.\n", cmd_wifi_disconnect, 1, 0),