SOC Application command request encoders and command response decoders

nRF5 SDK v9.0.0

nRF51 SDK v9.0.0

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_buf Pointer to buffer where encoded data command will be returned.
[in,out] p_buf_len in: size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESS Encoding success.
NRF_ERROR_NULL Encoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTH Encoding 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_temp Pointer to result of temperature measurement.
[in] p_buf Pointer to buffer where encoded data command will be returned.
[in,out] p_buf_len in: size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESS Encoding success.
NRF_ERROR_NULL Encoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTH Encoding 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_buf Pointer to beginning of command response packet.
[in] packet_len Length (in bytes) of response packet.
[out] p_result_code Command result code.
[out] p_temp Pointer to result of temperature measurement.
Returns
NRF_SUCCESS Version information stored successfully.
Return values
NRF_ERROR_INVALID_LENGTH Decoding failure. Incorrect buffer length.
NRF_ERROR_DATA_SIZE Decoding failure. Length of p_event is too small to hold decoded event.

Please send us your feedback about the documentation! For technical questions, visit the Nordic Developer Zone .