DeepCover Embedded Security in IoT: Public-key Secured Data Paths

Dependencies:   MaximInterface

The MAXREFDES155# is an internet-of-things (IoT) embedded-security reference design, built to authenticate and control a sensing node using elliptic-curve-based public-key cryptography with control and notification from a web server.

The hardware includes an ARM® mbed™ shield and attached sensor endpoint. The shield contains a DS2476 DeepCover® ECDSA/SHA-2 coprocessor, Wifi communication, LCD push-button controls, and status LEDs. The sensor endpoint is attached to the shield using a 300mm cable and contains a DS28C36 DeepCover ECDSA/SHA-2 authenticator, IR-thermal sensor, and aiming laser for the IR sensor. The MAXREFDES155# is equipped with a standard Arduino® form-factor shield connector for immediate testing using an mbed board such as the MAX32600MBED#. The combination of these two devices represent an IoT device. Communication to the web server is accomplished with the shield Wifi circuitry. Communication from the shield to the attached sensor module is accomplished over I2C . The sensor module represents an IoT endpoint that generates small data with a requirement for message authenticity/integrity and secure on/off operational control.

The design is hierarchical with each mbed platform and shield communicating data from the sensor node to a web server that maintains a centralized log and dispatches notifications as necessary. The simplicity of this design enables rapid integration into any star-topology IoT network to provide security with the low overhead and cost provided by the ECDSA-P256 asymmetric-key and SHA-256 symmetric-key algorithms.

More information about the MAXREFDES155# is available on the Maxim Integrated website.

