Start Guide P2P User Interface Linux
Start Guide P2P User Interface Linux
Start Guide P2P User Interface Linux
Interface
Date: 2012/04/06
Version: 0.6
1.4
2
P2P_UI
2.1
3.3
3.4
3.5.4 After 3.5.3, we issue provision discovery and also declaring which
WPS method we want to use( this information is inside provision
discovery frame)
3.5.5 We check p2p status, if status ==
P2P_STATE_RX_PROVISION_DIS_RSP then we set the
corresponding config method to driver.
3.5.6 Then we start negotiation.
3.5.8 Now, in this example, we set intent==1 and our role is client, so we
start wpa_supplicant automatically. We also require wpa_supplicant
start WPS connection with the config method that we set before.
3.5.9 If wpa_supplicant using WPS connection success, it will show wpa
state like the following:
3.5.10
After WPS connection successful, user interface will run DHCP
client automatically. That time, two P2P devices connected successfully,
we could try to ping each other.
3.5.11
Otherwise, if our role is P2P GO, then we start hosapd
automatically and require it starts WPS connection with the config
method that we set before. The following is the information that the
client connected successfully, using WPS connection.
3.5.12
If WPS connection success, GO will run DHCP server. That time,
two P2P devices connected successfully, we could try to ping each
other.
*Our P2P_UI is implementing in Fedora, so the route with DHCP
server in P2P_UI is writing as default route in Fedora. If you are
using another Linux OS, its recommended that changing DHCP
server route in P2P_UI or marked #define DHCP.
4
Start using the P2P_UI to be connected by other P2P device. (passive connection)
4.1 We enable p2p functionalities at first (enable as P2P device)
4.2
4.3
4.4
4.5
4.5.2 If its PIN code and peer P2P device wants to input our PIN code on
their device (or input the PIN code that displays on our label), then we
need insert command c as accepted.
4.5.3 If its PBC, then we need insert command b as accepted.
4.6
5
With this version, the first 3 steps are the same as 3.1~3.4
Issue provision discovery frame (insert cmd: p).
6.3.1 The purpose for issuing the provision discovery frame is to set/get the
WPS PIN CODE or WPS PBC to/from peer P2P device.
6.3.2 Select the way to get the WPS configuration method we want to use.
[0]: We input the PIN code that displays on peer device screen.
[1]: Our screen display PIN code and input this PIN code on the peer
device
*If we use this WPS configure method, we should input PIN code
at first (see 6.4) or use default PIN code: 12345670.
[2]: Both P2P devices will use the WPS PBC
[3]: We input the PIN code that printed on peer device WPS label (like
sticker).
6.3.3 After 6.3.2, we issue provision discovery request and also declaring
which WPS method we want to use( this information is inside
provision discovery frame)
6.4 Input PIN codes (insert cmd: c).
6.4.1 This step is optional because the P2P_UI already provides the default
PIN Code
6.4.2 The P2P_UI will check the validation of the inputted PIN code. If we
want use [1] in 6.3.2, its recommended that we input PIN code before
issuing provision discovery
6.4.3 If we select [0] in 6.3.2, we input PIN code that displays on the screen
of peer P2P device.
6.4.4 We dont need to input PIN code if you select the [2] in 6.3.2
6.4.5 If we select [3] in 6.3.2, we should input the PIN code which printed on
the label of peer P2P device.
6.5 Set WPS configuration method (insert cmd: w).
6.5.1 This command is used to inform the P2P driver that the P2P_UI
already received the WPS PIN code or WPS PBC. The WPS PIN code
and WPS PBC should be acquired by using the command 6.3 and 6.4.
6.5.2 We will set WPS configuration method based on 6.3 we issued.
If you select the [0] in 6.3, we will choose the [1] here.
If you select the [1] in 6.3, we will choose the [2] here.
If you select the [2] in 6.3, we will choose the [3] here.
If you select the [3] in 6.3, we will choose the [1] here.
6.6
6.6.2 Else, if our intent is higher than peer device, the P2P_UI would start
hostapd automatically and act as P2P GO.
6.6.3 For group owner negotiation procedure, it could be issued by one of
two P2P devices.
6.7 DHCP
6.7.1 If wpa_supplicant reported wpa_state=COMPLETED, it means P2P
connection is established successfully and P2P_UI will start dhclient
automatically to try to get the IP from the P2P GO.
6.7.2 If hostapd reported
dot11RSNAStatsSTAAddress=XX:XX:XX:XX:XX:XX, it means
the P2P connection is established successfully and the P2P_UI will
start DHCP server automatically.
6.8 For the other P2P device (passive connected), it could do re-flash current
state to check whether P2P device connected using P2P handshake.
Optional commands.
The following are some optional commands that could set or get information
from drivers.
7.1 Set operation channel (insert cmd: h)
7.1.1 It is optional command because the P2P_UI will have the rule to
determine the default value for the operation channel. However, this
information will be ignored if this P2P device is the P2P client after the
group owner negotiation handshake. Also, if hostapd is running, we
could not change this value, same as 7.2 and 7.5
7.1.2 The P2P_UI will use the value of channel in /hostapd.conf as default
value.
7.1.3 This operation channel is the channel number which the P2P GO
should stay if the local P2P device is the GO.
7.1.4 Notice that the value should be the same as the value of channel in
/hostapd.conf
7.2 Set softAP ssid (insert cmd: t)
7.2.1 Its optional because the P2P_UI will use the content of ssid in
/hostapd.conf as default
7.2.2 This command will inform other drivers the ssid string if this P2P
device is the GO.
7.2.3 Notice that the value should be the same as the content of ssid in
/hostapd.conf
7.3 Get current P2P role (insert cmd: r)
You can check the P2P role which the driver is acting as.
0: Disable
1: P2P Device
2: P2P Client
3: P2P GO
7.4 Get current P2P status (insert cmd: s)
You can check the current P2P status that the driver stands for.
0: P2P_STATE_NONE
1: P2P_STATE_IDLE
2: P2P_STATE_LISTEN
3: P2P_STATE_SCAN
4: P2P_STATE_FIND_PHASE_LISTEN
5: P2P_STATE_FIND_PHASE_SEARCH
6: P2P_STATE_TX_PROVISION_DIS_REQ
7: P2P_STATE_RX_PROVISION_DIS_RSP
8: P2P_STATE_RX_PROVISION_DIS_REQ
9: P2P_STATE_GONEGO_ING
10: P2P_STATE_GONEGO_OK
11: P2P_STATE_GONEGO_FAIL
12: P2P_STATE_RECV_INVITE_REQ
13: P2P_STATE_PROVISIONING_ING
14: P2P_STATE_PROVISIONING_DONE
7.5 Set device name (insert cmd: d)
Set the device name which will be seeing by the other P2P devices. In
Default we get this name from /hostapd.conf.
7.5.1 Its optional because the P2P_UI will use the content of ssid in
/hostapd.conf as default
7.5.2 This command will set the P2P device name which will be seeing by
other P2P devices.
7.5.3 Notice that the value should be the same as the content of ssid in
/hostapd.conf
7.6 Set listen channel (insert cmd: l)
Set the listen channel where the device will stay in the listen state, the listen
channel will set channel 1, 6, 11 only, as the spec. described.
7.7 Reflash current state (insert cmd: f)
It will reflash current state and other information that P2P_UI maintains.
7.8 Quit (insert cmd: q)
Quit P2P user interface, P2P functionality will be disabled.