Astarte Device SDK ESP32
ESP32 device SDK for the Astarte platform
astarte_hwid.h File Reference

Astarte hardware ID functions. More...

#include "astarte.h"
#include <stdint.h>
Include dependency graph for astarte_hwid.h:

Go to the source code of this file.

Functions

astarte_err_t astarte_hwid_get_id (uint8_t *hardware_id)
 get a unique hardware ID. More...
 
void astarte_hwid_encode (char *encoded, int dest_size, const uint8_t *hardware_id)
 encode a binary hardware ID to a C string. More...
 

Detailed Description

Astarte hardware ID functions.

Function Documentation

◆ astarte_hwid_encode()

void astarte_hwid_encode ( char *  encoded,
int  dest_size,
const uint8_t *  hardware_id 
)

encode a binary hardware ID to a C string.

base64url encode a 128 bits hardware id to an output string.

Parameters
encodedthe destination buffer where encoded string will be written.
dest_sizethe destination buffer size.
hardware_id16 bytes hardware id.

◆ astarte_hwid_get_id()

astarte_err_t astarte_hwid_get_id ( uint8_t *  hardware_id)

get a unique hardware ID.

Generate an unique hardware ID using device MAC address and other identification bits.

Parameters
hardware_ida 16 bytes buffer where device ID will be written.
Returns
The status code, ASTARTE_OK if successful, otherwise an error code is returned