mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 22:52:07 +00:00
Cleanup unique id
This commit is contained in:
parent
7ba593432e
commit
7acd72ede1
@ -197,9 +197,8 @@ NodeDB::NodeDB()
|
|||||||
uint32_t channelFileCRC = crc32Buffer(&channelFile, sizeof(channelFile));
|
uint32_t channelFileCRC = crc32Buffer(&channelFile, sizeof(channelFile));
|
||||||
|
|
||||||
int saveWhat = 0;
|
int saveWhat = 0;
|
||||||
// bool hasUniqueId = false;
|
|
||||||
// Get device unique id
|
// Get device unique id
|
||||||
#if defined(ARCH_ESP32) && defined(ESP_EFUSE_OPTIONAL_UNIQUE_ID)
|
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
uint32_t unique_id[4];
|
uint32_t unique_id[4];
|
||||||
// ESP32 factory burns a unique id in efuse for S2+ series and evidently C3+ series
|
// ESP32 factory burns a unique id in efuse for S2+ series and evidently C3+ series
|
||||||
// This is used for HMACs in the esp-rainmaker AIOT platform and seems to be a good choice for us
|
// This is used for HMACs in the esp-rainmaker AIOT platform and seems to be a good choice for us
|
||||||
@ -207,7 +206,6 @@ NodeDB::NodeDB()
|
|||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
memcpy(myNodeInfo.device_id.bytes, unique_id, sizeof(unique_id));
|
memcpy(myNodeInfo.device_id.bytes, unique_id, sizeof(unique_id));
|
||||||
myNodeInfo.device_id.size = 16;
|
myNodeInfo.device_id.size = 16;
|
||||||
hasUniqueId = true;
|
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("Failed to read unique id from efuse");
|
LOG_WARN("Failed to read unique id from efuse");
|
||||||
}
|
}
|
||||||
@ -221,12 +219,12 @@ NodeDB::NodeDB()
|
|||||||
memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end));
|
memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end));
|
||||||
myNodeInfo.device_id.size = 16;
|
myNodeInfo.device_id.size = 16;
|
||||||
// Uncomment below to print the device id
|
// Uncomment below to print the device id
|
||||||
// hasUniqueId = true;
|
|
||||||
#else
|
#else
|
||||||
// FIXME - implement for other platforms
|
// FIXME - implement for other platforms
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if (hasUniqueId) {
|
// if (myNodeInfo.device_id.size == 16) {
|
||||||
// std::string deviceIdHex;
|
// std::string deviceIdHex;
|
||||||
// for (size_t i = 0; i < myNodeInfo.device_id.size; ++i) {
|
// for (size_t i = 0; i < myNodeInfo.device_id.size; ++i) {
|
||||||
// char buf[3];
|
// char buf[3];
|
||||||
|
Loading…
Reference in New Issue
Block a user