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 <hui.bai@nxp.com>
This commit is contained in:
Hui Bai 2024-06-27 15:49:25 +08:00 committed by Anas Nashif
parent dbc6cdc711
commit c2472e8bae

View file

@ -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),