nRF51 SDK - S110 SoftDevice
|
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 sd_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 sd_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 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 buf_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 buf_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, ble_enable_params_t **const pp_ble_enable_params) |
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 middlware. More... | |
Connectivity command request decoders and command response encoders.
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 sd_ble_enable command request.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | pp_ble_enable_params | Pointer to pointer to ble_enable_params_t. It will be set to NULL if p_ble_enable_params is not present in the packet. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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.
[in] | p_event | Pointer to the ble_evt_t buffer that shall be encoded. |
[in] | event_len | Size (in bytes) of p_event buffer. |
[out] | p_buf | Pointer to the beginning of a buffer for encoded event packet. |
[in,out] | p_buf_len | in: Size (in bytes) of p_buf buffer. out: Length of encoded contents in p_buf . |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
NRF_ERROR_NOT_SUPPORTED | Event 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.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_opt_id | Pointer to pointer to ble_version_t address. |
[out] | pp_opt | Pointer to pointer to ble_opt_t address. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in] | opt_id | identifies type of ble_opt_t union |
[in] | p_opt | Pointer to ble_opt_t union. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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.
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | packet_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in,out] | p_opt_id | Pointer to opt_id which identifies type of ble_opt_t union. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_opt_id | Pointer to ble_opt_t union type identifier. |
[out] | pp_opt | Pointer to pointer to ble_opt_t union. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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 sd_ble_tx_buffer_count_get command request.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | pp_count | Pointer to pointer to location for count. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Decoding 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 sd_ble_tx_buffer_count_get command response.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in] | p_count | Pointer to count value. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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 sd_ble_uuid_decode command request.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | buf_len | Length (in bytes) of response packet. |
[out] | p_uuid_le_len | Pointer to the length of encoded UUID. |
[out] | pp_uuid_le | Pointer to pointer to buffer where encoded UUID will be stored. |
[out] | pp_uuid | Pointer to pointer to ble_uuid_t structure. It will be set to NULL if p_uuid is not present in the packet. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in] | p_uuid | Pointer to the buffer with encoded UUID. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | pp_uuid | Pointer to pointer to ble_uuid_t structure. |
[out] | pp_uuid_le_len | Pointer to pointer to the length of encoded UUID. |
[out] | pp_uuid_le | Pointer to pointer to buffer where encoded UUID will be stored. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in] | uuid_le_len | Length of the encoded UUID. |
[in] | p_uuid_le | Pointer to the buffer with encoded UUID. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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 sd_ble_uuid_vs_add command request.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | buf_len | Length (in bytes) of response packet. |
[out] | pp_uuid | Pointer to pointer to UUID. It will be set to NULL if p_uuid is not present in the packet. |
[out] | pp_uuid_type | Pointer to pointer to UUID type. It will be set to NULL if p_uuid_type is not present in the packet. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in] | p_uuid_type | Pointer to the UUID type. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding 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.
[in] | p_buf | Pointer to beginning of command request packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | pp_version | Pointer to pointer to ble_version_t address. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Decoding 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.
[in] | return_code | Return code indicating if command was successful or not. |
[out] | p_buf | Pointer to buffer where encoded data command response will be returned. |
[in,out] | p_buf_len | in: size of p_buf buffer. out: Length of encoded command response packet. |
[in] | p_version | Pointer to ble_version_t address. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |