WiFi Direct p2p association process

Jouni Malinen j
Thu Feb 12 04:40:02 PST 2015


On Wed, Feb 11, 2015 at 11:10:13AM -0800, Vinayak Rao wrote:
> Device 1:
> wpa_cli -p/var/run/p2p0 -ip2p0  p2p_find
> 
> Device 2:
> wpa_cli -p/var/run/p2p0 -ip2p0  p2p_find

> At this point of time either device can initiate the process.
> 
> Now lets says, device 2 issue command
> -------------------------------------
> wpa_cli -p/var/run/p2p0 -ip2p0 p2p_connect MAC_ADDRESS_DEVICE_1 8_DIGIT_PIN
> display join

That would not be a valid command in this sequence. The "join" parameter
would imply that the peer is already operating a group.

> How the device 1 knows that device 2 has
> 1/ Initiated the WFD command
> 2/ WFD method is PIN

If you were to remove that " join" part from the end (and not stop
p2p_find or p2p_listen on peer), the command would initiate GO
negotiation and that show up as a P2P-GO-NEG-REQUEST event on the peer.
That event includes dev_passwd_id=<value> parameter that indicates which
config method is being requested.

> I understand that there is some thing called events. My question is can we
> use wpa cli to capture the EVENTS, if yes which command? If no, then what /
> how shall we know that device 1 has initiated ? Do we need to run wpa_cli
> in interactive mode?

If you run wpa_cli in interactive mode, you'll see that event there (no
commands needed for that; wpa_cli registers automatically to receive
events and it will print them in stdout). That's fine for manual testing
purposes, but I'd assume most cases would use some upper layer component
to register directly to receiving wpa_supplicant control interface
events and reacting to them rather than doing this through wpa_cli.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list