Module for reporting internal stack events, to help traceability and debugging. More...
Data Structures | |
| struct | internal_event_t |
| Internal event structure. More... | |
Macros | |
| #define | __INTERNAL_EVENT_PUSH(EVENT_TYPE, ADDATA, PACKET_SIZE, P_PACKET) |
| Pushes an internal event to the callback function provided at the initialization. More... | |
Typedefs | |
| typedef uint32_t(* | internal_event_report_cb_t) (internal_event_t *p_event) |
| Callback function for inline handling of internal events. More... | |
Functions | |
| void | internal_event_init (internal_event_report_cb_t report_cb) |
| Initializes the internal event module. More... | |
| uint32_t | internal_event_push (internal_event_t *p_event) |
| Pushes an internal event to the callback function provided at the initialization. More... | |
Detailed Description
Module for reporting internal stack events, to help traceability and debugging.
Macro Definition Documentation
◆ __INTERNAL_EVENT_PUSH
| #define __INTERNAL_EVENT_PUSH | ( | EVENT_TYPE, | |
| ADDATA, | |||
| PACKET_SIZE, | |||
| P_PACKET | |||
| ) |
do { \ internal_event_t EVT = \ { \ .type = (EVENT_TYPE), \ .state.value = (ADDATA), \ .packet_size = (PACKET_SIZE), \ .p_packet = (uint8_t *) (P_PACKET) \ }; \ uint32_t RESULT = internal_event_push(&EVT); \ if (RESULT != NRF_SUCCESS) \ { \ __LOG(LOG_SRC_INTERNAL, LOG_LEVEL_WARN, "Unable to push the internal event to the callback function [er%d]", RESULT); \ } \ } while (0)uint32_t internal_event_push(internal_event_t *p_event)Pushes an internal event to the callback function provided at the initialization. ...
Pushes an internal event to the callback function provided at the initialization.
- Warning
- The macro will not return any error codes as a result of the callback call.
- Parameters
-
[in] EVENT_TYPE Type of internal event. [in] ADDATA Context data for event. May be NULL. [in] PACKET_SIZE Size of packet (optional) [in] P_PACKET Pointer to packet.
Definition at line 155 of file internal_event.h.
Typedef Documentation
◆ internal_event_report_cb_t
| typedef uint32_t(* internal_event_report_cb_t) (internal_event_t *p_event) |
Callback function for inline handling of internal events.
- Warning
- Events may be generated in
STACK_LOWcontext and may be highly timing sensitive.
- Parameters
-
[in,out] p_event Internal event.
- Returns
- NRF_SUCCESS Successfully handled event.
Definition at line 124 of file internal_event.h.
Enumeration Type Documentation
◆ internal_event_type_t
Internal event types.
| Enumerator | |
|---|---|
| INTERNAL_EVENT_DECRYPT_APP | |
| INTERNAL_EVENT_DECRYPT_TRS | Transport layer decrypted packet. |
| INTERNAL_EVENT_DECRYPT_TRS_SEG | Transport layer decrypted packet segment. |
| INTERNAL_EVENT_PACKET_DROPPED | Packet dropped with reason internal_event_packet_dropped_t. |
| INTERNAL_EVENT_PACKET_RELAYED | Packet was relayed by the network layer. |
| INTERNAL_EVENT_NET_PACKET_QUEUED_TX | Network queued packet in bearer for TX. |
| INTERNAL_EVENT_TRS_ACK_RECEIVED | ACK for transport SAR segment received. |
| INTERNAL_EVENT_ACK_QUEUED | ACK for transport SAR queued in bearer. |
| INTERNAL_EVENT_SAR_CANCELLED | SAR transaction cancelled. |
| INTERNAL_EVENT_FM_ACTION | Flash Manager Action Completed. |
| INTERNAL_EVENT_FM_DEFRAG | Flash Manager Defrag Completed. |
| INTERNAL_EVENT_SAR_SUCCESS | SAR transaction cancelled. |
| INTERNAL_EVENT_NET_PACKET_RECEIVED | Network layer packet data used for PTS. |
| INTERNAL_EVENT_GATT_PROV_PDU_IGNORED | Invalid provisioning PDU was ignored. |
| INTERNAL_EVENT_FRIEND_PACKET_QUEUED | Packet to LPN is queued on Friend node. |
| INTERNAL_EVENT_NET_BEACON_TX | Network beacon is transmitted. |
Definition at line 56 of file internal_event.h.
◆ internal_event_packet_dropped_t
Internal event packet dropped reasons.
Definition at line 80 of file internal_event.h.
Function Documentation
◆ internal_event_init()
| void internal_event_init | ( | internal_event_report_cb_t | report_cb | ) |
Initializes the internal event module.
- Parameters
-
[in] report_cb A callback function for reporting internal events.
◆ internal_event_push()
| uint32_t internal_event_push | ( | internal_event_t * | p_event | ) |
Pushes an internal event to the callback function provided at the initialization.
- Parameters
-
[in] p_event Pointer to internal event structure.
- Return values
-
NRF_SUCCESS Successfully pushed event to the callback function. NRF_ERROR_NULL NULL pointer supplied to function.