Wi-Fi Direct
59
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
WLAN
NOTE:
•
The connection parameters are not saved to flash memory so in case of disconnection
or reset no reconnection will be done, unless fast-connect policy is on.
•
This connection is in higher priority than connection through profiles. It means that if
there is already an existing Wi-Fi Direct connection in the system, the current connection
will be disconnected and the manual connection is operated.
•
At the beginning of the discovery phase, full scan cycle on all channels is performed to
find Autonomous GO which can operate on every channel.
Example:
_i16 Status;
SlWlanSecParams_t SecParams;
Status
= sl_WlanConnect(
"my-tv-p2p-device"
, 16, NULL, &SecParams ,0);
if
( Status )
{
/* error */
}
•
Manual Disconnection
The manual disconnect option lets the user disconnect from the remote peer by a host command. This
command performs Wi-Fi Direct group.
Example:
_i16 Status;
Status
= sl_WlanDisconnect();
if
( Status )
{
/* error */
}
•
Wi-Fi Direct Profiles
The purpose of profile configuration is to make an automatic Wi-Fi Direct connection after reset, or
after disconnection from the remote peer device. The add profile command stores the Wi-Fi Direct
remote device parameters in flash as a new profile, along with profile priority. These profiles are similar
to the STA mode profiles and have the same automatic connection behavior. The connection is
dependent on the profile policy configuration (see the connection policy section). If the Auto policy is
on, a Wi-Fi Direct discovery is performed, and if one or more of the found remote devices matches one
of the profiles, a negotiation phase is started according to the negotiation initiator policy, method, and
intent selected. The chosen profile is the one with the highest-priority profile.
NOTE:
If a manual connection is sent during a profile connection, the profile connection is stopped,
and the manual connection is started.
Example:
_u8 val = 1;
_u8 policyVal;
_i16 Role, Status;
_u8
my_p2p_device[33];
_u8
remote_p2p_device[33];
_u8 bssidEmpty[6] = {0,0,0,0,0,0};
SlWlanSecParams_t SecParams;
Role = sl_Start(NULL, NULL, NULL);
if
( Role !=
ROLE_P2P)
{
/* Set P2P as active mode */
Status = sl_WlanSetMode(ROLE_P2P);
}
/* Set Wi-Fi Direct client dhcp enable (assuming remote GO running DHCP server) */