Skip to content

Commit d4648a6

Browse files
MaochenWang1kartben
authored andcommitted
net: l2: wifi: fix invalid option error when use -i
For 'wifi connect' or 'wifi ap enable' CMD, there is 'invalid option' error log when input '-i' parameter. Parsing '-i' can fix this issue. Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
1 parent 5bcaf33 commit d4648a6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,9 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
11471147
case 'g':
11481148
params->ignore_broadcast_ssid = shell_strtol(state->optarg, 10, &ret);
11491149
break;
1150+
case 'i':
1151+
/* Unused, but parsing to avoid unknown option error */
1152+
break;
11501153
case 'h':
11511154
return -ENOEXEC;
11521155
default:
@@ -2142,6 +2145,10 @@ static int twt_args_to_params(const struct shell *sh, size_t argc, char *argv[],
21422145
params->setup.twt_mantissa = (uint16_t)value;
21432146
break;
21442147

2148+
case 'i':
2149+
/* Unused, but parsing to avoid unknown option error */
2150+
break;
2151+
21452152
case 'h':
21462153
return -ENOEXEC;
21472154
}
@@ -2452,6 +2459,9 @@ static int wifi_ap_config_args_to_params(const struct shell *sh, size_t argc, ch
24522459
params->type |= WIFI_AP_CONFIG_PARAM_VHT_CAPAB;
24532460
break;
24542461
#endif
2462+
case 'i':
2463+
/* Unused, but parsing to avoid unknown option error */
2464+
break;
24552465
case 'h':
24562466
shell_help(sh);
24572467
return SHELL_CMD_HELP_PRINTED;
@@ -2548,6 +2558,9 @@ static int cmd_wifi_reg_domain(const struct shell *sh, size_t argc,
25482558
case 'v':
25492559
verbose = true;
25502560
break;
2561+
case 'i':
2562+
/* Unused, but parsing to avoid unknown option error */
2563+
break;
25512564
default:
25522565
return -ENOEXEC;
25532566
}
@@ -3254,6 +3267,9 @@ static int parse_dpp_args_auth_init(const struct shell *sh, size_t argc, char *a
32543267
case 's':
32553268
strncpy(params->auth_init.ssid, state->optarg, WIFI_SSID_MAX_LEN);
32563269
break;
3270+
case 'i':
3271+
/* Unused, but parsing to avoid unknown option error */
3272+
break;
32573273
default:
32583274
PR_ERROR("Invalid option %c\n", state->optopt);
32593275
return -EINVAL;
@@ -3291,6 +3307,9 @@ static int parse_dpp_args_chirp(const struct shell *sh, size_t argc, char *argv[
32913307
case 'f':
32923308
params->chirp.freq = shell_strtol(state->optarg, 10, &ret);
32933309
break;
3310+
case 'i':
3311+
/* Unused, but parsing to avoid unknown option error */
3312+
break;
32943313
default:
32953314
PR_ERROR("Invalid option %c\n", state->optopt);
32963315
return -EINVAL;
@@ -3328,6 +3347,9 @@ static int parse_dpp_args_listen(const struct shell *sh, size_t argc, char *argv
33283347
case 'f':
33293348
params->listen.freq = shell_strtol(state->optarg, 10, &ret);
33303349
break;
3350+
case 'i':
3351+
/* Unused, but parsing to avoid unknown option error */
3352+
break;
33313353
default:
33323354
PR_ERROR("Invalid option %c\n", state->optopt);
33333355
return -EINVAL;
@@ -3374,6 +3396,9 @@ static int parse_dpp_args_btstrap_gen(const struct shell *sh, size_t argc, char
33743396
ret = net_bytes_from_str(params->bootstrap_gen.mac,
33753397
WIFI_MAC_ADDR_LEN, state->optarg);
33763398
break;
3399+
case 'i':
3400+
/* Unused, but parsing to avoid unknown option error */
3401+
break;
33773402
default:
33783403
PR_ERROR("Invalid option %c\n", state->optopt);
33793404
return -EINVAL;
@@ -3433,6 +3458,9 @@ static int parse_dpp_args_set_config_param(const struct shell *sh, size_t argc,
34333458
case 's':
34343459
strncpy(params->configurator_set.ssid, state->optarg, WIFI_SSID_MAX_LEN);
34353460
break;
3461+
case 'i':
3462+
/* Unused, but parsing to avoid unknown option error */
3463+
break;
34363464
default:
34373465
PR_ERROR("Invalid option %c\n", state->optopt);
34383466
return -EINVAL;
@@ -3717,6 +3745,9 @@ static int cmd_wifi_dpp_ap_auth_init(const struct shell *sh, size_t argc, char *
37173745
case 'p':
37183746
params.auth_init.peer = shell_strtol(state->optarg, 10, &ret);
37193747
break;
3748+
case 'i':
3749+
/* Unused, but parsing to avoid unknown option error */
3750+
break;
37203751
default:
37213752
PR_ERROR("Invalid option %c\n", state->optopt);
37223753
return -EINVAL;

0 commit comments

Comments
 (0)