SWRA704 June   2021 CC3120 , CC3130 , CC3135

 

  1.   Trademarks
  2. 1Introduction
  3. 2Porting the Host Driver
    1. 2.1 Porting Layer Files
    2. 2.2 Driver Enable/Disable
    3. 2.3 SPI Interface
      1. 2.3.1 Hardware Setup and Configuring Clocks
    4. 2.4 Memory Management
    5. 2.5 OS Abstraction: FreeRTOS
    6. 2.6 Timestamp Mechanism
    7. 2.7 Asynchronous Event Handler Routines
  4. 3Tips for Porting
    1. 3.1 Hardware Setup
    2. 3.2 Servicepack
    3. 3.3 Starting the Wi-Fi Driver in the Application Code
    4. 3.4 Configuring Clocks on the STM32L4
    5. 3.5 Terminal I/O Printing
    6. 3.6 Location of the Host Driver and Porting Files
    7. 3.7 Updating to the Latest Host Driver Version
  5. 4References
  6. 5License Information

Asynchronous Event Handler Routines

The asynchronous event handlers are used to pass aynchronous events from the network processor to the host application. This includes fatal errors, notifications of WLAN connections and disconnections, socket events, and more. The async event handlers are defined in user.h, but they are implemented by the developer in the application.

The event handlers are meant to be customized for the application. There are many references for how these event handlers can be used in the Wi-Fi SDK and Plugin examples. For more details, review the UserEvents in the Host Driver API documentation in the Wi-Fi SDK or Plugin. The following code snippet defines the event handlers with the API names that are commonly used in the examples.

user.h:

#define slcb_DeviceFatalErrorEvtHdlr    SimpleLinkFatalErrorEventHandler

#define slcb_DeviceGeneralEvtHdlr       SimpleLinkGeneralEventHandler
#define slcb_WlanEvtHdlr                SimpleLinkWlanEventHandler
#define slcb_NetAppEvtHdlr              SimpleLinkNetAppEventHandler
#define slcb_NetAppRequestHdlr          SimpleLinkNetAppRequestEventHandler
#define slcb_NetAppRequestMemFree       SimpleLinkNetAppRequestMemFreeEventHandler
#define slcb_SockEvtHdlr                SimpleLinkSockEventHandler