S145 SoftDevice for nRF54LS05 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_uuid_vs_add()

uint32_t sd_ble_uuid_vs_add ( ble_uuid128_t const * p_vs_uuid,
uint8_t * p_uuid_type )

#include <ble.h>

Add a Vendor Specific base UUID.

This call enables the application to add a Vendor Specific base UUID to the BLE stack's table, for later use with all other modules and APIs. This then allows the application to use the shorter, 24-bit ble_uuid_t format when dealing with both 16-bit and 128-bit UUIDs without having to check for lengths and having split code paths. This is accomplished by extending the grouping mechanism that the Bluetooth SIG standard base UUID uses for all other 128-bit UUIDs. The type field in the ble_uuid_t structure is an index (relative to BLE_UUID_TYPE_VENDOR_BEGIN) to the table populated by multiple calls to this function, and the UUID field in the same structure contains the 2 bytes at indexes 12 and 13. The number of possible 128-bit UUIDs available to the application is therefore the number of Vendor Specific UUIDs added with the help of this function times 65536, although restricted to modifying bytes 12 and 13 for each of the entries in the supplied array.

Note
Bytes 12 and 13 of the provided UUID will not be used internally, since those are always replaced by the 16-bit uuid field in ble_uuid_t.
If a UUID is already present in the BLE stack's internal table, the corresponding index will be returned in p_uuid_type along with an NRF_SUCCESS error code.
Parameters
[in]p_vs_uuidPointer to a 16-octet (128-bit) little endian Vendor Specific base UUID disregarding bytes 12 and 13.
[out]p_uuid_typePointer to a uint8_t where the type field in ble_uuid_t corresponding to this UUID will be stored.
Return values
NRF_SUCCESSSuccessfully added the Vendor Specific base UUID.
NRF_ERROR_INVALID_ADDRIf p_vs_uuid or p_uuid_type is NULL or invalid.
NRF_ERROR_NO_MEMIf there are no more free slots for VS UUIDs.