Wi-Fi Direct
58
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
WLAN
SlWlanNetworkEntry_t netEntries[30];
_i16 resultsCount = sl_WlanGetNetworkList(0,30,&netEntries[0]);
•
Wi-Fi Direct Remote Connection
Enabling the scan policy sets the device to be discoverable for other devices. The two following
options are available to complete the connection:
–
Combine the scan policy first with the connection policy AnyP2P, and allow the remote device to
find and complete the connection without any action from the user side (PBC only).
–
Listen to the SL_WLAN_EVENT_P2P_REQUEST event. This event holds information about the
remote device that initiated the connection such as the device name, name length, MAC address,
and WPS method. To complete the connection issue, connect or add profile command with the
correct parameters.
•
Negotiation Method
The following are two different Wi-Fi Direct negotiation methods which indicate the WPS phase that
follows to the negotiation:
–
Push-button
Both sides negotiate with PBC method. Define: SL_WLAN_SEC_TYPE_P2P_PBC.
–
Pin Code Connection
Divided to two options:
•
PIN_DISPLAY – this side looks for this pin to be written by its remote peer. Define:
SL_WLAN_SEC_TYPE_P2P_PIN_DISPLAY
•
PIN_KEYPAD – this side sends a pin code to its remote peer. Define:
SL_WLAN_SEC_TYPE_P2P_PIN_KEYPAD
These parameters influence the negotiation method and are supplied during the manual connection API
command that comes from the host or by setting the profile for automatic connection. The negotiation
method is performed by the device without user interference.
NOTE:
If no pin code is entered in the display side, the NWP auto-generates the pin code from the
device MAC using the following method:
1. Take the 7 LSB decimal digits in the device MAC address.
2. Add the checksum of the 7 LSB decimal digits to the LSB (8 digits total).
For example, if the MAC address is 03:4A:22:3B:FA:42, convert to it decimals (059:250:066);
7 LSB decimal digits are: 9250066, and the WPS pin checksum digit is 2. The default pin
code for this MAC is 92500662.
Configure the negotiation method by setting the security type in the security structure when issuing a
connect or add profile command.
•
Push Button
: secParams.Type = SL_WLAN_SEC_TYPE_P2P_PBC
•
Pin Code Keypad
:
–
secParams.Type = SL_WLAN_SEC_TYPE_PIN_KEYPAD
–
secParams.Key = “12345670”
•
Pin Code Display:
–
secParams.Type = SL_WLAN_SEC_TYPE_PIN_ DISPLAY
–
secParams.Key = “12345670”
•
Manual Connection
After finding a remote Wi-Fi Direct device, the host can instruct the device to connect to it by issuing a
simple connect command. This command performs immediate Wi-Fi Direct discovery, and once the
remote device is found, the negotiation phase is started according to the negotiation initiator policy,
method, and intent selected.