Skip to content

Hardware Information

Access to hardware-specific identification provided by the MCU/SoC.

Functions Overview

Name
size_thwinfo_get_deviceid(uint8_t * id, size_t len)
Reads the device's unique hardware identifier.

Function Details

function hwinfo_get_deviceid

cpp
size_t hwinfo_get_deviceid(
    uint8_t * id,
    size_t len
)

Reads the device's unique hardware identifier.

Parameters:

  • id Buffer that receives the identifier bytes.
  • len Capacity of id in bytes.

Return: The number of bytes written to id, or 0 on failure.

The identifier is provided by the underlying MCU/SoC (e.g. factory-burned UID registers). Its length depends on the platform; callers should size the buffer accordingly. If len is smaller than the actual identifier, only the first len bytes are written.