nRF5 SDK v17.1.0
Modules | Functions
Application codecs for S212

Modules

 Application command request encoders and command response decoders
 Application command request encoders and command response decoders.
 

Functions

uint32_t ant_event_dec (uint8_t const *const p_buf, uint32_t packet_len, ant_evt_t *const p_event, uint32_t *const p_event_len)
 Event decoding dispatcher. More...
 

Detailed Description

Function Documentation

uint32_t ant_event_dec ( uint8_t const *const  p_buf,
uint32_t  packet_len,
ant_evt_t *const  p_event,
uint32_t *const  p_event_len 
)

Event decoding dispatcher.

The event decoding dispatcher will route the event packet to the correct decoder, which in turn decodes the contents of the event and updates the p_event struct.

If p_event is null, the required length of p_event is returned in p_event_len.

Parameters
[in]p_bufPointer to the beginning of the event packet.
[in]packet_lenLength (in bytes) of the event packet.
[in,out]p_eventPointer to the ant_evt_t buffer where the decoded event will be stored. If NULL, the required length will be returned in p_event_len.
[in,out]p_event_lenin: Size (in bytes) of p_event buffer. out: Length of the decoded contents of p_event.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_DATA_SIZEDecoding failure. Length of p_event is too small to hold the decoded event.
NRF_ERROR_NOT_FOUNDDecoding failure. No event decoder is available.

Documentation feedback | Developer Zone | Subscribe | Updated