Pebble Foundation Classes  0.2.0
C++ for Pebble
Collaboration diagram for UUID:

Macros

#define UUID_SIZE   16
 
#define UuidMake(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15)   ((Uuid) {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15})
 
#define UuidMakeFromBEBytes(b)
 
#define UuidMakeFromLEBytes(b)
 
#define UUID_STRING_BUFFER_LENGTH   (32 + 4 + 2 + 1)
 The minimum required length of a string used to hold a uuid (including null).
 
#define UUID_SIZE   16
 
#define UuidMake(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15)   ((Uuid) {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15})
 
#define UuidMakeFromBEBytes(b)
 
#define UuidMakeFromLEBytes(b)
 
#define UUID_STRING_BUFFER_LENGTH   (32 + 4 + 2 + 1)
 The minimum required length of a string used to hold a uuid (including null).
 

Functions

bool uuid_equal (const Uuid *uu1, const Uuid *uu2)
 
void uuid_to_string (const Uuid *uuid, char *buffer)
 
struct __attribute__ ((__packed__))
 

Variables

 Uuid
 
 Uuid
 

Detailed Description

Macro Definition Documentation

◆ UuidMake [1/2]

#define UuidMake (   p0,
  p1,
  p2,
  p3,
  p4,
  p5,
  p6,
  p7,
  p8,
  p9,
  p10,
  p11,
  p12,
  p13,
  p14,
  p15 
)    ((Uuid) {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15})

Make a Uuid object from sixteen bytes.

Returns
A Uuid structure representing the bytes p0 to p15.

◆ UuidMake [2/2]

#define UuidMake (   p0,
  p1,
  p2,
  p3,
  p4,
  p5,
  p6,
  p7,
  p8,
  p9,
  p10,
  p11,
  p12,
  p13,
  p14,
  p15 
)    ((Uuid) {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15})

Make a Uuid object from sixteen bytes.

Returns
A Uuid structure representing the bytes p0 to p15.

◆ UuidMakeFromBEBytes [1/2]

#define UuidMakeFromBEBytes (   b)
Value:
((Uuid) { b[0], b[1], b[2], b[3], \
b[4], b[5], b[6], b[7], \
b[8], b[9], b[10], b[11], \
b[12], b[13], b[14], b[15] })

Creates a Uuid from an array of bytes with 16 bytes in Big Endian order.

Returns
The created Uuid

◆ UuidMakeFromBEBytes [2/2]

#define UuidMakeFromBEBytes (   b)
Value:
((Uuid) { b[0], b[1], b[2], b[3], \
b[4], b[5], b[6], b[7], \
b[8], b[9], b[10], b[11], \
b[12], b[13], b[14], b[15] })

Creates a Uuid from an array of bytes with 16 bytes in Big Endian order.

Returns
The created Uuid

◆ UuidMakeFromLEBytes [1/2]

#define UuidMakeFromLEBytes (   b)
Value:
((Uuid) { b[15], b[14], b[13], b[12], \
b[11], b[10], b[9], b[8], \
b[7], b[6], b[5], b[4], \
b[3], b[2], b[1], b[0] })

Creates a Uuid from an array of bytes with 16 bytes in Little Endian order.

Returns
The created Uuid

◆ UuidMakeFromLEBytes [2/2]

#define UuidMakeFromLEBytes (   b)
Value:
((Uuid) { b[15], b[14], b[13], b[12], \
b[11], b[10], b[9], b[8], \
b[7], b[6], b[5], b[4], \
b[3], b[2], b[1], b[0] })

Creates a Uuid from an array of bytes with 16 bytes in Little Endian order.

Returns
The created Uuid

Function Documentation

◆ __attribute__()

struct __attribute__ ( (__packed__)  )

Data structure for one serialized key/value tuple

Note
The structure is variable length! The length depends on the value data that the tuple contains.

The key

The type of data that the .value fields contains.

The length of .value in bytes

The value itself.

The different union fields are provided for convenience, avoiding the need for manual casts.

Note
The array length is of incomplete length on purpose, to facilitate variable length data and because a data length of zero is valid.
Important: The integers are little endian!

The byte array value. Valid when .type is TUPLE_BYTE_ARRAY.

The C-string value. Valid when .type is TUPLE_CSTRING.

The 8-bit unsigned integer value. Valid when .type is TUPLE_UINT and .length is 1 byte.

The 16-bit unsigned integer value. Valid when .type is TUPLE_UINT and .length is 2 byte.

The 32-bit unsigned integer value. Valid when .type is TUPLE_UINT and .length is 4 byte.

The 8-bit signed integer value. Valid when .type is TUPLE_INT and .length is 1 byte.

The 16-bit signed integer value. Valid when .type is TUPLE_INT and .length is 2 byte.

The 32-bit signed integer value. Valid when .type is TUPLE_INT and .length is 4 byte.

◆ uuid_equal()

bool uuid_equal ( const Uuid *  uu1,
const Uuid *  uu2 
)

Compares two UUIDs.

Returns
True if the two UUIDs are equal, false if they are not.

◆ uuid_to_string()

void uuid_to_string ( const Uuid *  uuid,
char *  buffer 
)

Writes UUID in a string form into buffer that looks like the following... {12345678-1234-5678-1234-567812345678} or {NULL UUID} if NULL was passed.

Parameters
uuidThe Uuid to write into the buffer as human-readable string
bufferMemory to write the string to. Must be at least UUID_STRING_BUFFER_LENGTH bytes long.