Skip to content

Commit

Permalink
net: l2: wifi: Fix issue command wifi connect fail.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nxf58150 authored and nashif committed Aug 28, 2024
1 parent dbc6cdc commit c2472e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit c2472e8

Please sign in to comment.