SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
AP mode is activated with default configuration, and reconfiguration is not mandatory, although this option exists. The following settings are available, require reset, and are persistent with no dependency on the system-persistent configuration.
The SimpleLink Wi-Fi device default SSID is ‘mysimplelink-xxyyzz’ where ‘xxyyzz’ are the last six digits of the device MAC address. Because the MAC address is unique, the SSID is also unique. Still, the SSID configuration exists with a maximum length of 32 characters.
Example:
_i16 Status;
_u8 Ssid[] = "Test_AP";
Status=sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_SSID, strlen(Ssid), Ssid);
if( Status )
{
/* error */
}
The device can be configured to not broadcast the SSID inside the Beacon frame when in AP mode. This configuration is disabled by default.
Example:
_i16 Status;
_u8 hidden = TRUE;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_HIDDEN_SSID, 1, (_u8 *)& hidden);
if( Status )
{
/* error */
}
Set the country code for AP mode.
For CC3x20 and CC3x30: Table 5-7 shows the basic supported country codes.
Country Code | Supported Channels |
---|---|
US | 1-11 |
EU | 1-13 |
JP | 1-13 |
The CC3135, CC3235S, and CC3235SF support a wider set of country codes due to different channels used by different countries in the 5-GHz band. The full list of supported countries could be found in Section C.
Example:
_i16 Status;
_u8 Str[] = "US";
Status = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE, 2, Str);
if( Status )
{
/* error */
}
Set the operational channel of the SimpleLink Wi-Fi device in access point mode.
The chosen channel must be valid in the selected regulatory domain. Table 5-8 shows the basic possible values for the 2.4-GHz band.
Country Code | Supported Channels |
---|---|
US | 1-11 |
EU | 1-13 |
JP | 1-13 |
Table 5-8 covers the following part numbers: CC3x20 and CC3x30. The CC3135 and CC3235 allow a wider range of channels, depending on the selected country code. For a full list of supported channels, refer to Section C.
The default channel in AP mode is 6. If the chosen channel is, for some reason, not supported in the regulatory domain, the system automatically switches to the default channel.
Example:
_i16 Status;
_u8 channel = 1;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_CHANNEL, 1, (_u8 *)& channel);
if( Status )
{
/* error */
}
Set the SimpleLink Wi-Fi device AP network security mode configuration. Possible security types are OPEN, WEP and WPA\WPA2. The default value is Open security.
Example:
_i16 Status;
_u8 val = SL_WLAN_SEC_TYPE_WPA_WPA2;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_SECURITY_TYPE, 1, (_u8 *)&val);
if( Status )
{
/* error */
}
When the SimpleLink Wi-Fi device is configured as a secured AP, it uses a security password. This password is used for all secured networks except OPEN. Setting the SimpleLink Wi-Fi device to use a WEP security requires a password length of 5 or 10 characters in HEX format, and 13 or 26 characters in ASCII format. For the WPA \ WPA2 security type, the password length must be between 8 and 64 characters. The default value is not supplied, and when using a secured network the password must be set.
Example:
_i16 Status;
_u8 password[] = {"123456789"};
_u16 len = strlen(password);
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_PASSWORD, len, (_u8 *)password);
if( Status )
{
/* error */
}
The SimpleLink Wi-Fi device lets users configure the maximum number of simultaneously connected stations allowed. The available range is from one to four stations. The default value is four stations.
Example:
_i16 Status;
_u8 max_ap_stations = 3;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STATIONS, sizeof(max_ap_stations), (_u8 *)&max_ap_stations);
if( Status )
{
/* error */
}
The SimpleLink Wi-Fi device lets users set the value of the maximum time before a station is considered inactive. After this time expires, a null data frame is sent to the station. If this frame is not acknowledged and no other frames are received, the station is disassociated. The default value is 60 seconds.
Example:
_i16 Status;
_u16 max_ap_sta_aging = 50;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STA_AGING, sizeof(max_ap_sta_aging), (_u8 *)&max_ap_sta_aging);
if( Status )
{
/* error */
}
The SimpleLink Wi-Fi device lets users set the TX power level in AP mode. The value is from 0 to 15, as dB offset from maximum power (0 is MAX power).
Tx Power can only be set on 2.4-GHz channels.
Example:
_i16 Status;
_u8 ApPower = 3;
Status = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER,1,(_u8 *)& ApPower);
if( Status )
{
/* error */
}
The SimpleLink Wi-Fi device lets users set up to four custom information (info) elements per mode, AP, or Wi-Fi Direct GO. For AP mode, no more than 300 bytes (SL_INFO_ELEMENT_MAX_TOTAL_LENGTH_AP) can be stored for all info elements (for example, 4 info elements of 75 bytes each). For Wi-Fi Direct GO mode, no more than 160 byes (SL_INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO) can be stored for all info elements (for example, 4 info elements of 40 bytes each). To delete an info element, use the relevant index with length 0.
Example:
_i16 Status;
SlWlanSetInfoElement_t InfoEle;
InfoEle.Index = Index; /* Index of the info element. range: 0 - SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED */
InfoEle.Role = Role; /* SL_WLAN_INFO_ELEMENT_AP_ROLE (0) or SL_WLAN_INFO_ELEMENT_P2P_GO_ROLE (1) */
InfoEle.IE.Id = Id; /* Info element ID. if SL_WLAN_INFO_ELEMENT_DEFAULT_ID (0) is set, ID will be set to 221 *//* Organization unique ID. If all 3 bytes are zero - it will be replaced with 08,00,28 */
InfoEle.IE.Oui[0] = Oui0; /* Organization unique ID first Byte */
InfoEle.IE.Oui[1] = Oui1; /* Organization unique ID second Byte */
InfoEle.IE.Oui[2] = Oui2; /* Organization unique ID third Byte */
InfoEle.IE.Length = Len; /* Length of the info element. must be smaller than 253 bytes */
InfoEle (infoele.IE.Data, 0, SL_WLAN_INFO_ELEMENT_MAX_SIZE);
if ( Len < = SL_WLAN_INFO_ELEMENT_MAX_SIZE )
{
memcpy(InfoEle.IE.Data, IE, Len);
Status = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,
sizeof(SlWlanSetInfoElement_t),(_u8* )&InfoEle);
if( Status )
{
/* error */
}
}