SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.15
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

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
1 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_DEVICE_ABORT
2  Indicates a severe error occured and the device stopped
3 Use pSlDeviceFatal->Data.DeviceAssert fields
4  - Code: An idication of the abort type
5  - Value: The abort data
6 
7 
8 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_NO_CMD_ACK
9  Indicates that the command sent to the device had no ack
10 Use pSlDeviceFatal->Data.NoCmdAck fields
11  - Code: An idication of the cmd opcode
12 
13 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_CMD_TIMEOUT
14  Indicates that the command got a timeout while waiting for its async response
15 Use pSlDeviceFatal->Data.CmdTimeout fields
16  - Code: An idication of the asyncevent opcode
17 
18 
19 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_DRIVER_ABORT
20  Indicates a severe error occured in the driver
21 Use pSlDeviceFatal->Data.DeviceAssert fields
22  - None.
23 
24 For pSlDeviceFatal->Id = SL_DEVICE_EVENT_FATAL_SYNC_LOSS
25  Indicates a sync loss with the device
26 Use pSlDeviceFatal->Data.DeviceAssert fields
27  - None.
1 Example for fatal error
2  printf(Abort type =%d Abort Data=0x%x\n\n",
3  pSlDeviceFatal->Data.deviceReport.AbortType,
4  pSlDeviceFatal->Data.deviceReport.AbortData);
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
1 For pSlDeviceEvent->Id = SL_DEVICE_EVENT_RESET_REQUEST
2 Use pSlDeviceEvent->Data.ResetRequest fields
3  - Status: An error code indication from the device
4  - Source: The sender originator which is based on SlDeviceSource_e enum
5 
6 For pSlDeviceEvent->Id = SL_DEVICE_EVENT_ERROR
7 Use pSlDeviceEvent->Data.Error fields
8  - Code: An error code indication from the device
9  - Source: The sender originator which is based on SlErrorSender_e enum
1 Example for error event:
2  printf(General Event Handler - ID=%d Sender=%d\n\n",
3  pSlDeviceEvent->Data.Error.Code, // the error code
4  pSlDeviceEvent->Data.Error.Source); // the error source
_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
void slcb_NetAppEvtHdlr ( SlNetAppEvent_t pSlNetAppEvent)

NETAPP Async event handler.

Parameters
[out]pSlNetAppEventpointer to SlNetAppEvent_t data
Returns
None
See also
Note
Warning
Example
1 For pSlNetAppEvent->Id = SL_NETAPP_EVENT_IPV4_ACQUIRED/SL_NETAPP_EVENT_IPV6_ACQUIRED
2 Use pSlNetAppEvent->Data.ipAcquiredV4 (V6) fields
3  - ip
4  - gateway
5  - dns
6 
7 For pSlNetAppEvent->Id = SL_NETAPP_IP_LEASED_EVENT, AP or P2P go dhcp lease event
8 Use pSlNetAppEvent->Data.ipLeased fields
9  - ip_address
10  - lease_time
11  - mac
12 
13 For pSlNetApp->Id = SL_NETAPP_IP_RELEASED_EVENT, AP or P2P go dhcp ip release event
14 Use pSlNetAppEvent->Data.ipReleased fields
15  - ip_address
16  - mac
17  - reason
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
1 For pSlHttpServerResponse->Event = SL_NETAPP_HTTPGETTOKENVALUE_EVENT
2 Use pSlHttpServerEvent->EventData fields
3  - httpTokenName
4  - data
5  - len
6 And pSlHttpServerResponse->ResponseData fields
7  - data
8  - len
9 
10 For pSlHttpServerEvent->Event = SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT
11 Use pSlHttpServerEvent->EventData.httpPostData fields
12  - action
13  - token_name
14  - token_value
15 And pSlHttpServerResponse->ResponseData fields:
16  - data
17  - len
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
1 TBD
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
1 TBD
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
void slcb_SockEvtHdlr ( SlSockEvent_t pSlSockEvent)

Socket Async event handler.

