Universally Unique Identifier (UUID) API
Collaboration diagram for Universally Unique Identifier (UUID) API:

Functions

void rdm_uuidInit (RDM_UUID_FACTORY_T *factory, uint32_t seed)
 
void rdm_uuidTerm (RDM_UUID_FACTORY_T *factory)
 
void rdm_uuidCreate (RDM_UUID_FACTORY_T *factory, RDM_UUID_T *uuid)
 
RDM_RETCODE rdm_uuidFromString (const char *str, RDM_UUID_T *uuid)
 
size_t rdm_uuidStrLen (const RDM_UUID_T *uuid, RDM_BOOL_T braces)
 
RDM_RETCODE rdm_uuidToString (const RDM_UUID_T *uuid, char *str, size_t len, RDM_BOOL_T braces)
 

Detailed Description

The RDM uuid datatype API. The functions here are located in RDM Base Functionality. Linker option:

    -lrdmbase

The UUID/GUID types represent 128-bit unique identifiers. The implementation of UUID/GUID is represented by the RFC 4122 standard

Function Documentation

◆ rdm_uuidCreate()

void rdm_uuidCreate ( RDM_UUID_FACTORY_T factory,
RDM_UUID_T uuid 
)

#include <rdmuuidapi.h>

Create a Universally Unique Identifier (UUID)

This function is able to create a universally unique identifier with a very high probability.

See also
rdm_uuidInit
rdm_uuidToString
rdm_uuidFromString
rdm_uuidTerm
Parameters
[in]factoryThe factory to use for creating UUIDs
[out]uuidThe Universally Unique Identifier to be creasted

◆ rdm_uuidFromString()

RDM_RETCODE rdm_uuidFromString ( const char *  str,
RDM_UUID_T uuid 
)

#include <rdmuuidapi.h>

Convert a string to a Universally Unique Identifier (UUID)

Convert a string to a Universally Unique Identifier (UUID).

Return values
sOKAYNormal, successful return.
ePSP_INVUUIDInvalid UUID in the PSP library.
See also
rdm_uuidToString
rdm_uuidCreate
Parameters
[in]strThe UUID in string form that is to be converted
[out]uuidThe converted UUID

◆ rdm_uuidInit()

void rdm_uuidInit ( RDM_UUID_FACTORY_T factory,
uint32_t  seed 
)

#include <rdmuuidapi.h>

Create a Universally Unique Identifier (UUID)

This function sets up a factory for creating universally unique identifier with a very high probability of being unique. One factory is very unlikely to generate two identical UUIDs.

The initial state of the factory is based on a seed and some information from the PSP layer such as the current time, the process ID, and the MAC address. Excactly which information is being used depend on the PSP and is therefor platform dependent.

Care should be taken to not use more than one factory for UUIDs that need to be unique. There is never an absolute guarantee that the generated UUIDs will be unique even with a single factory.

See also
rdm_uuidCreate
rdm_uuidTerm
Parameters
[in]factoryThe factory to use for creating UUIDs
[in]seedA seed that will be combined with other information from the PSP

◆ rdm_uuidStrLen()

size_t rdm_uuidStrLen ( const RDM_UUID_T uuid,
RDM_BOOL_T  braces 
)

#include <rdmuuidapi.h>

Get the string length of a Universally Unique Identifier (UUID)

Get the string length of a Universally Unique Identifier if it were to be converted to a string.

Returns
The string length, if converted to a string
See also
rdm_uuidToString
Parameters
[in]uuidThe UUID we want the string length off if converted to a string
[in]bracesWhether the converted string should include braces

◆ rdm_uuidTerm()

void rdm_uuidTerm ( RDM_UUID_FACTORY_T factory)

#include <rdmuuidapi.h>

Create a Universally Unique Identifier (UUID)

This function terminates a factory for creating universally unique identifier

See also
rdm_uuidCreate
rdm_uuidInit
Parameters
[in]factoryThe factory to be terminated

◆ rdm_uuidToString()

RDM_RETCODE rdm_uuidToString ( const RDM_UUID_T uuid,
char *  str,
size_t  len,
RDM_BOOL_T  braces 
)

#include <rdmuuidapi.h>

Convert a Universally Unique Identifier (UUID) to a string

Convert a Universally Unique Identifier (UUID) to a string. The string buffer provided should be big enough to hold at least 36 characters, plus the optional braces, and a null terminator.

Return values
sOKAYNormal, successful return.
sTRUNCATEResult is truncated.
See also
rdm_uuidStrLen
rdm_uuidFromString
rdm_uuidCreate
Parameters
[in]uuidThe UUID that is to be converted
[out]strThe string buffer for the converted UUID
[in]lenThe lengt of the provided string buffer measured in number of characters
[in]bracesWhether the converted string should include braces