nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SOC Application command request encoders and command response decoders

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

Functions

uint32_t power_system_off_req_enc (uint8_t *const p_buf, uint32_t *const p_buf_len)
 Encodes sd_power_system_off command request. More...
 
uint32_t temp_get_req_enc (int32_t const *const p_temp, uint8_t *const p_buf, uint32_t *const p_buf_len)
 Encodes sd_temp_get command request. More...
 
uint32_t temp_get_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code, int32_t *const p_temp)
 Decodes response to sd_temp_get command. More...
 

Detailed Description

SOC Application command request encoders and command response decoders.

Function Documentation

uint32_t power_system_off_req_enc ( uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Encodes sd_power_system_off command request.

See Also
0x34 - sd_power_system_off for packet format.
Parameters
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t temp_get_req_enc ( int32_t const *const  p_temp,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Encodes sd_temp_get command request.

See Also
0x52 - sd_temp_get for packet format. temp_get_rsp_dec for command response decoder.
Parameters
[in]p_tempPointer to result of temperature measurement.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t temp_get_rsp_dec ( uint8_t const *const  p_buf,
uint32_t  packet_len,
uint32_t *const  p_result_code,
int32_t *const  p_temp 
)

Decodes response to sd_temp_get command.

See Also
0x52 - sd_temp_get for packet format, temp_get_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_result_codeCommand result code.
[out]p_tempPointer to result of temperature measurement.
Returns
NRF_SUCCESS Version information stored successfully.
Return values
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_DATA_SIZEDecoding failure. Length of p_event is too small to hold decoded event.