nRF51 SDK - S120 SoftDevice
|
GATTS Application command request encoders and command response decoders. More...
Functions | |
uint32_t | ble_gatts_value_get_req_enc (uint16_t conn_handle, uint16_t handle, ble_gatts_value_t const *const p_value, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_value_get command request. More... | |
uint32_t | ble_gatts_value_get_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, ble_gatts_value_t *const p_value, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_value_get command. More... | |
uint32_t | ble_gatts_hvx_req_enc (uint16_t conn_handle, ble_gatts_hvx_params_t const *const p_hvx_params, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_hvx command request. More... | |
uint32_t | ble_gatts_hvx_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code, uint16_t **const pp_bytes_written) |
Decodes response to sd_ble_gatts_hvx command. More... | |
uint32_t | ble_gatts_characteristic_add_req_enc (uint16_t service_handle, ble_gatts_char_md_t const *const p_char_md, ble_gatts_attr_t const *const p_attr_char_value, ble_gatts_char_handles_t const *const p_handles, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_characteristic_add command request. More... | |
uint32_t | ble_gatts_characteristic_add_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint16_t **const pp_handles, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_characteristic_add command. More... | |
uint32_t | ble_gatts_service_add_req_enc (uint8_t type, ble_uuid_t const *const p_uuid, uint16_t const *const p_conn_handle, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_service_add command request. More... | |
uint32_t | ble_gatts_service_add_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint16_t *const p_conn_handle, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_service_add command. More... | |
uint32_t | ble_gatts_sys_attr_set_req_enc (uint16_t conn_handle, uint8_t const *const p_sys_attr_data, uint16_t sys_attr_data_len, uint32_t flags, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_sys_attr_set command request. More... | |
uint32_t | ble_gatts_sys_attr_set_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_sys_attr_set command. More... | |
uint32_t | ble_gatts_value_set_req_enc (uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_value_set command request. More... | |
uint32_t | ble_gatts_value_set_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, ble_gatts_value_t *const p_value, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_value_set command. More... | |
uint32_t | ble_gatts_sys_attr_get_req_enc (uint16_t conn_handle, uint8_t const *const p_sys_attr_data, uint16_t const *const p_sys_attr_data_len, uint32_t flags, uint8_t *const p_buf, uint32_t *p_buf_len) |
Encodes sd_ble_gatts_sys_attr_get command request. More... | |
uint32_t | ble_gatts_sys_attr_get_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint8_t *const p_sys_attr_data, uint16_t *const p_sys_attr_data_len, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_sys_attr_get command. More... | |
uint32_t | ble_gatts_descriptor_add_req_enc (uint16_t char_handle, ble_gatts_attr_t const *const p_attr, uint16_t *const p_handle, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_descriptor_add command request. More... | |
uint32_t | ble_gatts_descriptor_add_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint16_t *const p_handle, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_descriptor_add command. More... | |
uint32_t | ble_gatts_include_add_req_enc (uint16_t service_handle, uint16_t inc_srvc_handle, uint16_t *const p_include_handle, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_include_add command request. More... | |
uint32_t | ble_gatts_include_add_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint16_t *const p_include_handle, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_include_add command. More... | |
uint32_t | ble_gatts_rw_authorize_reply_req_enc (uint16_t conn_handle, ble_gatts_rw_authorize_reply_params_t const *const p_reply_params, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_rw_authorize_reply command request. More... | |
uint32_t | ble_gatts_rw_authorize_reply_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_rw_authorize_reply command. More... | |
uint32_t | ble_gatts_service_changed_req_enc (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t *const p_buf, uint32_t *const p_buf_len) |
Encodes sd_ble_gatts_service_changed command request. More... | |
uint32_t | ble_gatts_service_changed_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code) |
Decodes response to sd_ble_gatts_service_changed command. More... | |
GATTS Application command request encoders and command response decoders.
uint32_t ble_gatts_characteristic_add_req_enc | ( | uint16_t | service_handle, |
ble_gatts_char_md_t const *const | p_char_md, | ||
ble_gatts_attr_t const *const | p_attr_char_value, | ||
ble_gatts_char_handles_t const *const | p_handles, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_characteristic_add command request.
[in] | service_handle | Handle of the service where the characteristic is to be placed. If BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. |
[in] | p_char_md | Pointer to a ble_gatts_char_md_t structure, characteristic metadata. |
[in] | p_attr_char_value | Pointer to a ble_gatts_attr_t structure, corresponding to the characteristic value. |
[in] | p_handles | Pointer to a ble_gatts_char_handles_t structure, where the assigned handles will be stored. |
[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. |
p_handles
will not be updated by the command request encoder. Updated values are set by ble_gatts_characteristic_add_rsp_dec.NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_characteristic_add_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint16_t **const | pp_handles, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_characteristic_add command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | pp_handles | Pointer to pointer to location where handles should be decoded. |
[out] | p_result_code | Pointer to command result code decode location. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_descriptor_add_req_enc | ( | uint16_t | char_handle, |
ble_gatts_attr_t const *const | p_attr, | ||
uint16_t *const | p_handle, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_descriptor_add command request.
[in] | char_handle | Handle of the characteristic where the description is to be placed. If BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. |
[in] | p_attr | Pointer to a ble_gatts_attr_t structure, characteristic metadata. |
[in] | p_handle | Pointer to a ble_gatts_char_handles_t structure, where the assigned handles will be stored. |
[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. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_descriptor_add_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint16_t *const | p_handle, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_descriptor_add command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_handle | Pointer to bufer where descriptor handle will be returned. |
[out] | p_result_code | Pointer to command result code decode location. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_hvx_req_enc | ( | uint16_t | conn_handle, |
ble_gatts_hvx_params_t const *const | p_hvx_params, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_hvx command request.
[in] | conn_handle | Connection handle. |
[in] | p_hvx_params | Pointer to an HVx parameters structure to be encoded. |
[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. |
p_hvx_params
will not be updated by the command request encoder. Updated values are set by ble_gatts_hvx_rsp_dec.NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_hvx_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint32_t *const | p_result_code, | ||
uint16_t **const | pp_bytes_written | ||
) |
Decodes response to sd_ble_gatts_hvx command.
[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] | pp_bytes_written | Pointer to pointer to location where number of bytes is written. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_include_add_req_enc | ( | uint16_t | service_handle, |
uint16_t | inc_srvc_handle, | ||
uint16_t *const | p_include_handle, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_include_add command request.
[in] | service_handle | Handle of the service where the included service is to be placed. |
[in] | inc_srvc_handle | Handle of the included service |
[in] | p_include_handle | Pointer to Pointer to a 16-bit word where the assigned handle will be stored. |
[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. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_include_add_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint16_t *const | p_include_handle, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_include_add command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_include_handle | Pointer to a 16-bit word where the assigned handle will be stored. |
[out] | p_result_code | Pointer to command result code decode location. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_rw_authorize_reply_req_enc | ( | uint16_t | conn_handle, |
ble_gatts_rw_authorize_reply_params_t const *const | p_reply_params, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_rw_authorize_reply command request.
[in] | conn_handle | Connection handle. |
[in] | p_reply_params | Pointer to ble_gatts_rw_authorize_reply_params_t |
[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. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Encoding failure. Invalid param provided in p_reply_params. |
uint32_t ble_gatts_rw_authorize_reply_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_rw_authorize_reply command.
[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. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_service_add_req_enc | ( | uint8_t | type, |
ble_uuid_t const *const | p_uuid, | ||
uint16_t const *const | p_conn_handle, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_service_add command request.
[in] | type | Toggles between primary and secondary services, see GATT Server Service Types. |
[in] | p_uuid | Pointer to service UUID. |
[in] | p_conn_handle | Pointer to a 16-bit word where the assigned handle will be stored. |
[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. |
p_conn_handle
will not be updated by the command request encoder. Updated values are set by ble_gatts_service_add_rsp_dec.NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_service_add_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint16_t *const | p_conn_handle, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_service_add command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_conn_handle | Connection handle. |
[out] | p_result_code | Command result code. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_service_changed_req_enc | ( | uint16_t | conn_handle, |
uint16_t | start_handle, | ||
uint16_t | end_handle, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_service_changed command request.
[in] | conn_handle | Connection handle. |
[in] | start_handle | Start of affected attribute handle range. |
[in] | end_handle | End of affected attribute handle range. |
[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. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_PARAM | Encoding failure. Invalid param provided in p_reply_params. |
uint32_t ble_gatts_service_changed_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_service_changed command.
[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. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_sys_attr_get_req_enc | ( | uint16_t | conn_handle, |
uint8_t const *const | p_sys_attr_data, | ||
uint16_t const *const | p_sys_attr_data_len, | ||
uint32_t | flags, | ||
uint8_t *const | p_buf, | ||
uint32_t * | p_buf_len | ||
) |
Encodes sd_ble_gatts_sys_attr_get command request.
[in] | conn_handle | Connection handle of the connection. |
[in] | p_sys_attr_data | Pointer to buffer where updated information about system attributes will be stored. Can be NULL to calculate required size. |
[in] | p_sys_attr_data_len | Size of p_sys_attr_data buffer if p_sys_attr_data is not NULL. |
[in] | flags | Additional optional flags. |
[in,out] | 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. |
p_sys_attr_data
and p_sys_attr_data_len
will not be updated by the command request encoder. Updated values are set by ble_gatts_sys_attr_get_rsp_dec.NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_sys_attr_get_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint8_t *const | p_sys_attr_data, | ||
uint16_t *const | p_sys_attr_data_len, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_sys_attr_get command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_sys_attr_data | Pointer to a buffer where updated information about system attributes will be stored. |
[in,out] | p_sys_attr_data_len | in: Size (in bytes) of p_sys_attr_data buffer. out: Length of decoded contents of p_sys_attr_data . |
[out] | p_result_code | Command result code. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_DATA_SIZE | Length of p_sys_attr_data is too small to hold decoded value from response. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_sys_attr_set_req_enc | ( | uint16_t | conn_handle, |
uint8_t const *const | p_sys_attr_data, | ||
uint16_t | sys_attr_data_len, | ||
uint32_t | flags, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_sys_attr_set command request.
[in] | conn_handle | Connection handle. |
[in] | p_sys_attr_data | Pointer to a buffer (at least sys_attr_data_len bytes long) containing the attribute value to write. |
[in] | sys_attr_data_len | Length (in bytes) of p_sys_attr_data . |
[in] | flags | Optional additional flags. |
[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. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_sys_attr_set_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_sys_attr_set command.
[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. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_gatts_value_get_req_enc | ( | uint16_t | conn_handle, |
uint16_t | handle, | ||
ble_gatts_value_t const *const | p_value, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_value_get command request.
[in] | conn_handle | Connection handle. |
[in] | handle | Attribute handle. |
[in] | p_value | Pointer to attribute value information. |
[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. |
p_data_len
and p_data
will not be updated by the command request encoder. Updated values are set by ble_gatts_value_get_rsp_dec.NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_value_get_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
ble_gatts_value_t *const | p_value, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_value_get command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_value | Pointer to structure where the attribute value will be stored. |
[out] | p_result_code | Command result code. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_DATA_SIZE | Length of p_value is too small to hold decoded value from response. |
uint32_t ble_gatts_value_set_req_enc | ( | uint16_t | conn_handle, |
uint16_t | handle, | ||
ble_gatts_value_t * | p_value, | ||
uint8_t *const | p_buf, | ||
uint32_t *const | p_buf_len | ||
) |
Encodes sd_ble_gatts_value_set command request.
[in] | conn_handle | Connection handle. |
[in] | handle | Attribute handle. |
[in] | p_value | Pointer to attribute value information. |
[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. |
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_gatts_value_set_rsp_dec | ( | uint8_t const *const | p_buf, |
uint32_t | packet_len, | ||
ble_gatts_value_t *const | p_value, | ||
uint32_t *const | p_result_code | ||
) |
Decodes response to sd_ble_gatts_value_set command.
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_value | Pointer to attribute value information.. |
[out] | p_result_code | Command result code. |
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |