13ff40c12SJohn Marinowpa_supplicant and Wi-Fi P2P 23ff40c12SJohn Marino============================ 33ff40c12SJohn Marino 43ff40c12SJohn MarinoThis document describes how the Wi-Fi P2P implementation in 53ff40c12SJohn Marinowpa_supplicant can be configured and how an external component on the 63ff40c12SJohn Marinoclient (e.g., management GUI) is used to enable WPS enrollment and 73ff40c12SJohn Marinoregistrar registration. 83ff40c12SJohn Marino 93ff40c12SJohn Marino 103ff40c12SJohn MarinoIntroduction to Wi-Fi P2P 113ff40c12SJohn Marino------------------------- 123ff40c12SJohn Marino 133ff40c12SJohn MarinoTODO 143ff40c12SJohn Marino 153ff40c12SJohn MarinoMore information about Wi-Fi P2P is available from Wi-Fi Alliance: 163ff40c12SJohn Marinohttp://www.wi-fi.org/Wi-Fi_Direct.php 173ff40c12SJohn Marino 183ff40c12SJohn Marino 193ff40c12SJohn Marinowpa_supplicant implementation 203ff40c12SJohn Marino----------------------------- 213ff40c12SJohn Marino 223ff40c12SJohn MarinoTODO 233ff40c12SJohn Marino 243ff40c12SJohn Marino 253ff40c12SJohn Marinowpa_supplicant configuration 263ff40c12SJohn Marino---------------------------- 273ff40c12SJohn Marino 283ff40c12SJohn MarinoWi-Fi P2P is an optional component that needs to be enabled in the 293ff40c12SJohn Marinowpa_supplicant build configuration (.config). Here is an example 303ff40c12SJohn Marinoconfiguration that includes Wi-Fi P2P support and Linux nl80211 313ff40c12SJohn Marino-based driver interface: 323ff40c12SJohn Marino 333ff40c12SJohn MarinoCONFIG_DRIVER_NL80211=y 343ff40c12SJohn MarinoCONFIG_CTRL_IFACE=y 353ff40c12SJohn MarinoCONFIG_P2P=y 363ff40c12SJohn MarinoCONFIG_AP=y 373ff40c12SJohn MarinoCONFIG_WPS=y 383ff40c12SJohn Marino 393ff40c12SJohn Marino 403ff40c12SJohn MarinoIn run-time configuration file (wpa_supplicant.conf), some parameters 413ff40c12SJohn Marinofor P2P may be set. In order to make the devices easier to recognize, 423ff40c12SJohn Marinodevice_name and device_type should be specified. For example, 433ff40c12SJohn Marinosomething like this should be included: 443ff40c12SJohn Marino 453ff40c12SJohn Marinoctrl_interface=/var/run/wpa_supplicant 463ff40c12SJohn Marinodevice_name=My P2P Device 473ff40c12SJohn Marinodevice_type=1-0050F204-1 483ff40c12SJohn Marino 493ff40c12SJohn Marino 503ff40c12SJohn Marinowpa_cli 513ff40c12SJohn Marino------- 523ff40c12SJohn Marino 533ff40c12SJohn MarinoActual Wi-Fi P2P operations are requested during runtime. These can be 543ff40c12SJohn Marinodone for example using wpa_cli (which is described below) or a GUI 553ff40c12SJohn Marinolike wpa_gui-qt4. 563ff40c12SJohn Marino 573ff40c12SJohn Marino 583ff40c12SJohn Marinowpa_cli starts in interactive mode if no command string is included on 593ff40c12SJohn Marinothe command line. By default, it will select the first network interface 603ff40c12SJohn Marinothat it can find (and that wpa_supplicant controls). If more than one 613ff40c12SJohn Marinointerface is in use, it may be necessary to select one of the explicitly 623ff40c12SJohn Marinoby adding -i argument on the command line (e.g., 'wpa_cli -i wlan1'). 633ff40c12SJohn Marino 643ff40c12SJohn MarinoMost of the P2P operations are done on the main interface (e.g., the 653ff40c12SJohn Marinointerface that is automatically added when the driver is loaded, e.g., 663ff40c12SJohn Marinowlan0). When using a separate virtual interface for group operations 673ff40c12SJohn Marino(e.g., wlan1), the control interface for that group interface may need 683ff40c12SJohn Marinoto be used for some operations (mainly WPS activation in GO). This may 693ff40c12SJohn Marinochange in the future so that all the needed operations could be done 703ff40c12SJohn Marinoover the main control interface. 713ff40c12SJohn Marino 723ff40c12SJohn MarinoDevice Discovery 733ff40c12SJohn Marino 743ff40c12SJohn Marinop2p_find [timeout in seconds] [type=<social|progressive>] \ 753ff40c12SJohn Marino [dev_id=<addr>] [dev_type=<device type>] \ 76*a1157835SDaniel Fojt [delay=<search delay in ms>] [seek=<service name>] [freq=<MHz>] 773ff40c12SJohn Marino 783ff40c12SJohn MarinoThe default behavior is to run a single full scan in the beginning and 793ff40c12SJohn Marinothen scan only social channels. type=social will scan only social 803ff40c12SJohn Marinochannels, i.e., it skips the initial full scan. type=progressive is 813ff40c12SJohn Marinolike the default behavior, but it will scan through all the channels 823ff40c12SJohn Marinoprogressively one channel at the time in the Search state rounds. This 833ff40c12SJohn Marinowill help in finding new groups or groups missed during the initial 84*a1157835SDaniel Fojtfull scan. When the type parameter is not included (i.e., full scan), the 85*a1157835SDaniel Fojtoptional freq parameter can be used to override the first scan to use only 86*a1157835SDaniel Fojtthe specified channel after which only social channels are scanned. 873ff40c12SJohn Marino 883ff40c12SJohn MarinoThe optional dev_id option can be used to specify a single P2P peer to 893ff40c12SJohn Marinosearch for. The optional delay parameter can be used to request an extra 903ff40c12SJohn Marinodelay to be used between search iterations (e.g., to free up radio 913ff40c12SJohn Marinoresources for concurrent operations). 923ff40c12SJohn Marino 933ff40c12SJohn MarinoThe optional dev_type option can be used to specify a single device type 943ff40c12SJohn Marino(primary or secondary) to search for, e.g., 953ff40c12SJohn Marino"p2p_find dev_type=1-0050F204-1". 963ff40c12SJohn Marino 97*a1157835SDaniel Fojt 98*a1157835SDaniel FojtWith one or more seek arguments, the command sends Probe Request frames 99*a1157835SDaniel Fojtfor a P2PS service. For example, 100*a1157835SDaniel Fojtp2p_find 5 dev_id=11:22:33:44:55:66 seek=alt.example.chat seek=alt.example.video 101*a1157835SDaniel Fojt 102*a1157835SDaniel FojtParameters description: 103*a1157835SDaniel Fojt Timeout - Optional ASCII base-10-encoded u16. If missing, request will not 104*a1157835SDaniel Fojt time out and must be canceled manually 105*a1157835SDaniel Fojt dev_id - Optional to request responses from a single known remote device 106*a1157835SDaniel Fojt Service Name - Mandatory UTF-8 string for ASP seeks 107*a1157835SDaniel Fojt Service name must match the remote service being advertised exactly 108*a1157835SDaniel Fojt (no prefix matching). 109*a1157835SDaniel Fojt Service name may be empty, in which case all ASP services will be 110*a1157835SDaniel Fojt returned, and may be filtered with p2p_serv_disc_req settings, and 111*a1157835SDaniel Fojt p2p_serv_asp_resp results. 112*a1157835SDaniel Fojt Multiple service names may be requested, but if it exceeds internal 113*a1157835SDaniel Fojt limit, it will automatically revert to requesting all ASP services. 114*a1157835SDaniel Fojt 1153ff40c12SJohn Marinop2p_listen [timeout in seconds] 1163ff40c12SJohn Marino 1173ff40c12SJohn MarinoStart Listen-only state (become discoverable without searching for 1183ff40c12SJohn Marinoother devices). Optional parameter can be used to specify the duration 1193ff40c12SJohn Marinofor the Listen operation in seconds. This command may not be of that 1203ff40c12SJohn Marinomuch use during normal operations and is mainly designed for 1213ff40c12SJohn Marinotesting. It can also be used to keep the device discoverable without 1223ff40c12SJohn Marinohaving to maintain a group. 1233ff40c12SJohn Marino 1243ff40c12SJohn Marinop2p_stop_find 1253ff40c12SJohn Marino 1263ff40c12SJohn MarinoStop ongoing P2P device discovery or other operation (connect, listen 1273ff40c12SJohn Marinomode). 1283ff40c12SJohn Marino 1293ff40c12SJohn Marinop2p_flush 1303ff40c12SJohn Marino 1313ff40c12SJohn MarinoFlush P2P peer table and state. 1323ff40c12SJohn Marino 1333ff40c12SJohn MarinoGroup Formation 1343ff40c12SJohn Marino 1353ff40c12SJohn Marinop2p_prov_disc <peer device address> <display|keypad|pbc> [join|auto] 1363ff40c12SJohn Marino 1373ff40c12SJohn MarinoSend P2P provision discovery request to the specified peer. The 1383ff40c12SJohn Marinoparameters for this command are the P2P device address of the peer and 1393ff40c12SJohn Marinothe desired configuration method. For example, "p2p_prov_disc 1403ff40c12SJohn Marino02:01:02:03:04:05 display" would request the peer to display a PIN for 1413ff40c12SJohn Marinous and "p2p_prov_disc 02:01:02:03:04:05 keypad" would request the peer 1423ff40c12SJohn Marinoto enter a PIN that we display. 1433ff40c12SJohn Marino 1443ff40c12SJohn MarinoThe optional "join" parameter can be used to indicate that this command 1453ff40c12SJohn Marinois requesting an already running GO to prepare for a new client. This is 1463ff40c12SJohn Marinomainly used with "display" to request it to display a PIN. The "auto" 1473ff40c12SJohn Marinoparameter can be used to request wpa_supplicant to automatically figure 1483ff40c12SJohn Marinoout whether the peer device is operating as a GO and if so, use 1493ff40c12SJohn Marinojoin-a-group style PD instead of GO Negotiation style PD. 1503ff40c12SJohn Marino 151*a1157835SDaniel Fojtp2p_connect <peer device address> <pbc|pin|PIN#|p2ps> [display|keypad|p2ps] 1523ff40c12SJohn Marino [persistent|persistent=<network id>] [join|auth] 153*a1157835SDaniel Fojt [go_intent=<0..15>] [freq=<in MHz>] [ht40] [vht] [he] [provdisc] [auto] 154*a1157835SDaniel Fojt [ssid=<hexdump>] 1553ff40c12SJohn Marino 1563ff40c12SJohn MarinoStart P2P group formation with a discovered P2P peer. This includes 1573ff40c12SJohn Marinooptional group owner negotiation, group interface setup, provisioning, 1583ff40c12SJohn Marinoand establishing data connection. 1593ff40c12SJohn Marino 1603ff40c12SJohn MarinoThe <pbc|pin|PIN#> parameter specifies the WPS provisioning 1613ff40c12SJohn Marinomethod. "pbc" string starts pushbutton method, "pin" string start PIN 1623ff40c12SJohn Marinomethod using an automatically generated PIN (which will be returned as 1633ff40c12SJohn Marinothe command return code), PIN# means that a pre-selected PIN can be 1643ff40c12SJohn Marinoused (e.g., 12345670). [display|keypad] is used with PIN method 1653ff40c12SJohn Marinoto specify which PIN is used (display=dynamically generated random PIN 1663ff40c12SJohn Marinofrom local display, keypad=PIN entered from peer display). "persistent" 1673ff40c12SJohn Marinoparameter can be used to request a persistent group to be formed. The 1683ff40c12SJohn Marino"persistent=<network id>" alternative can be used to pre-populate 1693ff40c12SJohn MarinoSSID/passphrase configuration based on a previously used persistent 1703ff40c12SJohn Marinogroup where this device was the GO. The previously used parameters will 1713ff40c12SJohn Marinothen be used if the local end becomes the GO in GO Negotiation (which 1723ff40c12SJohn Marinocan be forced with go_intent=15). 1733ff40c12SJohn Marino 1743ff40c12SJohn Marino"join" indicates that this is a command to join an existing group as a 1753ff40c12SJohn Marinoclient. It skips the GO Negotiation part. This will send a Provision 1763ff40c12SJohn MarinoDiscovery Request message to the target GO before associating for WPS 1773ff40c12SJohn Marinoprovisioning. 1783ff40c12SJohn Marino 1793ff40c12SJohn Marino"auth" indicates that the WPS parameters are authorized for the peer 1803ff40c12SJohn Marinodevice without actually starting GO Negotiation (i.e., the peer is 1813ff40c12SJohn Marinoexpected to initiate GO Negotiation). This is mainly for testing 1823ff40c12SJohn Marinopurposes. 1833ff40c12SJohn Marino 1843ff40c12SJohn Marino"go_intent" can be used to override the default GO Intent for this GO 1853ff40c12SJohn MarinoNegotiation. 1863ff40c12SJohn Marino 1873ff40c12SJohn Marino"freq" can be used to set a forced operating channel (e.g., freq=2412 1883ff40c12SJohn Marinoto select 2.4 GHz channel 1). 1893ff40c12SJohn Marino 1903ff40c12SJohn Marino"provdisc" can be used to request a Provision Discovery exchange to be 1913ff40c12SJohn Marinoused prior to starting GO Negotiation as a workaround with some deployed 1923ff40c12SJohn MarinoP2P implementations that require this to allow the user to accept the 1933ff40c12SJohn Marinoconnection. 1943ff40c12SJohn Marino 195*a1157835SDaniel Fojt"auto" can be used to request wpa_supplicant to automatically figure 196*a1157835SDaniel Fojtout whether the peer device is operating as a GO and if so, use 197*a1157835SDaniel Fojtjoin-a-group operation rather than GO Negotiation. 198*a1157835SDaniel Fojt 199*a1157835SDaniel Fojt"ssid=<hexdump>" can be used to specify the Group SSID for join 200*a1157835SDaniel Fojtoperations. This allows the P2P Client interface to filter scan results 201*a1157835SDaniel Fojtbased on SSID to avoid selecting an incorrect BSS entry in case the same 202*a1157835SDaniel FojtP2P Device or Interface address have been used in multiple groups 203*a1157835SDaniel Fojtrecently. 204*a1157835SDaniel Fojt 205*a1157835SDaniel FojtP2PS attribute changes to p2p_connect command: 206*a1157835SDaniel Fojt 207*a1157835SDaniel FojtP2PS supports two WPS provisioning methods namely PIN method and P2PS default. 208*a1157835SDaniel FojtThe remaining parameters hold same role as in legacy P2P. In case of P2PS 209*a1157835SDaniel Fojtdefault config method "p2ps" keyword is added in p2p_connect command. 210*a1157835SDaniel Fojt 211*a1157835SDaniel FojtFor example: 212*a1157835SDaniel Fojtp2p_connect 02:0a:f5:85:11:00 12345670 p2ps persistent join 213*a1157835SDaniel Fojt (WPS Method = P2PS default) 214*a1157835SDaniel Fojt 215*a1157835SDaniel Fojtp2p_connect 02:0a:f5:85:11:00 45629034 keypad persistent 216*a1157835SDaniel Fojt (WPS Method = PIN) 217*a1157835SDaniel Fojt 218*a1157835SDaniel Fojtp2p_asp_provision <peer MAC address> <adv_id=peer adv id> 219*a1157835SDaniel Fojt <adv_mac=peer MAC address> [role=2|4|1] <session=session id> 220*a1157835SDaniel Fojt <session_mac=initiator mac address> 221*a1157835SDaniel Fojt [info='service info'] <method=Default|keypad|Display> 222*a1157835SDaniel Fojt 223*a1157835SDaniel FojtThis command starts provision discovery with the P2PS enabled peer device. 224*a1157835SDaniel Fojt 225*a1157835SDaniel FojtFor example, 226*a1157835SDaniel Fojtp2p_asp_provision 00:11:22:33:44:55 adv_id=4d6fc7 adv_mac=00:55:44:33:22:11 role=1 session=12ab34 session_mac=00:11:22:33:44:55 info='name=john' method=1000 227*a1157835SDaniel Fojt 228*a1157835SDaniel FojtParameter description: 229*a1157835SDaniel Fojt MAC address - Mandatory 230*a1157835SDaniel Fojt adv_id - Mandatory remote Advertising ID of service connection is being 231*a1157835SDaniel Fojt established for 232*a1157835SDaniel Fojt adv_mac - Mandatory MAC address that owns/registered the service 233*a1157835SDaniel Fojt role - Optional 234*a1157835SDaniel Fojt 2 (group client only) or 4 (group owner only) 235*a1157835SDaniel Fojt if not present (or 1) role is negotiated by the two peers. 236*a1157835SDaniel Fojt session - Mandatory Session ID of the first session to be established 237*a1157835SDaniel Fojt session_mac - Mandatory MAC address that owns/initiated the session 238*a1157835SDaniel Fojt method - Optional method to request for provisioning (1000 - P2PS Default, 239*a1157835SDaniel Fojt 100 - Keypad(PIN), 8 - Display(PIN)) 240*a1157835SDaniel Fojt info - Optional UTF-8 string. Hint for service to indicate possible usage 241*a1157835SDaniel Fojt parameters - Escape single quote & backslash: 242*a1157835SDaniel Fojt with a backslash 0x27 == ' == \', and 0x5c == \ == \\ 243*a1157835SDaniel Fojt 244*a1157835SDaniel Fojtp2p_asp_provision_resp <peer mac address> <adv_id= local adv id> 245*a1157835SDaniel Fojt <adv_mac=local MAC address> <role=1|2|4> <status=0> 246*a1157835SDaniel Fojt <session=session id> <session_mac=peer MAC address> 247*a1157835SDaniel Fojt 248*a1157835SDaniel FojtThis command sends a provision discovery response from responder side. 249*a1157835SDaniel Fojt 250*a1157835SDaniel FojtFor example, 251*a1157835SDaniel Fojtp2p_asp_provision_resp 00:55:44:33:22:11 adv_id=4d6fc7 adv_mac=00:55:44:33:22:11 role=1 status=0 session=12ab34 session_mac=00:11:22:33:44:55 252*a1157835SDaniel Fojt 253*a1157835SDaniel FojtParameters definition: 254*a1157835SDaniel Fojt MAC address - Mandatory 255*a1157835SDaniel Fojt adv_id - Mandatory local Advertising ID of service connection is being 256*a1157835SDaniel Fojt established for 257*a1157835SDaniel Fojt adv_mac - Mandatory MAC address that owns/registered the service 258*a1157835SDaniel Fojt role - Optional 2 (group client only) or 4 (group owner only) 259*a1157835SDaniel Fojt if not present (or 1) role is negotiated by the two peers. 260*a1157835SDaniel Fojt status - Mandatory Acceptance/Rejection code of Provisioning 261*a1157835SDaniel Fojt session - Mandatory Session ID of the first session to be established 262*a1157835SDaniel Fojt session_mac - Mandatory MAC address that owns/initiated the session 263*a1157835SDaniel Fojt 2643ff40c12SJohn Marinop2p_group_add [persistent|persistent=<network id>] [freq=<freq in MHz>] 265*a1157835SDaniel Fojt [ht40] [vht] [he] 2663ff40c12SJohn Marino 2673ff40c12SJohn MarinoSet up a P2P group owner manually (i.e., without group owner 2683ff40c12SJohn Marinonegotiation with a specific peer). This is also known as autonomous 2693ff40c12SJohn MarinoGO. Optional persistent=<network id> can be used to specify restart of 2703ff40c12SJohn Marinoa persistent group. Optional freq=<freq in MHz> can be used to force 2713ff40c12SJohn Marinothe GO to be started on a specific frequency. Special freq=2 or freq=5 2723ff40c12SJohn Marinooptions can be used to request the best 2.4 GHz or 5 GHz band channel 2733ff40c12SJohn Marinoto be selected automatically. 2743ff40c12SJohn Marino 2753ff40c12SJohn Marinop2p_reject <peer device address> 2763ff40c12SJohn Marino 2773ff40c12SJohn MarinoReject connection attempt from a peer (specified with a device 2783ff40c12SJohn Marinoaddress). This is a mechanism to reject a pending GO Negotiation with 2793ff40c12SJohn Marinoa peer and request to automatically block any further connection or 2803ff40c12SJohn Marinodiscovery of the peer. 2813ff40c12SJohn Marino 2823ff40c12SJohn Marinop2p_group_remove <group interface> 2833ff40c12SJohn Marino 2843ff40c12SJohn MarinoTerminate a P2P group. If a new virtual network interface was used for 2853ff40c12SJohn Marinothe group, it will also be removed. The network interface name of the 2863ff40c12SJohn Marinogroup interface is used as a parameter for this command. 2873ff40c12SJohn Marino 2883ff40c12SJohn Marinop2p_cancel 2893ff40c12SJohn Marino 2903ff40c12SJohn MarinoCancel an ongoing P2P group formation and joining-a-group related 291*a1157835SDaniel Fojtoperation. This operation unauthorizes the specific peer device (if any 2923ff40c12SJohn Marinohad been authorized to start group formation), stops P2P find (if in 2933ff40c12SJohn Marinoprogress), stops pending operations for join-a-group, and removes the 2943ff40c12SJohn MarinoP2P group interface (if one was used) that is in the WPS provisioning 2953ff40c12SJohn Marinostep. If the WPS provisioning step has been completed, the group is not 2963ff40c12SJohn Marinoterminated. 2973ff40c12SJohn Marino 2983ff40c12SJohn Marinop2p_remove_client <peer's P2P Device Address|iface=<interface address>> 2993ff40c12SJohn Marino 3003ff40c12SJohn MarinoThis command can be used to remove the specified client from all groups 3013ff40c12SJohn Marino(operating and persistent) from the local GO. Note that the peer device 3023ff40c12SJohn Marinocan rejoin the group if it is in possession of a valid key. See p2p_set 3033ff40c12SJohn Marinoper_sta_psk command below for more details on how the peer can be 3043ff40c12SJohn Marinoremoved securely. 3053ff40c12SJohn Marino 3063ff40c12SJohn MarinoService Discovery 3073ff40c12SJohn Marino 308*a1157835SDaniel Fojtp2p_service_add asp <auto accept> <adv id> <status 0/1> <Config Methods> 309*a1157835SDaniel Fojt <Service name> [Service Information] [Response Info] 310*a1157835SDaniel Fojt 311*a1157835SDaniel FojtThis command can be used to search for a P2PS service which includes 312*a1157835SDaniel FojtPlay, Send, Display, and Print service. The parameters for this command 313*a1157835SDaniel Fojtare "asp" to identify the command as P2PS one, auto accept value, 314*a1157835SDaniel Fojtadvertisement id which uniquely identifies the service requests, state 315*a1157835SDaniel Fojtof the service whether the service is available or not, config methods 316*a1157835SDaniel Fojtwhich can be either P2PS method or PIN method, service name followed by 317*a1157835SDaniel Fojttwo optional parameters service information, and response info. 318*a1157835SDaniel Fojt 319*a1157835SDaniel FojtFor example, 320*a1157835SDaniel Fojtp2p_service_add asp 1 4d6fc7 0 1108 alt.example.chat svc_info='name=john' rsp_info='enter PIN 1234' 321*a1157835SDaniel Fojt 322*a1157835SDaniel FojtParameters definition: 323*a1157835SDaniel Fojt asp - Mandatory for ASP service registration 324*a1157835SDaniel Fojt auto accept - Mandatory ASCII hex-encoded boolean (0 == no auto-accept, 325*a1157835SDaniel Fojt 1 == auto-accept ANY role, 2 == auto-accept CLIENT role, 326*a1157835SDaniel Fojt 4 == auto-accept GO role) 327*a1157835SDaniel Fojt Advertisement ID - Mandatory non-zero ASCII hex-encoded u32 328*a1157835SDaniel Fojt (Must be unique/not yet exist in svc db) 329*a1157835SDaniel Fojt State - Mandatory ASCII hex-encoded u8 (0 -- Svc not available, 330*a1157835SDaniel Fojt 1 -- Svc available, 2-0xff Application defined) 331*a1157835SDaniel Fojt Config Methods - Mandatory ASCII hex-encoded u16 (bitmask of WSC config 332*a1157835SDaniel Fojt methods) 333*a1157835SDaniel Fojt Service Name - Mandatory UTF-8 string 334*a1157835SDaniel Fojt Service Information - Optional UTF-8 string 335*a1157835SDaniel Fojt Escape single quote & backslash with a backslash: 336*a1157835SDaniel Fojt 0x27 == ' == \', and 0x5c == \ == \\ 337*a1157835SDaniel Fojt Session response information - Optional (used only if auto accept is TRUE) 338*a1157835SDaniel Fojt UTF-8 string 339*a1157835SDaniel Fojt Escape single quote & backslash with a backslash: 340*a1157835SDaniel Fojt 0x27 == ' == \', and 0x5c == \ == \\ 341*a1157835SDaniel Fojt 342*a1157835SDaniel Fojtp2p_service_rep asp <auto accept> <adv id> <status 0/1> <Config Methods> 343*a1157835SDaniel Fojt <Service name> [Service Information] [Response Info] 344*a1157835SDaniel Fojt 345*a1157835SDaniel FojtThis command can be used to replace the existing service request 346*a1157835SDaniel Fojtattributes from the initiator side. The replacement is only allowed if 347*a1157835SDaniel Fojtthe advertisement id issued in the command matches with any one entry in 348*a1157835SDaniel Fojtthe list of existing SD queries. If advertisement id doesn't match the 349*a1157835SDaniel Fojtcommand returns a failure. 350*a1157835SDaniel Fojt 351*a1157835SDaniel FojtFor example, 352*a1157835SDaniel Fojtp2p_service_rep asp 1 4d6fc7 1 1108 alt.example.chat svc_info='name=john' rsp_info='enter PIN 1234' 353*a1157835SDaniel Fojt 354*a1157835SDaniel FojtParameters definition: 355*a1157835SDaniel Fojt asp - Mandatory for ASP service registration 356*a1157835SDaniel Fojt auto accept - Mandatory ASCII hex-encoded boolean (1 == true, 0 == false) 357*a1157835SDaniel Fojt Advertisement ID - Mandatory non-zero ASCII hex-encoded u32 358*a1157835SDaniel Fojt (Must already exist in svc db) 359*a1157835SDaniel Fojt State - Mandatory ASCII hex-encoded u8 (can be used to indicate svc 360*a1157835SDaniel Fojt available or not available for instance) 361*a1157835SDaniel Fojt Config Methods - Mandatory ASCII hex-encoded u16 (bitmask of WSC config 362*a1157835SDaniel Fojt methods) 363*a1157835SDaniel Fojt Service Name - Mandatory UTF-8 string (Must match existing string in svc db) 364*a1157835SDaniel Fojt Service Information - Optional UTF-8 string 365*a1157835SDaniel Fojt Escape single quote & backslash with a backslash: 366*a1157835SDaniel Fojt 0x27 == ' == \', and 0x5c == \ == \\ 367*a1157835SDaniel Fojt Session response information - Optional (used only if auto accept is TRUE) 368*a1157835SDaniel Fojt UTF-8 string 369*a1157835SDaniel Fojt Escape single quote & backslash with a backslash: 370*a1157835SDaniel Fojt 0x27 == ' == \', and 0x5c == \ == \\ 371*a1157835SDaniel Fojt 3723ff40c12SJohn Marinop2p_serv_disc_req 3733ff40c12SJohn Marino 3743ff40c12SJohn MarinoSchedule a P2P service discovery request. The parameters for this 3753ff40c12SJohn Marinocommand are the device address of the peer device (or 00:00:00:00:00:00 3763ff40c12SJohn Marinofor wildcard query that is sent to every discovered P2P peer that 3773ff40c12SJohn Marinosupports service discovery) and P2P Service Query TLV(s) as hexdump. For 3783ff40c12SJohn Marinoexample, 3793ff40c12SJohn Marino 3803ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 02000001 3813ff40c12SJohn Marino 3823ff40c12SJohn Marinoschedules a request for listing all available services of all service 3833ff40c12SJohn Marinodiscovery protocols and requests this to be sent to all discovered 3843ff40c12SJohn Marinopeers (note: this can result in long response frames). The pending 3853ff40c12SJohn Marinorequests are sent during device discovery (see p2p_find). 3863ff40c12SJohn Marino 387*a1157835SDaniel FojtThere can be multiple pending peer device specific queries (each will be 388*a1157835SDaniel Fojtsent in sequence whenever the peer is found). 3893ff40c12SJohn Marino 3903ff40c12SJohn MarinoThis command returns an identifier for the pending query (e.g., 3913ff40c12SJohn Marino"1f77628") that can be used to cancel the request. Directed requests 3923ff40c12SJohn Marinowill be automatically removed when the specified peer has replied to 3933ff40c12SJohn Marinoit. 3943ff40c12SJohn Marino 3953ff40c12SJohn MarinoService Query TLV has following format: 3963ff40c12SJohn MarinoLength (2 octets, little endian) - length of following data 3973ff40c12SJohn MarinoService Protocol Type (1 octet) - see the table below 3983ff40c12SJohn MarinoService Transaction ID (1 octet) - nonzero identifier for the TLV 3993ff40c12SJohn MarinoQuery Data (Length - 2 octets of data) - service protocol specific data 4003ff40c12SJohn Marino 4013ff40c12SJohn MarinoService Protocol Types: 4023ff40c12SJohn Marino0 = All service protocols 4033ff40c12SJohn Marino1 = Bonjour 4043ff40c12SJohn Marino2 = UPnP 4053ff40c12SJohn Marino3 = WS-Discovery 4063ff40c12SJohn Marino4 = Wi-Fi Display 4073ff40c12SJohn Marino 4083ff40c12SJohn MarinoFor UPnP, an alternative command format can be used to specify a 4093ff40c12SJohn Marinosingle query TLV (i.e., a service discovery for a specific UPnP 4103ff40c12SJohn Marinoservice): 4113ff40c12SJohn Marino 4123ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp <version hex> <ST: from M-SEARCH> 4133ff40c12SJohn Marino 4143ff40c12SJohn MarinoFor example: 4153ff40c12SJohn Marino 4163ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1 4173ff40c12SJohn Marino 4183ff40c12SJohn MarinoAdditional examples for queries: 4193ff40c12SJohn Marino 4203ff40c12SJohn Marino# list of all Bonjour services 4213ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 02000101 4223ff40c12SJohn Marino 4233ff40c12SJohn Marino# list of all UPnP services 4243ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 02000201 4253ff40c12SJohn Marino 4263ff40c12SJohn Marino# list of all WS-Discovery services 4273ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 02000301 4283ff40c12SJohn Marino 4293ff40c12SJohn Marino# list of all Bonjour and UPnP services 4303ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 0200010102000202 4313ff40c12SJohn Marino 4323ff40c12SJohn Marino# Apple File Sharing over TCP 4333ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 130001010b5f6166706f766572746370c00c000c01 4343ff40c12SJohn Marino 4353ff40c12SJohn Marino# Bonjour SSTH (supported service type hash) 4363ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 05000101000000 4373ff40c12SJohn Marino 4383ff40c12SJohn Marino# UPnP examples 4393ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 ssdp:all 4403ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 upnp:rootdevice 4413ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:service:ContentDirectory:2 4423ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 uuid:6859dede-8574-59ab-9332-123456789012 4433ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 upnp 10 urn:schemas-upnp-org:device:InternetGatewayDevice:1 4443ff40c12SJohn Marino 4453ff40c12SJohn Marino# Wi-Fi Display examples 4463ff40c12SJohn Marino# format: wifi-display <list of roles> <list of subelements> 4473ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source] 2,3,4,5 4483ff40c12SJohn Marinop2p_serv_disc_req 02:01:02:03:04:05 wifi-display [pri-sink] 3 4493ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [sec-source] 2 4503ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source+sink] 2,3,4,5 4513ff40c12SJohn Marinop2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source][pri-sink] 2,3,4,5 4523ff40c12SJohn Marino 453*a1157835SDaniel Fojtp2p_serv_disc_req <Unicast|Broadcast mac address> asp <Transaction ID> 454*a1157835SDaniel Fojt <Service Name> [Service Information] 455*a1157835SDaniel Fojt 456*a1157835SDaniel FojtThe command can be used for service discovery for P2PS enabled devices. 457*a1157835SDaniel Fojt 458*a1157835SDaniel FojtFor example: p2p_serv_disc_req 00:00:00:00:00:00 asp a1 alt.example 'john' 459*a1157835SDaniel Fojt 460*a1157835SDaniel FojtParameters definition: 461*a1157835SDaniel Fojt MAC address - Mandatory Existing 462*a1157835SDaniel Fojt asp - Mandatory for ASP queries 463*a1157835SDaniel Fojt Transaction ID - Mandatory non-zero ASCII hex-encoded u8 for GAS 464*a1157835SDaniel Fojt Service Name Prefix - Mandatory UTF-8 string. 465*a1157835SDaniel Fojt Will match from beginning of remote Service Name 466*a1157835SDaniel Fojt Service Information Substring - Optional UTF-8 string 467*a1157835SDaniel Fojt If Service Information Substring is not included, all services matching 468*a1157835SDaniel Fojt Service Name Prefix will be returned. 469*a1157835SDaniel Fojt If Service Information Substring is included, both the Substring and the 470*a1157835SDaniel Fojt Service Name Prefix must match for service to be returned. 471*a1157835SDaniel Fojt If remote service has no Service Information, all Substring searches 472*a1157835SDaniel Fojt will fail. 473*a1157835SDaniel Fojt 4743ff40c12SJohn Marinop2p_serv_disc_cancel_req <query identifier> 4753ff40c12SJohn Marino 4763ff40c12SJohn MarinoCancel a pending P2P service discovery request. This command takes a 4773ff40c12SJohn Marinosingle parameter: identifier for the pending query (the value returned 4783ff40c12SJohn Marinoby p2p_serv_disc_req, e.g., "p2p_serv_disc_cancel_req 1f77628". 4793ff40c12SJohn Marino 4803ff40c12SJohn Marinop2p_serv_disc_resp 4813ff40c12SJohn Marino 4823ff40c12SJohn MarinoReply to a service discovery query. This command takes following 4833ff40c12SJohn Marinoparameters: frequency in MHz, destination address, dialog token, 4843ff40c12SJohn Marinoresponse TLV(s). The first three parameters are copied from the 4853ff40c12SJohn Marinorequest event. For example, "p2p_serv_disc_resp 2437 02:40:61:c2:f3:b7 4863ff40c12SJohn Marino1 0300000101". This command is used only if external program is used 4873ff40c12SJohn Marinoto process the request (see p2p_serv_disc_external). 4883ff40c12SJohn Marino 4893ff40c12SJohn Marinop2p_service_update 4903ff40c12SJohn Marino 4913ff40c12SJohn MarinoIndicate that local services have changed. This is used to increment 4923ff40c12SJohn Marinothe P2P service indicator value so that peers know when previously 4933ff40c12SJohn Marinocached information may have changed. This is only needed when external 4943ff40c12SJohn Marinoservice discovery processing is enabled since the commands to 4953ff40c12SJohn Marinopre-configure services for internal processing will increment the 4963ff40c12SJohn Marinoindicator automatically. 4973ff40c12SJohn Marino 4983ff40c12SJohn Marinop2p_serv_disc_external <0|1> 4993ff40c12SJohn Marino 5003ff40c12SJohn MarinoConfigure external processing of P2P service requests: 0 (default) = 5013ff40c12SJohn Marinono external processing of requests (i.e., internal code will process 5023ff40c12SJohn Marinoeach request based on pre-configured services), 1 = external 5033ff40c12SJohn Marinoprocessing of requests (external program is responsible for replying 5043ff40c12SJohn Marinoto service discovery requests with p2p_serv_disc_resp). Please note 5053ff40c12SJohn Marinothat there is quite strict limit on how quickly the response needs to 5063ff40c12SJohn Marinobe transmitted, so use of the internal processing is strongly 5073ff40c12SJohn Marinorecommended. 5083ff40c12SJohn Marino 5093ff40c12SJohn Marinop2p_service_add bonjour <query hexdump> <RDATA hexdump> 5103ff40c12SJohn Marino 5113ff40c12SJohn MarinoAdd a local Bonjour service for internal SD query processing. 5123ff40c12SJohn Marino 5133ff40c12SJohn MarinoExamples: 5143ff40c12SJohn Marino 5153ff40c12SJohn Marino# AFP Over TCP (PTR) 5163ff40c12SJohn Marinop2p_service_add bonjour 0b5f6166706f766572746370c00c000c01 074578616d706c65c027 5173ff40c12SJohn Marino# AFP Over TCP (TXT) (RDATA=null) 5183ff40c12SJohn Marinop2p_service_add bonjour 076578616d706c650b5f6166706f766572746370c00c001001 00 5193ff40c12SJohn Marino 5203ff40c12SJohn Marino# IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.) 5213ff40c12SJohn Marinop2p_service_add bonjour 045f697070c00c000c01 094d795072696e746572c027 5223ff40c12SJohn Marino# IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript) 5233ff40c12SJohn Marinop2p_service_add bonjour 096d797072696e746572045f697070c00c001001 09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074 5243ff40c12SJohn Marino 5253ff40c12SJohn Marino# Supported Service Type Hash (SSTH) 5263ff40c12SJohn Marinop2p_service_add bonjour 000000 <32-byte bitfield as hexdump> 5273ff40c12SJohn Marino(note: see P2P spec Annex E.4 for information on how to construct the bitfield) 5283ff40c12SJohn Marino 5293ff40c12SJohn Marinop2p_service_del bonjour <query hexdump> 5303ff40c12SJohn Marino 5313ff40c12SJohn MarinoRemove a local Bonjour service from internal SD query processing. 5323ff40c12SJohn Marino 5333ff40c12SJohn Marinop2p_service_add upnp <version hex> <service> 5343ff40c12SJohn Marino 5353ff40c12SJohn MarinoAdd a local UPnP service for internal SD query processing. 5363ff40c12SJohn Marino 5373ff40c12SJohn MarinoExamples: 5383ff40c12SJohn Marino 5393ff40c12SJohn Marinop2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice 5403ff40c12SJohn Marinop2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::upnp:rootdevice 5413ff40c12SJohn Marinop2p_service_add upnp 10 uuid:1122de4e-8574-59ab-9322-333456789044::urn:schemas-upnp-org:service:ContentDirectory:2 5423ff40c12SJohn Marinop2p_service_add upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2 5433ff40c12SJohn Marinop2p_service_add upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1 5443ff40c12SJohn Marino 5453ff40c12SJohn Marinop2p_service_del upnp <version hex> <service> 5463ff40c12SJohn Marino 5473ff40c12SJohn MarinoRemove a local UPnP service from internal SD query processing. 5483ff40c12SJohn Marino 549*a1157835SDaniel Fojtp2p_service_del asp <adv id> 550*a1157835SDaniel Fojt 551*a1157835SDaniel FojtRemoves the local asp service from internal SD query list. 552*a1157835SDaniel FojtFor example: p2p_service_del asp 4d6fc7 553*a1157835SDaniel Fojt 5543ff40c12SJohn Marinop2p_service_flush 5553ff40c12SJohn Marino 5563ff40c12SJohn MarinoRemove all local services from internal SD query processing. 5573ff40c12SJohn Marino 5583ff40c12SJohn MarinoInvitation 5593ff40c12SJohn Marino 5603ff40c12SJohn Marinop2p_invite [persistent=<network id>|group=<group ifname>] [peer=address] 561*a1157835SDaniel Fojt [go_dev_addr=address] [freq=<freq in MHz>] [ht40] [vht] [he] 5623ff40c12SJohn Marino [pref=<MHz>] 5633ff40c12SJohn Marino 5643ff40c12SJohn MarinoInvite a peer to join a group (e.g., group=wlan1) or to reinvoke a 5653ff40c12SJohn Marinopersistent group (e.g., persistent=4). If the peer device is the GO of 5663ff40c12SJohn Marinothe persistent group, the peer parameter is not needed. Otherwise it is 5673ff40c12SJohn Marinoused to specify which device to invite. go_dev_addr parameter can be 5683ff40c12SJohn Marinoused to override the GO device address for Invitation Request should 5693ff40c12SJohn Marinoit be not known for some reason (this should not be needed in most 5703ff40c12SJohn Marinocases). When reinvoking a persistent group, the GO device can specify 5713ff40c12SJohn Marinothe frequency for the group with the freq parameter. When reinvoking a 5723ff40c12SJohn Marinopersistent group, the P2P client device can use freq parameter to force 5733ff40c12SJohn Marinoa specific operating channel (or invitation failure if GO rejects that) 5743ff40c12SJohn Marinoor pref parameter to request a specific channel (while allowing GO to 5753ff40c12SJohn Marinoselect to use another channel, if needed). 5763ff40c12SJohn Marino 5773ff40c12SJohn MarinoGroup Operations 5783ff40c12SJohn Marino 5793ff40c12SJohn Marino(These are used on the group interface.) 5803ff40c12SJohn Marino 5813ff40c12SJohn Marinowps_pin <any|address> <PIN> 5823ff40c12SJohn Marino 5833ff40c12SJohn MarinoStart WPS PIN method. This allows a single WPS Enrollee to connect to 5843ff40c12SJohn Marinothe AP/GO. This is used on the GO when a P2P client joins an existing 5853ff40c12SJohn Marinogroup. The second parameter is the address of the Enrollee or a string 5863ff40c12SJohn Marino"any" to allow any station to use the entered PIN (which will restrict 5873ff40c12SJohn Marinothe PIN for one-time-use). PIN is the Enrollee PIN read either from a 5883ff40c12SJohn Marinolabel or display on the P2P Client/WPS Enrollee. 5893ff40c12SJohn Marino 5903ff40c12SJohn Marinowps_pbc 5913ff40c12SJohn Marino 5923ff40c12SJohn MarinoStart WPS PBC method (i.e., push the button). This allows a single WPS 5933ff40c12SJohn MarinoEnrollee to connect to the AP/GO. This is used on the GO when a P2P 5943ff40c12SJohn Marinoclient joins an existing group. 5953ff40c12SJohn Marino 5963ff40c12SJohn Marinop2p_get_passphrase 5973ff40c12SJohn Marino 5983ff40c12SJohn MarinoGet the passphrase for a group (only available when acting as a GO). 5993ff40c12SJohn Marino 6003ff40c12SJohn Marinop2p_presence_req [<duration> <interval>] [<duration> <interval>] 6013ff40c12SJohn Marino 6023ff40c12SJohn MarinoSend a P2P Presence Request to the GO (this is only available when 6033ff40c12SJohn Marinoacting as a P2P client). If no duration/interval pairs are given, the 6043ff40c12SJohn Marinorequest indicates that this client has no special needs for GO 6053ff40c12SJohn Marinopresence. The first parameter pair gives the preferred duration and 6063ff40c12SJohn Marinointerval values in microseconds. If the second pair is included, that 6073ff40c12SJohn Marinoindicates which value would be acceptable. This command returns OK 6083ff40c12SJohn Marinoimmediately and the response from the GO is indicated in a 6093ff40c12SJohn MarinoP2P-PRESENCE-RESPONSE event message. 6103ff40c12SJohn Marino 6113ff40c12SJohn MarinoParameters 6123ff40c12SJohn Marino 6133ff40c12SJohn Marinop2p_ext_listen [<period> <interval>] 6143ff40c12SJohn Marino 6153ff40c12SJohn MarinoConfigure Extended Listen Timing. If the parameters are omitted, this 6163ff40c12SJohn Marinofeature is disabled. If the parameters are included, Listen State will 6173ff40c12SJohn Marinobe entered every interval msec for at least period msec. Both values 6183ff40c12SJohn Marinohave acceptable range of 1-65535 (with interval obviously having to be 6193ff40c12SJohn Marinolarger than or equal to duration). If the P2P module is not idle at 6203ff40c12SJohn Marinothe time the Extended Listen Timing timeout occurs, the Listen State 6213ff40c12SJohn Marinooperation will be skipped. 6223ff40c12SJohn Marino 6233ff40c12SJohn MarinoThe configured values will also be advertised to other P2P Devices. The 6243ff40c12SJohn Marinoreceived values are available in the p2p_peer command output: 6253ff40c12SJohn Marino 6263ff40c12SJohn Marinoext_listen_period=100 ext_listen_interval=5000 6273ff40c12SJohn Marino 6283ff40c12SJohn Marinop2p_set <field> <value> 6293ff40c12SJohn Marino 6303ff40c12SJohn MarinoChange dynamic P2P parameters 6313ff40c12SJohn Marino 6323ff40c12SJohn Marinop2p_set discoverability <0/1> 6333ff40c12SJohn Marino 6343ff40c12SJohn MarinoDisable/enable advertisement of client discoverability. This is 6353ff40c12SJohn Marinoenabled by default and this parameter is mainly used to allow testing 6363ff40c12SJohn Marinoof device discoverability. 6373ff40c12SJohn Marino 6383ff40c12SJohn Marinop2p_set managed <0/1> 6393ff40c12SJohn Marino 6403ff40c12SJohn MarinoDisable/enable managed P2P Device operations. This is disabled by 6413ff40c12SJohn Marinodefault. 6423ff40c12SJohn Marino 643*a1157835SDaniel Fojtp2p_set listen_channel <channel> [<op_class>] 6443ff40c12SJohn Marino 6453ff40c12SJohn MarinoSet P2P Listen channel. This is mainly meant for testing purposes and 6463ff40c12SJohn Marinochanging the Listen channel during normal operations can result in 6473ff40c12SJohn Marinoprotocol failures. 6483ff40c12SJohn Marino 649*a1157835SDaniel FojtWhen specifying a social channel on the 2.4 GHz band (1/6/11) there is 650*a1157835SDaniel Fojtno need to specify the operating class since it defaults to 81. When 651*a1157835SDaniel Fojtspecifying a social channel on the 60 GHz band (2), specify the 60 GHz 652*a1157835SDaniel Fojtoperating class (180). 653*a1157835SDaniel Fojt 6543ff40c12SJohn Marinop2p_set ssid_postfix <postfix> 6553ff40c12SJohn Marino 6563ff40c12SJohn MarinoSet postfix string to be added to the automatically generated P2P SSID 6573ff40c12SJohn Marino(DIRECT-<two random characters>). For example, postfix of "-testing" 6583ff40c12SJohn Marinocould result in the SSID becoming DIRECT-ab-testing. 6593ff40c12SJohn Marino 6603ff40c12SJohn Marinop2p_set per_sta_psk <0/1> 6613ff40c12SJohn Marino 6623ff40c12SJohn MarinoDisabled(default)/enables use of per-client PSK in the P2P groups. This 6633ff40c12SJohn Marinocan be used to request GO to assign a unique PSK for each client during 6643ff40c12SJohn MarinoWPS provisioning. When enabled, this allow clients to be removed from 665*a1157835SDaniel Fojtthe group securely with p2p_remove_client command since that client's 6663ff40c12SJohn MarinoPSK is removed at the same time to prevent it from connecting back using 6673ff40c12SJohn Marinothe old PSK. When per-client PSK is not used, the client can still be 6683ff40c12SJohn Marinodisconnected, but it will be able to re-join the group since the PSK it 6693ff40c12SJohn Marinolearned previously is still valid. It should be noted that the default 6703ff40c12SJohn Marinopassphrase on the GO that is normally used to allow legacy stations to 6713ff40c12SJohn Marinoconnect through manual configuration does not change here, so if that is 6723ff40c12SJohn Marinoshared, devices with knowledge of that passphrase can still connect. 6733ff40c12SJohn Marino 6743ff40c12SJohn Marinoset <field> <value> 6753ff40c12SJohn Marino 6763ff40c12SJohn MarinoSet global configuration parameters which may also affect P2P 6773ff40c12SJohn Marinooperations. The format on these parameters is same as is used in 6783ff40c12SJohn Marinowpa_supplicant.conf. Only the parameters listen here should be 6793ff40c12SJohn Marinochanged. Modifying other parameters may result in incorrect behavior 6803ff40c12SJohn Marinosince not all existing users of the parameters are updated. 6813ff40c12SJohn Marino 6823ff40c12SJohn Marinoset uuid <UUID> 6833ff40c12SJohn Marino 6843ff40c12SJohn MarinoSet WPS UUID (by default, this is generated based on the MAC address). 6853ff40c12SJohn Marino 6863ff40c12SJohn Marinoset device_name <device name> 6873ff40c12SJohn Marino 6883ff40c12SJohn MarinoSet WPS Device Name (also included in some P2P messages). 6893ff40c12SJohn Marino 6903ff40c12SJohn Marinoset manufacturer <manufacturer> 6913ff40c12SJohn Marino 6923ff40c12SJohn MarinoSet WPS Manufacturer. 6933ff40c12SJohn Marino 6943ff40c12SJohn Marinoset model_name <model name> 6953ff40c12SJohn Marino 6963ff40c12SJohn MarinoSet WPS Model Name. 6973ff40c12SJohn Marino 6983ff40c12SJohn Marinoset model_number <model number> 6993ff40c12SJohn Marino 7003ff40c12SJohn MarinoSet WPS Model Number. 7013ff40c12SJohn Marino 7023ff40c12SJohn Marinoset serial_number <serial number> 7033ff40c12SJohn Marino 7043ff40c12SJohn MarinoSet WPS Serial Number. 7053ff40c12SJohn Marino 7063ff40c12SJohn Marinoset device_type <device type> 7073ff40c12SJohn Marino 7083ff40c12SJohn MarinoSet WPS Device Type. 7093ff40c12SJohn Marino 7103ff40c12SJohn Marinoset os_version <OS version> 7113ff40c12SJohn Marino 7123ff40c12SJohn MarinoSet WPS OS Version. 7133ff40c12SJohn Marino 7143ff40c12SJohn Marinoset config_methods <config methods> 7153ff40c12SJohn Marino 7163ff40c12SJohn MarinoSet WPS Configuration Methods. 7173ff40c12SJohn Marino 7183ff40c12SJohn Marinoset sec_device_type <device type> 7193ff40c12SJohn Marino 7203ff40c12SJohn MarinoAdd a new Secondary Device Type. 7213ff40c12SJohn Marino 7223ff40c12SJohn Marinoset p2p_go_intent <GO intent> 7233ff40c12SJohn Marino 7243ff40c12SJohn MarinoSet the default P2P GO Intent. Note: This value can be overridden in 7253ff40c12SJohn Marinop2p_connect command and as such, there should be no need to change the 7263ff40c12SJohn Marinodefault value here during normal operations. 7273ff40c12SJohn Marino 7283ff40c12SJohn Marinoset p2p_ssid_postfix <P2P SSID postfix> 7293ff40c12SJohn Marino 7303ff40c12SJohn MarinoSet P2P SSID postfix. 7313ff40c12SJohn Marino 7323ff40c12SJohn Marinoset persistent_reconnect <0/1> 7333ff40c12SJohn Marino 7343ff40c12SJohn MarinoDisable/enabled persistent reconnect for reinvocation of persistent 7353ff40c12SJohn Marinogroups. If enabled, invitations to reinvoke a persistent group will be 7363ff40c12SJohn Marinoaccepted without separate authorization (e.g., user interaction). 7373ff40c12SJohn Marino 7383ff40c12SJohn Marinoset country <two character country code> 7393ff40c12SJohn Marino 7403ff40c12SJohn MarinoSet country code (this is included in some P2P messages). 7413ff40c12SJohn Marino 742*a1157835SDaniel Fojtset p2p_search_delay <delay> 743*a1157835SDaniel Fojt 744*a1157835SDaniel FojtSet p2p_search_delay which adds extra delay in milliseconds between 745*a1157835SDaniel Fojtconcurrent search iterations to make p2p_find friendlier to concurrent 746*a1157835SDaniel Fojtoperations by avoiding it from taking 100% of radio resources. The 747*a1157835SDaniel Fojtdefault value is 500 ms. 748*a1157835SDaniel Fojt 7493ff40c12SJohn MarinoStatus 7503ff40c12SJohn Marino 7513ff40c12SJohn Marinop2p_peers [discovered] 7523ff40c12SJohn Marino 7533ff40c12SJohn MarinoList P2P Device Addresses of all the P2P peers we know. The optional 7543ff40c12SJohn Marino"discovered" parameter filters out the peers that we have not fully 7553ff40c12SJohn Marinodiscovered, i.e., which we have only seen in a received Probe Request 7563ff40c12SJohn Marinoframe. 7573ff40c12SJohn Marino 7583ff40c12SJohn Marinop2p_peer <P2P Device Address> 7593ff40c12SJohn Marino 7603ff40c12SJohn MarinoFetch information about a known P2P peer. 7613ff40c12SJohn Marino 7623ff40c12SJohn MarinoGroup Status 7633ff40c12SJohn Marino 7643ff40c12SJohn Marino(These are used on the group interface.) 7653ff40c12SJohn Marino 7663ff40c12SJohn Marinostatus 7673ff40c12SJohn Marino 7683ff40c12SJohn MarinoShow status information (connection state, role, use encryption 7693ff40c12SJohn Marinoparameters, IP address, etc.). 7703ff40c12SJohn Marino 7713ff40c12SJohn Marinosta 7723ff40c12SJohn Marino 7733ff40c12SJohn MarinoShow information about an associated station (when acting in AP/GO role). 7743ff40c12SJohn Marino 7753ff40c12SJohn Marinoall_sta 7763ff40c12SJohn Marino 7773ff40c12SJohn MarinoLists the currently associated stations. 7783ff40c12SJohn Marino 7793ff40c12SJohn MarinoConfiguration data 7803ff40c12SJohn Marino 7813ff40c12SJohn Marinolist_networks 7823ff40c12SJohn Marino 7833ff40c12SJohn MarinoLists the configured networks, including stored information for 7843ff40c12SJohn Marinopersistent groups. The identifier in this list is used with 7853ff40c12SJohn Marinop2p_group_add and p2p_invite to indicate which persistent group is to 7863ff40c12SJohn Marinobe reinvoked. 7873ff40c12SJohn Marino 7883ff40c12SJohn Marinoremove_network <network id> 7893ff40c12SJohn Marino 7903ff40c12SJohn MarinoRemove a network entry from configuration. 7913ff40c12SJohn Marino 7923ff40c12SJohn Marino 793*a1157835SDaniel FojtP2PS Events/Responses: 794*a1157835SDaniel Fojt 795*a1157835SDaniel FojtP2PS-PROV-START: This events gets triggered when provisioning is issued for 796*a1157835SDaniel Fojteither seeker or advertiser. 797*a1157835SDaniel Fojt 798*a1157835SDaniel FojtFor example, 799*a1157835SDaniel FojtP2PS-PROV-START 00:55:44:33:22:11 adv_id=111 adv_mac=00:55:44:33:22:11 conncap=1 session=1234567 session_mac=00:11:22:33:44:55 info='xxxx' 800*a1157835SDaniel Fojt 801*a1157835SDaniel FojtParameters definition: 802*a1157835SDaniel Fojt MAC address - always 803*a1157835SDaniel Fojt adv_id - always ASCII hex-encoded u32 804*a1157835SDaniel Fojt adv_mac - always MAC address that owns/registered the service 805*a1157835SDaniel Fojt conncap - always mask of 0x01 (new), 0x02 (group client), 0x04 (group owner) 806*a1157835SDaniel Fojt bits 807*a1157835SDaniel Fojt session - always Session ID of the first session to be established 808*a1157835SDaniel Fojt session_mac - always MAC address that owns/initiated the session 809*a1157835SDaniel Fojt info - if available, UTF-8 string 810*a1157835SDaniel Fojt Escaped single quote & backslash with a backslash: 811*a1157835SDaniel Fojt \' == 0x27 == ', and \\ == 0x5c == \ 812*a1157835SDaniel Fojt 813*a1157835SDaniel FojtP2PS-PROV-DONE: When provisioning is completed then this event gets triggered. 814*a1157835SDaniel Fojt 815*a1157835SDaniel FojtFor example, 816*a1157835SDaniel FojtP2PS-PROV-DONE 00:11:22:33:44:55 status=0 adv_id=111 adv_mac=00:55:44:33:22:11 conncap=1 session=1234567 session_mac=00:11:22:33:44:55 [dev_passwd_id=8 | go=p2p-wlan0-0 | join=11:22:33:44:55:66 | persist=0] 817*a1157835SDaniel Fojt 818*a1157835SDaniel FojtParameters definition: 819*a1157835SDaniel Fojt MAC address - always main device address of peer. May be different from MAC 820*a1157835SDaniel Fojt ultimately connected to. 821*a1157835SDaniel Fojt status - always ascii hex-encoded u8 (0 == success, 12 == deferred success) 822*a1157835SDaniel Fojt adv_id - always ascii hex-encoded u32 823*a1157835SDaniel Fojt adv_mac - always MAC address that owns/registered the service 824*a1157835SDaniel Fojt conncap - always One of: 1 (new), 2 (group client), 4 (group owner) bits 825*a1157835SDaniel Fojt session - always Session ID of the first session to be established 826*a1157835SDaniel Fojt session_mac - always MAC address that owns/initiated the session 827*a1157835SDaniel Fojt dev_passwd_id - only if conncap value == 1 (New GO negotiation) 828*a1157835SDaniel Fojt 8 - "p2ps" password must be passed in p2p_connect command 829*a1157835SDaniel Fojt 1 - "display" password must be passed in p2p_connect command 830*a1157835SDaniel Fojt 5 - "keypad" password must be passed in p2p_connect command 831*a1157835SDaniel Fojt join only - if conncap value == 2 (Client Only). Display password and "join" 832*a1157835SDaniel Fojt must be passed in p2p_connect and address must be the MAC specified 833*a1157835SDaniel Fojt go only - if conncap value == 4 (GO Only). Interface name must be set with a 834*a1157835SDaniel Fojt password 835*a1157835SDaniel Fojt persist - only if previous persistent group existed between peers and shall 836*a1157835SDaniel Fojt be re-used. Group is restarted by sending "p2p_group_add persistent=0" 837*a1157835SDaniel Fojt where value is taken from P2P-PROV-DONE 838*a1157835SDaniel Fojt 839*a1157835SDaniel FojtExtended Events/Response 840*a1157835SDaniel Fojt 841*a1157835SDaniel FojtP2P-DEVICE-FOUND 00:11:22:33:44:55 p2p_dev_addr=00:11:22:33:44:55 pri_dev_type=0-00000000-0 name='' config_methods=0x108 dev_capab=0x21 group_capab=0x0 adv_id=111 asp_svc=alt.example.chat 842*a1157835SDaniel Fojt 843*a1157835SDaniel FojtParameters definition: 844*a1157835SDaniel Fojt adv_id - if ASP ASCII hex-encoded u32. If it is reporting the 845*a1157835SDaniel Fojt "wildcard service", this value will be 0 846*a1157835SDaniel Fojt asp_svc - if ASP this is the service string. If it is reporting the 847*a1157835SDaniel Fojt "wildcard service", this value will be org.wi-fi.wfds 848*a1157835SDaniel Fojt 849*a1157835SDaniel Fojt 8503ff40c12SJohn Marinowpa_cli action script 8513ff40c12SJohn Marino--------------------- 8523ff40c12SJohn Marino 8533ff40c12SJohn MarinoSee examples/p2p-action.sh 8543ff40c12SJohn Marino 8553ff40c12SJohn MarinoTODO: describe DHCP/DNS setup 8563ff40c12SJohn MarinoTODO: cross-connection 857