Crate identity
Expand description
Access to unique identifiers provided by the device.
This module provides device_id_bytes()
and related functions, which returns an identifier for the
concrete piece of hardware that the software is running on in byte serialized form.
Concrete properties of a device identity are:
-
Identifiers are reasonably unique: They are either unique by construction (serial number, MAC address) or random identifiers (>= 64 bit).
-
The scope of the identifier is within an Ariel OS board. Their scope may be broader, eg. when a identifier is unique per MCU family, or even globally.
-
Identifiers do not change during regular development with a device, which includes the use of a programmer. Identifiers may change under deliberate conditions, eg. when a device has a one-time programmable identity, or when there is a custom functionality to overwrite the built-in identifier that is not triggered by the device erase that is performed as part of programming the device.
Constructing an identifier fails rather than produce a dummy identifier.
It is considered a breaking change in Ariel OS if a device’s identifier changes or becomes an error. Errors changing to valid identifiers is a compatible change.
Other identifiers, such as the EUI-48 addresses provided by interface_eui48()
, are usually
derived from the main identity, but have different properties.
Structs§
- An EUI-48 identifier, commonly known as a MAC address.
Functions§
- Obtains a unique identifier of the device in its byte serialized form.
- Generates an EUI-48 identifier (“6-byte MAC address”) based on the device identity.