本文轉載至:http://blog.xuite.net/free6d1823/blog/70485698-WiFi+Direct+testing+procedure
1. Remove old wpa_supplicant
wpa_cli terminate
2. Install WPA_Supplicant with P2P supported (open debug if needed)
wpa_supplicant -Dnl80211 -iwlan0 -c /etc/wpa_buffalo.conf -B -d -f wpa.txt
3. enter wpa_cli interactive mode to test P2P
wpa_cli
4. Test P2P command
The basics commands: Discovery, connection etc.
Command | Description |
---|---|
p2p_find [timeout (seconds)] [type <social \ progressive>] | Enables discovery – start sending probe request frames |
p2p_stop_find | Stops discovery, or whatever you are doing (listen mode, connection process etc.) |
P2p_connect <device address> <PBC \ PIN> [GO_intent=<0-15> \ auth \ join] | GO_intent – initiate connection to another device (using entered group intent) Auth – WPS authorize incoming connection Join – connect to an existing GO No input – initiate connection using default GO intent |
P2p_listen [timeout (seconds)] | Enable listen mode |
P2p_group_remove <interface> | Remove device from group, return to device mode if acting as GO or autonomous GO |
P2p_group_add | Become an autonomous GO |
Examples:
> p2p_find
<3>P2P-DEVICE-FOUND 12:68:3f:71:c6:5c p2p_dev_addr=12:68:3f:71:c6:5c pri_dev_type=10-0050F204-5 name='Android_4.2' config_methods=0x188 dev_capab=0x20 gro0
> p2p_connect 12:68:3f:71:c6:5c pbc GO_intent=7
> p2p_group_add
......
<3>P2P-GROUP-STARTED wlan0 GO ssid="DIRECT-3E" freq=2412 passphrase="nScOEING" go_dev_addr=b0:38:29:02:04:ed
Managing discovered peers: Using the discovered peers list
Command | Description |
---|---|
P2p_peers [discovered] | Shows list of discovered peers (with ‘discovered’ – shows only fully discovered peers) |
P2p_peer <address> | Show detailed information about discovered peers |
P2p_flush | Flush p2p_state, and clears the discovered peer list |
Examples
> p2p_peer 12:68:3f:71:c6:5c
12:68:3f:71:c6:5c
pri_dev_type=10-0050F204-5
device_name=Android_4.2
manufacturer=
model_name=
model_number=
serial_number=
config_methods=0x0
dev_capab=0x20
group_capab=0x0
level=0
age=69
listen_freq=2412
wps_method=not-ready
interface_addr=00:00:00:00:00:00
member_in_go_dev=00:00:00:00:00:00
member_in_go_iface=00:00:00:00:00:00
go_neg_req_sent=0
go_state=unknown
dialog_token=0
intended_addr=00:00:00:00:00:00
country=XX
oper_freq=0
req_config_methods=0x0
flags=[PROBE_REQ_ONLY]
status=0
wait_count=0
invitation_reqs=0
GO WPS authorizations:When devices try to connect to GOUT
Command | Description |
---|---|
Wps_pbc | pushbutton to accept incoming connections |
Wps_pin <PIN> <UUID> | Enable WPS enrollee PIN |
Others
Command | Description |
---|---|
p2p_prov_disc <address> <method> | Request provision discovery |
p2p_serv_disc_req <addr> <TLVs> | Send service discovery request |
p2p_serv_disc_cancel_req <id> | Cancel service discovery request |
p2p_serv_disc_resp <freq> <addr> <dialog token> <TLVs> | Service discovery response |
p2p_service_add <bonjour\upnp> <query\version> <response\service> | Add a local service |
p2p_service_del <bonjour\upnp> <query\version> [service] | Remove a local service |
p2p_invite <cmd> [address] | Send invitation to device |
Reconfigure | Wpa_supplicant will re-read configuration file |
Ping | Ping wpa_supplicant (only) |