SimpleLink CC31xx/CC32xx Host Driver  Version 3.0.1.55
Simplifies the implementation of Internet connectivity
UserEvents

Function prototypes for event callback handlers. More...

Functions

void slcb_DeviceFatalErrorEvtHdlr (SlDeviceFatal_t *pSlFatalErrorEvent)
 Fatal Error event for inspecting fatal error. More...
 
void slcb_DeviceGeneralEvtHdlr (SlDeviceEvent_t *pSlDeviceEvent)
 General async event for inspecting general events. More...
 
void slcb_WlanEvtHdlr (SlWlanEvent_t *pSlWlanEvent)
 WLAN Async event handler. More...
 
void slcb_NetAppEvtHdlr (SlNetAppEvent_t *pSlNetAppEvent)
 NETAPP Async event handler. More...
 
void slcb_SockEvtHdlr (SlSockEvent_t *pSlSockEvent)
 Socket Async event handler. More...
 
void slcb_NetAppHttpServerHdlr (SlNetAppHttpServerEvent_t *pSlHttpServerEvent, SlNetAppHttpServerResponse_t *pSlHttpServerResponse)
 HTTP server async event. More...
 
void slcb_NetAppRequestHdlr (SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse)
 General netapp async event. More...
 
void slcb_NetAppRequestMemFree (_u8 *buffer)
 A handler for freeing the memory of the NetApp response. More...
 
_u32 slcb_GetTimestamp (void)
 Get the timer counter value (timestamp).
The timer must count from zero to its MAX value. For non-os application, this routine must be implemented. More...
 
void slcb_SocketTriggerEventHandler (SlSockTriggerEvent_t *pSlSockTriggerEvent)
 Socket trigger routine. This routine will notify the application that a netwrok activity has been completed on the required socket/s. More...
 

Typedefs

typedef _u16 _SlOpcode_t
 
typedef _u8 _SlArgSize_t
 
typedef _i16 _SlDataSize_t
 
typedef _i16 _SlReturnVal_t
 

Enumerations

enum  _SlEventPropogationStatus_e {
  EVENT_PROPAGATION_BLOCK = 0,
  EVENT_PROPAGATION_CONTINUE
}
 

Detailed Description

Function prototypes for event callback handlers.

Attention
Async event activation notes
Function prototypes for event callback handlers
Event handler function names should be defined in the user.h file
e.g.
"#define slcb_WlanEvtHdlr SLWlanEventHandler"
Indicates all WLAN events are handled by User func "SLWlanEventHandler"
Important notes:
  1. Event handlers cannot activate another SimpleLink API from the event's context
  2. Event's data is valid during event's context. Any application data which is required for the user application should be copied or marked into user's variables
  3. It is not recommended to delay the execution of the event callback handler

Function Documentation

§ slcb_DeviceFatalErrorEvtHdlr()

void slcb_DeviceFatalErrorEvtHdlr ( SlDeviceFatal_t pSlFatalErrorEvent)

Fatal Error event for inspecting fatal error.

Parameters
[out]pSlFatalErrorEventpointer to SlDeviceFatal_t
Returns
None
See also
Note
Warning
Example
For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_DEVICE_ABORT
Indicates a severe error occured and the device stopped
Use pSlDeviceFatal->Data.DeviceAssert fields
- Code: An idication of the abort type
- Value: The abort data
For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_NO_CMD_ACK
Indicates that the command sent to the device had no ack
Use pSlDeviceFatal->Data.NoCmdAck fields
- Code: An idication of the cmd opcode
For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_CMD_TIMEOUT
Indicates that the command got a timeout while waiting for its async response
Use pSlDeviceFatal->Data.CmdTimeout fields
- Code: An idication of the asyncevent opcode
For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_DRIVER_ABORT
Indicates a severe error occured in the driver
Use pSlDeviceFatal->Data.DeviceAssert fields
- None.
For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_SYNC_LOSS
Indicates a sync loss with the device
Use pSlDeviceFatal->Data.DeviceAssert fields
- None.
Example for fatal error
printf(Abort type =%d Abort Data=0x%x\n\n",
pSlDeviceFatal->Data.deviceReport.AbortType,
pSlDeviceFatal->Data.deviceReport.AbortData);

§ slcb_DeviceGeneralEvtHdlr()

