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

◆ sd_ble_uuid_decode()

uint32_t sd_ble_uuid_decode ( uint8_t uuid_le_len,
uint8_t const * p_uuid_le,
ble_uuid_t * p_uuid )

#include <ble.h>

Decode little endian raw UUID bytes (16-bit or 128-bit) into a 24 bit ble_uuid_t structure.

The raw UUID bytes excluding bytes 12 and 13 (i.e. bytes 0-11 and 14-15) of p_uuid_le are compared to the corresponding ones in each entry of the table of Vendor Specific base UUIDs to look for a match. If there is such a match, bytes 12 and 13 are returned as p_uuid->uuid and the index relative to BLE_UUID_TYPE_VENDOR_BEGIN as p_uuid->type.

Note
If the UUID length supplied is 2, then the type set by this call will always be BLE_UUID_TYPE_BLE.
Parameters
[in]uuid_le_lenLength in bytes of the buffer pointed to by p_uuid_le (must be 2 or 16 bytes).
[in]p_uuid_lePointer pointing to little endian raw UUID bytes.
[out]p_uuidPointer to a ble_uuid_t structure to be filled in.
Return values
NRF_SUCCESSSuccessfully decoded into the ble_uuid_t structure.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_INVALID_LENGTHInvalid UUID length.
NRF_ERROR_NOT_FOUNDFor a 128-bit UUID, no match in the populated table of UUIDs.