nRF5 SDK  v17.0.2
Choose documentation:
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
GATTS Application command request encoders and command response decoders

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 pp_sys_attr_data, uint16_t **const pp_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...
 
uint32_t ble_gatts_attr_get_req_enc (uint16_t handle, ble_uuid_t *p_uuid, ble_gatts_attr_md_t *p_md, uint8_t *const p_buf, uint32_t *p_buf_len)
 Encodes sd_ble_gatts_attr_get command request. More...
 
uint32_t ble_gatts_attr_get_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, ble_uuid_t **pp_uuid, ble_gatts_attr_md_t **pp_md, uint32_t *const p_result_code)
 Decodes response to sd_ble_gatts_attr_get command. More...
 
uint32_t ble_gatts_initial_user_handle_get_req_enc (uint16_t *p_handle, uint8_t *const p_buf, uint32_t *p_buf_len)
 Encodes sd_ble_gatts_initial_user_handle_get command request. More...
 
uint32_t ble_gatts_initial_user_handle_get_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint16_t **pp_handle, uint32_t *const p_result_code)
 Decodes response to sd_ble_gatts_initial_user_handle_get command. More...
 
uint32_t ble_gatts_exchange_mtu_reply_req_enc (uint16_t conn_handle, uint16_t server_rx_mtu, uint8_t *const p_buf, uint32_t *const p_buf_len)
 Encodes sd_ble_gatts_exchange_mtu_reply command request. More...
 
uint32_t ble_gatts_exchange_mtu_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_exchange_mtu_reply command. More...
 

Detailed Description

GATTS Application command request encoders and command response decoders.

Function Documentation

uint32_t ble_gatts_attr_get_req_enc ( uint16_t  handle,
ble_uuid_t p_uuid,
ble_gatts_attr_md_t p_md,
uint8_t *const  p_buf,
uint32_t *  p_buf_len 
)

Encodes sd_ble_gatts_attr_get command request.

See Also
ble_gatts_attr_get_rsp_dec for command response decoder.
Parameters
[in]handleSee sd_ble_gatts_attr_get.
[in]p_uuidSee sd_ble_gatts_attr_get.
[out]p_mdSee sd_ble_gatts_attr_get.
[in,out]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_gatts_attr_get_rsp_dec ( uint8_t const *const  p_buf,
uint32_t  packet_len,
ble_uuid_t **  pp_uuid,
ble_gatts_attr_md_t **  pp_md,
uint32_t *const  p_result_code 
)

Decodes response to sd_ble_gatts_attr_get command.

See Also
ble_gatts_attr_get_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_uuidPointer to address where to put output data.
[out]pp_mdPointer to address where to put output data.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding failure. Decoded operation code does not match expected operation code.
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.

See Also
ble_gatts_characteristic_add_rsp_dec for command response decoder.
Parameters
[in]service_handleHandle 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_mdPointer to a ble_gatts_char_md_t structure, characteristic metadata.
[in]p_attr_char_valuePointer to a ble_gatts_attr_t structure, corresponding to the characteristic value.
[in]p_handlesPointer to a ble_gatts_char_handles_t structure, where the assigned handles will be stored.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Note
p_handles will not be updated by the command request encoder. Updated values are set by ble_gatts_characteristic_add_rsp_dec.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_characteristic_add_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_handlesPointer to pointer to location where handles should be decoded.
[out]p_result_codePointer to command result code decode location.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_descriptor_add_rsp_dec for command response decoder.
Parameters
[in]char_handleHandle of the characteristic where the description is to be placed. If BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially.
[in]p_attrPointer to a ble_gatts_attr_t structure, characteristic metadata.
[in]p_handlePointer to a ble_gatts_char_handles_t structure, where the assigned handles will be stored.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_descriptor_add_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_handlePointer to bufer where descriptor handle will be returned.
[out]p_result_codePointer to command result code decode location.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding failure. Decoded operation code does not match expected operation code.
uint32_t ble_gatts_exchange_mtu_reply_req_enc ( uint16_t  conn_handle,
uint16_t  server_rx_mtu,
uint8_t *const  p_buf,
uint32_t *const  p_buf_len 
)

Encodes sd_ble_gatts_exchange_mtu_reply command request.

See Also
ble_gatts_exchange_mtu_reply_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]server_rx_mtuServer MTU Size.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMEncoding failure. Invalid param provided in p_reply_params.
uint32_t ble_gatts_exchange_mtu_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_exchange_mtu_reply command.

