nrf-softdevice-s132

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gatts_characteristic_add(
service_handle: u16,
p_char_md: *const ble_gatts_char_md_t,
p_attr_char_value: *const ble_gatts_attr_t,
p_handles: *mut ble_gatts_char_handles_t
) -> u32
Expand description

@brief 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).

@note 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.

@note If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions.

@mscs @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} @endmscs

@param[in] service_handle Handle of the service where the characteristic is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. @param[in] p_char_md Characteristic metadata. @param[in] p_attr_char_value Pointer to the attribute structure corresponding to the characteristic value. @param[out] p_handles Pointer to the structure where the assigned handles will be stored.

@retval ::NRF_SUCCESS Successfully added a characteristic. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints. @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required. @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX.