216 #ifndef __SIMPLELINK_H__
217 #define __SIMPLELINK_H__
222 #define _u8 unsigned char
223 #define _i8 signed char
224 #define _u16 unsigned short
225 #define _i16 signed short
226 #define _u32 unsigned long
227 #define _i32 signed long
229 #define _volatile volatile
266 #define SL_DRIVER_VERSION "1.0.1.6"
267 #define SL_MAJOR_VERSION_NUM 1L
268 #define SL_MINOR_VERSION_NUM 0L
269 #define SL_VERSION_NUM 1L
270 #define SL_SUB_VERSION_NUM 6L
279 #undef SL_INC_ARG_CHECK
280 #undef SL_INC_EXT_API
281 #undef SL_INC_SOCK_SERVER_SIDE_API
282 #undef SL_INC_WLAN_PKG
283 #undef SL_INC_NET_CFG_PKG
285 #undef SL_INC_SET_UART_MODE
286 #undef SL_INC_NVMEM_PKG
287 #define SL_INC_STD_BSD_API_NAMING
288 #define SL_INC_SOCK_CLIENT_SIDE_API
289 #define SL_INC_SOCK_RECV_API
290 #define SL_INC_SOCK_SEND_API
291 #define SL_INC_SOCKET_PKG
292 #define SL_INC_NET_APP_PKG
297 #undef SL_INC_EXT_API
298 #undef SL_INC_NET_APP_PKG
299 #undef SL_INC_NET_CFG_PKG
301 #define SL_INC_ARG_CHECK
302 #define SL_INC_WLAN_PKG
303 #define SL_INC_SOCKET_PKG
304 #define SL_INC_SOCK_CLIENT_SIDE_API
305 #define SL_INC_SOCK_SERVER_SIDE_API
306 #define SL_INC_SOCK_RECV_API
307 #define SL_INC_SOCK_SEND_API
308 #define SL_INC_SET_UART_MODE
312 #define SL_INC_EXT_API
313 #define SL_INC_NET_APP_PKG
314 #define SL_INC_NET_CFG_PKG
315 #define SL_INC_FS_PKG
316 #define SL_INC_ARG_CHECK
317 #define SL_INC_WLAN_PKG
318 #define SL_INC_SOCKET_PKG
319 #define SL_INC_SOCK_CLIENT_SIDE_API
320 #define SL_INC_SOCK_SERVER_SIDE_API
321 #define SL_INC_SOCK_RECV_API
322 #define SL_INC_SOCK_SEND_API
323 #define SL_INC_SET_UART_MODE
326 #define SL_RET_CODE_OK (0)
327 #define SL_RET_CODE_INVALID_INPUT (-2)
328 #define SL_RET_CODE_SELF_ERROR (-3)
329 #define SL_RET_CODE_NWP_IF_ERROR (-4)
330 #define SL_RET_CODE_MALLOC_ERROR (-5)
331 #define SL_RET_CODE_ABORT (-6)
332 #define SL_RET_CODE_PROTOCOL_ERROR (-7)
336 #define sl_Memset(addr, val, len) memset(addr, val, (size_t)len)
337 #define sl_Memcpy(dest, src, len) memcpy(dest, src, (size_t)len)
340 #define SL_MAX_SOCKETS (_u8)(8)
342 #define SL_MAX_SOCKETS (_u8)(2)
359 #define TRUE (!FALSE)
366 typedef _u16 _SlOpcode_t;
367 typedef _u8 _SlArgSize_t;
368 typedef _i16 _SlDataSize_t;
369 typedef _i16 _SlReturnVal_t;
384 EVENT_PROPAGATION_BLOCK = 0,
385 EVENT_PROPAGATION_CONTINUE
387 } _SlEventPropogationStatus_e;
404 #include "../source/objInclusion.h"
412 #include "wlan_rx_filters.h"
417 #ifdef sl_GeneralEvtHdlr
418 #define _SlDrvHandleGeneralEvents sl_GeneralEvtHdlr
423 #ifdef sl_WlanEvtHdlr
424 #define _SlDrvHandleWlanEvents sl_WlanEvtHdlr
429 #ifdef sl_NetAppEvtHdlr
430 #define _SlDrvHandleNetAppEvents sl_NetAppEvtHdlr
435 #ifdef sl_HttpServerCallback
436 #define _SlDrvHandleHttpServerEvents sl_HttpServerCallback
441 #ifdef sl_SockEvtHdlr
442 #define _SlDrvHandleSockEvents sl_SockEvtHdlr
447 #define __CONCAT(x,y) x ## y
448 #define __CONCAT2(x,y) __CONCAT(x,y)
459 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_GENERAL_EVENT)
460 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl) (
SlDeviceEvent_t *);
461 #define SlExtLib1GeneralEventHandler __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl)
463 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
464 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
468 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_WLAN_EVENT)
469 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl) (
SlWlanEvent_t *);
470 #define SlExtLib1WlanEventHandler __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl)
472 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
473 #define EXT_LIB_REGISTERED_WLAN_EVENTS
477 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_NETAPP_EVENT)
478 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl) (
SlNetAppEvent_t *);
479 #define SlExtLib1NetAppEventHandler __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl)
481 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
482 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
486 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_HTTP_SERVER_EVENT)
488 #define SlExtLib1HttpServerEventHandler __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl)
490 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
491 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
495 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_SOCK_EVENT)
496 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _SockEventHdl) (
SlSockEvent_t *);
497 #define SlExtLib1SockEventHandler __CONCAT2(SL_EXT_LIB_1, _SockEventHdl)
499 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
500 #define EXT_LIB_REGISTERED_SOCK_EVENTS
509 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_GENERAL_EVENT)
510 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl) (
SlDeviceEvent_t *);
511 #define SlExtLib2GeneralEventHandler __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl)
513 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
514 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
518 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_WLAN_EVENT)
519 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl) (
SlWlanEvent_t *);
520 #define SlExtLib2WlanEventHandler __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl)
522 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
523 #define EXT_LIB_REGISTERED_WLAN_EVENTS
527 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_NETAPP_EVENT)
528 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl) (
SlNetAppEvent_t *);
529 #define SlExtLib2NetAppEventHandler __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl)
531 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
532 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
536 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_HTTP_SERVER_EVENT)
538 #define SlExtLib2HttpServerEventHandler __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl)
540 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
541 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
545 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_SOCK_EVENT)
546 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _SockEventHdl) (
SlSockEvent_t *);
547 #define SlExtLib2SockEventHandler __CONCAT2(SL_EXT_LIB_2, _SockEventHdl)
549 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
550 #define EXT_LIB_REGISTERED_SOCK_EVENTS
559 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_GENERAL_EVENT)
560 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl) (
SlDeviceEvent_t *);
561 #define SlExtLib3GeneralEventHandler __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl)
563 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
564 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
568 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_WLAN_EVENT)
569 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl) (
SlWlanEvent_t *);
570 #define SlExtLib3WlanEventHandler __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl)
572 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
573 #define EXT_LIB_REGISTERED_WLAN_EVENTS
577 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_NETAPP_EVENT)
578 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl) (
SlNetAppEvent_t *);
579 #define SlExtLib3NetAppEventHandler __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl)
581 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
582 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
586 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_HTTP_SERVER_EVENT)
588 #define SlExtLib3HttpServerEventHandler __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl)
590 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
591 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
595 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_SOCK_EVENT)
596 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _SockEventHdl) (
SlSockEvent_t *);
597 #define SlExtLib3SockEventHandler __CONCAT2(SL_EXT_LIB_3, _SockEventHdl)
599 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
600 #define EXT_LIB_REGISTERED_SOCK_EVENTS
609 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_GENERAL_EVENT)
610 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl) (
SlDeviceEvent_t *);
611 #define SlExtLib4GeneralEventHandler __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl)
613 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
614 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
618 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_WLAN_EVENT)
619 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl) (
SlWlanEvent_t *);
620 #define SlExtLib4WlanEventHandler __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl)
622 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
623 #define EXT_LIB_REGISTERED_WLAN_EVENTS
627 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_NETAPP_EVENT)
628 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl) (
SlNetAppEvent_t *);
629 #define SlExtLib4NetAppEventHandler __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl)
631 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
632 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
636 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_HTTP_SERVER_EVENT)
638 #define SlExtLib4HttpServerEventHandler __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl)
640 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
641 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
645 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_SOCK_EVENT)
646 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _SockEventHdl) (
SlSockEvent_t *);
647 #define SlExtLib4SockEventHandler __CONCAT2(SL_EXT_LIB_4, _SockEventHdl)
649 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
650 #define EXT_LIB_REGISTERED_SOCK_EVENTS
659 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_GENERAL_EVENT)
660 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl) (
SlDeviceEvent_t *);
661 #define SlExtLib5GeneralEventHandler __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl)
663 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
664 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
668 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_WLAN_EVENT)
669 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl) (
SlWlanEvent_t *);
670 #define SlExtLib5WlanEventHandler __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl)
672 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
673 #define EXT_LIB_REGISTERED_WLAN_EVENTS
677 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_NETAPP_EVENT)
678 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl) (
SlNetAppEvent_t *);
679 #define SlExtLib5NetAppEventHandler __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl)
681 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
682 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
686 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_HTTP_SERVER_EVENT)
688 #define SlExtLib5HttpServerEventHandler __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl)
690 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
691 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
695 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_SOCK_EVENT)
696 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _SockEventHdl) (
SlSockEvent_t *);
697 #define SlExtLib5SockEventHandler __CONCAT2(SL_EXT_LIB_5, _SockEventHdl)
699 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
700 #define EXT_LIB_REGISTERED_SOCK_EVENTS
707 #if defined(EXT_LIB_REGISTERED_GENERAL_EVENTS)
708 extern void _SlDrvHandleGeneralEvents(
SlDeviceEvent_t *slGeneralEvent);
711 #if defined(EXT_LIB_REGISTERED_WLAN_EVENTS)
712 extern void _SlDrvHandleWlanEvents(
SlWlanEvent_t *slWlanEvent);
715 #if defined (EXT_LIB_REGISTERED_NETAPP_EVENTS)
719 #if defined(EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS)
724 #if defined(EXT_LIB_REGISTERED_SOCK_EVENTS)
725 extern void _SlDrvHandleSockEvents(
SlSockEvent_t *slSockEvent);
729 typedef short (*_SlSpawnEntryFunc_t)(
void* pValue);
731 #define SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER (0X1)
733 #ifdef SL_PLATFORM_MULTI_THREADED
734 #include "../source/spawn.h"
736 #include "../source/nonos.h"
852 #if (defined(sl_WlanEvtHdlr))
883 #if (defined(sl_NetAppEvtHdlr))
905 #if (defined(sl_SockEvtHdlr))
937 #if (defined(sl_HttpServerCallback))
953 #if defined (sl_GetTimestamp)
_u32 sl_GetTimestamp(void)
SL get timestamp routine. It returns the timer counter value in ticks unit. The counter must count fr...
void sl_GeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent)
General async event for inspecting general events.
void sl_HttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, SlHttpServerResponse_t *pSlHttpServerResponse)
HTTP server async event.
void sl_SockEvtHdlr(SlSockEvent_t *pSlSockEvent)
Socket Async event handler.
void sl_WlanEvtHdlr(SlWlanEvent_t *pSlWlanEvent)
WLAN Async event handler.
void sl_NetAppEvtHdlr(SlNetAppEvent_t *pSlNetApp)
NETAPP Async event handler.