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
IanBenzMaxim 0:33d4e66780c0 372
IanBenzMaxim 0:33d4e66780c0 373 /*
IanBenzMaxim 0:33d4e66780c0 374 * This event status used to block or continue the event propagation
IanBenzMaxim 0:33d4e66780c0 375 * through all the registered external libs/user application
IanBenzMaxim 0:33d4e66780c0 376 *
IanBenzMaxim 0:33d4e66780c0 377 */
IanBenzMaxim 0:33d4e66780c0 378
IanBenzMaxim 0:33d4e66780c0 379 typedef enum {
IanBenzMaxim 0:33d4e66780c0 380 EVENT_PROPAGATION_BLOCK = 0,
IanBenzMaxim 0:33d4e66780c0 381 EVENT_PROPAGATION_CONTINUE
IanBenzMaxim 0:33d4e66780c0 382
IanBenzMaxim 0:33d4e66780c0 383 } _SlEventPropogationStatus_e;
IanBenzMaxim 0:33d4e66780c0 384
IanBenzMaxim 0:33d4e66780c0 385
IanBenzMaxim 0:33d4e66780c0 386
IanBenzMaxim 0:33d4e66780c0 387
IanBenzMaxim 0:33d4e66780c0 388
IanBenzMaxim 0:33d4e66780c0 389
IanBenzMaxim 0:33d4e66780c0 390 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 391 /* Include files */
IanBenzMaxim 0:33d4e66780c0 392 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 393
IanBenzMaxim 0:33d4e66780c0 394
IanBenzMaxim 0:33d4e66780c0 395 /*
IanBenzMaxim 0:33d4e66780c0 396 objInclusion.h and user.h must be included before all api header files
IanBenzMaxim 0:33d4e66780c0 397 objInclusion.h must be the last arrangement just before including the API header files
IanBenzMaxim 0:33d4e66780c0 398 since it based on the other configurations to decide which object should be included
IanBenzMaxim 0:33d4e66780c0 399 */
IanBenzMaxim 0:33d4e66780c0 400 #include "../source/objInclusion.h"
IanBenzMaxim 0:33d4e66780c0 401 #include "trace.h"
IanBenzMaxim 0:33d4e66780c0 402 #include "fs.h"
IanBenzMaxim 0:33d4e66780c0 403 #include "socket.h"
IanBenzMaxim 0:33d4e66780c0 404 #include "netapp.h"
IanBenzMaxim 0:33d4e66780c0 405 #include "wlan.h"
IanBenzMaxim 0:33d4e66780c0 406 #include "device.h"
IanBenzMaxim 0:33d4e66780c0 407 #include "netcfg.h"
IanBenzMaxim 0:33d4e66780c0 408 #include "wlan_rx_filters.h"
IanBenzMaxim 0:33d4e66780c0 409
IanBenzMaxim 0:33d4e66780c0 410
IanBenzMaxim 0:33d4e66780c0 411 /* The general events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 412 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 413 #ifdef sl_GeneralEvtHdlr
IanBenzMaxim 0:33d4e66780c0 414 #define _SlDrvHandleGeneralEvents sl_GeneralEvtHdlr
IanBenzMaxim 0:33d4e66780c0 415 #endif
IanBenzMaxim 0:33d4e66780c0 416
IanBenzMaxim 0:33d4e66780c0 417 /* The wlan events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 418 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 419 #ifdef sl_WlanEvtHdlr
IanBenzMaxim 0:33d4e66780c0 420 #define _SlDrvHandleWlanEvents sl_WlanEvtHdlr
IanBenzMaxim 0:33d4e66780c0 421 #endif
IanBenzMaxim 0:33d4e66780c0 422
IanBenzMaxim 0:33d4e66780c0 423 /* The NetApp events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 424 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 425 #ifdef sl_NetAppEvtHdlr
IanBenzMaxim 0:33d4e66780c0 426 #define _SlDrvHandleNetAppEvents sl_NetAppEvtHdlr
IanBenzMaxim 0:33d4e66780c0 427 #endif
IanBenzMaxim 0:33d4e66780c0 428
IanBenzMaxim 0:33d4e66780c0 429 /* The http server events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 430 * initialized to the user handler if exists */
IanBenzMaxim 0:33d4e66780c0 431 #ifdef sl_HttpServerCallback
IanBenzMaxim 0:33d4e66780c0 432 #define _SlDrvHandleHttpServerEvents sl_HttpServerCallback
IanBenzMaxim 0:33d4e66780c0 433 #endif
IanBenzMaxim 0:33d4e66780c0 434
IanBenzMaxim 0:33d4e66780c0 435 /* The socket events dispatcher which is
IanBenzMaxim 0:33d4e66780c0 436 * initialized to the user handler */
IanBenzMaxim 0:33d4e66780c0 437 #ifdef sl_SockEvtHdlr
IanBenzMaxim 0:33d4e66780c0 438 #define _SlDrvHandleSockEvents sl_SockEvtHdlr
IanBenzMaxim 0:33d4e66780c0 439 #endif
IanBenzMaxim 0:33d4e66780c0 440
IanBenzMaxim 0:33d4e66780c0 441
IanBenzMaxim 0:33d4e66780c0 442
IanBenzMaxim 0:33d4e66780c0 443 #define __CONCAT(x,y) x ## y
IanBenzMaxim 0:33d4e66780c0 444 #define __CONCAT2(x,y) __CONCAT(x,y)
IanBenzMaxim 0:33d4e66780c0 445
IanBenzMaxim 0:33d4e66780c0 446
IanBenzMaxim 0:33d4e66780c0 447 /*
IanBenzMaxim 0:33d4e66780c0 448 * The section below handles the external lib event registration
IanBenzMaxim 0:33d4e66780c0 449 * according to the desired events it specified in its API header file.
IanBenzMaxim 0:33d4e66780c0 450 * The external lib should be first installed by the user (see user.h)
IanBenzMaxim 0:33d4e66780c0 451 */
IanBenzMaxim 0:33d4e66780c0 452 #ifdef SL_EXT_LIB_1
IanBenzMaxim 0:33d4e66780c0 453
IanBenzMaxim 0:33d4e66780c0 454 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 455 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 456 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 457 #define SlExtLib1GeneralEventHandler __CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 458
IanBenzMaxim 0:33d4e66780c0 459 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 460 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 461 #endif
IanBenzMaxim 0:33d4e66780c0 462
IanBenzMaxim 0:33d4e66780c0 463 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 464 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 465 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 466 #define SlExtLib1WlanEventHandler __CONCAT2(SL_EXT_LIB_1, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 467
IanBenzMaxim 0:33d4e66780c0 468 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 469 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 470 #endif
IanBenzMaxim 0:33d4e66780c0 471
IanBenzMaxim 0:33d4e66780c0 472 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 473 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 474 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 475 #define SlExtLib1NetAppEventHandler __CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 476
IanBenzMaxim 0:33d4e66780c0 477 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 478 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 479 #endif
IanBenzMaxim 0:33d4e66780c0 480
IanBenzMaxim 0:33d4e66780c0 481 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 482 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 483 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 484 #define SlExtLib1HttpServerEventHandler __CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 485
IanBenzMaxim 0:33d4e66780c0 486 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 487 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 488 #endif
IanBenzMaxim 0:33d4e66780c0 489
IanBenzMaxim 0:33d4e66780c0 490 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 491 #if __CONCAT2(SL_EXT_LIB_1, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 492 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_1, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 493 #define SlExtLib1SockEventHandler __CONCAT2(SL_EXT_LIB_1, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 494
IanBenzMaxim 0:33d4e66780c0 495 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 496 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 497 #endif
IanBenzMaxim 0:33d4e66780c0 498
IanBenzMaxim 0:33d4e66780c0 499 #endif
IanBenzMaxim 0:33d4e66780c0 500
IanBenzMaxim 0:33d4e66780c0 501
IanBenzMaxim 0:33d4e66780c0 502 #ifdef SL_EXT_LIB_2
IanBenzMaxim 0:33d4e66780c0 503
IanBenzMaxim 0:33d4e66780c0 504 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 505 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 506 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 507 #define SlExtLib2GeneralEventHandler __CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 508
IanBenzMaxim 0:33d4e66780c0 509 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 510 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 511 #endif
IanBenzMaxim 0:33d4e66780c0 512
IanBenzMaxim 0:33d4e66780c0 513 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 514 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 515 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 516 #define SlExtLib2WlanEventHandler __CONCAT2(SL_EXT_LIB_2, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 517
IanBenzMaxim 0:33d4e66780c0 518 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 519 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 520 #endif
IanBenzMaxim 0:33d4e66780c0 521
IanBenzMaxim 0:33d4e66780c0 522 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 523 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 524 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 525 #define SlExtLib2NetAppEventHandler __CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 526
IanBenzMaxim 0:33d4e66780c0 527 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 528 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 529 #endif
IanBenzMaxim 0:33d4e66780c0 530
IanBenzMaxim 0:33d4e66780c0 531 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 532 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 533 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 534 #define SlExtLib2HttpServerEventHandler __CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 535
IanBenzMaxim 0:33d4e66780c0 536 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 537 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 538 #endif
IanBenzMaxim 0:33d4e66780c0 539
IanBenzMaxim 0:33d4e66780c0 540 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 541 #if __CONCAT2(SL_EXT_LIB_2, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 542 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_2, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 543 #define SlExtLib2SockEventHandler __CONCAT2(SL_EXT_LIB_2, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 544
IanBenzMaxim 0:33d4e66780c0 545 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 546 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 547 #endif
IanBenzMaxim 0:33d4e66780c0 548
IanBenzMaxim 0:33d4e66780c0 549 #endif
IanBenzMaxim 0:33d4e66780c0 550
IanBenzMaxim 0:33d4e66780c0 551
IanBenzMaxim 0:33d4e66780c0 552 #ifdef SL_EXT_LIB_3
IanBenzMaxim 0:33d4e66780c0 553
IanBenzMaxim 0:33d4e66780c0 554 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 555 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 556 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 557 #define SlExtLib3GeneralEventHandler __CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 558
IanBenzMaxim 0:33d4e66780c0 559 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 560 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 561 #endif
IanBenzMaxim 0:33d4e66780c0 562
IanBenzMaxim 0:33d4e66780c0 563 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 564 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 565 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 566 #define SlExtLib3WlanEventHandler __CONCAT2(SL_EXT_LIB_3, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 567
IanBenzMaxim 0:33d4e66780c0 568 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 569 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 570 #endif
IanBenzMaxim 0:33d4e66780c0 571
IanBenzMaxim 0:33d4e66780c0 572 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 573 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 574 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 575 #define SlExtLib3NetAppEventHandler __CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 576
IanBenzMaxim 0:33d4e66780c0 577 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 578 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 579 #endif
IanBenzMaxim 0:33d4e66780c0 580
IanBenzMaxim 0:33d4e66780c0 581 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 582 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 583 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 584 #define SlExtLib3HttpServerEventHandler __CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 585
IanBenzMaxim 0:33d4e66780c0 586 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 587 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 588 #endif
IanBenzMaxim 0:33d4e66780c0 589
IanBenzMaxim 0:33d4e66780c0 590 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 591 #if __CONCAT2(SL_EXT_LIB_3, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 592 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_3, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 593 #define SlExtLib3SockEventHandler __CONCAT2(SL_EXT_LIB_3, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 594
IanBenzMaxim 0:33d4e66780c0 595 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 596 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 597 #endif
IanBenzMaxim 0:33d4e66780c0 598
IanBenzMaxim 0:33d4e66780c0 599 #endif
IanBenzMaxim 0:33d4e66780c0 600
IanBenzMaxim 0:33d4e66780c0 601
IanBenzMaxim 0:33d4e66780c0 602 #ifdef SL_EXT_LIB_4
IanBenzMaxim 0:33d4e66780c0 603
IanBenzMaxim 0:33d4e66780c0 604 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 605 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 606 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 607 #define SlExtLib4GeneralEventHandler __CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 608
IanBenzMaxim 0:33d4e66780c0 609 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 610 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 611 #endif
IanBenzMaxim 0:33d4e66780c0 612
IanBenzMaxim 0:33d4e66780c0 613 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 614 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 615 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 616 #define SlExtLib4WlanEventHandler __CONCAT2(SL_EXT_LIB_4, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 617
IanBenzMaxim 0:33d4e66780c0 618 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 619 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 620 #endif
IanBenzMaxim 0:33d4e66780c0 621
IanBenzMaxim 0:33d4e66780c0 622 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 623 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 624 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 625 #define SlExtLib4NetAppEventHandler __CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 626
IanBenzMaxim 0:33d4e66780c0 627 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 628 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 629 #endif
IanBenzMaxim 0:33d4e66780c0 630
IanBenzMaxim 0:33d4e66780c0 631 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 632 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 633 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 634 #define SlExtLib4HttpServerEventHandler __CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 635
IanBenzMaxim 0:33d4e66780c0 636 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 637 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 638 #endif
IanBenzMaxim 0:33d4e66780c0 639
IanBenzMaxim 0:33d4e66780c0 640 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 641 #if __CONCAT2(SL_EXT_LIB_4, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 642 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_4, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 643 #define SlExtLib4SockEventHandler __CONCAT2(SL_EXT_LIB_4, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 644
IanBenzMaxim 0:33d4e66780c0 645 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 646 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 647 #endif
IanBenzMaxim 0:33d4e66780c0 648
IanBenzMaxim 0:33d4e66780c0 649 #endif
IanBenzMaxim 0:33d4e66780c0 650
IanBenzMaxim 0:33d4e66780c0 651
IanBenzMaxim 0:33d4e66780c0 652 #ifdef SL_EXT_LIB_5
IanBenzMaxim 0:33d4e66780c0 653
IanBenzMaxim 0:33d4e66780c0 654 /* General Event Registration */
IanBenzMaxim 0:33d4e66780c0 655 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_GENERAL_EVENT)
IanBenzMaxim 0:33d4e66780c0 656 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl) (SlDeviceEvent_t *);
IanBenzMaxim 0:33d4e66780c0 657 #define SlExtLib5GeneralEventHandler __CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl)
IanBenzMaxim 0:33d4e66780c0 658
IanBenzMaxim 0:33d4e66780c0 659 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 660 #define EXT_LIB_REGISTERED_GENERAL_EVENTS
IanBenzMaxim 0:33d4e66780c0 661 #endif
IanBenzMaxim 0:33d4e66780c0 662
IanBenzMaxim 0:33d4e66780c0 663 /* Wlan Event Registration */
IanBenzMaxim 0:33d4e66780c0 664 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_WLAN_EVENT)
IanBenzMaxim 0:33d4e66780c0 665 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl) (SlWlanEvent_t *);
IanBenzMaxim 0:33d4e66780c0 666 #define SlExtLib5WlanEventHandler __CONCAT2(SL_EXT_LIB_5, _WlanEventHdl)
IanBenzMaxim 0:33d4e66780c0 667
IanBenzMaxim 0:33d4e66780c0 668 #undef EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 669 #define EXT_LIB_REGISTERED_WLAN_EVENTS
IanBenzMaxim 0:33d4e66780c0 670 #endif
IanBenzMaxim 0:33d4e66780c0 671
IanBenzMaxim 0:33d4e66780c0 672 /* NetApp Event Registration */
IanBenzMaxim 0:33d4e66780c0 673 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_NETAPP_EVENT)
IanBenzMaxim 0:33d4e66780c0 674 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl) (SlNetAppEvent_t *);
IanBenzMaxim 0:33d4e66780c0 675 #define SlExtLib5NetAppEventHandler __CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl)
IanBenzMaxim 0:33d4e66780c0 676
IanBenzMaxim 0:33d4e66780c0 677 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 678 #define EXT_LIB_REGISTERED_NETAPP_EVENTS
IanBenzMaxim 0:33d4e66780c0 679 #endif
IanBenzMaxim 0:33d4e66780c0 680
IanBenzMaxim 0:33d4e66780c0 681 /* Http Server Event Registration */
IanBenzMaxim 0:33d4e66780c0 682 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_HTTP_SERVER_EVENT)
IanBenzMaxim 0:33d4e66780c0 683 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl) (SlHttpServerEvent_t* , SlHttpServerResponse_t*);
IanBenzMaxim 0:33d4e66780c0 684 #define SlExtLib5HttpServerEventHandler __CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl)
IanBenzMaxim 0:33d4e66780c0 685
IanBenzMaxim 0:33d4e66780c0 686 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 687 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS
IanBenzMaxim 0:33d4e66780c0 688 #endif
IanBenzMaxim 0:33d4e66780c0 689
IanBenzMaxim 0:33d4e66780c0 690 /* Socket Event Registration */
IanBenzMaxim 0:33d4e66780c0 691 #if __CONCAT2(SL_EXT_LIB_5, _NOTIFY_SOCK_EVENT)
IanBenzMaxim 0:33d4e66780c0 692 extern _SlEventPropogationStatus_e __CONCAT2(SL_EXT_LIB_5, _SockEventHdl) (SlSockEvent_t *);
IanBenzMaxim 0:33d4e66780c0 693 #define SlExtLib5SockEventHandler __CONCAT2(SL_EXT_LIB_5, _SockEventHdl)
IanBenzMaxim 0:33d4e66780c0 694
IanBenzMaxim 0:33d4e66780c0 695 #undef EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 696 #define EXT_LIB_REGISTERED_SOCK_EVENTS
IanBenzMaxim 0:33d4e66780c0 697 #endif
IanBenzMaxim 0:33d4e66780c0 698
IanBenzMaxim 0:33d4e66780c0 699 #endif
IanBenzMaxim 0:33d4e66780c0 700
IanBenzMaxim 0:33d4e66780c0 701
IanBenzMaxim 0:33d4e66780c0 702
IanBenzMaxim 0:33d4e66780c0 703 #if defined(EXT_LIB_REGISTERED_GENERAL_EVENTS)
IanBenzMaxim 0:33d4e66780c0 704 extern void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *slGeneralEvent);
IanBenzMaxim 0:33d4e66780c0 705 #endif
IanBenzMaxim 0:33d4e66780c0 706
IanBenzMaxim 0:33d4e66780c0 707 #if defined(EXT_LIB_REGISTERED_WLAN_EVENTS)
IanBenzMaxim 0:33d4e66780c0 708 extern void _SlDrvHandleWlanEvents(SlWlanEvent_t *slWlanEvent);
IanBenzMaxim 0:33d4e66780c0 709 #endif
IanBenzMaxim 0:33d4e66780c0 710
IanBenzMaxim 0:33d4e66780c0 711 #if defined (EXT_LIB_REGISTERED_NETAPP_EVENTS)
IanBenzMaxim 0:33d4e66780c0 712 extern void _SlDrvHandleNetAppEvents(SlNetAppEvent_t *slNetAppEvent);
IanBenzMaxim 0:33d4e66780c0 713 #endif
IanBenzMaxim 0:33d4e66780c0 714
IanBenzMaxim 0:33d4e66780c0 715 #if defined(EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS)
IanBenzMaxim 0:33d4e66780c0 716 extern void _SlDrvHandleHttpServerEvents(SlHttpServerEvent_t *slHttpServerEvent, SlHttpServerResponse_t *slHttpServerResponse);
IanBenzMaxim 0:33d4e66780c0 717 #endif
IanBenzMaxim 0:33d4e66780c0 718
IanBenzMaxim 0:33d4e66780c0 719
IanBenzMaxim 0:33d4e66780c0 720 #if defined(EXT_LIB_REGISTERED_SOCK_EVENTS)
IanBenzMaxim 0:33d4e66780c0 721 extern void _SlDrvHandleSockEvents(SlSockEvent_t *slSockEvent);
IanBenzMaxim 0:33d4e66780c0 722 #endif
IanBenzMaxim 0:33d4e66780c0 723
IanBenzMaxim 0:33d4e66780c0 724
IanBenzMaxim 0:33d4e66780c0 725 typedef short (*_SlSpawnEntryFunc_t)(void* pValue);
IanBenzMaxim 0:33d4e66780c0 726
IanBenzMaxim 0:33d4e66780c0 727 #define SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER (0X1)
IanBenzMaxim 0:33d4e66780c0 728
IanBenzMaxim 0:33d4e66780c0 729 #ifdef SL_PLATFORM_MULTI_THREADED
IanBenzMaxim 0:33d4e66780c0 730 #include "../source/spawn.h"
IanBenzMaxim 0:33d4e66780c0 731 #else
IanBenzMaxim 0:33d4e66780c0 732 #include "../source/nonos.h"
IanBenzMaxim 0:33d4e66780c0 733 #endif
IanBenzMaxim 0:33d4e66780c0 734
IanBenzMaxim 0:33d4e66780c0 735
IanBenzMaxim 0:33d4e66780c0 736
IanBenzMaxim 0:33d4e66780c0 737 /* Async functions description*/
IanBenzMaxim 0:33d4e66780c0 738
IanBenzMaxim 0:33d4e66780c0 739 /*!
IanBenzMaxim 0:33d4e66780c0 740 \brief General async event for inspecting general events
IanBenzMaxim 0:33d4e66780c0 741
IanBenzMaxim 0:33d4e66780c0 742 \param[out] pSlDeviceEvent pointer to SlDeviceEvent_t
IanBenzMaxim 0:33d4e66780c0 743
IanBenzMaxim 0:33d4e66780c0 744 \par
IanBenzMaxim 0:33d4e66780c0 745 Parameters: \n
IanBenzMaxim 0:33d4e66780c0 746 - <b>pSlDeviceEvent->Event = SL_DEVICE_FATAL_ERROR_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 747 - pSlDeviceEvent->EventData.deviceEvent fields:
IanBenzMaxim 0:33d4e66780c0 748 - status: An error code indication from the device
IanBenzMaxim 0:33d4e66780c0 749 - sender: The sender originator which is based on SlErrorSender_e enum
IanBenzMaxim 0:33d4e66780c0 750
IanBenzMaxim 0:33d4e66780c0 751 - <b>pSlDeviceEvent->Event = SL_DEVICE_ABORT_ERROR_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 752 Indicates a severe error occured and the device stopped
IanBenzMaxim 0:33d4e66780c0 753 - pSlDeviceEvent->EventData.deviceReport fields:
IanBenzMaxim 0:33d4e66780c0 754 - AbortType: An idication of the event type
IanBenzMaxim 0:33d4e66780c0 755 - AbortData: Additional info about the data error
IanBenzMaxim 0:33d4e66780c0 756
IanBenzMaxim 0:33d4e66780c0 757
IanBenzMaxim 0:33d4e66780c0 758 \par Example for fatal error:
IanBenzMaxim 0:33d4e66780c0 759 \code
IanBenzMaxim 0:33d4e66780c0 760 printf(General Event Handler - ID=%d Sender=%d\n\n",
IanBenzMaxim 0:33d4e66780c0 761 pSlDeviceEvent->EventData.deviceEvent.status, // status of the general event
IanBenzMaxim 0:33d4e66780c0 762 pSlDeviceEvent->EventData.deviceEvent.sender); // sender type
IanBenzMaxim 0:33d4e66780c0 763 \endcode
IanBenzMaxim 0:33d4e66780c0 764 \par Example for abort request:
IanBenzMaxim 0:33d4e66780c0 765 \code
IanBenzMaxim 0:33d4e66780c0 766 printf(Abort type =%d Abort Data=%d\n\n",
IanBenzMaxim 0:33d4e66780c0 767 pSlDeviceEvent->EventData.deviceReport.AbortType,
IanBenzMaxim 0:33d4e66780c0 768 pSlDeviceEvent->EventData.deviceReport.AbortData);
IanBenzMaxim 0:33d4e66780c0 769
IanBenzMaxim 0:33d4e66780c0 770 \endcode
IanBenzMaxim 0:33d4e66780c0 771 */
IanBenzMaxim 0:33d4e66780c0 772 extern void sl_GeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent);
IanBenzMaxim 0:33d4e66780c0 773
IanBenzMaxim 0:33d4e66780c0 774
IanBenzMaxim 0:33d4e66780c0 775 /*!
IanBenzMaxim 0:33d4e66780c0 776 \brief WLAN Async event handler
IanBenzMaxim 0:33d4e66780c0 777
IanBenzMaxim 0:33d4e66780c0 778 \param[out] pSlWlanEvent pointer to SlWlanEvent_t data
IanBenzMaxim 0:33d4e66780c0 779
IanBenzMaxim 0:33d4e66780c0 780 \par
IanBenzMaxim 0:33d4e66780c0 781 Parameters:
IanBenzMaxim 0:33d4e66780c0 782
IanBenzMaxim 0:33d4e66780c0 783 - <b>pSlWlanEvent->Event = SL_WLAN_CONNECT_EVENT </b>, STA or P2P client connection indication event
IanBenzMaxim 0:33d4e66780c0 784 - pSlWlanEvent->EventData.STAandP2PModeWlanConnected main fields:
IanBenzMaxim 0:33d4e66780c0 785 - ssid_name
IanBenzMaxim 0:33d4e66780c0 786 - ssid_len
IanBenzMaxim 0:33d4e66780c0 787 - bssid
IanBenzMaxim 0:33d4e66780c0 788 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 789 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 790
IanBenzMaxim 0:33d4e66780c0 791 - <b>pSlWlanEvent->Event = SL_WLAN_DISCONNECT_EVENT </b>, STA or P2P client disconnection event
IanBenzMaxim 0:33d4e66780c0 792 - pSlWlanEvent->EventData.STAandP2PModeDisconnected main fields:
IanBenzMaxim 0:33d4e66780c0 793 - ssid_name
IanBenzMaxim 0:33d4e66780c0 794 - ssid_len
IanBenzMaxim 0:33d4e66780c0 795 - reason_code
IanBenzMaxim 0:33d4e66780c0 796
IanBenzMaxim 0:33d4e66780c0 797 - <b>pSlWlanEvent->Event = SL_WLAN_STA_CONNECTED_EVENT </b>, AP/P2P(Go) connected STA/P2P(Client)
IanBenzMaxim 0:33d4e66780c0 798 - pSlWlanEvent->EventData.APModeStaConnected fields:
IanBenzMaxim 0:33d4e66780c0 799 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 800 - mac
IanBenzMaxim 0:33d4e66780c0 801 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 802 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 803 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 804 - own_ssid_len: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 805
IanBenzMaxim 0:33d4e66780c0 806 - <b>pSlWlanEvent->Event = SL_WLAN_STA_DISCONNECTED_EVENT </b>, AP/P2P(Go) disconnected STA/P2P(Client)
IanBenzMaxim 0:33d4e66780c0 807 - pSlWlanEvent->EventData.APModestaDisconnected fields:
IanBenzMaxim 0:33d4e66780c0 808 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 809 - mac
IanBenzMaxim 0:33d4e66780c0 810 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 811 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 812 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 813 - own_ssid_len: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 814
IanBenzMaxim 0:33d4e66780c0 815 - <b>pSlWlanEvent->Event = SL_WLAN_SMART_CONFIG_COMPLETE_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 816 - pSlWlanEvent->EventData.smartConfigStartResponse fields:
IanBenzMaxim 0:33d4e66780c0 817 - status
IanBenzMaxim 0:33d4e66780c0 818 - ssid_len
IanBenzMaxim 0:33d4e66780c0 819 - ssid
IanBenzMaxim 0:33d4e66780c0 820 - private_token_len
IanBenzMaxim 0:33d4e66780c0 821 - private_token
IanBenzMaxim 0:33d4e66780c0 822
IanBenzMaxim 0:33d4e66780c0 823 - <b>pSlWlanEvent->Event = SL_WLAN_SMART_CONFIG_STOP_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 824 - pSlWlanEvent->EventData.smartConfigStopResponse fields:
IanBenzMaxim 0:33d4e66780c0 825 - status
IanBenzMaxim 0:33d4e66780c0 826
IanBenzMaxim 0:33d4e66780c0 827 - <b>pSlWlanEvent->Event = SL_WLAN_P2P_DEV_FOUND_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 828 - pSlWlanEvent->EventData.P2PModeDevFound fields:
IanBenzMaxim 0:33d4e66780c0 829 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 830 - mac
IanBenzMaxim 0:33d4e66780c0 831 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 832 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 833 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 834 - own_ssid_len: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 835
IanBenzMaxim 0:33d4e66780c0 836 - <b>pSlWlanEvent->Event = SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT </b>
IanBenzMaxim 0:33d4e66780c0 837 - pSlWlanEvent->EventData.P2PModeNegReqReceived fields
IanBenzMaxim 0:33d4e66780c0 838 - go_peer_device_name
IanBenzMaxim 0:33d4e66780c0 839 - mac
IanBenzMaxim 0:33d4e66780c0 840 - go_peer_device_name_len
IanBenzMaxim 0:33d4e66780c0 841 - wps_dev_password_id
IanBenzMaxim 0:33d4e66780c0 842 - own_ssid: relevant for event sta-connected only
IanBenzMaxim 0:33d4e66780c0 843
IanBenzMaxim 0:33d4e66780c0 844 - <b>pSlWlanEvent->Event = SL_WLAN_CONNECTION_FAILED_EVENT </b>, P2P only
IanBenzMaxim 0:33d4e66780c0 845 - pSlWlanEvent->EventData.P2PModewlanConnectionFailure fields:
IanBenzMaxim 0:33d4e66780c0 846 - status
IanBenzMaxim 0:33d4e66780c0 847 */
IanBenzMaxim 0:33d4e66780c0 848 #if (defined(sl_WlanEvtHdlr))
IanBenzMaxim 0:33d4e66780c0 849 extern void sl_WlanEvtHdlr(SlWlanEvent_t* pSlWlanEvent);
IanBenzMaxim 0:33d4e66780c0 850 #endif
IanBenzMaxim 0:33d4e66780c0 851
IanBenzMaxim 0:33d4e66780c0 852
IanBenzMaxim 0:33d4e66780c0 853 /*!
IanBenzMaxim 0:33d4e66780c0 854 \brief NETAPP Async event handler
IanBenzMaxim 0:33d4e66780c0 855
IanBenzMaxim 0:33d4e66780c0 856 \param[out] pSlNetApp pointer to SlNetAppEvent_t data
IanBenzMaxim 0:33d4e66780c0 857
IanBenzMaxim 0:33d4e66780c0 858 \par
IanBenzMaxim 0:33d4e66780c0 859 Parameters:
IanBenzMaxim 0:33d4e66780c0 860 - <b>pSlNetApp->Event = SL_NETAPP_IPV4_IPACQUIRED_EVENT</b>, IPV4 acquired event
IanBenzMaxim 0:33d4e66780c0 861 - pSlNetApp->EventData.ipAcquiredV4 fields:
IanBenzMaxim 0:33d4e66780c0 862 - ip
IanBenzMaxim 0:33d4e66780c0 863 - gateway
IanBenzMaxim 0:33d4e66780c0 864 - dns
IanBenzMaxim 0:33d4e66780c0 865
IanBenzMaxim 0:33d4e66780c0 866 - <b>pSlNetApp->Event = SL_NETAPP_IP_LEASED_EVENT</b>, AP or P2P go dhcp lease event
IanBenzMaxim 0:33d4e66780c0 867 - pSlNetApp->EventData.ipLeased fields:
IanBenzMaxim 0:33d4e66780c0 868 - ip_address
IanBenzMaxim 0:33d4e66780c0 869 - lease_time
IanBenzMaxim 0:33d4e66780c0 870 - mac
IanBenzMaxim 0:33d4e66780c0 871
IanBenzMaxim 0:33d4e66780c0 872 - <b>pSlNetApp->Event = SL_NETAPP_IP_RELEASED_EVENT</b>, AP or P2P go dhcp ip release event
IanBenzMaxim 0:33d4e66780c0 873 - pSlNetApp->EventData.ipReleased fields
IanBenzMaxim 0:33d4e66780c0 874 - ip_address
IanBenzMaxim 0:33d4e66780c0 875 - mac
IanBenzMaxim 0:33d4e66780c0 876 - reason
IanBenzMaxim 0:33d4e66780c0 877
IanBenzMaxim 0:33d4e66780c0 878 */
IanBenzMaxim 0:33d4e66780c0 879 #if (defined(sl_NetAppEvtHdlr))
IanBenzMaxim 0:33d4e66780c0 880 extern void sl_NetAppEvtHdlr(SlNetAppEvent_t* pSlNetApp);
IanBenzMaxim 0:33d4e66780c0 881 #endif
IanBenzMaxim 0:33d4e66780c0 882
IanBenzMaxim 0:33d4e66780c0 883 /*!
IanBenzMaxim 0:33d4e66780c0 884 \brief Socket Async event handler
IanBenzMaxim 0:33d4e66780c0 885
IanBenzMaxim 0:33d4e66780c0 886 \param[out] pSlSockEvent pointer to SlSockEvent_t data
IanBenzMaxim 0:33d4e66780c0 887
IanBenzMaxim 0:33d4e66780c0 888 \par
IanBenzMaxim 0:33d4e66780c0 889 Parameters:\n
IanBenzMaxim 0:33d4e66780c0 890 - <b>pSlSockEvent->Event = SL_SOCKET_TX_FAILED_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 891 - pSlSockEvent->SockTxFailData fields:
IanBenzMaxim 0:33d4e66780c0 892 - sd
IanBenzMaxim 0:33d4e66780c0 893 - status
IanBenzMaxim 0:33d4e66780c0 894 - <b>pSlSockEvent->Event = SL_SOCKET_ASYNC_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 895 - pSlSockEvent->SockAsyncData fields:
IanBenzMaxim 0:33d4e66780c0 896 - sd
IanBenzMaxim 0:33d4e66780c0 897 - type: SSL_ACCEPT or RX_FRAGMENTATION_TOO_BIG or OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED
IanBenzMaxim 0:33d4e66780c0 898 - val
IanBenzMaxim 0:33d4e66780c0 899
IanBenzMaxim 0:33d4e66780c0 900 */
IanBenzMaxim 0:33d4e66780c0 901 #if (defined(sl_SockEvtHdlr))
IanBenzMaxim 0:33d4e66780c0 902 extern void sl_SockEvtHdlr(SlSockEvent_t* pSlSockEvent);
IanBenzMaxim 0:33d4e66780c0 903 #endif
IanBenzMaxim 0:33d4e66780c0 904
IanBenzMaxim 0:33d4e66780c0 905 /*!
IanBenzMaxim 0:33d4e66780c0 906 \brief HTTP server async event
IanBenzMaxim 0:33d4e66780c0 907
IanBenzMaxim 0:33d4e66780c0 908 \param[out] pSlHttpServerEvent pointer to SlHttpServerEvent_t
IanBenzMaxim 0:33d4e66780c0 909 \param[in] pSlHttpServerResponse pointer to SlHttpServerResponse_t
IanBenzMaxim 0:33d4e66780c0 910
IanBenzMaxim 0:33d4e66780c0 911 \par
IanBenzMaxim 0:33d4e66780c0 912 Parameters: \n
IanBenzMaxim 0:33d4e66780c0 913
IanBenzMaxim 0:33d4e66780c0 914 - <b>pSlHttpServerEvent->Event = SL_NETAPP_HTTPGETTOKENVALUE_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 915 - pSlHttpServerEvent->EventData fields:
IanBenzMaxim 0:33d4e66780c0 916 - httpTokenName
IanBenzMaxim 0:33d4e66780c0 917 - data
IanBenzMaxim 0:33d4e66780c0 918 - len
IanBenzMaxim 0:33d4e66780c0 919 - pSlHttpServerResponse->ResponseData fields:
IanBenzMaxim 0:33d4e66780c0 920 - data
IanBenzMaxim 0:33d4e66780c0 921 - len
IanBenzMaxim 0:33d4e66780c0 922
IanBenzMaxim 0:33d4e66780c0 923 - <b>pSlHttpServerEvent->Event = SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT</b>
IanBenzMaxim 0:33d4e66780c0 924 - pSlHttpServerEvent->EventData.httpPostData fields:
IanBenzMaxim 0:33d4e66780c0 925 - action
IanBenzMaxim 0:33d4e66780c0 926 - token_name
IanBenzMaxim 0:33d4e66780c0 927 - token_value
IanBenzMaxim 0:33d4e66780c0 928 - pSlHttpServerResponse->ResponseData fields:
IanBenzMaxim 0:33d4e66780c0 929 - data
IanBenzMaxim 0:33d4e66780c0 930 - len
IanBenzMaxim 0:33d4e66780c0 931
IanBenzMaxim 0:33d4e66780c0 932 */
IanBenzMaxim 0:33d4e66780c0 933 #if (defined(sl_HttpServerCallback))
IanBenzMaxim 0:33d4e66780c0 934 extern void sl_HttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, SlHttpServerResponse_t *pSlHttpServerResponse);
IanBenzMaxim 0:33d4e66780c0 935 #endif
IanBenzMaxim 0:33d4e66780c0 936
IanBenzMaxim 0:33d4e66780c0 937
IanBenzMaxim 0:33d4e66780c0 938
IanBenzMaxim 0:33d4e66780c0 939
IanBenzMaxim 0:33d4e66780c0 940 /*!
IanBenzMaxim 0:33d4e66780c0 941 \brief SL get timestamp routine.
IanBenzMaxim 0:33d4e66780c0 942 It returns the timer counter value in ticks unit.
IanBenzMaxim 0:33d4e66780c0 943 The counter must count from zero to its max value
IanBenzMaxim 0:33d4e66780c0 944
IanBenzMaxim 0:33d4e66780c0 945 \par
IanBenzMaxim 0:33d4e66780c0 946 Parameters: \n
IanBenzMaxim 0:33d4e66780c0 947
IanBenzMaxim 0:33d4e66780c0 948 */
IanBenzMaxim 0:33d4e66780c0 949 #if defined (sl_GetTimestamp)
IanBenzMaxim 0:33d4e66780c0 950 extern _u32 sl_GetTimestamp(void);
IanBenzMaxim 0:33d4e66780c0 951 #endif
IanBenzMaxim 0:33d4e66780c0 952
IanBenzMaxim 0:33d4e66780c0 953 /*!
IanBenzMaxim 0:33d4e66780c0 954
IanBenzMaxim 0:33d4e66780c0 955 Close the Doxygen group.
IanBenzMaxim 0:33d4e66780c0 956 @}
IanBenzMaxim 0:33d4e66780c0 957
IanBenzMaxim 0:33d4e66780c0 958 */
IanBenzMaxim 0:33d4e66780c0 959
IanBenzMaxim 0:33d4e66780c0 960 #ifdef __cplusplus
IanBenzMaxim 0:33d4e66780c0 961 }
IanBenzMaxim 0:33d4e66780c0 962 #endif /* __cplusplus */
IanBenzMaxim 0:33d4e66780c0 963
IanBenzMaxim 0:33d4e66780c0 964 #endif /* __SIMPLELINK_H__ */
IanBenzMaxim 0:33d4e66780c0 965