SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The device supports multiple connection policies. These policies define how the device initiates the connection, and helps to maintain a specific connection configuration after reset, which is appropriate for the desired use case. The WLAN connection policy supports four options for connecting the SimpleLink Wi-Fi device to a given AP.
The four options for the connection policy:
Set the Auto policy with the following macro: SL_WLAN_CONNECTION_POLICY(1,0,0,0)
Set the Auto and Fast policy with the following macro: SL_WLAN_CONNECTION_POLICY(1,1,0,0)
Set the Auto and AnyP2P with the following macro: SL_WLAN_CONNECTION_POLICY(1,0,1,0)
Set the Auto and Auto Provisioning with the following macro: SL_WLAN_CONNECTION_POLICY(1,0,0,1)
More than one connection policy can be set, for example Auto and Fast and Auto provisioning. The connection policy enabled by default is Auto and Auto Provisioning. Setting the connection policy takes effect immediately. For example, if setting the Auto policy and profiles exists, a connection attempt to the highest priority profile is immediately triggered. This configuration is persistent according to the system-persistent configuration, or can be non-persistent upon flag configuration (see example below).
Set persistent connection policy example:
_i16 Status;
Status = sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,1,0,1),NULL,0);
if( Status )
{
/* error */
}
Set non-persistent connection policy example:
_i16 Status;
uint32_t flags = 0;
flags |= SL_WLAN_CONN_POLICY_NON_PERSISTENT_FLAG;
Status= sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,0,0,0),&flags,sizeof(flags));
if( Status )
{
/* error */
}