NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
Bluetooth UUID

Bluetooth UUID. More...

Classes

struct  ble_uuid_t
 
struct  ble_uuid16_t
 
struct  ble_uuid32_t
 
struct  ble_uuid128_t
 
union  ble_uuid_any_t
 

Macros

#define BLE_UUID_STR_LEN   (37)
 

Enumerations

enum  { BLE_UUID_TYPE_16 = 16 , BLE_UUID_TYPE_32 = 32 , BLE_UUID_TYPE_128 = 128 }
 

Functions

int ble_uuid_init_from_buf (ble_uuid_any_t *uuid, const void *buf, size_t len)
 Constructs a UUID object from a byte array.
 
int ble_uuid_cmp (const ble_uuid_t *uuid1, const ble_uuid_t *uuid2)
 Compares two Bluetooth UUIDs.
 
void ble_uuid_copy (ble_uuid_any_t *dst, const ble_uuid_t *src)
 Copy Bluetooth UUID.
 
char * ble_uuid_to_str (const ble_uuid_t *uuid, char *dst)
 Converts the specified UUID to its string representation.
 
uint16_t ble_uuid_u16 (const ble_uuid_t *uuid)
 Converts the specified 16-bit UUID to a uint16_t.
 

Detailed Description

Bluetooth UUID.

Macro Definition Documentation

◆ BLE_UUID_STR_LEN

#define BLE_UUID_STR_LEN   (37)

Size of buffer needed to store UUID as a string. Includes trailing \0.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Type of UUID

Enumerator
BLE_UUID_TYPE_16 

16-bit UUID (BT SIG assigned)

BLE_UUID_TYPE_32 

32-bit UUID (BT SIG assigned)

BLE_UUID_TYPE_128 

128-bit UUID

Function Documentation

◆ ble_uuid_cmp()

int ble_uuid_cmp ( const ble_uuid_t uuid1,
const ble_uuid_t uuid2 
)

Compares two Bluetooth UUIDs.

Parameters
uuid1The first UUID to compare.
uuid2The second UUID to compare.
Returns
0 if the two UUIDs are equal, nonzero if the UUIDs differ.

◆ ble_uuid_copy()

void ble_uuid_copy ( ble_uuid_any_t dst,
const ble_uuid_t src 
)

Copy Bluetooth UUID.

Parameters
dstDestination UUID.
srcSource UUID.

◆ ble_uuid_init_from_buf()

int ble_uuid_init_from_buf ( ble_uuid_any_t uuid,
const void *  buf,
size_t  len 
)

Constructs a UUID object from a byte array.

Parameters
uuidOn success, this gets populated with the constructed UUID.
bufThe source buffer to parse.
lenThe size of the buffer, in bytes.
Returns
0 on success, BLE_HS_EINVAL if the source buffer does not contain a valid UUID.

◆ ble_uuid_to_str()

char * ble_uuid_to_str ( const ble_uuid_t uuid,
char *  dst 
)

Converts the specified UUID to its string representation.

Example string representations: o 16-bit: 0x1234 o 32-bit: 0x12345678 o 128-bit: 12345678-1234-1234-1234-123456789abc

Parameters
uuidThe source UUID to convert.
dstThe destination buffer.
Returns
A pointer to the supplied destination buffer.

◆ ble_uuid_u16()

uint16_t ble_uuid_u16 ( const ble_uuid_t uuid)

Converts the specified 16-bit UUID to a uint16_t.

Parameters
uuidThe source UUID to convert.
Returns
The converted integer on success, NULL if the specified UUID is not 16 bits.