@@ -477,7 +477,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
477
477
params -> security = WIFI_SECURITY_TYPE_NONE ;
478
478
params -> mfp = WIFI_MFP_OPTIONAL ;
479
479
480
- while ((opt = getopt_long (argc , argv , "s:p:k:w:b:c:h" , long_options , & opt_index )) != -1 ) {
480
+ while ((opt = getopt_long (argc , argv , "s:p:k:w:b:c:m: h" , long_options , & opt_index )) != -1 ) {
481
481
state = getopt_state_get ();
482
482
switch (opt ) {
483
483
case 's' :
@@ -561,6 +561,12 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
561
561
}
562
562
params -> mfp = atoi (optarg );
563
563
break ;
564
+ case 'm' :
565
+ sscanf (optarg , "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx" ,
566
+ & params -> bssid [0 ], & params -> bssid [1 ],
567
+ & params -> bssid [2 ], & params -> bssid [3 ],
568
+ & params -> bssid [4 ], & params -> bssid [5 ]);
569
+ break ;
564
570
case 'h' :
565
571
shell_help (sh );
566
572
break ;
@@ -570,6 +576,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
570
576
return - EINVAL ;
571
577
}
572
578
}
579
+
573
580
return 0 ;
574
581
}
575
582
@@ -1858,9 +1865,11 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
1858
1865
"[-k, --key-mgmt]: Key Management type (valid only for secure SSIDs)\n"
1859
1866
"0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE, 4:WAPI, 5:EAP, 6:WEP, 7: WPA-PSK\n"
1860
1867
"[-w, --ieee-80211w]: MFP (optional: needs security type to be specified)\n"
1861
- ": 0:Disable, 1:Optional, 2:Required.\n" ,
1868
+ ": 0:Disable, 1:Optional, 2:Required.\n"
1869
+ "[-m, --bssid]: MAC address of the AP (BSSID).\n"
1870
+ "[-h, --help]: Print out the help for the connect command.\n" ,
1862
1871
cmd_wifi_connect ,
1863
- 2 , 5 ),
1872
+ 2 , 7 ),
1864
1873
SHELL_CMD_ARG (disconnect , NULL , "Disconnect from the Wi-Fi AP.\n" ,
1865
1874
cmd_wifi_disconnect ,
1866
1875
1 , 0 ),
0 commit comments