void slcb_DeviceGeneralEvtHdlr ( SlDeviceEvent_t pSlDeviceEvent)

General async event for inspecting general events.

Parameters
[out]pSlDeviceEventpointer to SlDeviceEvent_t
Returns
None
See also
Note
Warning
Example
For pSlDeviceEvent->Id = SL_DEVICE_EVENT_RESET_REQUEST
Use pSlDeviceEvent->Data.ResetRequest fields
- Status: An error code indication from the device
- Source: The sender originator which is based on SlDeviceSource_e enum
For pSlDeviceEvent->Id = SL_DEVICE_EVENT_ERROR
Use pSlDeviceEvent->Data.Error fields
- Code: An error code indication from the device
- Source: The sender originator which is based on SlErrorSender_e enum
Example for error event:
printf(General Event Handler - ID=%d Sender=%d\n\n",
pSlDeviceEvent->Data.Error.Code, // the error code
pSlDeviceEvent->Data.Error.Source); // the error source

§ slcb_GetTimestamp()

_u32 slcb_GetTimestamp ( void  )

Get the timer counter value (timestamp).
The timer must count from zero to its MAX value. For non-os application, this routine must be implemented.

Parameters
None
Returns
Returns 32-bit timer counter value (ticks unit)
See also
Note
belongs to porting_sec
Warning

§ slcb_NetAppEvtHdlr()

void slcb_NetAppEvtHdlr ( SlNetAppEvent_t pSlNetAppEvent)

NETAPP Async event handler.

Parameters
[out]pSlNetAppEventpointer to SlNetAppEvent_t data
Returns
None
See also
Note
Warning
Example
For pSlNetAppEvent->Id = SL_NETAPP_EVENT_IPV4_ACQUIRED/SL_NETAPP_EVENT_IPV6_ACQUIRED
Use pSlNetAppEvent->Data.ipAcquiredV4 (V6) fields
- ip
- gateway
- dns
For pSlNetAppEvent->Id = SL_NETAPP_IP_LEASED_EVENT, AP or P2P go dhcp lease event
Use pSlNetAppEvent->Data.ipLeased fields
- ip_address
- lease_time
- mac
For pSlNetApp->Id = SL_NETAPP_IP_RELEASED_EVENT, AP or P2P go dhcp ip release event
Use pSlNetAppEvent->Data.ipReleased fields
- ip_address
- mac
- reason

§ slcb_NetAppHttpServerHdlr()

void slcb_NetAppHttpServerHdlr ( SlNetAppHttpServerEvent_t pSlHttpServerEvent,
SlNetAppHttpServerResponse_t pSlHttpServerResponse 
)

HTTP server async event.

Parameters
[out]pSlHttpServerEventPointer to SlNetAppHttpServerEvent_t
[in]pSlHttpServerResponsePointer to SlNetAppHttpServerResponse_t
Returns
None
See also
slcb_NetAppRequestHdlr
Note
Warning
Example
For pSlHttpServerResponse->Event = SL_NETAPP_HTTPGETTOKENVALUE_EVENT
Use pSlHttpServerEvent->EventData fields
- httpTokenName
- data
- len
And pSlHttpServerResponse->ResponseData fields
- data
- len
For pSlHttpServerEvent->Event = SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT
Use pSlHttpServerEvent->EventData.httpPostData fields
- action
- token_name
- token_value
And pSlHttpServerResponse->ResponseData fields:
- data
- len

§ slcb_NetAppRequestHdlr()

void slcb_NetAppRequestHdlr ( SlNetAppRequest_t pNetAppRequest,
SlNetAppResponse_t pNetAppResponse 
)

General netapp async event.

Parameters
[out]pNetAppRequestPointer to SlNetAppRequest_t
[in]pNetAppResponsePointer to SlNetAppResponse_t
Returns
None
See also
slcb_NetAppHttpServerHdlr
Note
Warning
Example
TBD

§ slcb_NetAppRequestMemFree()

void slcb_NetAppRequestMemFree ( _u8 *  buffer)

A handler for freeing the memory of the NetApp response.

Parameters
[in,out]bufferPointer to the buffer to free
Returns
None
See also
Note
Warning
Example
TBD

§ slcb_SocketTriggerEventHandler()

