S145 SoftDevice for nRF54L15/nRF54L10/nRF54L05 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_gatts_characteristic_add()

uint32_t sd_ble_gatts_characteristic_add ( uint16_t service_handle,
ble_gatts_char_md_t const * p_char_md,
ble_gatts_attr_t const * p_attr_char_value,
ble_gatts_char_handles_t * p_handles )

#include <ble_gatts.h>

Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the Attribute Table.

Note
It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time).
Several restrictions apply to the parameters, such as matching permissions between the user description descriptor and the writable auxiliaries bits, readable (no security) and writable (selectable) CCCDs and SCCDs and valid presentation format values.
If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions.
Relevant Message Sequence Charts
GATTS ATT Table Population
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_mdCharacteristic metadata.
[in]p_attr_char_valuePointer to the attribute structure corresponding to the characteristic value.
[out]p_handlesPointer to the structure where the assigned handles will be stored.
Return values
NRF_SUCCESSSuccessfully added a characteristic.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_INVALID_PARAMInvalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints.
NRF_ERROR_INVALID_STATEInvalid state to perform operation, a service context is required.
NRF_ERROR_FORBIDDENForbidden value supplied, certain UUIDs are reserved for the stack.
NRF_ERROR_NO_MEMNot enough memory to complete operation.
NRF_ERROR_DATA_SIZEInvalid data size(s) supplied, attribute lengths are restricted by Maximum attribute lengths.