SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The host can receive an indication of specific states through events or errors. All WLAN events are sent to the handler mapped to slcb_WlanEvtHdlr().
Asynchronous events can be sent to the host at any given time with an indication of specific states and specific data for each event. To listen to these events and determine the needed information, a handler must be implemented in the user application and registered under the user.h header file. The following event may be received in relation to a WLAN connection:
Indicates the connection is successful and includes the following information:
Indicates the disconnection is successful and includes the following information:
Errors are indicated by the return value of the API. Each error code is unique. Table 5-4 lists common errors that require user action (a complete list of errors is under the error.h file in the host driver).
Error | Value | Comments |
---|---|---|
SL_ERROR_ROLE_STA_ERR | –4107 | Initialization failure in STA mode |
SL_ERROR_WLAN_INVALID_ROLE | –2050 | Action applied does not match the current mode. |
SL_ERROR_WLAN_KEY_ERROR | –2049 | One of the security parameters or SSID supplied is wrong (invalid length or not supported). |
SL_ERROR_WLAN_INVALID_SECURITY_TYPE | –2054 | |
SL_ERROR_WLAN_PASSPHRASE_TOO_LONG | –2055 | |
SL_ERROR_WLAN_PASSWORD_ERROR | –2058 | |
SL_ERROR_WLAN_SSID_LEN_ERROR | –2060 | |
SL_ERROR_WLAN_ILLEGAL_WEP_KEY_INDEX | –2064 | |
SL_ERROR_WLAN_EAP_WRONG_METHOD | –2057 | One of the EAP security parameters supplied is wrong (invalid length or not supported). |
SL_ERROR_WLAN_EAP_ANONYMOUS_LEN_ERROR | –2059 | |
SL_ERROR_WLAN_USER_ID_LEN_ERROR | –2061 | |
SL_ERROR_WLAN_PREFERRED_NETWORK_LIST_FULL | –2062 | No free profile |
SL_ERROR_WLAN_INVALID_POLICY_TYPE | –2066 | Invalid policy type. Value is not supported. |
SL_ERROR_WLAN_WIFI_ALREADY_DISCONNECTED | –2071 | Applying disconnect command when disconnected |
SL_ERROR_WLAN_GET_NETWORK_LIST_EAGAIN | –2073 | Network list is unavailable because scan was not enabled. A one-shot scan is immediately triggered, and the user should fetch the scan results again. |
SL_ERROR_WLAN_GET_PROFILE_INVALID_INDEX | –2074 | Profile index is too high or does not exist. |