nRF5 SDK v13.0.0
Functions
Connectivity command request decoders and command response encoders

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

Functions

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 sd_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 sd_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 sd_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 sd_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 sd_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 sd_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 sd_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 sd_ble_uuid_encode command response. More...
 
uint32_t ble_uuid_decode_req_dec (uint8_t const *const p_buf, uint32_t const packet_len, uint8_t *p_uuid_le_len, uint8_t **const pp_uuid_le, ble_uuid_t **const pp_uuid)
 Decodes sd_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 sd_ble_uuid_decode command response. More...
 
uint32_t ble_uuid_vs_add_req_dec (uint8_t const *const p_buf, uint16_t packet_len, ble_uuid128_t **const pp_uuid, uint8_t **const pp_uuid_type)
 Decodes sd_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 sd_ble_uuid_vs_add command response. More...
 
uint32_t ble_enable_req_dec (uint8_t const *const p_buf, uint32_t packet_len)
 Decodes sd_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 sd_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 middleware. More...
 
uint32_t ble_user_mem_reply_req_dec (uint8_t const *const p_buf, uint32_t packet_len, uint16_t *const p_conn_handle, ble_user_mem_block_t **const pp_block)
 Decodes sd_ble_user_mem_reply command request. More...
 
uint32_t ble_user_mem_reply_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len)
 Encodes sd_ble_user_mem_reply command response. 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 
)

Decodes sd_ble_enable command request.

See Also
ble_enable_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response 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 sd_ble_enable command response.

See Also
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 sd_ble_opt_get command request.

See Also
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 sd_ble_opt_get command response.

See Also
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 middleware.

Parameters
[out]p_bufPointer to buffer where encoded data command response will be returned.
[in,out]packet_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 sd_ble_opt_set command request.

See Also
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 sd_ble_opt_set command response.

See Also
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_user_mem_reply_req_dec ( uint8_t const *const  p_buf,
uint32_t  packet_len,
uint16_t *const  p_conn_handle,
ble_user_mem_block_t **const  pp_block 
)

Decodes sd_ble_user_mem_reply command request.

See Also
ble_user_mem_reply_rsp_enc for response encoding.
Parameters
[in]p_bufPointer to beginning of command request packet.
[in]packet_lenLength (in bytes) of response packet.
[in]p_conn_handlePointer to Connection Handle.
[in,out]pp_blockPointer to pointer to ble_user_mem_block_t. It will be set to NULL if p_block 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_user_mem_reply_rsp_enc ( uint32_t  return_code,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Encodes sd_ble_user_mem_reply command response.

See Also
ble_user_mem_reply_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_uuid_decode_req_dec ( uint8_t const *const  p_buf,
uint32_t const  packet_len,
uint8_t *  p_uuid_le_len,
uint8_t **const  pp_uuid_le,
ble_uuid_t **const  pp_uuid 
)

Decodes sd_ble_uuid_decode command request.

See Also
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 sd_ble_uuid_decode command response.

See Also
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 sd_ble_uuid_encode command request.

See Also
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 sd_ble_uuid_encode command response.

See Also
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_lePointer 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  packet_len,
ble_uuid128_t **const  pp_uuid,
uint8_t **const  pp_uuid_type 
)

Decodes sd_ble_uuid_vs_add command request.

See Also
ble_uuid_vs_add_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 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 sd_ble_uuid_vs_add command response.

See Also
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_uuid_typePointer 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 sd_ble_version_get command request.

See Also
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 sd_ble_version_get command response.

See Also
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.

Documentation feedback | Developer Zone | Subscribe | Updated