@@ -1700,6 +1700,57 @@ static int cmd_wifi_btm_query(const struct shell *sh, size_t argc, char *argv[])
17001700}
17011701#endif
17021702
1703+ static int cmd_wifi_wps_pbc (const struct shell * sh , size_t argc , char * argv [])
1704+ {
1705+ struct net_if * iface = net_if_get_first_wifi ();
1706+ struct wifi_wps_config_params params = {0 };
1707+
1708+ context .sh = sh ;
1709+
1710+ if (argc == 1 ) {
1711+ params .oper = WIFI_WPS_PBC ;
1712+ } else {
1713+ shell_help (sh );
1714+ return - ENOEXEC ;
1715+ }
1716+
1717+ if (net_mgmt (NET_REQUEST_WIFI_WPS_CONFIG , iface , & params , sizeof (params ))) {
1718+ PR_WARNING ("Start wps pbc connection failed\n" );
1719+ return - ENOEXEC ;
1720+ }
1721+
1722+ return 0 ;
1723+ }
1724+
1725+ static int cmd_wifi_wps_pin (const struct shell * sh , size_t argc , char * argv [])
1726+ {
1727+ struct net_if * iface = net_if_get_first_wifi ();
1728+ struct wifi_wps_config_params params = {0 };
1729+
1730+ context .sh = sh ;
1731+
1732+ if (argc == 1 ) {
1733+ params .oper = WIFI_WPS_PIN_GET ;
1734+ } else if (argc == 2 ) {
1735+ params .oper = WIFI_WPS_PIN_SET ;
1736+ strncpy (params .pin , argv [1 ], WIFI_WPS_PIN_MAX_LEN );
1737+ } else {
1738+ shell_help (sh );
1739+ return - ENOEXEC ;
1740+ }
1741+
1742+ if (net_mgmt (NET_REQUEST_WIFI_WPS_CONFIG , iface , & params , sizeof (params ))) {
1743+ PR_WARNING ("Start wps pin connection failed\n" );
1744+ return - ENOEXEC ;
1745+ }
1746+
1747+ if (params .oper == WIFI_WPS_PIN_GET ) {
1748+ PR ("WPS PIN is: %s\n" , params .pin );
1749+ }
1750+
1751+ return 0 ;
1752+ }
1753+
17031754static int cmd_wifi_ps_wakeup_mode (const struct shell * sh , size_t argc , char * argv [])
17041755{
17051756 struct net_if * iface = net_if_get_first_wifi ();
@@ -2960,6 +3011,13 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
29603011 cmd_wifi_btm_query ,
29613012 2 , 0 ),
29623013#endif
3014+ SHELL_CMD_ARG (wps_pbc , NULL ,
3015+ "Start a WPS PBC connection.\n" ,
3016+ cmd_wifi_wps_pbc , 1 , 0 ),
3017+ SHELL_CMD_ARG (wps_pin , NULL ,
3018+ "Set and get WPS pin.\n"
3019+ "[pin] Only applicable for set.\n" ,
3020+ cmd_wifi_wps_pin , 1 , 1 ),
29633021 SHELL_CMD_ARG (ps_timeout ,
29643022 NULL ,
29653023 "<val> - PS inactivity timer(in ms).\n" ,
0 commit comments