Function nrf_softdevice_s113::sd_ble_gatts_value_get
source · pub unsafe fn sd_ble_gatts_value_get(
conn_handle: u16,
handle: u16,
p_value: *mut ble_gatts_value_t
) -> u32
Expand description
@brief Get the value of a given attribute.
@note If the attribute value is longer than the size of the supplied buffer, @ref ble_gatts_value_t::len will return the total attribute value length (excluding offset), and not the number of bytes actually returned in @ref ble_gatts_value_t::p_value. The application may use this information to allocate a suitable buffer size.
@note When retrieving system attribute values with this function, the connection handle may refer to an already disconnected connection. Refer to the documentation of @ref sd_ble_gatts_sys_attr_get for further information.
@param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute. @param[in] handle Attribute handle. @param[in,out] p_value Attribute value information.
@retval ::NRF_SUCCESS Successfully retrieved the value of the attribute. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_NOT_FOUND Attribute not found. @retval ::NRF_ERROR_INVALID_PARAM Invalid attribute offset supplied. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute. @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value.