luid.h

Header of the unique ID generation module.

LUID_BACKUP_SEED

Value used as based for the LUIDs in case the cpuid module is not present.

1
0x23
void luid_get(void * buf, msp430_types.h::size_t len)

Get a unique ID.

The resulting ID is built from the base ID generated with luid.h::luid_base(), which isXORed with an 8-bit incrementing counter value into the most significant byte.

Note

The resulting LUID will repeat after 255 calls.

Parameters

buf:memory location to copy the LUID into. MUST be able to hold at least len bytes
len:length of the LUID in bytes

void luid_custom(void * buf, msp430_types.h::size_t len, int gen)

Get a custom unique ID based on a user given generator value.

The resulting ID is built from the base ID XORed with gen in the base ID’s most significant bytes.

Note

Calling this function with identical values for gen and len will always result in identical LUIDs.

Parameters

buf:memory location to copy the LUID into. MUST be able to hold at least len bytes
len:length of the LUID in bytes
gen:custom LUID generator value

void luid_base(void * buf, msp430_types.h::size_t len)

Get a LUID base value.

The luid module creates the value dependent on the given len value using the cpuid module if present or a static seed value (luid.h::LUID_BACKUP_SEED) if not.

Parameters

buf:memory location to copy the LUID into. MUST be able to hold at least len bytes
len:length of the LUID in bytes