void slcb_SocketTriggerEventHandler ( SlSockTriggerEvent_t pSlSockTriggerEvent)

Socket trigger routine. This routine will notify the application that a netwrok activity has been completed on the required socket/s.

Parameters
[out]pSlSockTriggerEventpointer to SlSockTriggerEvent_t data
Returns
None.
See also
Note
belongs to porting_sec
Warning

§ slcb_SockEvtHdlr()

void slcb_SockEvtHdlr ( SlSockEvent_t pSlSockEvent)

Socket Async event handler.

Parameters
[out]pSlSockEventpointer to SlSockEvent_t data
Returns
None
See also
Note
Warning
Example
For pSlSockEvent->Event = SL_SOCKET_TX_FAILED_EVENT
Use pSlSockEvent->SockTxFailData fields
- sd
- status
For pSlSockEvent->Event = SL_SOCKET_ASYNC_EVENT
Use pSlSockEvent->SockAsyncData fields
- sd
- type
- SL_SSL_ACCEPT
- SL_WLAN_RX_FRAGMENTATION_TOO_BIG
- SL_OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED
- val

§ slcb_WlanEvtHdlr()

void slcb_WlanEvtHdlr ( SlWlanEvent_t pSlWlanEvent)

WLAN Async event handler.

Parameters
[out]pSlWlanEventpointer to SlWlanEvent_t data
Returns
None
See also
Note
Warning
Example
For pSlWlanEvent->Id = SL_WLAN_EVENT_CONNECT, STA connection indication event
Use pSlWlanEvent->Data.Connect main fields
- SsidLen
- SsidName
- Bssid
For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CONNECT, P2P client connection indication event
Use pSlWlanEvent->Data.P2PConnect main fields
- SsidLen
- SsidName
- Bssid
- GoDeviceNameLen
- GoDeviceName
For pSlWlanEvent->Id = SL_WLAN_EVENT_DISCONNECT, STA client disconnection event
Use pSlWlanEvent->Data.Disconnect main fields:
- SsidLen
- SsidName
- Bssid
- ReasonCode
For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_DISCONNECT, P2P client disconnection event
Use pSlWlanEvent->Data.P2PDisconnect main fields:
- SsidLen
- SsidName
- Bssid
- ReasonCode
- GoDeviceNameLen
- GoDeviceName
For pSlWlanEvent->Id = SL_WLAN_EVENT_STA_ADDED, AP connected STA
Use pSlWlanEvent->Data.STAAdded fields:
- Mac
For pSlWlanEvent->Id = SL_WLAN_EVENT_STA_REMOVED, AP disconnected STA
Use pSlWlanEvent->Data.STARemoved fields:
- Mac
For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CLIENT_ADDED, P2P(Go) connected P2P(Client)
Use pSlWlanEvent->Data.P2PClientAdded fields:
- Mac
- GoDeviceNameLen
- GoDeviceName
- OwnSsidLen
- OwnSsid
For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CLIENT_REMOVED, P2P(Go) disconnected P2P(Client)
Use pSlWlanEvent->Data.P2PClientRemoved fields:
- Mac
- GoDeviceNameLen
- GoDeviceName
- OwnSsidLen
- OwnSsid
For pSlWlanEvent->Id = SL_WLAN_P2P_DEV_FOUND_EVENT
Use pSlWlanEvent->Data.P2PDevFound fields:
- GoDeviceNameLen
- GoDeviceName
- Mac
- WpsMethod
For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_REQUEST
Use pSlWlanEvent->Data.P2PRequest fields
- GoDeviceNameLen
- GoDeviceName
- Mac
- WpsMethod
For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CONNECTFAIL, P2P only
Use pSlWlanEvent->Data.P2PConnectFail fields:
- Status
For pSlWlanEvent->Id = SL_WLAN_EVENT_PROVISIONING_STATUS
Use pSlWlanEvent->Data.ProvisioningStatus fields
- Status
For pSlWlanEvent->Id = SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED
Use pSlWlanEvent->Data.ProvisioningProfileAdded fields:
- Status
- SsidLen
- Ssid
- Reserved
For pSlWlanEvent->Id = SL_WLAN_EVENT_LINK_QUALITY_TRIGGER
Use pSlWlanEvent->Data.LinkQualityTrigger fields:
- Data
- TriggerId