40 #include "simplelink.h"
70 #define SL_POOL_IS_EMPTY (-2000)
75 #define SL_ESMALLBUF (-2001)
79 #define SL_EZEROLEN (-2002)
82 #define SL_INVALPARAM (-2003)
86 #define SL_BAD_INTERFACE (-2004)
89 #define SL_API_ABORTED (-100)
102 SL_ERR_SENDER_HEALTH_MON,
103 SL_ERR_SENDER_CLI_UART,
104 SL_ERR_SENDER_SUPPLICANT,
105 SL_ERR_SENDER_NETWORK_STACK,
106 SL_ERR_SENDER_WLAN_DRV_IF,
107 SL_ERR_SENDER_WILINK,
108 SL_ERR_SENDER_INIT_APP,
110 SL_ERR_SENDER_HOST_APD,
112 SL_ERR_SENDER_HTTP_SERVER,
113 SL_ERR_SENDER_DHCP_SERVER,
114 SL_ERR_SENDER_DHCP_CLIENT,
116 SL_ERR_NUM_SENDER_LAST=0xFF
122 SL_DRIVER_API_DEVICE_SL_START = 0,
123 SL_DRIVER_API_DEVICE_SL_STOP,
124 SL_DRIVER_API_NETAPP_PING_START,
125 SL_DRIVER_API_SOCKET_CONNECT,
126 SL_DRIVER_API_SOCKET_ACCEPT,
127 SL_DRIVER_API_SOCKET_SELECT,
128 SL_DRIVER_API_SOCKET_RECV,
129 SL_DRIVER_API_SOCKET_RECVFROM
131 } SlDriverAPIWithTimeout_e;
135 #define SL_ERROR_STATIC_ADDR_SUBNET_ERROR (-60)
136 #define SL_ERROR_ILLEGAL_CHANNEL (-61)
137 #define SL_ERROR_SUPPLICANT_ERROR (-72)
138 #define SL_ERROR_HOSTAPD_INIT_FAIL (-73)
139 #define SL_ERROR_HOSTAPD_INIT_IF_FAIL (-74)
140 #define SL_ERROR_WLAN_DRV_INIT_FAIL (-75)
141 #define SL_ERROR_WLAN_DRV_START_FAIL (-76)
142 #define SL_ERROR_FS_FILE_TABLE_LOAD_FAILED (-77)
143 #define SL_ERROR_PREFERRED_NETWORKS_FILE_LOAD_FAILED (-78)
144 #define SL_ERROR_HOSTAPD_BSSID_VALIDATION_ERROR (-79)
145 #define SL_ERROR_HOSTAPD_FAILED_TO_SETUP_INTERFACE (-80)
146 #define SL_ERROR_MDNS_ENABLE_FAIL (-81)
147 #define SL_ERROR_HTTP_SERVER_ENABLE_FAILED (-82)
148 #define SL_ERROR_DHCP_SERVER_ENABLE_FAILED (-83)
149 #define SL_ERROR_PREFERRED_NETWORK_LIST_FULL (-93)
150 #define SL_ERROR_PREFERRED_NETWORKS_FILE_WRITE_FAILED (-94)
151 #define SL_ERROR_DHCP_CLIENT_RENEW_FAILED (-100)
153 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_UNSPECIFIED (-102)
154 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_AUTH_REJECT (-103)
155 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT (-104)
156 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE (-105)
157 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE (-106)
158 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE (-107)
159 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER (-108)
160 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT (-109)
161 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_SG_RESELECT (-110)
162 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_ROC_FAILURE (-111)
163 #define SL_GENERAL_ERROR_CON_MGMT_STATUS_MIC_FAILURE (-112)
165 #define SL_ERROR_WAKELOCK_ERROR_PREFIX (-115)
166 #define SL_ERROR_LENGTH_ERROR_PREFIX (-116)
167 #define SL_ERROR_MDNS_CREATE_FAIL (-121)
168 #define SL_ERROR_GENERAL_ERROR (-127)
172 #define SL_DEVICE_GENERAL_CONFIGURATION (1)
173 #define SL_DEVICE_GENERAL_CONFIGURATION_DATE_TIME (11)
174 #define SL_DEVICE_GENERAL_VERSION (12)
175 #define SL_DEVICE_STATUS (2)
184 #define SL_WLAN_CONNECT_EVENT (1)
185 #define SL_WLAN_DISCONNECT_EVENT (2)
187 #define SL_WLAN_SMART_CONFIG_COMPLETE_EVENT (3)
188 #define SL_WLAN_SMART_CONFIG_STOP_EVENT (4)
190 #define SL_WLAN_STA_CONNECTED_EVENT (5)
191 #define SL_WLAN_STA_DISCONNECTED_EVENT (6)
193 #define SL_WLAN_P2P_DEV_FOUND_EVENT (7)
194 #define SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT (8)
195 #define SL_WLAN_CONNECTION_FAILED_EVENT (9)
199 SL_DEVICE_GENERAL_ERROR_EVENT = 1,
200 SL_DEVICE_ABORT_ERROR_EVENT,
201 SL_DEVICE_DRIVER_ASSERT_ERROR_EVENT,
202 SL_DEVICE_DRIVER_TIMEOUT_CMD_COMPLETE,
203 SL_DEVICE_DRIVER_TIMEOUT_SYNC_PATTERN,
204 SL_DEVICE_DRIVER_TIMEOUT_ASYNC_EVENT,
207 SlDeviceDriverError_e;
210 #define SL_SOCKET_TX_FAILED_EVENT (1)
211 #define SL_SOCKET_ASYNC_EVENT (2)
213 #define SL_NETAPP_IPV4_IPACQUIRED_EVENT (1)
214 #define SL_NETAPP_IPV6_IPACQUIRED_EVENT (2)
215 #define SL_NETAPP_IP_LEASED_EVENT (3)
216 #define SL_NETAPP_IP_RELEASED_EVENT (4)
219 #define SL_NETAPP_HTTPGETTOKENVALUE_EVENT (1)
220 #define SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT (2)
229 #define SL_EVENT_CLASS_GLOBAL (0)
230 #define SL_EVENT_CLASS_DEVICE (1)
231 #define SL_EVENT_CLASS_WLAN (2)
232 #define SL_EVENT_CLASS_BSD (3)
233 #define SL_EVENT_CLASS_NETAPP (4)
234 #define SL_EVENT_CLASS_NETCFG (5)
235 #define SL_EVENT_CLASS_FS (6)
239 #define EVENT_DROPPED_DEVICE_ASYNC_GENERAL_ERROR (0x00000001L)
240 #define STATUS_DEVICE_SMART_CONFIG_ACTIVE (0x80000000L)
243 #define EVENT_DROPPED_WLAN_WLANASYNCONNECTEDRESPONSE (0x00000001L)
244 #define EVENT_DROPPED_WLAN_WLANASYNCDISCONNECTEDRESPONSE (0x00000002L)
245 #define EVENT_DROPPED_WLAN_STA_CONNECTED (0x00000004L)
246 #define EVENT_DROPPED_WLAN_STA_DISCONNECTED (0x00000008L)
247 #define STATUS_WLAN_STA_CONNECTED (0x80000000L)
250 #define EVENT_DROPPED_NETAPP_IPACQUIRED (0x00000001L)
251 #define EVENT_DROPPED_NETAPP_IPACQUIRED_V6 (0x00000002L)
252 #define EVENT_DROPPED_NETAPP_IP_LEASED (0x00000004L)
253 #define EVENT_DROPPED_NETAPP_IP_RELEASED (0x00000008L)
256 #define EVENT_DROPPED_SOCKET_TXFAILEDASYNCRESPONSE (0x00000001L)
266 #define SL_ERROR_CON_MGMT_STATUS_UNSPECIFIED SL_GENERAL_ERROR_CON_MGMT_STATUS_UNSPECIFIED
267 #define SL_ERROR_CON_MGMT_STATUS_AUTH_REJECT SL_GENERAL_ERROR_CON_MGMT_STATUS_AUTH_REJECT
268 #define SL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT SL_GENERAL_ERROR_CON_MGMT_STATUS_ASSOC_REJECT
269 #define SL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE SL_GENERAL_ERROR_CON_MGMT_STATUS_SECURITY_FAILURE
270 #define SL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DEAUTHENTICATE
271 #define SL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE SL_GENERAL_ERROR_CON_MGMT_STATUS_AP_DISASSOCIATE
272 #define SL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER SL_GENERAL_ERROR_CON_MGMT_STATUS_ROAMING_TRIGGER
273 #define SL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT SL_GENERAL_ERROR_CON_MGMT_STATUS_DISCONNECT_DURING_CONNECT
274 #define SL_ERROR_CON_MGMT_STATUS_SG_RESELECT SL_GENERAL_ERROR_CON_MGMT_STATUS_SG_RESELECT
275 #define SL_ERROR_CON_MGMT_STATUS_ROC_FAILURE SL_GENERAL_ERROR_CON_MGMT_STATUS_ROC_FAILURE
276 #define SL_ERROR_CON_MGMT_STATUS_MIC_FAILURE SL_GENERAL_ERROR_CON_MGMT_STATUS_MIC_FAILURE
277 #define SL_DEVICE_FATAL_ERROR_EVENT SL_DEVICE_GENERAL_ERROR_EVENT
285 #ifdef SL_IF_TYPE_UART
289 _u8 FlowControlEnable;
319 SlErrorSender_e sender;
335 SlDeviceDriverError_e Event;
357 typedef void (*P_INIT_CALLBACK)(_u32 Status);
412 #if _SL_INCLUDE_FUNC(sl_Start)
413 _i16
sl_Start(
const void* pIfHdl, _i8* pDevName,
const P_INIT_CALLBACK pInitCallBack);
444 #if _SL_INCLUDE_FUNC(sl_Stop)
445 _i16
sl_Stop(
const _u16 timeout);
481 #if _SL_INCLUDE_FUNC(sl_DevSet)
482 _i32
sl_DevSet(
const _u8 DeviceSetId ,
const _u8 Option,
const _u8 ConfigLen,
const _u8 *pValues);
545 #if _SL_INCLUDE_FUNC(sl_DevGet)
546 _i32
sl_DevGet(
const _u8 DeviceGetId,_u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
597 #if _SL_INCLUDE_FUNC(sl_EventMaskSet)
637 #if _SL_INCLUDE_FUNC(sl_EventMaskGet)
662 #if _SL_INCLUDE_FUNC(sl_Task)
683 #ifdef SL_IF_TYPE_UART
684 #if _SL_INCLUDE_FUNC(sl_UartSetMode)
_i16 sl_EventMaskGet(const _u8 EventClass, _u32 *pMask)
Get current event mask of the device.
_i16 sl_Start(const void *pIfHdl, _i8 *pDevName, const P_INIT_CALLBACK pInitCallBack)
Start the SimpleLink device.
_i16 sl_EventMaskSet(const _u8 EventClass, const _u32 Mask)
Set asynchronous event mask.
_i16 sl_UartSetMode(const SlUartIfParams_t *pUartParams)
Setting the internal uart mode.
void sl_Task(void)
the simple link task entry
_i16 sl_Stop(const _u16 timeout)
Stop the SimpleLink device.
_i32 sl_DevGet(const _u8 DeviceGetId, _u8 *pOption, _u8 *pConfigLen, _u8 *pValues)
Internal function for getting device configurations.
_i32 sl_DevSet(const _u8 DeviceSetId, const _u8 Option, const _u8 ConfigLen, const _u8 *pValues)
Internal function for setting device configurations.