SimpleLink Host Driver  0.0.5.1
 All Data Structures Functions Variables Groups
simplelink.h
1 /*
2  * simplelink.h - CC31xx/CC32xx Host Driver Implementation
3  *
4  * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
5  *
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35 */
36 
37 
216 #include "../user.h"
217 
218 #ifndef __SIMPLELINK_H__
219 #define __SIMPLELINK_H__
220 
221 #ifdef __cplusplus
222 extern "C"
223 {
224 #endif
225 
226 #define SL_DRIVER_VERSION "0.0.5.1"
227 #define SL_MAJOR_VERSION_NUM 0L
228 #define SL_MINOR_VERSION_NUM 0L
229 #define SL_VERSION_NUM 5L
230 #define SL_SUB_VERSION_NUM 1L
231 
232 /* Compilation Integrity Check */
233 
234 
235 
236 /*****************************************************************************
237 
238  Predefined configurations
239 
240  *****************************************************************************/
241 
242 #ifdef SL_TINY
243 #undef SL_INC_ARG_CHECK
244 #undef SL_INC_EXT_API
245 #undef SL_INC_SOCK_CLIENT_SIDE_API
246 #undef SL_INC_SOCK_SEND_API
247 #undef SL_INC_WLAN_PKG
248 #undef SL_INC_NET_APP_PKG
249 #undef SL_INC_NET_CFG_PKG
250 #undef SL_INC_FS_PKG
251 #define SL_INC_STD_BSD_API_NAMING
252 #define SL_INC_SOCK_SERVER_SIDE_API
253 #define SL_INC_SOCK_RECV_API
254 #define SL_INC_SOCKET_PKG
255 #endif
256 
257 #ifdef SL_SMALL
258 #undef SL_INC_EXT_API
259 #undef SL_INC_NET_APP_PKG
260 #undef SL_INC_NET_CFG_PKG
261 #undef SL_INC_FS_PKG
262 #define SL_INC_ARG_CHECK
263 #define SL_INC_WLAN_PKG
264 #define SL_INC_SOCKET_PKG
265 #define SL_INC_STD_BSD_API_NAMING
266 #define SL_INC_SOCK_CLIENT_SIDE_API
267 #define SL_INC_SOCK_SERVER_SIDE_API
268 #define SL_INC_SOCK_RECV_API
269 #define SL_INC_SOCK_SEND_API
270 #endif
271 
272 #ifdef SL_FULL
273 #define SL_INC_EXT_API
274 #define SL_INC_NET_APP_PKG
275 #define SL_INC_NET_CFG_PKG
276 #define SL_INC_FS_PKG
277 #define SL_INC_ARG_CHECK
278 #define SL_INC_WLAN_PKG
279 #define SL_INC_SOCKET_PKG
280 #define SL_INC_STD_BSD_API_NAMING
281 #define SL_INC_SOCK_CLIENT_SIDE_API
282 #define SL_INC_SOCK_SERVER_SIDE_API
283 #define SL_INC_SOCK_RECV_API
284 #define SL_INC_SOCK_SEND_API
285 #endif
286 
287 
288 typedef void (*_SlSpawnEntryFunc_t)(void* pValue);
289 
290 
291 #define SL_RET_CODE_OK (0)
292 #define SL_RET_CODE_INVALID_INPUT (-2)
293 #define SL_RET_CODE_SELF_ERROR (-3)
294 #define SL_RET_CODE_NWP_IF_ERROR (-4)
295 #define SL_RET_CODE_MALLOC_ERROR (-5)
296 
297 #define sl_Memcpy memcpy
298 #define sl_Memset memset
299 
300 #define sl_SyncObjClear(pObj) sl_SyncObjWait(pObj,SL_OS_NO_WAIT)
301 
302 #define SL_MAX_SOCKETS 8
303 
304 
305 
306 #ifdef __cplusplus
307 }
308 #endif /* __cplusplus */
309 
310 
311 #ifdef SL_PLATFORM_MULTI_THREADED
312  #include "../source/spawn.h"
313 #else
314  #include "../source/nonos.h"
315 #endif
316 
317 /*
318  objInclusion.h and user.h must be included before all api header files
319  objInclusion.h must be the last arrangement just before including the API header files
320  since it based on the other configurations to decide which object should be included
321 */
322 #include "../source/objInclusion.h"
323 #include "../source/datatypes.h"
324 #include "trace.h"
325 #include "fs.h"
326 #include "socket.h"
327 #include "netapp.h"
328 #include "wlan.h"
329 #include "device.h"
330 #include "netcfg.h"
331 #include "wlan_rx_filters.h"
332 
333 
334 /*****************************************************************************
335 
336 Create prototypes for all event handlers
337 
338 *****************************************************************************/
339 
340 #if (defined(sl_GeneralEvtHdlr))
341 extern void sl_GeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent);
342 #endif
343 
344 #if (defined(sl_WlanEvtHdlr))
345 extern void sl_WlanEvtHdlr(SlWlanEvent_t *pSlWlanEvent);
346 #endif
347 
348 #if (defined(sl_NetAppEvtHdlr))
349 extern void sl_NetAppEvtHdlr(SlNetAppEvent_t *pSlSockEvent);
350 #endif
351 
352 #if (defined(sl_SockEvtHdlr))
353 extern void sl_SockEvtHdlr(SlSockEvent_t *pSlSockEvent);
354 #endif
355 
356 #if (defined(sl_HttpServerCallback))
357 extern void sl_HttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, SlHttpServerResponse_t *pSlHttpServerResponse);
358 #endif
359 
360 #endif /* __SIMPLELINK_H__ */
Definition: device.h:311
Definition: socket.h:413
#define sl_NetAppEvtHdlr
An event handler for IP address asynchronous event. Usually accepted after new WLAN connection...
Definition: user.h:952
Definition: wlan.h:395
Definition: socket.h:536
#define sl_WlanEvtHdlr
An event handler for WLAN connection or disconnection indication This event handles async WLAN events...
Definition: user.h:937
Definition: netapp.h:140
#define sl_HttpServerCallback
A callback for HTTP server events. Possible events are: SL_NETAPP_HTTPGETTOKENVALUE - NWP requests to...
Definition: user.h:971
Definition: netapp.h:146