Embassy
nrf-softdevice-s122

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gatts_service_add(
type_: u8,
p_uuid: *const ble_uuid_t,
p_handle: *mut u16
) -> u32
Expand description

@brief Add a service declaration to the Attribute Table.

@note Secondary Services are only relevant in the context of the entity that references them, it is therefore forbidden to add a secondary service declaration that is not referenced by another service later in the Attribute Table.

@mscs @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} @endmscs

@param[in] type Toggles between primary and secondary services, see @ref BLE_GATTS_SRVC_TYPES. @param[in] p_uuid Pointer to service UUID. @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored.

@retval ::NRF_SUCCESS Successfully added a service declaration. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, Vendor Specific UUIDs need to be present in the table. @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.