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

Connectivity command request decoders and command response encoders. More...

Functions

uint32_t ble_tx_buffer_count_get_req_dec (uint8_t const *const p_buf, uint16_t packet_len, uint8_t **const pp_count)
 Decodes ble_tx_buffer_count_get command request. More...
 
uint32_t ble_tx_buffer_count_get_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len, uint8_t const *const p_count)
 Encodes ble_tx_buffer_count_get command response. More...
 
uint32_t ble_event_enc (ble_evt_t const *const p_event, uint32_t event_len, uint8_t *const p_buf, uint32_t *const p_buf_len)
 Event encoding dispatcher. More...
 
uint32_t ble_version_get_req_dec (uint8_t const *const p_buf, uint16_t packet_len, ble_version_t **const pp_version)
 Decodes ble_version_get command request. More...
 
uint32_t ble_version_get_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len, ble_version_t const *const p_version)
 Encodes ble_version_get command response. More...
 
uint32_t ble_opt_get_req_dec (uint8_t const *const p_buf, uint16_t packet_len, uint32_t *const p_opt_id, ble_opt_t **const pp_opt)
 Decodes ble_opt_get command request. More...
 
uint32_t ble_opt_get_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len, uint32_t opt_id, ble_opt_t const *const p_opt)
 Encodes ble_opt_get command response. More...
 
uint32_t ble_opt_set_req_dec (uint8_t const *const p_buf, uint16_t packet_len, uint32_t *const p_opt_id, ble_opt_t **const pp_opt)
 Decodes ble_opt_set command request. More...
 
uint32_t ble_opt_set_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len)
 Encodes ble_opt_set command response. More...
 
uint32_t ble_uuid_encode_req_dec (uint8_t const *const p_buf, uint16_t packet_len, ble_uuid_t **const pp_uuid, uint8_t **const pp_uuid_le_len, uint8_t **const pp_uuid_le)
 Decodes ble_uuid_encode command request. More...
 
uint32_t ble_uuid_encode_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len, uint8_t uuid_le_len, uint8_t const *const p_uuid_le)
 Encodes ble_uuid_encode command response. More...
 
uint32_t ble_uuid_decode_req_dec (uint8_t const *const p_buf, uint32_t const buf_len, uint8_t *p_uuid_le_len, uint8_t **const pp_uuid_le, ble_uuid_t **const pp_uuid)
 Decodes ble_uuid_decode command request. More...
 
uint32_t ble_uuid_decode_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len, ble_uuid_t const *const p_uuid)
 Encodes ble_uuid_decode command response. More...
 
uint32_t ble_uuid_vs_add_req_dec (uint8_t const *const p_buf, uint16_t buf_len, ble_uuid128_t **const pp_uuid, uint8_t **const pp_uuid_type)
 Decodes ble_uuid_vs_add command request. More...
 
uint32_t ble_uuid_vs_add_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len, uint8_t const *const p_uuid_type)
 Encodes ble_uuid_vs_add command response. More...
 
uint32_t ble_enable_req_dec (uint8_t const *const p_buf, uint32_t packet_len, ble_enable_params_t **const pp_ble_enable_params)
 Decodes ble_enable command request. More...
 
uint32_t ble_enable_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len)
 Encodes ble_enable command response. More...
 
uint32_t ble_opt_id_pre_dec (uint8_t const *const p_buf, uint16_t packet_len, uint32_t *const p_opt_id)
 Pre-decodes opt_id of ble_opt_t for middlware. More...
 

Detailed Description

Connectivity command request decoders and command response encoders.

Function Documentation

uint32_t ble_enable_req_dec ( uint8_t const *const  p_buf,
uint32_t  packet_len,
ble_enable_params_t **const  pp_ble_enable_params 
)

Decodes ble_enable command request.

See Also
nrf51_sd_ble_enable for packet format, ble_enable_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]buf_lenLength (in bytes) of response packet.
[out]pp_ble_enable_paramsPointer to pointer to ble_enable_params_t. It will be set to NULL if p_ble_enable_params is not present in the packet.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
uint32_t ble_enable_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Encodes ble_enable command response.

See Also
nrf51_sd_ble_enable for packet format. ble_enable_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_event_enc ( ble_evt_t const *const  p_event,
uint32_t  event_len,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Event encoding dispatcher.

The event encoding dispatcher will route the event packet to the correct encoder which in turn encodes the contents of the event and updates the p_buf buffer.

Parameters
[in]p_eventPointer to the ble_evt_t buffer that shall be encoded.
[in]event_lenSize (in bytes) of p_event buffer.
[out]p_bufPointer to the beginning of a buffer for encoded event packet.
[in,out]p_buf_lenin: Size (in bytes) of p_buf buffer. out: Length of encoded contents in p_buf.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
NRF_ERROR_NOT_SUPPORTEDEvent encoder is not implemented.
uint32_t ble_opt_get_req_dec ( uint8_t const *const  p_buf,
uint16_t  packet_len,
uint32_t *const  p_opt_id,
ble_opt_t **const  pp_opt 
)

Decodes ble_opt_get command request.

See Also
nrf51_sd_ble_opt_get for packet format, ble_opt_get_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_opt_idPointer to pointer to ble_version_t address.
[out]pp_optPointer to pointer to ble_opt_t address.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMDecoding failure. Invalid operation type.
uint32_t ble_opt_get_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len,
uint32_t  opt_id,
ble_opt_t const *const  p_opt 
)

Encodes ble_opt_get command response.

