mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #14016 from benpicco/luid_get_be
sys/luid: provide luid_get_lb(), fix documentation
This commit is contained in:
commit
88e4c0ffef
@ -74,7 +74,7 @@ extern "C" {
|
||||
* @brief Get a unique ID
|
||||
*
|
||||
* The resulting ID is built from the base ID generated with luid_base(), which
|
||||
* isXORed with an 8-bit incrementing counter value into the most significant
|
||||
* isXORed with an 8-bit incrementing counter value into the first (lowest index)
|
||||
* byte.
|
||||
*
|
||||
* @note The resulting LUID will repeat after 255 calls.
|
||||
@ -85,6 +85,21 @@ extern "C" {
|
||||
*/
|
||||
void luid_get(void *buf, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Get a unique ID with change in the last byte
|
||||
*
|
||||
* The resulting ID is built from the base ID generated with luid_base(), which
|
||||
* isXORed with an 8-bit incrementing counter value into the last (highest index)
|
||||
* byte.
|
||||
*
|
||||
* @note The resulting LUID will repeat after 255 calls.
|
||||
*
|
||||
* @param[out] buf memory location to copy the LUID into. MUST be able to
|
||||
* hold at least @p len bytes
|
||||
* @param[in] len length of the LUID in bytes
|
||||
*/
|
||||
void luid_get_lb(void *buf, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Get a unique short unicast address
|
||||
*
|
||||
|
@ -54,6 +54,13 @@ void luid_get(void *buf, size_t len)
|
||||
((uint8_t *)buf)[0] ^= lastused++;
|
||||
}
|
||||
|
||||
void luid_get_lb(void *buf, size_t len)
|
||||
{
|
||||
luid_base(buf, len);
|
||||
|
||||
((uint8_t *)buf)[len - 1] ^= lastused++;
|
||||
}
|
||||
|
||||
void luid_custom(void *buf, size_t len, int gen)
|
||||
{
|
||||
luid_base(buf, len);
|
||||
|
Loading…
Reference in New Issue
Block a user