1 /* 2 * simplelink.h - CC31xx/CC32xx Host Driver Implementation 3 * 4 * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ 5 * 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 14 * Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the 17 * distribution. 18 * 19 * Neither the name of Texas Instruments Incorporated nor the names of 20 * its contributors may be used to endorse or promote products derived 21 * from this software without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 * 35 */ 36 37 38 /*! 39 \mainpage SimpleLink Driver 40 41 \section intro_sec Introduction 42 43 The SimpleLink(tm) CC31xx/CC32xx family allows to add Wi-Fi and networking capabilities 44 to low-cost embedded products without having prior Wi-Fi, RF or networking expertise.\n 45 The CC31xx/CC32xx is an ideal solution for microcontroller-based sensor and control 46 applications such as home appliances, home automation and smart metering.\n 47 The CC31xx/CC32xx has integrated a comprehensive TCP/IP network stack, Wi-Fi driver and 48 security supplicant leading to easier portability to microcontrollers, to an 49 ultra-low memory footprint, all without compromising the capabilities and robustness 50 of the final application. 51 52 53 54 \section modules_sec Module Names 55 To make it simple, TI's SimpleLink CC31xx/CC32xx platform capabilities were divided into modules by topic (Silo).\n 56 These capabilities range from basic device management through wireless 57 network configuration, standard BSD socket and much more.\n 58 Listed below are the various modules in the SimpleLink CC31xx/CC32xx driver: 59 -# \ref Device - Controls the behaviour of the CC31xx/CC32xx device (start/stop, events masking and obtaining specific device status) 60 -# \ref FileSystem - Provides file system capabilities to TI's CC31XX that can be used by both the CC31XX device and the user. 61 -# \ref NetApp - Activates networking applications, such as: HTTP Server, DHCP Server, Ping, DNS and mDNS. 62 -# \ref NetCfg - Controls the configuration of the device addresses (i.e. IP and MAC addresses) 63 -# \ref NetUtil - Networking related commands and configuration 64 -# \ref Socket - Controls standard client/server sockets programming options and capabilities 65 -# \ref Wlan - Controls the use of the WiFi WLAN module including: 66 - Connection features, such as: profiles, policies, SmartConfig(tm) 67 - Advanced WLAN features, such as: scans, rx filters and rx statistics collection 68 -# \ref UserEvents - Function prototypes for event callback handlers 69 70 \section persistency_sec Persistency 71 The SimpleLink(tm) device support few different persistency types for settings and configurations:\n 72 - <b>Temporary</b> - Effective immediately but returned to default after reset\n 73 - <b>System Persistent</b> - Effective immediately and kept after reset according\n 74 to system persistent mode\n 75 - <b>Persistent</b> - Effective immediately and kept after reset regardless the system persistent mode\n 76 - <b>Optionally Persistent</b> - Effective immediately and kept after reset according to a parameter in the API call\n 77 - <b>Reset</b> - Persistent but effective only after reset\n 78 \n 79 For all Set/Get function in this guide, the type of persistency per relevant parameters will be 80 described as part of the function description\n 81 82 \section proting_sec Porting Guide 83 84 The porting of the SimpleLink host driver to any new platform is based on few simple steps.\n 85 This guide takes you through this process step by step. Please follow the instructions 86 carefully to avoid any problems during this process and to enable efficient and proper 87 work with the device.\n 88 Please notice that all modifications and porting adjustments of the driver should be 89 made in the user.h header file only. Keeping this method ensure smoothly 90 transaction to new versions of the driver in the future!\n 91 92 The porting process consists of few simple steps: 93 -# Create user.h for the target platform 94 -# Select the capabilities set 95 -# Bind the device enable/disable line 96 -# Writing your interface communication driver 97 -# Choose your memory management model 98 -# OS adaptation 99 -# Set your asynchronous event handlers 100 -# Testing 101 102 For host interface details please refer to: 103 http://processors.wiki.ti.com/index.php/CC31xx_Host_Interface 104 105 Please see the rest of the page for more details about the different steps. 106 107 \subsection porting_step1 Step 1 - Create your own user.h file 108 109 The first step is to create a <b><i>user.h</i></b> file that will include your configurations and 110 adjustments. \n 111 The file should be located in the porting directory (the porting directory is in the same level as the source directory)\n 112 It is recommended to use the empty template provided as part of this driver or 113 file of other platform such as MSP432 or CC32xx, from one of the wide range 114 of example applications provided by Texas Instruments. 115 116 \subsection porting_step2 Step 2 - Bind the device enable/disable output line 117 118 The CC31xx has two external hardware lines that can be used to enable/disable the device. 119 - <b>nReset</b> 120 - <b>nHib</b> - provides mechanism to enter the device into the least current consumption mode. In 121 this mode the RTC value is kept. 122 123 The driver manipulates the enable/disable line automatically during sl_Start / sl_Stop.\n 124 Not connecting one these lines means that the driver could start only once (sl_Stop will not 125 work correctly and might lead to failure latter on) and the internal provisioning mechanism 126 could not be used.\n 127 128 To bind these lines the following defines should be defined correctly: 129 - <b>sl_DeviceEnable</b> 130 - <b>sl_DeviceDisable</b> 131 132 If some initializations required before the enable/disable macros are called the user can use also the following <i>optional</i> define 133 - <b>sl_DeviceEnablePreamble</b> 134 135 \subsection porting_step4 Step 4 - Writing your interface communication driver 136 137 The SimpleLink CC31xx has two standard communication interfaces 138 - SPI 139 - UART 140 141 The device detects automatically the active interface during initialization. After the detection, the second interface could not be used.\n 142 143 To wrap the driver for the communication channel the following functions should be implemented: 144 -# sl_IfOpen 145 -# sl_IfClose 146 -# sl_IfRead 147 -# sl_IfWrite 148 -# sl_IfRegIntHdlr 149 150 The way these functions are implemented has direct effect on the performances of the SimpleLink 151 device on this target platform. DMA and Jitter Buffer should be considered.\n 152 153 In some platforms the user need to mask the IRQ line when this interrupt could be masked. \n 154 The driver can call the mask/unmask whenever is needed. To allow this functionality the 155 user should implement also the following defines: 156 - sl_IfMaskIntHdlr 157 - sl_IfUnMaskIntHdlr 158 159 By default the driver is writing the command in few transactions to allow zero-copy mechanism. \n 160 To enable a Jitter buffer for improving the communication line utilization, the can implement 161 also the following defines: 162 - sl_IfStartWriteSequence 163 - sl_IfEndWriteSequence 164 165 \subsection porting_step5 Step 5 - Choose your memory management model 166 167 The SimpleLink driver support two memory models: 168 - Static 169 - Dynamic (default) 170 171 To enable the dynamic memory, the following pre-processor define should be set: \n 172 #define SL_MEMORY_MGMT_DYNAMIC 173 174 And the following macros should be defined and supplied: 175 - sl_Malloc 176 - sl_Free 177 178 Using the dynamic mode will allocate the required resources on sl_Start and release these resource on sl_Stop. 179 180 \subsection porting_step6 Step 6 - OS adaptation 181 182 The SimpleLink driver could run on two kind of platforms: 183 -# Non-Os / Single Threaded (default) 184 -# Multi-Threaded 185 186 When building a multi-threaded application. the following pre-processor define must be set: \n 187 #define SL_PLATFORM_MULTI_THREADED 188 189 If you choose to work in multi-threaded environment under operating system you will have to 190 provide some basic adaptation routines to allow the driver to protect access to resources 191 for different threads (locking object) and to allow synchronization between threads (sync objects). 192 In additional the driver support running without dedicated thread allocated solely to the 193 SimpleLink driver. If you choose to work in this mode, you should also supply a spawn method that 194 will enable to run function on a temporary context. 195 196 197 \subsection porting_step7 Step 7 - Set your asynchronous event handlers routines 198 199 The SimpleLink device generate asynchronous events in several situations. 200 These asynchronous events could be masked. 201 In order to catch these events you have to provide handler routines. 202 Please notice that if you not provide a handler routine and the event is received, 203 the driver will drop this event without any indication of this drop. 204 205 206 \subsection porting_step8 Step 8 - Run diagnostic tools to validate the correctness of your porting 207 208 The driver is delivered with some porting diagnostic tools to simplify the porting validation process 209 and to reduce issues latter. It is very important to follow carefully this process. 210 211 The diagnostic process include: 212 -# Validating interface communication driver 213 -# Validating basic work with the device 214 215 216 \section annex_step Annex Persistency 217 The SimpleLink(tm) device support few different persistency types for settings and configurations:\n 218 - <b>Temporary</b> - Effective immediately but returned to default after reset\n 219 - <b>System Persistent</b> - Effective immediately and kept after reset according\n 220 - to system persistent mode\n 221 - <b>Persistent</b> - Effective immediately and kept after reset regardless the system persistent mode\n 222 - <b>Optionally Persistent</b> - Effective immediately and kept after reset according to a parameter in the API call\n 223 - <b>Reset</b> - Persistent but effective only after reset\n 224 225 */ 226 227 #ifndef __SIMPLELINK_H__ 228 #define __SIMPLELINK_H__ 229 230 /* define the default types 231 * If user wants to overwrite it, 232 * he need to undef and define again */ 233 #define _u8 unsigned char 234 #define _i8 signed char 235 #define _u16 unsigned short 236 #define _i16 signed short 237 #define _u32 unsigned long 238 #define _i32 signed long 239 240 #define _volatile volatile 241 #define _const const 242 243 #include <ti/drivers/net/wifi/porting/user.h> 244 245 #ifdef __cplusplus 246 extern "C" 247 { 248 #endif 249 250 /*! 251 \defgroup UserEvents 252 \short Function prototypes for event callback handlers 253 254 */ 255 256 /*! \attention Async event activation notes\n 257 Function prototypes for event callback handlers\n 258 Event handler function names should be defined in the user.h file\n 259 e.g.\n 260 "#define slcb_WlanEvtHdlr SLWlanEventHandler"\n 261 Indicates all WLAN events are handled by User func "SLWlanEventHandler"\n 262 Important notes:\n 263 1. Event handlers cannot activate another SimpleLink API from the event's context 264 2. Event's data is valid during event's context. Any application data 265 which is required for the user application should be copied or marked 266 into user's variables 267 3. It is not recommended to delay the execution of the event callback handler 268 269 */ 270 271 /*! 272 273 \addtogroup UserEvents 274 @{ 275 276 */ 277 278 279 /*****************************************************************************/ 280 /* Macro declarations for Host Driver version */ 281 /*****************************************************************************/ 282 #define SL_DRIVER_VERSION "3.0.1.61" 283 #define SL_MAJOR_VERSION_NUM 3L 284 #define SL_MINOR_VERSION_NUM 0L 285 #define SL_VERSION_NUM 1L 286 #define SL_SUB_VERSION_NUM 61L 287 288 /*****************************************************************************/ 289 /* Macro declarations for predefined configurations */ 290 /*****************************************************************************/ 291 292 293 /* #define sl_Memcpy memcpy */ 294 #define sl_Memset(addr, val, len) memset(addr, val, (size_t)len) 295 #define sl_Memcpy(dest, src, len) memcpy(dest, src, (size_t)len) 296 #define sl_Memmove(dest, src, len) memmove(dest, src, (size_t)len) 297 298 #define SL_MAX_SOCKETS (_u8)(16) 299 300 301 /*****************************************************************************/ 302 /* Types definitions */ 303 /*****************************************************************************/ 304 305 #ifndef NULL 306 #define NULL (0) 307 #endif 308 309 #ifndef FALSE 310 #define FALSE (0) 311 #endif 312 313 #ifndef TRUE 314 #define TRUE (!FALSE) 315 #endif 316 317 typedef _u16 _SlOpcode_t; 318 typedef _u8 _SlArgSize_t; 319 typedef _i16 _SlDataSize_t; 320 typedef _i16 _SlReturnVal_t; 321 322 /* 323 * This event status used to block or continue the event propagation 324 * through all the registered external libs/user application 325 * 326 */ 327 328 typedef enum { 329 EVENT_PROPAGATION_BLOCK = 0, 330 EVENT_PROPAGATION_CONTINUE 331 } _SlEventPropogationStatus_e; 332 333 334 /*****************************************************************************/ 335 /* Include files */ 336 /*****************************************************************************/ 337 338 339 /* 340 objInclusion.h and user.h must be included before all api header files 341 objInclusion.h must be the last arrangement just before including the API header files 342 since it based on the other configurations to decide which object should be included 343 */ 344 #include "source/objInclusion.h" 345 #include "trace.h" 346 #include "fs.h" 347 #include "sl_socket.h" 348 #include "netapp.h" 349 #include "wlan.h" 350 #include "device.h" 351 #include "netcfg.h" 352 #include "netutil.h" 353 #include "errors.h" 354 #include "eventreg.h" 355 #include "wlanconfig.h" 356 /*! 357 \cond DOXYGEN_IGNORE 358 */ 359 /* In case of use dynamic event registration 360 * redirect the event to the internal mechanism */ 361 #if (defined(SL_RUNTIME_EVENT_REGISTERATION)) 362 363 #define _SlDrvHandleFatalErrorEvents _SlDeviceFatalErrorEvtHdlr 364 #define _SlDrvHandleGeneralEvents _SlDeviceGeneralEvtHdlr 365 #define _SlDrvHandleWlanEvents _SlWlanEvtHdlr 366 #define _SlDrvHandleNetAppEvents _SlNetAppEvtHdlr 367 #define _SlDrvHandleSockEvents _SlSockEvtHdlr 368 #define _SlDrvHandleHttpServerEvents _SlNetAppHttpServerHdlr 369 #define _SlDrvHandleNetAppRequestEvents _SlNetAppRequestHdlr 370 #define _SlDrvHandleNetAppRequestMemFreeEvents _SlNetAppRequestMemFree 371 #define _SlDrvHandleSocketTriggerEvents _SlSocketTriggerEventHandler 372 373 #else 374 375 /* The fatal error events dispatcher which is 376 * initialized to the user handler */ 377 #ifdef slcb_DeviceFatalErrorEvtHdlr 378 #define _SlDrvHandleFatalErrorEvents slcb_DeviceFatalErrorEvtHdlr 379 #endif 380 381 /* The general events dispatcher which is 382 * initialized to the user handler */ 383 #ifdef slcb_DeviceGeneralEvtHdlr 384 #define _SlDrvHandleGeneralEvents slcb_DeviceGeneralEvtHdlr 385 #endif 386 387 /* The wlan events dispatcher which is 388 * initialized to the user handler */ 389 #ifdef slcb_WlanEvtHdlr 390 #define _SlDrvHandleWlanEvents slcb_WlanEvtHdlr 391 #endif 392 393 /* The NetApp events dispatcher which is 394 * initialized to the user handler */ 395 #ifdef slcb_NetAppEvtHdlr 396 #define _SlDrvHandleNetAppEvents slcb_NetAppEvtHdlr 397 #endif 398 399 /* The http server events dispatcher which is 400 * initialized to the user handler if exists */ 401 #ifdef slcb_NetAppHttpServerHdlr 402 #define _SlDrvHandleHttpServerEvents slcb_NetAppHttpServerHdlr 403 #endif 404 405 /* The socket events dispatcher which is 406 * initialized to the user handler */ 407 #ifdef slcb_SockEvtHdlr 408 #define _SlDrvHandleSockEvents slcb_SockEvtHdlr 409 #endif 410 411 412 /* The netapp requests dispatcher which is 413 * initialized to the user handler if exists */ 414 #ifdef slcb_NetAppRequestHdlr 415 #define _SlDrvHandleNetAppRequestEvents slcb_NetAppRequestHdlr 416 #endif 417 418 /* The netapp request mem free requests dispatcher which is 419 * initialized to the user handler if exists */ 420 #ifdef slcb_NetAppRequestMemFree 421 #define _SlDrvHandleNetAppRequestMemFreeEvents slcb_NetAppRequestMemFree 422 #endif 423 424 /* The netapp requests dispatcher which is 425 * initialized to the user handler if exists */ 426 #ifdef slcb_SocketTriggerEventHandler 427 #define _SlDrvHandleSocketTriggerEvents slcb_SocketTriggerEventHandler 428 #endif 429 430 431 #endif 432 433 #define SL_CONCAT(x,y) x ## y 434 #define SL_CONCAT2(x,y) SL_CONCAT(x,y) 435 436 437 #if (!defined(SL_RUNTIME_EVENT_REGISTERATION)) 438 439 /* 440 * The section below handles the external lib event registration 441 * according to the desired events it specified in its API header file. 442 * The external lib should be first installed by the user (see user.h) 443 */ 444 #ifdef SL_EXT_LIB_1 445 446 /* General Event Registration */ 447 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_GENERAL_EVENT) 448 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl) (SlDeviceEvent_t *); 449 #define SlExtLib1GeneralEventHandler SL_CONCAT2(SL_EXT_LIB_1, _GeneralEventHdl) 450 451 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS 452 #define EXT_LIB_REGISTERED_GENERAL_EVENTS 453 #endif 454 455 /* Wlan Event Registration */ 456 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_WLAN_EVENT) 457 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _WlanEventHdl) (SlWlanEvent_t *); 458 #define SlExtLib1WlanEventHandler SL_CONCAT2(SL_EXT_LIB_1, _WlanEventHdl) 459 460 #undef EXT_LIB_REGISTERED_WLAN_EVENTS 461 #define EXT_LIB_REGISTERED_WLAN_EVENTS 462 #endif 463 464 /* NetApp Event Registration */ 465 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_NETAPP_EVENT) 466 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl) (SlNetAppEvent_t *); 467 #define SlExtLib1NetAppEventHandler SL_CONCAT2(SL_EXT_LIB_1, _NetAppEventHdl) 468 469 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS 470 #define EXT_LIB_REGISTERED_NETAPP_EVENTS 471 #endif 472 473 /* Http Server Event Registration */ 474 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_HTTP_SERVER_EVENT) 475 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl) (SlNetAppHttpServerEvent_t* , SlNetAppHttpServerResponse_t*); 476 #define SlExtLib1HttpServerEventHandler SL_CONCAT2(SL_EXT_LIB_1, _HttpServerEventHdl) 477 478 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 479 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 480 #endif 481 482 /* Socket Event Registration */ 483 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_SOCK_EVENT) 484 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _SockEventHdl) (SlSockEvent_t *); 485 #define SlExtLib1SockEventHandler SL_CONCAT2(SL_EXT_LIB_1, _SockEventHdl) 486 487 #undef EXT_LIB_REGISTERED_SOCK_EVENTS 488 #define EXT_LIB_REGISTERED_SOCK_EVENTS 489 #endif 490 491 /* Fatal Error Event Registration */ 492 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_FATAL_ERROR_EVENT) 493 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _FatalErrorEventHdl) (SlDeviceEvent_t *); 494 #define SlExtLib1FatalErrorEventHandler SL_CONCAT2(SL_EXT_LIB_1, _FatalErrorEventHdl) 495 496 #undef EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 497 #define EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 498 #endif 499 500 /* NetApp requests events registration */ 501 #if SL_CONCAT2(SL_EXT_LIB_1, _NOTIFY_NETAPP_REQUEST_EVENT) 502 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_1, _NetAppRequestEventHdl) (SlNetAppRequest_t*, SlNetAppResponse_t *); 503 #define SlExtLib1NetAppRequestEventHandler SL_CONCAT2(SL_EXT_LIB_1, _NetAppRequestEventHdl) 504 505 #undef EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 506 #define EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 507 #endif 508 509 #endif 510 511 512 #ifdef SL_EXT_LIB_2 513 514 /* General Event Registration */ 515 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_GENERAL_EVENT) 516 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl) (SlDeviceEvent_t *); 517 #define SlExtLib2GeneralEventHandler SL_CONCAT2(SL_EXT_LIB_2, _GeneralEventHdl) 518 519 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS 520 #define EXT_LIB_REGISTERED_GENERAL_EVENTS 521 #endif 522 523 /* Wlan Event Registration */ 524 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_WLAN_EVENT) 525 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _WlanEventHdl) (SlWlanEvent_t *); 526 #define SlExtLib2WlanEventHandler SL_CONCAT2(SL_EXT_LIB_2, _WlanEventHdl) 527 528 #undef EXT_LIB_REGISTERED_WLAN_EVENTS 529 #define EXT_LIB_REGISTERED_WLAN_EVENTS 530 #endif 531 532 /* NetApp Event Registration */ 533 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_NETAPP_EVENT) 534 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl) (SlNetAppEvent_t *); 535 #define SlExtLib2NetAppEventHandler SL_CONCAT2(SL_EXT_LIB_2, _NetAppEventHdl) 536 537 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS 538 #define EXT_LIB_REGISTERED_NETAPP_EVENTS 539 #endif 540 541 /* Http Server Event Registration */ 542 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_HTTP_SERVER_EVENT) 543 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl) (SlNetAppHttpServerEvent_t* , SlNetAppHttpServerResponse_t*); 544 #define SlExtLib2HttpServerEventHandler SL_CONCAT2(SL_EXT_LIB_2, _HttpServerEventHdl) 545 546 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 547 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 548 #endif 549 550 /* Socket Event Registration */ 551 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_SOCK_EVENT) 552 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _SockEventHdl) (SlSockEvent_t *); 553 #define SlExtLib2SockEventHandler SL_CONCAT2(SL_EXT_LIB_2, _SockEventHdl) 554 555 #undef EXT_LIB_REGISTERED_SOCK_EVENTS 556 #define EXT_LIB_REGISTERED_SOCK_EVENTS 557 #endif 558 559 /* Fatal Error Event Registration */ 560 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_FATAL_ERROR_EVENT) 561 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _FatalErrorEventHdl) (SlDeviceEvent_t *); 562 #define SlExtLib2FatalErrorEventHandler SL_CONCAT2(SL_EXT_LIB_2, _FatalErrorEventHdl) 563 564 #undef EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 565 #define EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 566 #endif 567 568 /* NetApp requests events registration */ 569 #if SL_CONCAT2(SL_EXT_LIB_2, _NOTIFY_NETAPP_REQUEST_EVENT) 570 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_2, _NetAppRequestEventHdl) (SlNetAppRequest_t*, SlNetAppResponse_t *); 571 #define SlExtLib1NetAppRequestEventHandler SL_CONCAT2(SL_EXT_LIB_2, _NetAppRequestEventHdl) 572 573 #undef EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 574 #define EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 575 #endif 576 577 #endif 578 579 #ifdef SL_EXT_LIB_3 580 581 /* General Event Registration */ 582 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_GENERAL_EVENT) 583 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl) (SlDeviceEvent_t *); 584 #define SlExtLib3GeneralEventHandler SL_CONCAT2(SL_EXT_LIB_3, _GeneralEventHdl) 585 586 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS 587 #define EXT_LIB_REGISTERED_GENERAL_EVENTS 588 #endif 589 590 /* Wlan Event Registration */ 591 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_WLAN_EVENT) 592 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _WlanEventHdl) (SlWlanEvent_t *); 593 #define SlExtLib3WlanEventHandler SL_CONCAT2(SL_EXT_LIB_3, _WlanEventHdl) 594 595 #undef EXT_LIB_REGISTERED_WLAN_EVENTS 596 #define EXT_LIB_REGISTERED_WLAN_EVENTS 597 #endif 598 599 /* NetApp Event Registration */ 600 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_NETAPP_EVENT) 601 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl) (SlNetAppEvent_t *); 602 #define SlExtLib3NetAppEventHandler SL_CONCAT2(SL_EXT_LIB_3, _NetAppEventHdl) 603 604 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS 605 #define EXT_LIB_REGISTERED_NETAPP_EVENTS 606 #endif 607 608 /* Http Server Event Registration */ 609 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_HTTP_SERVER_EVENT) 610 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl) (SlNetAppHttpServerEvent_t* , SlNetAppHttpServerResponse_t*); 611 #define SlExtLib3HttpServerEventHandler SL_CONCAT2(SL_EXT_LIB_3, _HttpServerEventHdl) 612 613 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 614 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 615 #endif 616 617 /* Socket Event Registration */ 618 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_SOCK_EVENT) 619 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _SockEventHdl) (SlSockEvent_t *); 620 #define SlExtLib3SockEventHandler SL_CONCAT2(SL_EXT_LIB_3, _SockEventHdl) 621 622 #undef EXT_LIB_REGISTERED_SOCK_EVENTS 623 #define EXT_LIB_REGISTERED_SOCK_EVENTS 624 #endif 625 626 627 /* Fatal Error Event Registration */ 628 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_FATAL_ERROR_EVENT) 629 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _FatalErrorEventHdl) (SlDeviceEvent_t *); 630 #define SlExtLib3FatalErrorEventHandler SL_CONCAT2(SL_EXT_LIB_3, _FatalErrorEventHdl) 631 632 #undef EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 633 #define EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 634 #endif 635 636 /* NetApp requests events registration */ 637 #if SL_CONCAT2(SL_EXT_LIB_3, _NOTIFY_NETAPP_REQUEST_EVENT) 638 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_3, _NetAppRequestEventHdl) (SlNetAppRequest_t*, SlNetAppResponse_t *); 639 #define SlExtLib1NetAppRequestEventHandler SL_CONCAT2(SL_EXT_LIB_3, _NetAppRequestEventHdl) 640 641 #undef EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 642 #define EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 643 #endif 644 645 #endif 646 647 #ifdef SL_EXT_LIB_4 648 649 /* General Event Registration */ 650 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_GENERAL_EVENT) 651 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl) (SlDeviceEvent_t *); 652 #define SlExtLib4GeneralEventHandler SL_CONCAT2(SL_EXT_LIB_4, _GeneralEventHdl) 653 654 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS 655 #define EXT_LIB_REGISTERED_GENERAL_EVENTS 656 #endif 657 658 /* Wlan Event Registration */ 659 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_WLAN_EVENT) 660 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _WlanEventHdl) (SlWlanEvent_t *); 661 #define SlExtLib4WlanEventHandler SL_CONCAT2(SL_EXT_LIB_4, _WlanEventHdl) 662 663 #undef EXT_LIB_REGISTERED_WLAN_EVENTS 664 #define EXT_LIB_REGISTERED_WLAN_EVENTS 665 #endif 666 667 /* NetApp Event Registration */ 668 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_NETAPP_EVENT) 669 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl) (SlNetAppEvent_t *); 670 #define SlExtLib4NetAppEventHandler SL_CONCAT2(SL_EXT_LIB_4, _NetAppEventHdl) 671 672 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS 673 #define EXT_LIB_REGISTERED_NETAPP_EVENTS 674 #endif 675 676 /* Http Server Event Registration */ 677 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_HTTP_SERVER_EVENT) 678 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl) (SlNetAppHttpServerEvent_t* , SlNetAppHttpServerResponse_t*); 679 #define SlExtLib4HttpServerEventHandler SL_CONCAT2(SL_EXT_LIB_4, _HttpServerEventHdl) 680 681 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 682 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 683 #endif 684 685 /* Socket Event Registration */ 686 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_SOCK_EVENT) 687 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _SockEventHdl) (SlSockEvent_t *); 688 #define SlExtLib4SockEventHandler SL_CONCAT2(SL_EXT_LIB_4, _SockEventHdl) 689 690 #undef EXT_LIB_REGISTERED_SOCK_EVENTS 691 #define EXT_LIB_REGISTERED_SOCK_EVENTS 692 #endif 693 694 /* Fatal Error Event Registration */ 695 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_FATAL_ERROR_EVENT) 696 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _FatalErrorEventHdl) (SlDeviceEvent_t *); 697 #define SlExtLib4FatalErrorEventHandler SL_CONCAT2(SL_EXT_LIB_4, _FatalErrorEventHdl) 698 699 #undef EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 700 #define EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 701 #endif 702 703 /* NetApp requests events registration */ 704 #if SL_CONCAT2(SL_EXT_LIB_4, _NOTIFY_NETAPP_REQUEST_EVENT) 705 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_4, _NetAppRequestEventHdl) (SlNetAppRequest_t*, SlNetAppResponse_t *); 706 #define SlExtLib1NetAppRequestEventHandler SL_CONCAT2(SL_EXT_LIB_4, _NetAppRequestEventHdl) 707 708 #undef EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 709 #define EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 710 #endif 711 712 #endif 713 714 #ifdef SL_EXT_LIB_5 715 716 /* General Event Registration */ 717 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_GENERAL_EVENT) 718 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl) (SlDeviceEvent_t *); 719 #define SlExtLib5GeneralEventHandler SL_CONCAT2(SL_EXT_LIB_5, _GeneralEventHdl) 720 721 #undef EXT_LIB_REGISTERED_GENERAL_EVENTS 722 #define EXT_LIB_REGISTERED_GENERAL_EVENTS 723 #endif 724 725 /* Wlan Event Registration */ 726 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_WLAN_EVENT) 727 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _WlanEventHdl) (SlWlanEvent_t *); 728 #define SlExtLib5WlanEventHandler SL_CONCAT2(SL_EXT_LIB_5, _WlanEventHdl) 729 730 #undef EXT_LIB_REGISTERED_WLAN_EVENTS 731 #define EXT_LIB_REGISTERED_WLAN_EVENTS 732 #endif 733 734 /* NetApp Event Registration */ 735 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_NETAPP_EVENT) 736 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl) (SlNetAppEvent_t *); 737 #define SlExtLib5NetAppEventHandler SL_CONCAT2(SL_EXT_LIB_5, _NetAppEventHdl) 738 739 #undef EXT_LIB_REGISTERED_NETAPP_EVENTS 740 #define EXT_LIB_REGISTERED_NETAPP_EVENTS 741 #endif 742 743 /* Http Server Event Registration */ 744 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_HTTP_SERVER_EVENT) 745 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl) (SlNetAppHttpServerEvent_t* , SlNetAppHttpServerResponse_t*); 746 #define SlExtLib5HttpServerEventHandler SL_CONCAT2(SL_EXT_LIB_5, _HttpServerEventHdl) 747 748 #undef EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 749 #define EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS 750 #endif 751 752 /* Socket Event Registration */ 753 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_SOCK_EVENT) 754 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _SockEventHdl) (SlSockEvent_t *); 755 #define SlExtLib5SockEventHandler SL_CONCAT2(SL_EXT_LIB_5, _SockEventHdl) 756 757 #undef EXT_LIB_REGISTERED_SOCK_EVENTS 758 #define EXT_LIB_REGISTERED_SOCK_EVENTS 759 #endif 760 761 /* Fatal Error Event Registration */ 762 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_FATAL_ERROR_EVENT) 763 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _FatalErrorEventHdl) (SlDeviceEvent_t *); 764 #define SlExtLib5FatalErrorEventHandler SL_CONCAT2(SL_EXT_LIB_5, _FatalErrorEventHdl) 765 766 #undef EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 767 #define EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS 768 #endif 769 770 /* NetApp requests events registration */ 771 #if SL_CONCAT2(SL_EXT_LIB_5, _NOTIFY_NETAPP_REQUEST_EVENT) 772 extern _SlEventPropogationStatus_e SL_CONCAT2(SL_EXT_LIB_5, _NetAppRequestEventHdl) (SlNetAppRequest_t*, SlNetAppResponse_t *); 773 #define SlExtLib1NetAppRequestEventHandler SL_CONCAT2(SL_EXT_LIB_5, _NetAppRequestEventHdl) 774 775 #undef EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 776 #define EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS 777 #endif 778 779 #endif 780 781 #if defined(EXT_LIB_REGISTERED_FATAL_ERROR_EVENTS) 782 extern void _SlDrvHandleFatalErrorEvents(SlDeviceEvent_t *slFatalErrorEvent); 783 #endif 784 785 #if defined(EXT_LIB_REGISTERED_GENERAL_EVENTS) 786 extern void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *slGeneralEvent); 787 #endif 788 789 #if defined(EXT_LIB_REGISTERED_WLAN_EVENTS) 790 extern void _SlDrvHandleWlanEvents(SlWlanEvent_t *slWlanEvent); 791 #endif 792 793 #if defined (EXT_LIB_REGISTERED_NETAPP_EVENTS) 794 extern void _SlDrvHandleNetAppEvents(SlNetAppEvent_t *slNetAppEvent); 795 #endif 796 797 #if defined(EXT_LIB_REGISTERED_HTTP_SERVER_EVENTS) 798 extern void _SlDrvHandleHttpServerEvents(SlNetAppHttpServerEvent_t *slHttpServerEvent, SlNetAppHttpServerResponse_t *slHttpServerResponse); 799 #endif 800 801 #if defined(EXT_LIB_REGISTERED_SOCK_EVENTS) 802 extern void _SlDrvHandleSockEvents(SlSockEvent_t *slSockEvent); 803 #endif 804 805 #if defined(EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS) 806 extern void _SlDrvHandleNetAppRequestEvents(SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse); 807 #endif 808 809 #endif //#if (defined(SL_RUNTIME_EVENT_REGISTERATION)) 810 811 typedef _SlReturnVal_t (*_SlSpawnEntryFunc_t)(void* pValue); 812 813 #define SL_SPAWN_FLAG_FROM_SL_IRQ_HANDLER (0x1) 814 #define SL_SPAWN_FLAG_FROM_CMD_CTX (0x2) 815 #define SL_SPAWN_FLAG_FROM_CMD_PROCESS (0x3) 816 817 #ifdef SL_PLATFORM_MULTI_THREADED 818 #include "source/spawn.h" 819 #else 820 #include "source/nonos.h" 821 #endif 822 823 /*! 824 \endcond 825 */ 826 827 828 /* Async functions description*/ 829 830 831 /*! 832 \brief Fatal Error event for inspecting fatal error 833 834 \param[out] pSlFatalErrorEvent pointer to SlDeviceFatal_t 835 \return None 836 \sa 837 \note 838 \warning 839 \par Example 840 \code 841 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_DEVICE_ABORT 842 Indicates a severe error occured and the device stopped 843 Use pSlDeviceFatal->Data.DeviceAssert fields 844 - Code: An idication of the abort type 845 - Value: The abort data 846 847 848 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_NO_CMD_ACK 849 Indicates that the command sent to the device had no ack 850 Use pSlDeviceFatal->Data.NoCmdAck fields 851 - Code: An idication of the cmd opcode 852 853 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_CMD_TIMEOUT 854 Indicates that the command got a timeout while waiting for its async response 855 Use pSlDeviceFatal->Data.CmdTimeout fields 856 - Code: An idication of the asyncevent opcode 857 858 859 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_DRIVER_ABORT 860 Indicates a severe error occured in the driver 861 Use pSlDeviceFatal->Data.DeviceAssert fields 862 - None. 863 864 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_SYNC_LOSS 865 Indicates a sync loss with the device 866 Use pSlDeviceFatal->Data.DeviceAssert fields 867 - None. 868 \endcode 869 \code 870 Example for fatal error 871 printf(Abort type =%d Abort Data=0x%x\n\n", 872 pSlDeviceFatal->Data.deviceReport.AbortType, 873 pSlDeviceFatal->Data.deviceReport.AbortData); 874 \endcode 875 */ 876 #if (defined(slcb_DeviceFatalErrorEvtHdlr)) 877 extern void slcb_DeviceFatalErrorEvtHdlr(SlDeviceFatal_t *pSlFatalErrorEvent); 878 #endif 879 880 881 /*! 882 \brief General async event for inspecting general events 883 884 \param[out] pSlDeviceEvent pointer to SlDeviceEvent_t 885 \return None 886 \sa 887 \note 888 \warning 889 \par Example 890 \code 891 For pSlDeviceEvent->Id = SL_DEVICE_EVENT_RESET_REQUEST 892 Use pSlDeviceEvent->Data.ResetRequest fields 893 - Status: An error code indication from the device 894 - Source: The sender originator which is based on SlDeviceSource_e enum 895 896 For pSlDeviceEvent->Id = SL_DEVICE_EVENT_ERROR 897 Use pSlDeviceEvent->Data.Error fields 898 - Code: An error code indication from the device 899 - Source: The sender originator which is based on SlErrorSender_e enum 900 \endcode 901 \code 902 Example for error event: 903 printf(General Event Handler - ID=%d Sender=%d\n\n", 904 pSlDeviceEvent->Data.Error.Code, // the error code 905 pSlDeviceEvent->Data.Error.Source); // the error source 906 \endcode 907 908 */ 909 #if (defined(slcb_DeviceGeneralEvtHdlr)) 910 extern void slcb_DeviceGeneralEvtHdlr(SlDeviceEvent_t *pSlDeviceEvent); 911 #endif 912 913 /*! 914 \brief WLAN Async event handler 915 916 \param[out] pSlWlanEvent pointer to SlWlanEvent_t data 917 \return None 918 \sa 919 \note 920 \warning 921 \par Example 922 \code 923 For pSlWlanEvent->Id = SL_WLAN_EVENT_CONNECT, STA connection indication event 924 Use pSlWlanEvent->Data.Connect main fields 925 - SsidLen 926 - SsidName 927 - Bssid 928 929 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CONNECT, P2P client connection indication event 930 Use pSlWlanEvent->Data.P2PConnect main fields 931 - SsidLen 932 - SsidName 933 - Bssid 934 - GoDeviceNameLen 935 - GoDeviceName 936 937 For pSlWlanEvent->Id = SL_WLAN_EVENT_DISCONNECT, STA client disconnection event 938 Use pSlWlanEvent->Data.Disconnect main fields: 939 - SsidLen 940 - SsidName 941 - Bssid 942 - ReasonCode 943 944 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_DISCONNECT, P2P client disconnection event 945 Use pSlWlanEvent->Data.P2PDisconnect main fields: 946 - SsidLen 947 - SsidName 948 - Bssid 949 - ReasonCode 950 - GoDeviceNameLen 951 - GoDeviceName 952 953 For pSlWlanEvent->Id = SL_WLAN_EVENT_STA_ADDED, AP connected STA 954 Use pSlWlanEvent->Data.STAAdded fields: 955 - Mac 956 957 For pSlWlanEvent->Id = SL_WLAN_EVENT_STA_REMOVED, AP disconnected STA 958 Use pSlWlanEvent->Data.STARemoved fields: 959 - Mac 960 961 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CLIENT_ADDED, P2P(Go) connected P2P(Client) 962 Use pSlWlanEvent->Data.P2PClientAdded fields: 963 - Mac 964 - GoDeviceNameLen 965 - GoDeviceName 966 - OwnSsidLen 967 - OwnSsid 968 969 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CLIENT_REMOVED, P2P(Go) disconnected P2P(Client) 970 Use pSlWlanEvent->Data.P2PClientRemoved fields: 971 - Mac 972 - GoDeviceNameLen 973 - GoDeviceName 974 - OwnSsidLen 975 - OwnSsid 976 977 For pSlWlanEvent->Id = SL_WLAN_P2P_DEV_FOUND_EVENT 978 Use pSlWlanEvent->Data.P2PDevFound fields: 979 - GoDeviceNameLen 980 - GoDeviceName 981 - Mac 982 - WpsMethod 983 984 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_REQUEST 985 Use pSlWlanEvent->Data.P2PRequest fields 986 - GoDeviceNameLen 987 - GoDeviceName 988 - Mac 989 - WpsMethod 990 991 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CONNECTFAIL, P2P only 992 Use pSlWlanEvent->Data.P2PConnectFail fields: 993 - Status 994 995 For pSlWlanEvent->Id = SL_WLAN_EVENT_PROVISIONING_STATUS 996 Use pSlWlanEvent->Data.ProvisioningStatus fields 997 - Status 998 999 For pSlWlanEvent->Id = SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED 1000 Use pSlWlanEvent->Data.ProvisioningProfileAdded fields: 1001 - Status 1002 - SsidLen 1003 - Ssid 1004 - Reserved 1005 For pSlWlanEvent->Id = SL_WLAN_EVENT_LINK_QUALITY_TRIGGER 1006 Use pSlWlanEvent->Data.LinkQualityTrigger fields: 1007 - Data 1008 - TriggerId 1009 1010 \endcode 1011 */ 1012 #if (defined(slcb_WlanEvtHdlr)) 1013 extern void slcb_WlanEvtHdlr(SlWlanEvent_t* pSlWlanEvent); 1014 #endif 1015 1016 1017 /*! 1018 \brief NETAPP Async event handler 1019 1020 \param[out] pSlNetAppEvent pointer to SlNetAppEvent_t data 1021 \return None 1022 \sa 1023 \note 1024 \warning 1025 \par Example 1026 \code 1027 For pSlNetAppEvent->Id = SL_NETAPP_EVENT_IPV4_ACQUIRED/SL_NETAPP_EVENT_IPV6_ACQUIRED 1028 Use pSlNetAppEvent->Data.ipAcquiredV4 (V6) fields 1029 - ip 1030 - gateway 1031 - dns 1032 1033 For pSlNetAppEvent->Id = SL_NETAPP_IP_LEASED_EVENT, AP or P2P go dhcp lease event 1034 Use pSlNetAppEvent->Data.ipLeased fields 1035 - ip_address 1036 - lease_time 1037 - mac 1038 1039 For pSlNetApp->Id = SL_NETAPP_IP_RELEASED_EVENT, AP or P2P go dhcp ip release event 1040 Use pSlNetAppEvent->Data.ipReleased fields 1041 - ip_address 1042 - mac 1043 - reason 1044 \endcode 1045 */ 1046 #if (defined(slcb_NetAppEvtHdlr)) 1047 extern void slcb_NetAppEvtHdlr(SlNetAppEvent_t* pSlNetAppEvent); 1048 #endif 1049 1050 /*! 1051 \brief Socket Async event handler 1052 1053 \param[out] pSlSockEvent pointer to SlSockEvent_t data 1054 \return None 1055 \sa 1056 \note 1057 \warning 1058 \par Example 1059 \code 1060 For pSlSockEvent->Event = SL_SOCKET_TX_FAILED_EVENT 1061 Use pSlSockEvent->SockTxFailData fields 1062 - sd 1063 - status 1064 For pSlSockEvent->Event = SL_SOCKET_ASYNC_EVENT 1065 Use pSlSockEvent->SockAsyncData fields 1066 - sd 1067 - type 1068 - SL_SSL_ACCEPT 1069 - SL_WLAN_RX_FRAGMENTATION_TOO_BIG 1070 - SL_OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED 1071 - val 1072 \endcode 1073 1074 */ 1075 #if (defined(slcb_SockEvtHdlr)) 1076 extern void slcb_SockEvtHdlr(SlSockEvent_t* pSlSockEvent); 1077 #endif 1078 1079 /*! 1080 \brief HTTP server async event 1081 1082 \param[out] pSlHttpServerEvent Pointer to SlNetAppHttpServerEvent_t 1083 \param[in] pSlHttpServerResponse Pointer to SlNetAppHttpServerResponse_t 1084 1085 \return None 1086 \sa slcb_NetAppRequestHdlr 1087 \note 1088 \warning 1089 \par Example 1090 \code 1091 For pSlHttpServerResponse->Event = SL_NETAPP_HTTPGETTOKENVALUE_EVENT 1092 Use pSlHttpServerEvent->EventData fields 1093 - httpTokenName 1094 - data 1095 - len 1096 And pSlHttpServerResponse->ResponseData fields 1097 - data 1098 - len 1099 1100 For pSlHttpServerEvent->Event = SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT 1101 Use pSlHttpServerEvent->EventData.httpPostData fields 1102 - action 1103 - token_name 1104 - token_value 1105 And pSlHttpServerResponse->ResponseData fields: 1106 - data 1107 - len 1108 \endcode 1109 */ 1110 #if (defined(slcb_NetAppHttpServerHdlr)) 1111 extern void slcb_NetAppHttpServerHdlr(SlNetAppHttpServerEvent_t *pSlHttpServerEvent, SlNetAppHttpServerResponse_t *pSlHttpServerResponse); 1112 #endif 1113 1114 /*! 1115 \brief General netapp async event 1116 1117 \param[out] pNetAppRequest Pointer to SlNetAppRequest_t 1118 \param[in] pNetAppResponse Pointer to SlNetAppResponse_t 1119 1120 \return None 1121 \sa slcb_NetAppHttpServerHdlr 1122 \note 1123 \warning 1124 \par Example 1125 \code 1126 TBD 1127 \endcode 1128 */ 1129 #if (defined(slcb_NetAppRequestHdlr)) 1130 extern void slcb_NetAppRequestHdlr(SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse); 1131 #endif 1132 1133 /*! 1134 \brief A handler for freeing the memory of the NetApp response. 1135 1136 \param[in,out] buffer Pointer to the buffer to free 1137 1138 \return None 1139 \sa 1140 \note 1141 \warning 1142 \par Example 1143 \code 1144 TBD 1145 \endcode 1146 */ 1147 #if (defined(slcb_NetAppRequestMemFree)) 1148 extern void slcb_NetAppRequestMemFree (_u8 *buffer); 1149 #endif 1150 1151 /*! 1152 \brief Get the timer counter value (timestamp).\n 1153 The timer must count from zero to its MAX value. 1154 For non-os application, this routine must be implemented. 1155 \param None 1156 \return Returns 32-bit timer counter value (ticks unit) 1157 \sa 1158 \note 1159 \note belongs to \ref porting_sec 1160 \warning 1161 */ 1162 #if defined (slcb_GetTimestamp) 1163 extern _u32 slcb_GetTimestamp(void); 1164 #endif 1165 1166 1167 /*! 1168 \brief Socket trigger routine. 1169 This routine will notify the application that a netwrok activity has 1170 been completed on the required socket/s. 1171 1172 \param[out] pSlSockTriggerEvent pointer to SlSockTriggerEvent_t data 1173 \return None. 1174 \sa 1175 \note 1176 \note belongs to \ref porting_sec 1177 \warning 1178 */ 1179 #if (defined(slcb_SocketTriggerEventHandler)) 1180 extern void slcb_SocketTriggerEventHandler(SlSockTriggerEvent_t* pSlSockTriggerEvent); 1181 #endif 1182 1183 1184 /*! 1185 Close the Doxygen group. 1186 @} 1187 1188 */ 1189 1190 #ifdef __cplusplus 1191 } 1192 #endif /* __cplusplus */ 1193 1194 #endif /* __SIMPLELINK_H__ */ 1195 1196