See Also
ble_gatts_exchange_mtu_reply_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_hvx_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]p_hvx_paramsPointer to an HVx parameters structure to be encoded.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Note
p_hvx_params will not be updated by the command request encoder. Updated values are set by ble_gatts_hvx_rsp_dec.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_hvx_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_result_codeCommand result code.
[out]pp_bytes_writtenPointer to pointer to location where number of bytes is written.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_include_add_rsp_dec for command response decoder.
Parameters
[in]service_handleHandle of the service where the included service is to be placed.
[in]inc_srvc_handleHandle of the included service
[in]p_include_handlePointer to Pointer to a 16-bit word where the assigned handle will be stored.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_include_add_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_include_handlePointer to a 16-bit word where the assigned handle will be stored.
[out]p_result_codePointer to command result code decode location.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding failure. Decoded operation code does not match expected operation code.
uint32_t ble_gatts_initial_user_handle_get_req_enc ( uint16_t *  p_handle,
uint8_t *const  p_buf,
uint32_t *  p_buf_len 
)

Encodes sd_ble_gatts_initial_user_handle_get command request.

See Also
ble_gatts_initial_user_handle_get_rsp_dec for command response decoder.
Parameters
[out]p_handleSee sd_ble_gatts_initial_user_handle_get.
[in,out]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
uint32_t ble_gatts_initial_user_handle_get_rsp_dec ( uint8_t const *const  p_buf,
uint32_t  packet_len,
uint16_t **  pp_handle,
uint32_t *const  p_result_code 
)

Decodes response to sd_ble_gatts_initial_user_handle_get command.

See Also
ble_gatts_initial_user_handle_get_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_handlePointer to address where to put output data.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_rw_authorize_reply_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]p_reply_paramsPointer to ble_gatts_rw_authorize_reply_params_t
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMEncoding 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.

See Also
ble_gatts_rw_authorize_reply_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_service_add_rsp_dec for command response decoder.
Parameters
[in]typeToggles between primary and secondary services, see GATT Server Service Types.
[in]p_uuidPointer to service UUID.
[in]p_conn_handlePointer to a 16-bit word where the assigned handle will be stored.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Note
p_conn_handle will not be updated by the command request encoder. Updated values are set by ble_gatts_service_add_rsp_dec.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_service_add_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_conn_handleConnection handle.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_service_changed_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]start_handleStart of affected attribute handle range.
[in]end_handleEnd of affected attribute handle range.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_PARAMEncoding 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.

See Also
ble_gatts_service_changed_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_sys_attr_get_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle of the connection.
[in]p_sys_attr_dataPointer to buffer where updated information about system attributes will be stored. Can be NULL to calculate required size.
[in]p_sys_attr_data_lenSize of p_sys_attr_data buffer if p_sys_attr_data is not NULL.
[in]flagsAdditional optional flags.
[in,out]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: size of p_buf buffer. out: Length of encoded command packet.
Note
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.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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  pp_sys_attr_data,
uint16_t **const  pp_sys_attr_data_len,
uint32_t *const  p_result_code 
)

Decodes response to sd_ble_gatts_sys_attr_get command.

See Also
ble_gatts_sys_attr_get_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]pp_sys_attr_dataPointer to a buffer where updated information about system attributes will be stored.
[in,out]pp_sys_attr_data_lenin: Size (in bytes) of p_sys_attr_data buffer. out: Length of decoded contents of p_sys_attr_data.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_DATA_SIZELength of p_sys_attr_data is too small to hold decoded value from response.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_sys_attr_set_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]p_sys_attr_dataPointer to a buffer (at least sys_attr_data_len bytes long) containing the attribute value to write.
[in]sys_attr_data_lenLength (in bytes) of p_sys_attr_data.
[in]flagsOptional additional flags.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_sys_attr_set_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding 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.

See Also
ble_gatts_value_get_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]handleAttribute handle.
[in]p_valuePointer to attribute value information.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Note
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.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_value_get_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_valuePointer to structure where the attribute value will be stored.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_DATA_SIZELength 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.

See Also
ble_gatts_value_set_rsp_dec for command response decoder.
Parameters
[in]conn_handleConnection handle.
[in]handleAttribute handle.
[in]p_valuePointer to attribute value information.
[in]p_bufPointer to buffer where encoded data command will be returned.
[in,out]p_buf_lenin: Size of p_buf buffer. out: Length of encoded command packet.
Return values
NRF_SUCCESSEncoding success.
NRF_ERROR_NULLEncoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHEncoding 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.

See Also
ble_gatts_value_set_req_enc for command request encoder.
Parameters
[in]p_bufPointer to beginning of command response packet.
[in]packet_lenLength (in bytes) of response packet.
[out]p_valuePointer to attribute value information.
[out]p_result_codeCommand result code.
Return values
NRF_SUCCESSDecoding success.
NRF_ERROR_NULLDecoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTHDecoding failure. Incorrect buffer length.
NRF_ERROR_INVALID_DATADecoding failure. Decoded operation code does not match expected operation code.