Astarte device API for Zephyr 0.7.2
Astarte device SDK for Zephyr RTOS
|
Functions for the generation of Astarte device identifiers. More...
Macros | |
#define | ASTARTE_DEVICE_ID_LEN 22 |
Number of characters in the string version of an Astarte device ID. | |
#define | ASTARTE_DEVICE_ID_NAMESPACE_SIZE 16 |
Size in bytes for the namespace used to generate a deterministic device IDs. | |
Functions | |
astarte_result_t | astarte_device_id_generate_random (char out[static ASTARTE_DEVICE_ID_LEN+1]) |
Generate a random Astarte device ID. | |
astarte_result_t | astarte_device_id_generate_deterministic (const uint8_t namespace[static ASTARTE_DEVICE_ID_NAMESPACE_SIZE], const uint8_t *name, size_t name_size, char out[static ASTARTE_DEVICE_ID_LEN+1]) |
Generate a deterministic Astarte device ID. | |
Functions for the generation of Astarte device identifiers.
#define ASTARTE_DEVICE_ID_LEN 22 |
Number of characters in the string version of an Astarte device ID.
The Astarte device IDs are 128 bit identifiers. Their string representation is a base 64 (RFC 4648 sec. 5) URL and filename safe encoding.
#define ASTARTE_DEVICE_ID_NAMESPACE_SIZE 16 |
Size in bytes for the namespace used to generate a deterministic device IDs.
astarte_result_t astarte_device_id_generate_deterministic | ( | const uint8_t | namespace[static ASTARTE_DEVICE_ID_NAMESPACE_SIZE], |
const uint8_t * | name, | ||
size_t | name_size, | ||
char | out[static ASTARTE_DEVICE_ID_LEN+1] ) |
Generate a deterministic Astarte device ID.
The Astarte device ID will be generated using an UUIDv5. An UUIDv5 is created hasing a namespace and name. The namespace is an UUID itself (of any version).
[in] | namespace | The namespace used to generate the device ID. |
[in] | name | The name used to generate the device ID. |
[in] | name_size | The size of the name buffer. |
[out] | out | A buffer where the result will be written. |
astarte_result_t astarte_device_id_generate_random | ( | char | out[static ASTARTE_DEVICE_ID_LEN+1] | ) |
Generate a random Astarte device ID.
The Astarte device ID will be generated using an UUIDv4.
[out] | out | A buffer where the result will be written. |