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 indication of specific states through events or errors. Asynchronous events can be sent to the host at any given time with indication of the 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 file. The following events may be received:
Indicates that a Wi-Fi Direct connection was successfully completed. Occurs when the device is a Wi-Fi Direct CLIENT and contains the remote device parameters:
Indicates that Wi-Fi Direct disconnect is successfully completed. Occurs when the device is a Wi-Fi Direct CLIENT and contains the remote device parameters:
Indicates that Wi-Fi Direct connection was successfully completed. Occurs when the device is a Wi-Fi Direct GO and contains the remote device parameters:
Indicates that a Wi-Fi Direct client was disconnected successfully. Occurs when the device is a Wi-Fi Direct GO and contains the remote device parameters:
Indicates that a Wi-Fi Direct device was found during the scan and it contains the remote device parameters:
Indicates that a negotiation request was received from a Wi-Fi Direct remote device and it contains the remote device parameters:
This event is sent if the connection failed with the failure reason.
Errors are indicated by the return value of the API. Each error code is unique. Table 5-11 lists common errors that require user action (a complete list of possible errors is under the file error.h in the host driver).
Error | Value | Comments |
---|---|---|
SL_ERROR_ROLE_P2P_ERR | -4109 | Initialization failure in Wi-Fi Direct mode |
SL_ERROR_NET_APP_P2P_ROLE_IS_NOT_CONFIGURED | -6210 | Wi-Fi Direct mode is not configured yet, and should be CL or GO to execute the command. |
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_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 | Scan was not enabled, one-shot scan is immediately triggered, and user should fetch the scan results again. |
SL_ERROR_WLAN_GET_PROFILE_INVALID_INDEX | -2074 | Profile index is too high or does not exist |