ble/uuid.h header reference
[Bluetooth Low Energy library module]

The source code of this header can be browsed online.

Description [link] 

Bluetooth uses UUIDs in a special way. There are short-hand versions using a special "Bluetoot base UUID" as common value. In MutekH, BLE library does not use shortened UUIDs in memory. Shortening is only done where protocol requires so.

UUIDs are defined as a 16-byte structure. A set of accessor functions and a comparator function are provided.

BLE_UUID_BT_BASED_P, BLE_UUID_P yield valid pointers to constant UUIDs for given values.

With the following code

static const struct ble_uuid_s dis_service_type_1 =
{
.value = {0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00,
0x00, 0x80,
0x00, 0x10,
0x00, 0x00,
0x0a, 0x18, 0x00, 0x00},
};

static const struct ble_uuid_s dis_service_type_2 = BLE_UUID(0x180a, 0x0000, 0x1000, 0x8000, 0x00805f9b34fbULL);

static const struct ble_uuid_s dis_service_type_3 = BLE_UUID_BT_BASED(0x180a);

those five statements yield a pointer to a constant UUID object with value 0000180a-0000-1000-8000-00805f9b34fb.

&dis_service_type_1;
&dis_service_type_2;
&dis_service_type_3;
BLE_UUID_P(0x180a, 0x0000, 0x1000, 0x8000, 0x00805f9b34fbULL);
BLE_UUID_BT_BASED_P(0x180a);

Members [link] 

Type [link] 

Functions [link] 

Constant [link] 

Macros [link] 

Members detail [link] 

#define BLE_UUID(a, b, c, d, e) [link] 

This macro is declared in ble/uuid.h source file, line 97.

this macro is a shorthand initializer for UUID structure. It expects the 5 parts of UUID value as arguments, in natural display order.

The following code defines UUID 12345678-3344-5566-7788-abcdef678901:

struct ble_uuid_s test = BLE_UUID(0x12345678, 0x3344, 0x5566, 0x7788, 0xabcdef678901ULL);

#define BLE_UUID_ARG(x) [link] 

This macro is declared in ble/uuid.h source file, line 162.

See also BLE_UUID_FMT.

#define BLE_UUID_BT_BASED(x) [link] 

This macro is declared in ble/uuid.h source file, line 128.

this macro is an shorthand initializer for a Bluetooth-based UUID object. It can be used to initialize a constant structure.

The following code defines UUID 00001812-0000-1000-8000-00805f9b34fb:

static const struct ble_uuid_s ble_hid_service_type = BLE_UUID_BT_BASED(0x1812);

#define BLE_UUID_BT_BASED_P(x) [link] 

This macro is declared in ble/uuid.h source file, line 148.

this macro is an shorthand initializer for a Bluetooth-based UUID object. It can be used to initialize a constant structure.

The following code defines a pointer to UUID 00001812-0000-1000-8000-00805f9b34fb:

static const struct ble_uuid_s *ble_hid_service_type_ptr = BLE_UUID_BT_BASED_P(0x1812);

See also ble_uuid_bluetooth_based.

#define BLE_UUID_FMT [link] 

This macro is declared in ble/uuid.h source file, line 159.

this macro is a format string for printing a UUID. It should be used with BLE_UUID_ARG.

struct ble_uuid_s *type = ...;
printk("Service type UUID: " BLE_UUID_FMT "\n", BLE_UUID_ARG(type));

#define BLE_UUID_H_ [link] 

This macro is declared in ble/uuid.h source file, line 21.

#define BLE_UUID_P(a, b, c, d, e) [link] 

This macro is declared in ble/uuid.h source file, line 134.

this macro is an shorthand initializer for a UUID object pointer.

void ble_uuid_bluetooth_based(struct ble_uuid_s *uuid, uint32_t short_uuid) [link] 

This function is declared in ble/uuid.h source file, line 224.

this function initializes 128 bits of a UUID to be expanded form a short UUID (either UUID16 or UUID32).

This is a dynamic counterpart for BLE_UUID_BT_BASED.

int8_t ble_uuid_cmp(const struct ble_uuid_s *a, const struct ble_uuid_s *b) [link] 

This function is declared in ble/uuid.h source file, line 216.

this function compares two UUIDs and returns difference between their first differing byte. This can be used to sort UUIDs or check for equality.

The return value is 0 when matching, or a difference value.

bool_t ble_uuid_is_bluetooth_based(const struct ble_uuid_s *uuid) [link] 

This function is declared in ble/uuid.h source file, line 180.

this function checks whether passed UUID is based on bluetooth base UUID. If so, it may be shortened to either UUID16 or UUID32.

bool_t ble_uuid_is_uuid16(const struct ble_uuid_s *uuid) [link] 

This function is declared in ble/uuid.h source file, line 187.

this function checks whether passed UUID is based on bluetooth base UUID and fits a 16-bit constant. If so, it may be shortened to a UUID16.

bool_t ble_uuid_is_uuid32(const struct ble_uuid_s *uuid) [link] 

This function is declared in ble/uuid.h source file, line 200.

this function checks whether passed UUID is based on bluetooth base UUID and fits an UUID32.

struct ble_uuid_s [link] 

This struct is declared in ble/gattdb/client.h source file, line 49.

this struct defines a UUID object. UUIDs are stored in Bluetooth network order in memory.

FieldDescription
union <anonymous> {
uint8_t value[16];
uint16_t value16[8];
uint32_t value32[4];
};

uint16_t ble_uuid_uuid16_get(const struct ble_uuid_s *uuid) [link] 

This function is declared in ble/uuid.h source file, line 194.

this function retrieves UUID16 value from a short UUID expressed in its 128-bit form. This does not check whether UUID is actually bluetooth-based.

uint32_t ble_uuid_uuid32_get(const struct ble_uuid_s *uuid) [link] 

This function is declared in ble/uuid.h source file, line 207.

this function retrieves UUID32 value from a short UUID expressed in its 128-bit form. This does not check whether UUID is actually bluetooth-based.

const struct ble_uuid_s bluetooth_base_uuid [link] 

This constant is declared in ble/uuid.h source file, line 174.

Bluetooth base UUID

Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:05 2022 using MkDoc