@@ -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
@@ -1864,9 +1871,11 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
1864
1871
"[-k, --key-mgmt]: Key Management type (valid only for secure SSIDs)\n"
1865
1872
"0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE, 4:WAPI, 5:EAP, 6:WEP, 7: WPA-PSK\n"
1866
1873
"[-w, --ieee-80211w]: MFP (optional: needs security type to be specified)\n"
1867
- ": 0:Disable, 1:Optional, 2:Required.\n" ,
1874
+ ": 0:Disable, 1:Optional, 2:Required.\n"
1875
+ "[-m, --bssid]: MAC address of the AP (BSSID).\n"
1876
+ "[-h, --help]: Print out the help for the connect command.\n" ,
1868
1877
cmd_wifi_connect ,
1869
- 2 , 5 ),
1878
+ 2 , 7 ),
1870
1879
SHELL_CMD_ARG (disconnect , NULL , "Disconnect from the Wi-Fi AP.\n" ,
1871
1880
cmd_wifi_disconnect ,
1872
1881
1 , 0 ),
0 commit comments