S115 SoftDevice for nRF54LM20 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_gatts_value_get()

uint32_t sd_ble_gatts_value_get ( uint16_t conn_handle,
uint16_t handle,
ble_gatts_value_t * p_value )

#include <ble_gatts.h>

Get the value of a given attribute.

Note
If the attribute value is longer than the size of the supplied buffer, ble_gatts_value_t::len will return the total attribute value length (excluding offset), and not the number of bytes actually returned in ble_gatts_value_t::p_value. The application may use this information to allocate a suitable buffer size.
When retrieving system attribute values with this function, the connection handle may refer to an already disconnected connection. Refer to the documentation of sd_ble_gatts_sys_attr_get for further information.
Parameters
[in]conn_handleConnection handle. Ignored if the value does not belong to a system attribute.
[in]handleAttribute handle.
[in,out]p_valueAttribute value information.
Return values
NRF_SUCCESSSuccessfully retrieved the value of the attribute.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_NOT_FOUNDAttribute not found.
NRF_ERROR_INVALID_PARAMInvalid attribute offset supplied.
BLE_ERROR_INVALID_CONN_HANDLEInvalid connection handle supplied on a system attribute.
BLE_ERROR_GATTS_SYS_ATTR_MISSINGSystem attributes missing, use sd_ble_gatts_sys_attr_set to set them to a known value.