Parameters
[out]pSlSockEventpointer to SlSockEvent_t data
Returns
None
See also
Note
Warning
Example
1 For pSlSockEvent->Event = SL_SOCKET_TX_FAILED_EVENT
2 Use pSlSockEvent->SockTxFailData fields
3  - sd
4  - status
5 For pSlSockEvent->Event = SL_SOCKET_ASYNC_EVENT
6 Use pSlSockEvent->SockAsyncData fields
7  - sd
8  - type
9  - SL_SSL_ACCEPT
10  - SL_WLAN_RX_FRAGMENTATION_TOO_BIG
11  - SL_OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED
12  - val
void slcb_WlanEvtHdlr ( SlWlanEvent_t pSlWlanEvent)

WLAN Async event handler.

Parameters
[out]pSlWlanEventpointer to SlWlanEvent_t data
Returns
None
See also
Note
Warning
Example
1 For pSlWlanEvent->Id = SL_WLAN_EVENT_CONNECT, STA connection indication event
2 Use pSlWlanEvent->Data.Connect main fields
3  - SsidLen
4  - SsidName
5  - Bssid
6 
7 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CONNECT, P2P client connection indication event
8 Use pSlWlanEvent->Data.P2PConnect main fields
9  - SsidLen
10  - SsidName
11  - Bssid
12  - GoDeviceNameLen
13  - GoDeviceName
14 
15 For pSlWlanEvent->Id = SL_WLAN_EVENT_DISCONNECT, STA client disconnection event
16 Use pSlWlanEvent->Data.Disconnect main fields:
17  - SsidLen
18  - SsidName
19  - Bssid
20  - ReasonCode
21 
22 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_DISCONNECT, P2P client disconnection event
23 Use pSlWlanEvent->Data.P2PDisconnect main fields:
24  - SsidLen
25  - SsidName
26  - Bssid
27  - ReasonCode
28  - GoDeviceNameLen
29  - GoDeviceName
30 
31 For pSlWlanEvent->Id = SL_WLAN_EVENT_STA_ADDED, AP connected STA
32 Use pSlWlanEvent->Data.STAAdded fields:
33  - Mac
34 
35 For pSlWlanEvent->Id = SL_WLAN_EVENT_STA_REMOVED, AP disconnected STA
36 Use pSlWlanEvent->Data.STARemoved fields:
37  - Mac
38 
39 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CLIENT_ADDED, P2P(Go) connected P2P(Client)
40 Use pSlWlanEvent->Data.P2PClientAdded fields:
41  - Mac
42  - GoDeviceNameLen
43  - GoDeviceName
44  - OwnSsidLen
45  - OwnSsid
46 
47 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CLIENT_REMOVED, P2P(Go) disconnected P2P(Client)
48 Use pSlWlanEvent->Data.P2PClientRemoved fields:
49  - Mac
50  - GoDeviceNameLen
51  - GoDeviceName
52  - OwnSsidLen
53  - OwnSsid
54 
55 For pSlWlanEvent->Id = SL_WLAN_P2P_DEV_FOUND_EVENT
56 Use pSlWlanEvent->Data.P2PDevFound fields:
57  - GoDeviceNameLen
58  - GoDeviceName
59  - Mac
60  - WpsMethod
61 
62 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_REQUEST
63 Use pSlWlanEvent->Data.P2PRequest fields
64  - GoDeviceNameLen
65  - GoDeviceName
66  - Mac
67  - WpsMethod
68 
69 For pSlWlanEvent->Id = SL_WLAN_EVENT_P2P_CONNECTFAIL, P2P only
70 Use pSlWlanEvent->Data.P2PConnectFail fields:
71  - Status
72 
73 For pSlWlanEvent->Id = SL_WLAN_EVENT_PROVISIONING_STATUS
74 Use pSlWlanEvent->Data.ProvisioningStatus fields
75  - Status
76 
77 For pSlWlanEvent->Id = SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED
78 Use pSlWlanEvent->Data.ProvisioningProfileAdded fields:
79  - Status
80  - SsidLen
81  - Ssid
82  - Reserved