Committer:
IanBenzMaxim
Date:
Tue Dec 03 12:56:25 2019 -0600
Revision:
18:c2631e985780
Parent:
16:a004191a79ab
Updated MaximInterface to version 2.1.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 0:33d4e66780c0 1 /*
IanBenzMaxim 0:33d4e66780c0 2 * simplelink.h - CC31xx/CC32xx Host Driver Implementation
IanBenzMaxim 0:33d4e66780c0 3 *
IanBenzMaxim 0:33d4e66780c0 4 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
IanBenzMaxim 0:33d4e66780c0 5 *
IanBenzMaxim 0:33d4e66780c0 6 *
IanBenzMaxim 0:33d4e66780c0 7 * Redistribution and use in source and binary forms, with or without
IanBenzMaxim 0:33d4e66780c0 8 * modification, are permitted provided that the following conditions
IanBenzMaxim 0:33d4e66780c0 9 * are met:
IanBenzMaxim 0:33d4e66780c0 10 *
IanBenzMaxim 0:33d4e66780c0 11 * Redistributions of source code must retain the above copyright
IanBenzMaxim 0:33d4e66780c0 12 * notice, this list of conditions and the following disclaimer.
IanBenzMaxim 0:33d4e66780c0 13 *
IanBenzMaxim 0:33d4e66780c0 14 * Redistributions in binary form must reproduce the above copyright
IanBenzMaxim 0:33d4e66780c0 15 * notice, this list of conditions and the following disclaimer in the
IanBenzMaxim 0:33d4e66780c0 16 * documentation and/or other materials provided with the
IanBenzMaxim 0:33d4e66780c0 17 * distribution.
IanBenzMaxim 0:33d4e66780c0 18 *
IanBenzMaxim 0:33d4e66780c0 19 * Neither the name of Texas Instruments Incorporated nor the names of
IanBenzMaxim 0:33d4e66780c0 20 * its contributors may be used to endorse or promote products derived
IanBenzMaxim 0:33d4e66780c0 21 * from this software without specific prior written permission.
IanBenzMaxim 0:33d4e66780c0 22 *
IanBenzMaxim 0:33d4e66780c0 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
IanBenzMaxim 0:33d4e66780c0 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
IanBenzMaxim 0:33d4e66780c0 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
IanBenzMaxim 0:33d4e66780c0 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
IanBenzMaxim 0:33d4e66780c0 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
IanBenzMaxim 0:33d4e66780c0 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
IanBenzMaxim 0:33d4e66780c0 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
IanBenzMaxim 0:33d4e66780c0 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
IanBenzMaxim 0:33d4e66780c0 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
IanBenzMaxim 0:33d4e66780c0 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
IanBenzMaxim 0:33d4e66780c0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IanBenzMaxim 0:33d4e66780c0 34 *
IanBenzMaxim 0:33d4e66780c0 35 */
IanBenzMaxim 0:33d4e66780c0 36
IanBenzMaxim 0:33d4e66780c0 37
IanBenzMaxim 0:33d4e66780c0 38 /*!
IanBenzMaxim 0:33d4e66780c0 39 \mainpage SimpleLink Driver
IanBenzMaxim 0:33d4e66780c0 40
IanBenzMaxim 0:33d4e66780c0 41 \section intro_sec Introduction
IanBenzMaxim 0:33d4e66780c0 42
IanBenzMaxim 0:33d4e66780c0 43 The SimpleLink CC31xx/CC2xx family allows to add Wi-Fi and networking capabilities
IanBenzMaxim 0:33d4e66780c0 44 to low-cost embedded products without having prior Wi-Fi, RF or networking expertise.
IanBenzMaxim 0:33d4e66780c0 45 The CC31xx/CC32xx is an ideal solution for microcontroller-based sensor and control
IanBenzMaxim 0:33d4e66780c0 46 applications such as home appliances, home automation and smart metering.
IanBenzMaxim 0:33d4e66780c0 47 The CC31xx/CC32xx has integrated a comprehensive TCP/IP network stack, Wi-Fi driver and
IanBenzMaxim 0:33d4e66780c0 48 security supplicant leading to easier portability to microcontrollers, to an
IanBenzMaxim 0:33d4e66780c0 49 ultra-low memory footprint, all without compromising the capabilities and robustness
IanBenzMaxim 0:33d4e66780c0 50 of the final application.
IanBenzMaxim 0:33d4e66780c0 51
IanBenzMaxim 0:33d4e66780c0 52
IanBenzMaxim 0:33d4e66780c0 53
IanBenzMaxim 0:33d4e66780c0 54 \section modules_sec Module Names
IanBenzMaxim 0:33d4e66780c0 55 To make it simple, TI's SimpleLink CC31xx/CC32xx platform capabilities were divided into modules by topic (Silo).
IanBenzMaxim 0:33d4e66780c0 56 These capabilities range from basic device management through wireless
IanBenzMaxim 0:33d4e66780c0 57 network configuration, standard BSD socket and much more.
IanBenzMaxim 0:33d4e66780c0 58 Listed below are the various modules in the SimpleLink CC31xx/CC32xx driver:
IanBenzMaxim 0:33d4e66780c0 59 -# \ref device - controls the behaviour of the CC31xx/CC32xx device (start/stop, events masking and obtaining specific device status)
IanBenzMaxim 0:33d4e66780c0 60 -# \ref wlan - controls the use of the WiFi WLAN module including:
IanBenzMaxim 0:33d4e66780c0 61 - Connection features, such as: profiles, policies, SmartConfig™
IanBenzMaxim 0:33d4e66780c0 62 - Advanced WLAN features, such as: scans, rx filters and rx statistics collection
IanBenzMaxim 0:33d4e66780c0 63 -# \ref socket - controls standard client/server sockets programming options and capabilities
IanBenzMaxim 0:33d4e66780c0 64 -# \ref netapp - activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS.
IanBenzMaxim 0:33d4e66780c0 65 -# \ref netcfg - controls the configuration of the device addresses (i.e. IP and MAC addresses)
IanBenzMaxim 0:33d4e66780c0 66 -# \ref FileSystem - provides file system capabilities to TI's CC31XX that can be used by both the CC31XX device and the user.
IanBenzMaxim 0:33d4e66780c0 67
IanBenzMaxim 0:33d4e66780c0 68
IanBenzMaxim 0:33d4e66780c0 69 \section proting_sec Porting Guide
IanBenzMaxim 0:33d4e66780c0 70
IanBenzMaxim 0:33d4e66780c0 71 The porting of the SimpleLink driver to any new platform is based on few simple steps.
IanBenzMaxim 0:33d4e66780c0 72 This guide takes you through this process step by step. Please follow the instructions
IanBenzMaxim 0:33d4e66780c0 73 carefully to avoid any problems during this process and to enable efficient and proper
IanBenzMaxim 0:33d4e66780c0 74 work with the device.
IanBenzMaxim 0:33d4e66780c0 75 Please notice that all modifications and porting adjustments of the driver should be
IanBenzMaxim 0:33d4e66780c0 76 made in the user.h header file only.
IanBenzMaxim 0:33d4e66780c0 77 Keep making any of the changes only in this file will ensure smoothly transaction to
IanBenzMaxim 0:33d4e66780c0 78 new versions of the driver at the future!
IanBenzMaxim 0:33d4e66780c0 79
IanBenzMaxim 0:33d4e66780c0 80
IanBenzMaxim 0:33d4e66780c0 81 \subsection porting_step1 Step 1 - Create your own user.h file
IanBenzMaxim 0:33d4e66780c0 82
IanBenzMaxim 0:33d4e66780c0 83 The first step is to create a user.h file that will include your configurations and
IanBenzMaxim 0:33d4e66780c0 84 adjustments. You can use the empty template provided as part of this driver or
IanBenzMaxim 0:33d4e66780c0 85 you can choose to base your file on file from one of the wide range of examples
IanBenzMaxim 0:33d4e66780c0 86 applications provided by Texas Instruments
IanBenzMaxim 0:33d4e66780c0 87
IanBenzMaxim 0:33d4e66780c0 88
IanBenzMaxim 0:33d4e66780c0 89 \subsection porting_step2 Step 2 - Select the capabilities set required for your application
IanBenzMaxim 0:33d4e66780c0 90
IanBenzMaxim 0:33d4e66780c0 91 Texas Instruments made a lot of efforts to build set of predefined capability sets that would
IanBenzMaxim 0:33d4e66780c0 92 fit most of the target application.
IanBenzMaxim 0:33d4e66780c0 93 It is recommended to try and choose one of this predefined capabilities set before going to
IanBenzMaxim 0:33d4e66780c0 94 build your own customized set. If you find compatible set you can skip the rest of this step.
IanBenzMaxim 0:33d4e66780c0 95
IanBenzMaxim 0:33d4e66780c0 96 The available sets are:
IanBenzMaxim 0:33d4e66780c0 97 -# SL_TINY - Compatible to be used on platforms with very limited resources. Provides
IanBenzMaxim 0:33d4e66780c0 98 the best in class foot print in terms of Code and Data consumption.
IanBenzMaxim 0:33d4e66780c0 99 -# SL_SMALL - Compatible to most common networking applications. Provide the most
IanBenzMaxim 0:33d4e66780c0 100 common APIs with decent balance between code size, data size, functionality
IanBenzMaxim 0:33d4e66780c0 101 and performances
IanBenzMaxim 0:33d4e66780c0 102 -# SL_FULL - Provide access to all SimpleLink functionalities
IanBenzMaxim 0:33d4e66780c0 103
IanBenzMaxim 0:33d4e66780c0 104
IanBenzMaxim 0:33d4e66780c0 105 \subsection porting_step3 Step 3 - Bind the device enable/disable output line
IanBenzMaxim 0:33d4e66780c0 106
IanBenzMaxim 0:33d4e66780c0 107 The enable/disable line (nHib) provide mechanism to enter the device into the least current
IanBenzMaxim 0:33d4e66780c0 108 consumption mode. This mode could be used when no traffic is required (tx/rx).
IanBenzMaxim 0:33d4e66780c0 109 when this line is not connected to any IO of the host this define should be left empty.
IanBenzMaxim 0:33d4e66780c0 110 Not connecting this line results in ability to start the driver only once.
IanBenzMaxim 0:33d4e66780c0 111
IanBenzMaxim 0:33d4e66780c0 112
IanBenzMaxim 0:33d4e66780c0 113 \subsection porting_step4 Step 4 - Writing your interface communication driver
IanBenzMaxim 0:33d4e66780c0 114
IanBenzMaxim 0:33d4e66780c0 115 The SimpleLink device support several standard communication protocol among SPI and
IanBenzMaxim 0:33d4e66780c0 116 UART. Depending on your needs and your hardware design, you should choose the
IanBenzMaxim 0:33d4e66780c0 117 communication channel type.
IanBenzMaxim 0:33d4e66780c0 118 The interface for this communication channel should include 4 simple access functions:
IanBenzMaxim 0:33d4e66780c0 119 -# open
IanBenzMaxim 0:33d4e66780c0 120 -# close
IanBenzMaxim 0:33d4e66780c0 121 -# read
IanBenzMaxim 0:33d4e66780c0 122 -# write
IanBenzMaxim 0:33d4e66780c0 123
IanBenzMaxim 0:33d4e66780c0 124 The way this driver would be implemented is directly effecting the efficiency and
IanBenzMaxim 0:33d4e66780c0 125 the performances of the SimpleLink device on this platform.
IanBenzMaxim 0:33d4e66780c0 126 If your system has DMA you should consider to use it in order to increase the utilization
IanBenzMaxim 0:33d4e66780c0 127 of the communication channel
IanBenzMaxim 0:33d4e66780c0 128 If you have enough memory resources you should consider using a buffer to increase the
IanBenzMaxim 0:33d4e66780c0 129 efficiency of the write operations.
IanBenzMaxim 0:33d4e66780c0 130
IanBenzMaxim 0:33d4e66780c0 131
IanBenzMaxim 0:33d4e66780c0 132 \subsection porting_step5 Step 5 - Choose your memory management model
IanBenzMaxim 0:33d4e66780c0 133
IanBenzMaxim 0:33d4e66780c0 134 The SimpleLink driver support two memory models:
IanBenzMaxim 0:33d4e66780c0 135 -# Static (default)
IanBenzMaxim 0:33d4e66780c0 136 -# Dynamic
IanBenzMaxim 0:33d4e66780c0 137
IanBenzMaxim 0:33d4e66780c0 138 If you choose to work in dynamic model you will have to provide alloc and free functions
IanBenzMaxim 0:33d4e66780c0 139 to be used by the Simple Link driver otherwise nothing need to be done.
IanBenzMaxim 0:33d4e66780c0 140
IanBenzMaxim 0:33d4e66780c0 141
IanBenzMaxim 0:33d4e66780c0 142 \subsection porting_step6 Step 6 - OS adaptation
IanBenzMaxim 0:33d4e66780c0 143
IanBenzMaxim 0:33d4e66780c0 144 The SimpleLink driver could run on two kind of platforms:
IanBenzMaxim 0:33d4e66780c0 145 -# Non-Os / Single Threaded (default)
IanBenzMaxim 0:33d4e66780c0 146 -# Multi-Threaded
IanBenzMaxim 0:33d4e66780c0 147
IanBenzMaxim 0:33d4e66780c0 148 If you choose to work in multi-threaded environment under operating system you will have to
IanBenzMaxim 0:33d4e66780c0 149 provide some basic adaptation routines to allow the driver to protect access to resources
IanBenzMaxim 0:33d4e66780c0 150 for different threads (locking object) and to allow synchronization between threads (sync objects).
IanBenzMaxim 0:33d4e66780c0 151 In additional the driver support running without dedicated thread allocated solely to the simple
IanBenzMaxim 0:33d4e66780c0 152 link driver. If you choose to work in this mode, you should also supply a spawn method that
IanBenzMaxim 0:33d4e66780c0 153 will enable to run function on a temporary context.
IanBenzMaxim 0:33d4e66780c0 154
IanBenzMaxim 0:33d4e66780c0 155
IanBenzMaxim 0:33d4e66780c0 156 \subsection porting_step7 Step 7 - Set your asynchronous event handlers routines
IanBenzMaxim 0:33d4e66780c0 157
IanBenzMaxim 0:33d4e66780c0 158 The SimpleLink device generate asynchronous events in several situations.
IanBenzMaxim 0:33d4e66780c0 159 These asynchronous events could be masked.
IanBenzMaxim 0:33d4e66780c0 160 In order to catch these events you have to provide handler routines.
IanBenzMaxim 0:33d4e66780c0 161 Please notice that if you not provide a handler routine and the event is received,
IanBenzMaxim 0:33d4e66780c0 162 the driver will drop this event without any indication of this drop.
IanBenzMaxim 0:33d4e66780c0 163
IanBenzMaxim 0:33d4e66780c0 164
IanBenzMaxim 0:33d4e66780c0 165 \subsection porting_step8 Step 8 - Run diagnostic tools to validate the correctness of your porting
IanBenzMaxim 0:33d4e66780c0 166
IanBenzMaxim 0:33d4e66780c0 167 The driver is delivered with some porting diagnostic tools to simplify the porting validation process
IanBenzMaxim 0:33d4e66780c0 168 and to reduce issues latter. It is very important to follow carefully this process.
IanBenzMaxim 0:33d4e66780c0 169
IanBenzMaxim 0:33d4e66780c0 170 The diagnostic process include:
IanBenzMaxim 0:33d4e66780c0 171 -# Validating Interface Communication Driver
IanBenzMaxim 0:33d4e66780c0 172 -# Validating OS adaptation layer
IanBenzMaxim 0:33d4e66780c0 173 -# Validating HW integrity
IanBenzMaxim 0:33d4e66780c0 174 -# Validating basic work with the device
IanBenzMaxim 0:33d4e66780c0 175
IanBenzMaxim 0:33d4e66780c0 176
IanBenzMaxim 0:33d4e66780c0 177 \section sw_license License
IanBenzMaxim 0:33d4e66780c0 178
IanBenzMaxim 0:33d4e66780c0 179 *
IanBenzMaxim 0:33d4e66780c0 180 *
IanBenzMaxim 0:33d4e66780c0 181 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
IanBenzMaxim 0:33d4e66780c0 182 *
IanBenzMaxim 0:33d4e66780c0 183 *
IanBenzMaxim 0:33d4e66780c0 184 * Redistribution and use in source and binary forms, with or without
IanBenzMaxim 0:33d4e66780c0 185 * modification, are permitted provided that the following conditions
IanBenzMaxim 0:33d4e66780c0 186 * are met:
IanBenzMaxim 0:33d4e66780c0 187 *
IanBenzMaxim 0:33d4e66780c0 188 * Redistributions of source code must retain the above copyright
IanBenzMaxim 0:33d4e66780c0 189 * notice, this list of conditions and the following disclaimer.
IanBenzMaxim 0:33d4e66780c0 190 *
IanBenzMaxim 0:33d4e66780c0 191 * Redistributions in binary form must reproduce the above copyright
IanBenzMaxim 0:33d4e66780c0 192 * notice, this list of conditions and the following disclaimer in the
IanBenzMaxim 0:33d4e66780c0 193 * documentation and/or other materials provided with the
IanBenzMaxim 0:33d4e66780c0 194 * distribution.
IanBenzMaxim 0:33d4e66780c0 195 *
IanBenzMaxim 0:33d4e66780c0 196 * Neither the name of Texas Instruments Incorporated nor the names of
IanBenzMaxim 0:33d4e66780c0 197 * its contributors may be used to endorse or promote products derived
IanBenzMaxim 0:33d4e66780c0 198 * from this software without specific prior written permission.
IanBenzMaxim 0:33d4e66780c0 199 *
IanBenzMaxim 0:33d4e66780c0 200 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
IanBenzMaxim 0:33d4e66780c0 201 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
IanBenzMaxim 0:33d4e66780c0 202 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
IanBenzMaxim 0:33d4e66780c0 203 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
IanBenzMaxim 0:33d4e66780c0 204 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
IanBenzMaxim 0:33d4e66780c0 205 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
IanBenzMaxim 0:33d4e66780c0 206 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
IanBenzMaxim 0:33d4e66780c0 207 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
IanBenzMaxim 0:33d4e66780c0 208 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
IanBenzMaxim 0:33d4e66780c0 209 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
IanBenzMaxim 0:33d4e66780c0 210 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IanBenzMaxim 0:33d4e66780c0 211 *
IanBenzMaxim 0:33d4e66780c0 212 */
IanBenzMaxim 0:33d4e66780c0 213
IanBenzMaxim 0:33d4e66780c0 214
IanBenzMaxim 0:33d4e66780c0 215
IanBenzMaxim 0:33d4e66780c0 216 #ifndef __SIMPLELINK_H__
IanBenzMaxim 0:33d4e66780c0 217 #define __SIMPLELINK_H__
IanBenzMaxim 0:33d4e66780c0 218
IanBenzMaxim 0:33d4e66780c0 219 /* define the default types
IanBenzMaxim 0:33d4e66780c0 220 * If user wants to overwrite it,
IanBenzMaxim 0:33d4e66780c0 221 * he need to undef and define again */
IanBenzMaxim 0:33d4e66780c0 222 #define _u8 unsigned char
IanBenzMaxim 0:33d4e66780c0 223 #define _i8 signed char
IanBenzMaxim 0:33d4e66780c0 224 #define _u16 unsigned short
IanBenzMaxim 0:33d4e66780c0 225 #define _i16 signed short
IanBenzMaxim 0:33d4e66780c0 226 #define _u32 unsigned long
IanBenzMaxim 0:33d4e66780c0 227 #define _i32 signed long
IanBenzMaxim 0:33d4e66780c0 228
IanBenzMaxim 0:33d4e66780c0 229 #define _volatile volatile
IanBenzMaxim 0:33d4e66780c0 230 #define _const const
IanBenzMaxim 0:33d4e66780c0 231
IanBenzMaxim 0:33d4e66780c0 232 #include "user.h"
IanBenzMaxim 0:33d4e66780c0 233
IanBenzMaxim 0:33d4e66780c0 234 #ifdef __cplusplus
IanBenzMaxim 0:33d4e66780c0 235 extern "C"
IanBenzMaxim 0:33d4e66780c0 236 {
IanBenzMaxim 0:33d4e66780c0 237 #endif
IanBenzMaxim 0:33d4e66780c0 238
IanBenzMaxim 0:33d4e66780c0 239
IanBenzMaxim 0:33d4e66780c0 240 /*! \attention Async event activation notes
IanBenzMaxim 0:33d4e66780c0 241 Function prototypes for event callback handlers
IanBenzMaxim 0:33d4e66780c0 242 Event handler function names should be defined in the user.h file
IanBenzMaxim 0:33d4e66780c0 243 e.g.
IanBenzMaxim 0:33d4e66780c0 244 "#define sl_WlanEvtHdlr SLWlanEventHandler"
IanBenzMaxim 0:33d4e66780c0 245 Indicates all WLAN events are handled by User func "SLWlanEventHandler"
IanBenzMaxim 0:33d4e66780c0 246 Important notes:
IanBenzMaxim 0:33d4e66780c0 247 1. Event handlers cannot activate another SimpleLink API from the event's context
IanBenzMaxim 0:33d4e66780c0 248 2. Event's data is valid during event's context. Any application data
IanBenzMaxim 0:33d4e66780c0 249 which is required for the user application should be copied or marked
IanBenzMaxim 0:33d4e66780c0 250 into user's variables
IanBenzMaxim 0:33d4e66780c0 251 3. It is not recommended to delay the execution of the event callback handler
IanBenzMaxim 0:33d4e66780c0 252
IanBenzMaxim 0:33d4e66780c0 253 */
IanBenzMaxim 0:33d4e66780c0 254
IanBenzMaxim 0:33d4e66780c0 255 /*!
IanBenzMaxim 0:33d4e66780c0 256
IanBenzMaxim 0:33d4e66780c0 257 \addtogroup UserEvents
IanBenzMaxim 0:33d4e66780c0 258 @{
IanBenzMaxim 0:33d4e66780c0 259
IanBenzMaxim 0:33d4e66780c0 260 */
IanBenzMaxim 0:33d4e66780c0 261
IanBenzMaxim 0:33d4e66780c0 262
IanBenzMaxim 0:33d4e66780c0 263 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 264 /* Macro declarations for Host Driver version */
IanBenzMaxim 0:33d4e66780c0 265 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 266 #define SL_DRIVER_VERSION "1.0.1.6"
IanBenzMaxim 0:33d4e66780c0 267 #define SL_MAJOR_VERSION_NUM 1L
IanBenzMaxim 0:33d4e66780c0 268 #define SL_MINOR_VERSION_NUM 0L
IanBenzMaxim 0:33d4e66780c0 269 #define SL_VERSION_NUM 1L
IanBenzMaxim 0:33d4e66780c0 270 #define SL_SUB_VERSION_NUM 6L
IanBenzMaxim 0:33d4e66780c0 271
IanBenzMaxim 0:33d4e66780c0 272
IanBenzMaxim 0:33d4e66780c0 273 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 274 /* Macro declarations for predefined configurations */
IanBenzMaxim 0:33d4e66780c0 275 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 276
IanBenzMaxim 0:33d4e66780c0 277 #ifdef SL_TINY
IanBenzMaxim 0:33d4e66780c0 278
IanBenzMaxim 0:33d4e66780c0 279 #undef SL_INC_ARG_CHECK
IanBenzMaxim 0:33d4e66780c0 280 #undef SL_INC_EXT_API
IanBenzMaxim 0:33d4e66780c0 281 #undef SL_INC_SOCK_SERVER_SIDE_API
IanBenzMaxim 0:33d4e66780c0 282 #undef SL_INC_WLAN_PKG
IanBenzMaxim 0:33d4e66780c0 283 #undef SL_INC_NET_CFG_PKG
IanBenzMaxim 0:33d4e66780c0 284 #undef SL_INC_FS_PKG
IanBenzMaxim 0:33d4e66780c0 285 #undef SL_INC_SET_UART_MODE
IanBenzMaxim 0:33d4e66780c0 286 #undef SL_INC_NVMEM_PKG
IanBenzMaxim 0:33d4e66780c0 287 #define SL_INC_STD_BSD_API_NAMING
IanBenzMaxim 0:33d4e66780c0 288 #define SL_INC_SOCK_CLIENT_SIDE_API
IanBenzMaxim 0:33d4e66780c0 289 #define SL_INC_SOCK_RECV_API
IanBenzMaxim 0:33d4e66780c0 290 #define SL_INC_SOCK_SEND_API
IanBenzMaxim 0:33d4e66780c0 291 #define SL_INC_SOCKET_PKG
IanBenzMaxim 0:33d4e66780c0 292 #define SL_INC_NET_APP_PKG
IanBenzMaxim 0:33d4e66780c0 293
IanBenzMaxim 0:33d4e66780c0 294 #endif
IanBenzMaxim 0:33d4e66780c0 295
IanBenzMaxim 0:33d4e66780c0 296 #ifdef SL_SMALL
IanBenzMaxim 0:33d4e66780c0 297 #undef SL_INC_EXT_API
IanBenzMaxim 0:33d4e66780c0 298 #undef SL_INC_NET_APP_PKG
IanBenzMaxim 0:33d4e66780c0 299 #undef SL_INC_NET_CFG_PKG
IanBenzMaxim 0:33d4e66780c0 300 #undef SL_INC_FS_PKG
IanBenzMaxim 0:33d4e66780c0 301 #define SL_INC_ARG_CHECK
IanBenzMaxim 0:33d4e66780c0 302 #define SL_INC_WLAN_PKG
IanBenzMaxim 0:33d4e66780c0 303 #define SL_INC_SOCKET_PKG
IanBenzMaxim 0:33d4e66780c0 304 #define SL_INC_SOCK_CLIENT_SIDE_API
IanBenzMaxim 0:33d4e66780c0 305 #define SL_INC_SOCK_SERVER_SIDE_API
IanBenzMaxim 0:33d4e66780c0 306 #define SL_INC_SOCK_RECV_API
IanBenzMaxim 0:33d4e66780c0 307 #define SL_INC_SOCK_SEND_API
IanBenzMaxim 0:33d4e66780c0 308 #define SL_INC_SET_UART_MODE
IanBenzMaxim 0:33d4e66780c0 309 #endif
IanBenzMaxim 0:33d4e66780c0 310
IanBenzMaxim 0:33d4e66780c0 311 #ifdef SL_FULL
IanBenzMaxim 0:33d4e66780c0 312 #define SL_INC_EXT_API
IanBenzMaxim 0:33d4e66780c0 313 #define SL_INC_NET_APP_PKG
IanBenzMaxim 0:33d4e66780c0 314 #define SL_INC_NET_CFG_PKG
IanBenzMaxim 0:33d4e66780c0 315 #define SL_INC_FS_PKG
IanBenzMaxim 0:33d4e66780c0 316 #define SL_INC_ARG_CHECK
IanBenzMaxim 0:33d4e66780c0 317 #define SL_INC_WLAN_PKG
IanBenzMaxim 0:33d4e66780c0 318 #define SL_INC_SOCKET_PKG
IanBenzMaxim 0:33d4e66780c0 319 #define SL_INC_SOCK_CLIENT_SIDE_API
IanBenzMaxim 0:33d4e66780c0 320 #define SL_INC_SOCK_SERVER_SIDE_API
IanBenzMaxim 0:33d4e66780c0 321 #define SL_INC_SOCK_RECV_API
IanBenzMaxim 0:33d4e66780c0 322 #define SL_INC_SOCK_SEND_API
IanBenzMaxim 0:33d4e66780c0 323 #define SL_INC_SET_UART_MODE
IanBenzMaxim 0:33d4e66780c0 324 #endif
IanBenzMaxim 0:33d4e66780c0 325
IanBenzMaxim 0:33d4e66780c0 326 #define SL_RET_CODE_OK (0)
IanBenzMaxim 0:33d4e66780c0 327 #define SL_RET_CODE_INVALID_INPUT (-2)
IanBenzMaxim 0:33d4e66780c0 328 #define SL_RET_CODE_SELF_ERROR (-3)
IanBenzMaxim 0:33d4e66780c0 329 #define SL_RET_CODE_NWP_IF_ERROR (-4)
IanBenzMaxim 0:33d4e66780c0 330 #define SL_RET_CODE_MALLOC_ERROR (-5)
IanBenzMaxim 0:33d4e66780c0 331 #define SL_RET_CODE_ABORT (-6)
IanBenzMaxim 0:33d4e66780c0 332 #define SL_RET_CODE_PROTOCOL_ERROR (-7)
IanBenzMaxim 0:33d4e66780c0 333
IanBenzMaxim 0:33d4e66780c0 334
IanBenzMaxim 0:33d4e66780c0 335 /* #define sl_Memcpy memcpy */
IanBenzMaxim 0:33d4e66780c0 336 #define sl_Memset(addr, val, len) memset(addr, val, (size_t)len)
IanBenzMaxim 0:33d4e66780c0 337 #define sl_Memcpy(dest, src, len) memcpy(dest, src, (size_t)len)
IanBenzMaxim 0:33d4e66780c0 338
IanBenzMaxim 0:33d4e66780c0 339 #ifndef SL_TINY_EXT
IanBenzMaxim 0:33d4e66780c0 340 #define SL_MAX_SOCKETS (_u8)(8)
IanBenzMaxim 0:33d4e66780c0 341 #else
IanBenzMaxim 0:33d4e66780c0 342 #define SL_MAX_SOCKETS (_u8)(2)
IanBenzMaxim 0:33d4e66780c0 343 #endif
IanBenzMaxim 0:33d4e66780c0 344
IanBenzMaxim 0:33d4e66780c0 345
IanBenzMaxim 0:33d4e66780c0 346 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 347 /* Types definitions */
IanBenzMaxim 0:33d4e66780c0 348 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 349
IanBenzMaxim 0:33d4e66780c0 350 #ifndef NULL
IanBenzMaxim 0:33d4e66780c0 351 #define NULL (0)
IanBenzMaxim 0:33d4e66780c0 352 #endif
IanBenzMaxim 0:33d4e66780c0 353
IanBenzMaxim 0:33d4e66780c0 354 #ifndef FALSE
IanBenzMaxim 0:33d4e66780c0 355 #define FALSE (0)
IanBenzMaxim 0:33d4e66780c0 356 #endif
IanBenzMaxim 0:33d4e66780c0 357
IanBenzMaxim 0:33d4e66780c0 358 #ifndef TRUE
IanBenzMaxim 0:33d4e66780c0 359 #define TRUE (!FALSE)
IanBenzMaxim 0:33d4e66780c0 360 #endif
IanBenzMaxim 0:33d4e66780c0 361
IanBenzMaxim 0:33d4e66780c0 362 #ifndef OK
IanBenzMaxim 0:33d4e66780c0 363 #define OK (0)
IanBenzMaxim 0:33d4e66780c0 364 #endif
IanBenzMaxim 0:33d4e66780c0 365
IanBenzMaxim 0:33d4e66780c0 366 typedef _u16 _SlOpcode_t;
IanBenzMaxim 0:33d4e66780c0 367 typedef _u8 _SlArgSize_t;
IanBenzMaxim 0:33d4e66780c0 368 typedef _i16 _SlDataSize_t;
IanBenzMaxim 0:33d4e66780c0 369 typedef _i16 _SlReturnVal_t;
IanBenzMaxim 0:33d4e66780c0 370
IanBenzMaxim 0:33d4e66780c0 371 #ifdef __cplusplus
IanBenzMaxim 0:33d4e66780c0 372 }
IanBenzMaxim 0:33d4e66780c0 373 #endif /* __cplusplus */
IanBenzMaxim 0:33d4e66780c0 374
IanBenzMaxim 0:33d4e66780c0 375
IanBenzMaxim 0:33d4e66780c0 376
IanBenzMaxim 0:33d4e66780c0 377 /*
IanBenzMaxim 0:33d4e66780c0 378 * This event status used to block or continue the event propagation
IanBenzMaxim 0:33d4e66780c0 379 * through all the registered external libs/user application
IanBenzMaxim 0:33d4e66780c0 380 *
IanBenzMaxim 0:33d4e66780c0 381 */
IanBenzMaxim 0:33d4e66780c0 382
IanBenzMaxim 0:33d4e66780c0 383 typedef enum {
IanBenzMaxim 0:33d4e66780c0 384 EVENT_PROPAGATION_BLOCK = 0,
IanBenzMaxim 0:33d4e66780c0 385 EVENT_PROPAGATION_CONTINUE
IanBenzMaxim 0:33d4e66780c0 386
IanBenzMaxim 0:33d4e66780c0 387 } _SlEventPropogationStatus_e;
IanBenzMaxim 0:33d4e66780c0 388
IanBenzMaxim 0:33d4e66780c0 389
IanBenzMaxim 0:33d4e66780c0 390
IanBenzMaxim 0:33d4e66780c0 391
IanBenzMaxim 0:33d4e66780c0 392
IanBenzMaxim 0:33d4e66780c0 393
IanBenzMaxim 0:33d4e66780c0 394 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 395 /* Include files */
IanBenzMaxim 0:33d4e66780c0 396 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 397
IanBenzMaxim 0:33d4e66780c0 398
IanBenzMaxim 0:33d4e66780c0 399 /*
IanBenzMaxim 0:33d4e66780c0 400 objInclusion.h and user.h must be included before all api header files
IanBenzMaxim 0:33d4e66780c0 401 objInclusion.h must be the last arrangement just before including the API header files
IanBenzMaxim 0:33d4e66780c0 402 since it based on the other configurations to decide which object should be included
IanBenzMaxim 0:33d4e66780c0 403 */
IanBenzMaxim 0:33d4e66780c0 404 #include "../source/objInclusion.h"
IanBenzMaxim 0:33d4e66780c0 405 #include "trace.h"
IanBenzMaxim 0:33d4e66780c0 406 #include "fs.h"
IanBenzMaxim 0:33d4e66780c0 407 #include "socket.h"
IanBenzMaxim 0:33d4e66780c0 408 #include "netapp.h"
IanBenzMaxim 0:33d4e66780c0 409 #include "wlan.h"
IanBenzMaxim 0:33d4e66780c0 410 #include "device.h"
IanBenzMaxim 0:33d4e66780c0 411 #include "netcfg.h"
IanBenzMaxim 0:33d4e66780c0 412 #include "wlan_rx_filters.h"
IanBenzMaxim 0:33d4e66780c0 413
IanBenzMaxim 0:33d4e66780c0 414
IanBenzMaxim 0:33d4e66780c0 415 /* The general events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 416 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 417 #ifdef sl_GeneralEvtHdlr
IanBenzMaxim 0:33d4e66780c0 418 #define _SlDrvHandleGeneralEvents sl_GeneralEvtHdlr
IanBenzMaxim 0:33d4e66780c0 419 #endif
IanBenzMaxim 0:33d4e66780c0 420
IanBenzMaxim 0:33d4e66780c0 421 /* The wlan events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 422 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 423 #ifdef sl_WlanEvtHdlr
IanBenzMaxim 0:33d4e66780c0 424 #define _SlDrvHandleWlanEvents sl_WlanEvtHdlr
IanBenzMaxim 0:33d4e66780c0 425 #endif
IanBenzMaxim 0:33d4e66780c0 426
IanBenzMaxim 0:33d4e66780c0 427 /* The NetApp events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 428 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 429 #ifdef sl_NetAppEvtHdlr
IanBenzMaxim 0:33d4e66780c0 430 #define _SlDrvHandleNetAppEvents sl_NetAppEvtHdlr
IanBenzMaxim 0:33d4e66780c0 431 #endif
IanBenzMaxim 0:33d4e66780c0 432
IanBenzMaxim 0:33d4e66780c0 433 /* The http server events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 434 * initialized to the user handler if exists */
IanBenzMaxim 0:33d4e66780c0 435 #ifdef sl_HttpServerCallback
IanBenzMaxim 0:33d4e66780c0 436 #define _SlDrvHandleHttpServerEvents sl_HttpServerCallback
IanBenzMaxim 0:33d4e66780c0 437 #endif
IanBenzMaxim 0:33d4e66780c0 438
IanBenzMaxim 0:33d4e66780c0 439 /* The socket events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 440 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 441 #ifdef sl_SockEvtHdlr
IanBenzMaxim 0:33d4e66780c0 442 #define _SlDrvHandleSockEvents sl_SockEvtHdlr
IanBenzMaxim 0:33d4e66780c0 443 #endif
IanBenzMaxim 0:33d4e66780c0 444
IanBenzMaxim 0:33d4e66780c0 445
IanBenzMaxim 0:33d4e66780c0 446
IanBenzMaxim 0:33d4e66780c0 447 #define __CONCAT(x,y) x ## y
IanBenzMaxim 0:33d4e66780c0 448 #define __CONCAT2(x,y) __CONCAT(x,y)
IanBenzMaxim 0:33d4e66780c0 449
IanBenzMaxim 0:33d4e66780c0 450
IanBenzMaxim 0:33d4e66780c0 451 /*
IanBenzMaxim 0:33d4e66780c0 452 * The section below handles the external lib event registration
IanBenzMaxim 0:33d4e66780c0 453 * according to the desired events it specified in its API header file.
IanBenzMaxim 0:33d4e66780c0 454 * The external lib should be first installed by the user (see user.h)
IanBenzMaxim 0:33d4e66780c0 455 */
IanBenzMaxim 0:33d4e66780c0 456 #ifdef SL_EXT_LIB_1
IanBenzMaxim 0:33d4e66780c0 457
IanBenzMaxim 0:33d4e66780c0 458 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 459 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 460 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 461 #define SlExtLib1GeneralEventHandler __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 462
IanBenzMaxim 0:33d4e66780c0 463 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 464 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 465 #endif
IanBenzMaxim 0:33d4e66780c0 466
IanBenzMaxim 0:33d4e66780c0 467 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 468 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 469 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 470 #define SlExtLib1WlanEventHandler __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 471
IanBenzMaxim 0:33d4e66780c0 472 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 473 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 474 #endif
IanBenzMaxim 0:33d4e66780c0 475
IanBenzMaxim 0:33d4e66780c0 476 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 477 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 478 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 479 #define SlExtLib1NetAppEventHandler __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 480
IanBenzMaxim 0:33d4e66780c0 481 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 482 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 483 #endif
IanBenzMaxim 0:33d4e66780c0 484
IanBenzMaxim 0:33d4e66780c0 485 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 486 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 487 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 488 #define SlExtLib1HttpServerEventHandler __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 489
IanBenzMaxim 0:33d4e66780c0 490 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 491 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 492 #endif
IanBenzMaxim 0:33d4e66780c0 493
IanBenzMaxim 0:33d4e66780c0 494 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 495 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 496 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 497 #define SlExtLib1SockEventHandler __CONCAT2(SL_EXT_LIB_1, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 498
IanBenzMaxim 0:33d4e66780c0 499 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 500 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 501 #endif
IanBenzMaxim 0:33d4e66780c0 502
IanBenzMaxim 0:33d4e66780c0 503 #endif
IanBenzMaxim 0:33d4e66780c0 504
IanBenzMaxim 0:33d4e66780c0 505
IanBenzMaxim 0:33d4e66780c0 506 #ifdef SL_EXT_LIB_2
IanBenzMaxim 0:33d4e66780c0 507
IanBenzMaxim 0:33d4e66780c0 508 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 509 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 510 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 511 #define SlExtLib2GeneralEventHandler __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 512
IanBenzMaxim 0:33d4e66780c0 513 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 514 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 515 #endif
IanBenzMaxim 0:33d4e66780c0 516
IanBenzMaxim 0:33d4e66780c0 517 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 518 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 519 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 520 #define SlExtLib2WlanEventHandler __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 521
IanBenzMaxim 0:33d4e66780c0 522 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 523 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 524 #endif
IanBenzMaxim 0:33d4e66780c0 525
IanBenzMaxim 0:33d4e66780c0 526 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 527 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 528 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 529 #define SlExtLib2NetAppEventHandler __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 530
IanBenzMaxim 0:33d4e66780c0 531 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 532 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 533 #endif
IanBenzMaxim 0:33d4e66780c0 534
IanBenzMaxim 0:33d4e66780c0 535 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 536 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 537 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 538 #define SlExtLib2HttpServerEventHandler __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 539
IanBenzMaxim 0:33d4e66780c0 540 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 541 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 542 #endif
IanBenzMaxim 0:33d4e66780c0 543
IanBenzMaxim 0:33d4e66780c0 544 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 545 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 546 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 547 #define SlExtLib2SockEventHandler __CONCAT2(SL_EXT_LIB_2, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 548
IanBenzMaxim 0:33d4e66780c0 549 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 550 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 551 #endif
IanBenzMaxim 0:33d4e66780c0 552
IanBenzMaxim 0:33d4e66780c0 553 #endif
IanBenzMaxim 0:33d4e66780c0 554
IanBenzMaxim 0:33d4e66780c0 555
IanBenzMaxim 0:33d4e66780c0 556 #ifdef SL_EXT_LIB_3
IanBenzMaxim 0:33d4e66780c0 557
IanBenzMaxim 0:33d4e66780c0 558 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 559 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 560 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 561 #define SlExtLib3GeneralEventHandler __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 562
IanBenzMaxim 0:33d4e66780c0 563 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 564 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 565 #endif
IanBenzMaxim 0:33d4e66780c0 566
IanBenzMaxim 0:33d4e66780c0 567 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 568 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 569 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 570 #define SlExtLib3WlanEventHandler __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 571
IanBenzMaxim 0:33d4e66780c0 572 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 573 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 574 #endif
IanBenzMaxim 0:33d4e66780c0 575
IanBenzMaxim 0:33d4e66780c0 576 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 577 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 578 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 579 #define SlExtLib3NetAppEventHandler __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 580
IanBenzMaxim 0:33d4e66780c0 581 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 582 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 583 #endif
IanBenzMaxim 0:33d4e66780c0 584
IanBenzMaxim 0:33d4e66780c0 585 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 586 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 587 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 588 #define SlExtLib3HttpServerEventHandler __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 589
IanBenzMaxim 0:33d4e66780c0 590 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 591 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 592 #endif
IanBenzMaxim 0:33d4e66780c0 593
IanBenzMaxim 0:33d4e66780c0 594 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 595 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 596 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 597 #define SlExtLib3SockEventHandler __CONCAT2(SL_EXT_LIB_3, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 598
IanBenzMaxim 0:33d4e66780c0 599 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 600 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 601 #endif
IanBenzMaxim 0:33d4e66780c0 602
IanBenzMaxim 0:33d4e66780c0 603 #endif
IanBenzMaxim 0:33d4e66780c0 604
IanBenzMaxim 0:33d4e66780c0 605
IanBenzMaxim 0:33d4e66780c0 606 #ifdef SL_EXT_LIB_4
IanBenzMaxim 0:33d4e66780c0 607
IanBenzMaxim 0:33d4e66780c0 608 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 609 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 610 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 611 #define SlExtLib4GeneralEventHandler __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 612
IanBenzMaxim 0:33d4e66780c0 613 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 614 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 615 #endif
IanBenzMaxim 0:33d4e66780c0 616
IanBenzMaxim 0:33d4e66780c0 617 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 618 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 619 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 620 #define SlExtLib4WlanEventHandler __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 621
IanBenzMaxim 0:33d4e66780c0 622 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 623 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 624 #endif
IanBenzMaxim 0:33d4e66780c0 625
IanBenzMaxim 0:33d4e66780c0 626 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 627 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 628 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 629 #define SlExtLib4NetAppEventHandler __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 630
IanBenzMaxim 0:33d4e66780c0 631 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 632 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 633 #endif
IanBenzMaxim 0:33d4e66780c0 634
IanBenzMaxim 0:33d4e66780c0 635 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 636 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 637 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 638 #define SlExtLib4HttpServerEventHandler __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 639
IanBenzMaxim 0:33d4e66780c0 640 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 641 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 642 #endif
IanBenzMaxim 0:33d4e66780c0 643
IanBenzMaxim 0:33d4e66780c0 644 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 645 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 646 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 647 #define SlExtLib4SockEventHandler __CONCAT2(SL_EXT_LIB_4, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 648
IanBenzMaxim 0:33d4e66780c0 649 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 650 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 651 #endif
IanBenzMaxim 0:33d4e66780c0 652
IanBenzMaxim 0:33d4e66780c0 653 #endif
IanBenzMaxim 0:33d4e66780c0 654
IanBenzMaxim 0:33d4e66780c0 655
IanBenzMaxim 0:33d4e66780c0 656 #ifdef SL_EXT_LIB_5
IanBenzMaxim 0:33d4e66780c0 657
IanBenzMaxim 0:33d4e66780c0 658 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 659 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 660 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 661 #define SlExtLib5GeneralEventHandler __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 662
IanBenzMaxim 0:33d4e66780c0 663 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 664 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 665 #endif
IanBenzMaxim 0:33d4e66780c0 666
IanBenzMaxim 0:33d4e66780c0 667 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 668 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 669 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 670 #define SlExtLib5WlanEventHandler __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 671
IanBenzMaxim 0:33d4e66780c0 672 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 673 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 674 #endif
IanBenzMaxim 0:33d4e66780c0 675
IanBenzMaxim 0:33d4e66780c0 676 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 677 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 678 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 679 #define SlExtLib5NetAppEventHandler __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 680
IanBenzMaxim 0:33d4e66780c0 681 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 682 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 683 #endif
IanBenzMaxim 0:33d4e66780c0 684
IanBenzMaxim 0:33d4e66780c0 685 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 686 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 687 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 688 #define SlExtLib5HttpServerEventHandler __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 689
IanBenzMaxim 0:33d4e66780c0 690 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 691 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 692 #endif
IanBenzMaxim 0:33d4e66780c0 693
IanBenzMaxim 0:33d4e66780c0 694 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 695 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 696 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 697 #define SlExtLib5SockEventHandler __CONCAT2(SL_EXT_LIB_5, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 698
IanBenzMaxim 0:33d4e66780c0 699 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 700 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 701 #endif
IanBenzMaxim 0:33d4e66780c0 702
IanBenzMaxim 0:33d4e66780c0 703 #endif
IanBenzMaxim 0:33d4e66780c0 704
IanBenzMaxim 0:33d4e66780c0 705
IanBenzMaxim 0:33d4e66780c0 706
IanBenzMaxim 0:33d4e66780c0 707 #if defined(EXT_LIB_REGISTERED_GENERAL_EVENTS)
IanBenzMaxim 0:33d4e66780c0 708 extern void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *slGeneralEvent);
IanBenzMaxim 0:33d4e66780c0 709 #endif
IanBenzMaxim 0:33d4e66780c0 710
IanBenzMaxim 0:33d4e66780c0 711 #if defined(EXT_LIB_REGISTERED_WLAN_EVENTS)
IanBenzMaxim 0:33d4e66780c0 712 extern void _SlDrvHandleWlanEvents(SlWlanEvent_t *slWlanEvent);
IanBenzMaxim 0:33d4e66780c0 713 #endif
IanBenzMaxim 0:33d4e66780c0 714
IanBenzMaxim 0:33d4e66780c0 715 #if defined (EXT_LIB_REGISTERED_NETAPP_EVENTS)
IanBenzMaxim 0:33d4e66780c0 716 extern void _SlDrvHandleNetAppEvents(SlNetAppEvent_t *slNetAppEvent);
IanBenzMaxim 0:33d4e66780c0 717 #endif
IanBenzMaxim 0:33d4e66780c0 718
IanBenzMaxim 0:33d4e66780c0 719 #if defined(EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS)
IanBenzMaxim 0:33d4e66780c0 720 extern void _SlDrvHandleHttpServerEvents(SlHttpServerEvent_t *slHttpServerEvent, SlHttpServerResponse_t *slHttpServerResponse);
IanBenzMaxim 0:33d4e66780c0 721 #endif
IanBenzMaxim 0:33d4e66780c0 722
IanBenzMaxim 0:33d4e66780c0 723
IanBenzMaxim 0:33d4e66780c0 724 #if defined(EXT_LIB_REGISTERED_SOCK_EVENTS)
IanBenzMaxim 0:33d4e66780c0 725 extern void _SlDrvHandleSockEvents(SlSockEvent_t *slSockEvent);
IanBenzMaxim 0:33d4e66780c0 726 #endif
IanBenzMaxim 0:33d4e66780c0 727
IanBenzMaxim 0:33d4e66780c0 728
IanBenzMaxim 0:33d4e66780c0 729 typedef short (*_SlSpawnEntryFunc_t)(void* pValue);
IanBenzMaxim 0:33d4e66780c0 730
IanBenzMaxim 0:33d4e66780c0 731 #define SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER (0X1)
IanBenzMaxim 0:33d4e66780c0 732
IanBenzMaxim 0:33d4e66780c0 733 #ifdef SL_PLATFORM_MULTI_THREADED
IanBenzMaxim 0:33d4e66780c0 734 #include "../source/spawn.h"
IanBenzMaxim 0:33d4e66780c0 735 #else
IanBenzMaxim 0:33d4e66780c0 736 #include "../source/nonos.h"
IanBenzMaxim 0:33d4e66780c0 737 #endif
IanBenzMaxim 0:33d4e66780c0 738
IanBenzMaxim 0:33d4e66780c0 739
IanBenzMaxim 0:33d4e66780c0 740
IanBenzMaxim 0:33d4e66780c0 741 /* Async functions description*/
IanBenzMaxim 0:33d4e66780c0 742
IanBenzMaxim 0:33d4e66780c0 743 /*!
IanBenzMaxim 0:33d4e66780c0 744 \brief General async event for inspecting general events
IanBenzMaxim 0:33d4e66780c0 745
IanBenzMaxim 0:33d4e66780c0 746 \param[out] pSlDeviceEvent pointer to SlDeviceEvent_t
IanBenzMaxim 0:33d4e66780c0 747
IanBenzMaxim 0:33d4e66780c0 748 \par
IanBenzMaxim 0:33d4e66780c0 749 Parameters: \n
IanBenzMaxim 0:33d4e66780c0 750 - <b>pSlDeviceEvent->Event = SL_DEVICE_FATAL_ERROR_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 751 - pSlDeviceEvent->EventData.deviceEvent fields:
IanBenzMaxim 0:33d4e66780c0 752 - status: An error code indication from the device
IanBenzMaxim 0:33d4e66780c0 753 - sender: The sender originator which is based on SlErrorSender_e enum
IanBenzMaxim 0:33d4e66780c0 754
IanBenzMaxim 0:33d4e66780c0 755 - <b>pSlDeviceEvent->Event = SL_DEVICE_ABORT_ERROR_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 756 Indicates a severe error occured and the device stopped
IanBenzMaxim 0:33d4e66780c0 757 - pSlDeviceEvent->EventData.deviceReport fields:
IanBenzMaxim 0:33d4e66780c0 758 - AbortType: An idication of the event type
IanBenzMaxim 0:33d4e66780c0 759 - AbortData: Additional info about the data error
IanBenzMaxim 0:33d4e66780c0 760
IanBenzMaxim 0:33d4e66780c0 761
IanBenzMaxim 0:33d4e66780c0 762 \par Example for fatal error:
IanBenzMaxim 0:33d4e66780c0 763 \code
IanBenzMaxim 0:33d4e66780c0 764 printf(General Event Handler - ID=%d Sender=%d\n\n",
IanBenzMaxim 0:33d4e66780c0 765 pSlDeviceEvent->EventData.deviceEvent.status, // status of the general event
IanBenzMaxim 0:33d4e66780c0 766 pSlDeviceEvent->EventData.deviceEvent.sender); // sender type
IanBenzMaxim 0:33d4e66780c0 767 \endcode
IanBenzMaxim 0:33d4e66780c0 768 \par Example for abort request:
IanBenzMaxim 0:33d4e66780c0 769 \code
IanBenzMaxim 0:33d4e66780c0 770 printf(Abort type =%d Abort Data=%d\n\n",
IanBenzMaxim 0:33d4e66780c0 771 pSlDeviceEvent->EventData.deviceReport.AbortType,
IanBenzMaxim 0:33d4e66780c0 772 pSlDeviceEvent->EventData.deviceReport.AbortData);
IanBenzMaxim 0:33d4e66780c0 773
IanBenzMaxim 0:33d4e66780c0 774 \endcode
IanBenzMaxim 0:33d4e66780c0 775 */
IanBenzMaxim 0:33d4e66780c0 776 extern void sl_GeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent);
IanBenzMaxim 0:33d4e66780c0 777
IanBenzMaxim 0:33d4e66780c0 778
IanBenzMaxim 0:33d4e66780c0 779 /*!
IanBenzMaxim 0:33d4e66780c0 780 \brief WLAN Async event handler
IanBenzMaxim 0:33d4e66780c0 781
IanBenzMaxim 0:33d4e66780c0 782 \param[out] pSlWlanEvent pointer to SlWlanEvent_t data
IanBenzMaxim 0:33d4e66780c0 783
IanBenzMaxim 0:33d4e66780c0 784 \par
IanBenzMaxim 0:33d4e66780c0 785 Parameters:
IanBenzMaxim 0:33d4e66780c0 786
IanBenzMaxim 0:33d4e66780c0 787 - <b>pSlWlanEvent->Event = SL_WLAN_CONNECT_EVENT </b>, STA or P2P client connection indication event
IanBenzMaxim 0:33d4e66780c0 788 - pSlWlanEvent->EventData.STAandP2PModeWlanConnected main fields:
IanBenzMaxim 0:33d4e66780c0 789 - ssid_name
IanBenzMaxim 0:33d4e66780c0 790 - ssid_len
IanBenzMaxim 0:33d4e66780c0 791 - bssid
IanBenzMaxim 0:33d4e66780c0 792 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 793 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 794
IanBenzMaxim 0:33d4e66780c0 795 - <b>pSlWlanEvent->Event = SL_WLAN_DISCONNECT_EVENT </b>, STA or P2P client disconnection event
IanBenzMaxim 0:33d4e66780c0 796 - pSlWlanEvent->EventData.STAandP2PModeDisconnected main fields:
IanBenzMaxim 0:33d4e66780c0 797 - ssid_name
IanBenzMaxim 0:33d4e66780c0 798 - ssid_len
IanBenzMaxim 0:33d4e66780c0 799 - reason_code
IanBenzMaxim 0:33d4e66780c0 800
IanBenzMaxim 0:33d4e66780c0 801 - <b>pSlWlanEvent->Event = SL_WLAN_STA_CONNECTED_EVENT </b>, AP/P2P(Go) connected STA/P2P(Client)
IanBenzMaxim 0:33d4e66780c0 802 - pSlWlanEvent->EventData.APModeStaConnected fields:
IanBenzMaxim 0:33d4e66780c0 803 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 804 - mac
IanBenzMaxim 0:33d4e66780c0 805 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 806 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 807 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 808 - own_ssid_len: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 809
IanBenzMaxim 0:33d4e66780c0 810 - <b>pSlWlanEvent->Event = SL_WLAN_STA_DISCONNECTED_EVENT </b>, AP/P2P(Go) disconnected STA/P2P(Client)
IanBenzMaxim 0:33d4e66780c0 811 - pSlWlanEvent->EventData.APModestaDisconnected fields:
IanBenzMaxim 0:33d4e66780c0 812 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 813 - mac
IanBenzMaxim 0:33d4e66780c0 814 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 815 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 816 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 817 - own_ssid_len: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 818
IanBenzMaxim 0:33d4e66780c0 819 - <b>pSlWlanEvent->Event = SL_WLAN_SMART_CONFIG_COMPLETE_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 820 - pSlWlanEvent->EventData.smartConfigStartResponse fields:
IanBenzMaxim 0:33d4e66780c0 821 - status
IanBenzMaxim 0:33d4e66780c0 822 - ssid_len
IanBenzMaxim 0:33d4e66780c0 823 - ssid
IanBenzMaxim 0:33d4e66780c0 824 - private_token_len
IanBenzMaxim 0:33d4e66780c0 825 - private_token
IanBenzMaxim 0:33d4e66780c0 826
IanBenzMaxim 0:33d4e66780c0 827 - <b>pSlWlanEvent->Event = SL_WLAN_SMART_CONFIG_STOP_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 828 - pSlWlanEvent->EventData.smartConfigStopResponse fields:
IanBenzMaxim 0:33d4e66780c0 829 - status
IanBenzMaxim 0:33d4e66780c0 830
IanBenzMaxim 0:33d4e66780c0 831 - <b>pSlWlanEvent->Event = SL_WLAN_P2P_DEV_FOUND_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 832 - pSlWlanEvent->EventData.P2PModeDevFound fields:
IanBenzMaxim 0:33d4e66780c0 833 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 834 - mac
IanBenzMaxim 0:33d4e66780c0 835 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 836 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 837 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 838 - own_ssid_len: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 839
IanBenzMaxim 0:33d4e66780c0 840 - <b>pSlWlanEvent->Event = SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 841 - pSlWlanEvent->EventData.P2PModeNegReqReceived fields
IanBenzMaxim 0:33d4e66780c0 842 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 843 - mac
IanBenzMaxim 0:33d4e66780c0 844 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 845 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 846 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 847
IanBenzMaxim 0:33d4e66780c0 848 - <b>pSlWlanEvent->Event = SL_WLAN_CONNECTION_FAILED_EVENT </b>, P2P only
IanBenzMaxim 0:33d4e66780c0 849 - pSlWlanEvent->EventData.P2PModewlanConnectionFailure fields:
IanBenzMaxim 0:33d4e66780c0 850 - status
IanBenzMaxim 0:33d4e66780c0 851 */
IanBenzMaxim 0:33d4e66780c0 852 #if (defined(sl_WlanEvtHdlr))
IanBenzMaxim 0:33d4e66780c0 853 extern void sl_WlanEvtHdlr(SlWlanEvent_t* pSlWlanEvent);
IanBenzMaxim 0:33d4e66780c0 854 #endif
IanBenzMaxim 0:33d4e66780c0 855
IanBenzMaxim 0:33d4e66780c0 856
IanBenzMaxim 0:33d4e66780c0 857 /*!
IanBenzMaxim 0:33d4e66780c0 858 \brief NETAPP Async event handler
IanBenzMaxim 0:33d4e66780c0 859
IanBenzMaxim 0:33d4e66780c0 860 \param[out] pSlNetApp pointer to SlNetAppEvent_t data
IanBenzMaxim 0:33d4e66780c0 861
IanBenzMaxim 0:33d4e66780c0 862 \par
IanBenzMaxim 0:33d4e66780c0 863 Parameters:
IanBenzMaxim 0:33d4e66780c0 864 - <b>pSlNetApp->Event = SL_NETAPP_IPV4_IPACQUIRED_EVENT</b>, IPV4 acquired event
IanBenzMaxim 0:33d4e66780c0 865 - pSlNetApp->EventData.ipAcquiredV4 fields:
IanBenzMaxim 0:33d4e66780c0 866 - ip
IanBenzMaxim 0:33d4e66780c0 867 - gateway
IanBenzMaxim 0:33d4e66780c0 868 - dns
IanBenzMaxim 0:33d4e66780c0 869
IanBenzMaxim 0:33d4e66780c0 870 - <b>pSlNetApp->Event = SL_NETAPP_IP_LEASED_EVENT</b>, AP or P2P go dhcp lease event
IanBenzMaxim 0:33d4e66780c0 871 - pSlNetApp->EventData.ipLeased fields:
IanBenzMaxim 0:33d4e66780c0 872 - ip_address
IanBenzMaxim 0:33d4e66780c0 873 - lease_time
IanBenzMaxim 0:33d4e66780c0 874 - mac
IanBenzMaxim 0:33d4e66780c0 875
IanBenzMaxim 0:33d4e66780c0 876 - <b>pSlNetApp->Event = SL_NETAPP_IP_RELEASED_EVENT</b>, AP or P2P go dhcp ip release event
IanBenzMaxim 0:33d4e66780c0 877 - pSlNetApp->EventData.ipReleased fields
IanBenzMaxim 0:33d4e66780c0 878 - ip_address
IanBenzMaxim 0:33d4e66780c0 879 - mac
IanBenzMaxim 0:33d4e66780c0 880 - reason
IanBenzMaxim 0:33d4e66780c0 881
IanBenzMaxim 0:33d4e66780c0 882 */
IanBenzMaxim 0:33d4e66780c0 883 #if (defined(sl_NetAppEvtHdlr))
IanBenzMaxim 0:33d4e66780c0 884 extern void sl_NetAppEvtHdlr(SlNetAppEvent_t* pSlNetApp);
IanBenzMaxim 0:33d4e66780c0 885 #endif
IanBenzMaxim 0:33d4e66780c0 886
IanBenzMaxim 0:33d4e66780c0 887 /*!
IanBenzMaxim 0:33d4e66780c0 888 \brief Socket Async event handler
IanBenzMaxim 0:33d4e66780c0 889
IanBenzMaxim 0:33d4e66780c0 890 \param[out] pSlSockEvent pointer to SlSockEvent_t data
IanBenzMaxim 0:33d4e66780c0 891
IanBenzMaxim 0:33d4e66780c0 892 \par
IanBenzMaxim 0:33d4e66780c0 893 Parameters:\n
IanBenzMaxim 0:33d4e66780c0 894 - <b>pSlSockEvent->Event = SL_SOCKET_TX_FAILED_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 895 - pSlSockEvent->SockTxFailData fields:
IanBenzMaxim 0:33d4e66780c0 896 - sd
IanBenzMaxim 0:33d4e66780c0 897 - status
IanBenzMaxim 0:33d4e66780c0 898 - <b>pSlSockEvent->Event = SL_SOCKET_ASYNC_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 899 - pSlSockEvent->SockAsyncData fields:
IanBenzMaxim 0:33d4e66780c0 900 - sd
IanBenzMaxim 0:33d4e66780c0 901 - type: SSL_ACCEPT or RX_FRAGMENTATION_TOO_BIG or OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED
IanBenzMaxim 0:33d4e66780c0 902 - val
IanBenzMaxim 0:33d4e66780c0 903
IanBenzMaxim 0:33d4e66780c0 904 */
IanBenzMaxim 0:33d4e66780c0 905 #if (defined(sl_SockEvtHdlr))
IanBenzMaxim 0:33d4e66780c0 906 extern void sl_SockEvtHdlr(SlSockEvent_t* pSlSockEvent);
IanBenzMaxim 0:33d4e66780c0 907 #endif
IanBenzMaxim 0:33d4e66780c0 908
IanBenzMaxim 0:33d4e66780c0 909 /*!
IanBenzMaxim 0:33d4e66780c0 910 \brief HTTP server async event
IanBenzMaxim 0:33d4e66780c0 911
IanBenzMaxim 0:33d4e66780c0 912 \param[out] pSlHttpServerEvent pointer to SlHttpServerEvent_t
IanBenzMaxim 0:33d4e66780c0 913 \param[in] pSlHttpServerResponse pointer to SlHttpServerResponse_t
IanBenzMaxim 0:33d4e66780c0 914
IanBenzMaxim 0:33d4e66780c0 915 \par
IanBenzMaxim 0:33d4e66780c0 916 Parameters: \n
IanBenzMaxim 0:33d4e66780c0 917
IanBenzMaxim 0:33d4e66780c0 918 - <b>pSlHttpServerEvent->Event = SL_NETAPP_HTTPGETTOKENVALUE_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 919 - pSlHttpServerEvent->EventData fields:
IanBenzMaxim 0:33d4e66780c0 920 - httpTokenName
IanBenzMaxim 0:33d4e66780c0 921 - data
IanBenzMaxim 0:33d4e66780c0 922 - len
IanBenzMaxim 0:33d4e66780c0 923 - pSlHttpServerResponse->ResponseData fields:
IanBenzMaxim 0:33d4e66780c0 924 - data
IanBenzMaxim 0:33d4e66780c0 925 - len
IanBenzMaxim 0:33d4e66780c0 926
IanBenzMaxim 0:33d4e66780c0 927 - <b>pSlHttpServerEvent->Event = SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 928 - pSlHttpServerEvent->EventData.httpPostData fields:
IanBenzMaxim 0:33d4e66780c0 929 - action
IanBenzMaxim 0:33d4e66780c0 930 - token_name
IanBenzMaxim 0:33d4e66780c0 931 - token_value
IanBenzMaxim 0:33d4e66780c0 932 - pSlHttpServerResponse->ResponseData fields:
IanBenzMaxim 0:33d4e66780c0 933 - data
IanBenzMaxim 0:33d4e66780c0 934 - len
IanBenzMaxim 0:33d4e66780c0 935
IanBenzMaxim 0:33d4e66780c0 936 */
IanBenzMaxim 0:33d4e66780c0 937 #if (defined(sl_HttpServerCallback))
IanBenzMaxim 0:33d4e66780c0 938 extern void sl_HttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, SlHttpServerResponse_t *pSlHttpServerResponse);
IanBenzMaxim 0:33d4e66780c0 939 #endif
IanBenzMaxim 0:33d4e66780c0 940
IanBenzMaxim 0:33d4e66780c0 941
IanBenzMaxim 0:33d4e66780c0 942
IanBenzMaxim 0:33d4e66780c0 943
IanBenzMaxim 0:33d4e66780c0 944 /*!
IanBenzMaxim 0:33d4e66780c0 945 \brief SL get timestamp routine.
IanBenzMaxim 0:33d4e66780c0 946 It returns the timer counter value in ticks unit.
IanBenzMaxim 0:33d4e66780c0 947 The counter must count from zero to its max value
IanBenzMaxim 0:33d4e66780c0 948
IanBenzMaxim 0:33d4e66780c0 949 \par
IanBenzMaxim 0:33d4e66780c0 950 Parameters: \n
IanBenzMaxim 0:33d4e66780c0 951
IanBenzMaxim 0:33d4e66780c0 952 */
IanBenzMaxim 0:33d4e66780c0 953 #if defined (sl_GetTimestamp)
IanBenzMaxim 0:33d4e66780c0 954 extern _u32 sl_GetTimestamp(void);
IanBenzMaxim 0:33d4e66780c0 955 #endif
IanBenzMaxim 0:33d4e66780c0 956
IanBenzMaxim 0:33d4e66780c0 957 /*!
IanBenzMaxim 0:33d4e66780c0 958
IanBenzMaxim 0:33d4e66780c0 959 Close the Doxygen group.
IanBenzMaxim 0:33d4e66780c0 960 @}
IanBenzMaxim 0:33d4e66780c0 961
IanBenzMaxim 0:33d4e66780c0 962 */
IanBenzMaxim 0:33d4e66780c0 963
IanBenzMaxim 0:33d4e66780c0 964 #ifdef __cplusplus
IanBenzMaxim 0:33d4e66780c0 965 }
IanBenzMaxim 0:33d4e66780c0 966 #endif /* __cplusplus */
IanBenzMaxim 0:33d4e66780c0 967
IanBenzMaxim 0:33d4e66780c0 968 #endif /* __SIMPLELINK_H__ */
IanBenzMaxim 0:33d4e66780c0 969