SensESP
3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
serial_number.h
Go to the documentation of this file.
1
#ifndef SENSESP_SYSTEM_SERIAL_NUMBER_H_
2
#define SENSESP_SYSTEM_SERIAL_NUMBER_H_
3
4
#include <cstdint>
5
#include <esp_mac.h>
6
7
uint64_t
GetBoardSerialNumber
() {
8
uint8_t chipid[6];
9
esp_efuse_mac_get_default(chipid);
10
return
((uint64_t)chipid[0] << 0) + ((uint64_t)chipid[1] << 8) +
11
((uint64_t)chipid[2] << 16) + ((uint64_t)chipid[3] << 24) +
12
((uint64_t)chipid[4] << 32) + ((uint64_t)chipid[5] << 40);
13
}
14
15
#endif
// SENSESP_SRC_SENSESP_SYSTEM_SERIAL_NUMBER_H_
GetBoardSerialNumber
uint64_t GetBoardSerialNumber()
Definition
serial_number.h:7
src
sensesp
system
serial_number.h
Generated by
1.12.0