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 committed Jul 2, 2024
1 parent 46649b7 commit de7eb95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,9 +1295,10 @@ 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;
int ret;

memset(&cnx_params, 0, sizeof(struct wifi_connect_req_params));
context.sh = sh;
if (__wifi_args_to_params(sh, argc, &argv[0], &cnx_params, WIFI_MODE_AP)) {
shell_help(sh);
Expand Down Expand Up @@ -2050,7 +2051,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
"[-t, --timeout]: Timeout for the connection attempt (in seconds).\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 de7eb95

Please sign in to comment.