See Also
nrf51_sd_ble_opt_get for packet format. ble_opt_get_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in]opt_ididentifies type of ble_opt_t union
[in]p_optPointer to ble_opt_t union.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_opt_id_pre_dec ( uint8_t const *const  p_buf,
uint16_t  packet_len,
uint32_t *const  p_opt_id 
)

Pre-decodes opt_id of ble_opt_t for middlware.

See Also
nrf51_sd_ble_enable for packet format. ble_enable_req_dec for request decoding.
Parameters
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in,out]p_opt_idPointer to opt_id which identifies type of ble_opt_t union.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_opt_set_req_dec ( uint8_t const *const  p_buf,
uint16_t  packet_len,
uint32_t *const  p_opt_id,
ble_opt_t **const  pp_opt 
)

Decodes ble_opt_set command request.

See Also
nrf51_sd_ble_opt_set for packet format, ble_opt_set_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_opt_idPointer to ble_opt_t union type identifier.
[out]pp_optPointer to pointer to ble_opt_t union.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMDecoding failure. Invalid operation type.
uint32_t ble_opt_set_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Encodes ble_opt_set command response.

See Also
nrf51_sd_ble_opt_set for packet format. ble_opt_set_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_tx_buffer_count_get_req_dec ( uint8_t const *const  p_buf,
uint16_t  packet_len,
uint8_t **const  pp_count 
)

Decodes ble_tx_buffer_count_get command request.

See Also
nrf51_sd_ble_tx_buffer_count_get for packet format, ble_tx_buffer_count_get_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_countPointer to pointer to location for count.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMDecoding failure. Invalid operation type.
uint32_t ble_tx_buffer_count_get_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len,
uint8_t const *const  p_count 
)

Encodes ble_tx_buffer_count_get command response.

See Also
nrf51_sd_ble_tx_buffer_count_get for packet format. ble_tx_buffer_count_get_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in]p_countPointer to count value.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_uuid_decode_req_dec ( uint8_t const *const  p_buf,
uint32_t const  buf_len,
uint8_t *  p_uuid_le_len,
uint8_t **const  pp_uuid_le,
ble_uuid_t **const  pp_uuid 
)

Decodes ble_uuid_decode command request.

See Also
nrf51_sd_ble_uuid_decode for packet format, ble_uuid_decode_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_uuid_le_lenPointer to the length of encoded UUID.
[out]pp_uuid_lePointer to pointer to buffer where encoded UUID will be stored.
[out]pp_uuidPointer to pointer to ble_uuid_t structure. It will be set to NULL if p_uuid is not present in the packet.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
uint32_t ble_uuid_decode_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len,
ble_uuid_t const *const  p_uuid 
)

Encodes ble_uuid_decode command response.

See Also
nrf51_sd_ble_uuid_decode for packet format. ble_uuid_decode_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in]p_uuidPointer to the buffer with encoded UUID.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_uuid_encode_req_dec ( uint8_t const *const  p_buf,
uint16_t  packet_len,
ble_uuid_t **const  pp_uuid,
uint8_t **const  pp_uuid_le_len,
uint8_t **const  pp_uuid_le 
)

Decodes ble_uuid_encode command request.

See Also
nrf51_sd_ble_uuid_encode for packet format, ble_uuid_encode_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_uuidPointer to pointer to ble_uuid_t structure.
[out]pp_uuid_le_lenPointer to pointer to the length of encoded UUID.
[out]pp_uuid_lePointer to pointer to buffer where encoded UUID will be stored.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMDecoding failure. Invalid operation type.
uint32_t ble_uuid_encode_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len,
uint8_t  uuid_le_len,
uint8_t const *const  p_uuid_le 
)

Encodes ble_uuid_encode command response.

See Also
nrf51_sd_ble_uuid_encode for packet format. ble_uuid_encode_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in]uuid_le_lenLength of the encoded UUID.
[in]p_uuid_le_Pointer to the buffer with encoded UUID.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_uuid_vs_add_req_dec ( uint8_t const *const  p_buf,
uint16_t  buf_len,
ble_uuid128_t **const  pp_uuid,
uint8_t **const  pp_uuid_type 
)

Decodes ble_uuid_vs_add command request.

See Also
nrf51_sd_ble_uuid_vs_add for packet format, ble_uuid_vs_add_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]buf_lenLength (in bytes) of response packet.
[out]pp_uuidPointer to pointer to UUID. It will be set to NULL if p_uuid is not present in the packet.
[out]pp_uuid_typePointer to pointer to UUID type. It will be set to NULL if p_uuid_type is not present in the packet.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
uint32_t ble_uuid_vs_add_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len,
uint8_t const *const  p_uuid_type 
)

Encodes ble_uuid_vs_add command response.

See Also
nrf51_sd_ble_uuid_vs_add for packet format. ble_uuid_vs_add_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in]p_uuidPointer to the UUID type.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_version_get_req_dec ( uint8_t const *const  p_buf,
uint16_t  packet_len,
ble_version_t **const  pp_version 
)

Decodes ble_version_get command request.

See Also
nrf51_sd_ble_version_get for packet format, ble_version_get_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_versionPointer to pointer to ble_version_t address.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMDecoding failure. Invalid operation type.
uint32_t ble_version_get_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len,
ble_version_t const *const  p_version 
)

Encodes ble_version_get command response.

See Also
nrf51_sd_ble_version_get for packet format. ble_version_get_req_dec for request decoding.
Parameters
[in]return_codeReturn code indicating if command was successful or not.
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command response packet.
[in]p_versionPointer to ble_version_t address.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.