Access Point
52
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
WLAN
4.4.4.2
Disconnect a Station
In AP mode, the SimpleLink Wi-Fi device lets users force disconnect a station by using its MAC address.
Disconnecting a station does not add it to the black list, and the station can immediately connect again.
Example:
_i16 Status;
_u8
ap_sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
Status
= sl_NetCfgSet(SL_NETCFG_AP_STATION_DISCONNECT,1,SL_MAC_ADDR_LEN,(_u8 *)ap_sta_mac);
if
( Status )
{
/* error */
}
4.4.5 Events and Errors
The host can receive indication of specific states through events or errors. Asynchronous events can be
sent to the host at any time, with indication of a specific state and specific data for each event. To listen to
these events and determine the needed information, a handler should be implemented in the user
application, and registered under the user.h to catch the following possible events:
•
SL_WLAN_EVENT_STA_ADDED
Indicates connection is successfully completed and includes the following information: MAC address
•
SL_WLAN_EVENT_STA_REMOVED
Indicates connection is successfully completed and includes the following information: MAC address
•
SL_NETAPP_EVENT_IPV4_ACQUIRED
Indicates connection is successfully completed and includes the following information:
–
IPv4 address
–
Default Gateway address
–
DNS address
Errors are indicated by the return value of the API. Each error code is unique.
lists common
errors that require user action (a complete list of possible errors is under the file error.h in the host driver).
Table 4-5. Common Errors
Error
Value
Comments
SL_ERROR_ROLE_AP_ERR
–4108
Initialization failure in AP mode.
SL_ERROR_WLAN_TX_POWER_OUT_OF_RANGE
–2167
Configured TX power is out of range.
SL_ERROR_WLAN_INVALID_ROLE
–2050
Action applied does not match the current mode.
SL_ERROR_WLAN_CANNOT_CONFIG_SCAN_DU
RING_PROVISIONING
–2052
Illegal action occurred during provisioning.
SL_ERROR_WLAN_INVALID_COUNTRY_CODE
–2464
Invalid country code
SL_ERROR_WLAN_INVALID_AP_PASSWORD_LE
NGTH
–2168
Configured AP password has invalid length.
SL_ERROR_WLAN_AP_SCAN_INTERVAL_TOO_S
HORT
–2176
Scan in AP mode has a minimum interval of 10 seconds.
4.4.6 Limitations
A list of device limitations follows:
•
A maximum of four stations can connect to the SimpleLink Wi-Fi device in AP mode.
•
Only 802.11bg is supported.
•
No power save support in AP mode.