diff --git a/CLC-qthing/IRSender.hpp b/CLC-qthing/IRSender.hpp index b97ed7f696ada9cc73945622a1503437416ad66b..82ebf9a32d53e513b19619099ec5ab9f4e5767a2 100644 --- a/CLC-qthing/IRSender.hpp +++ b/CLC-qthing/IRSender.hpp @@ -1,3 +1,5 @@ +#pragma once + #include <cinttypes> #include <string> diff --git a/CLC-qthing/SiliconTorch/CyanBusCRC.hpp b/CLC-qthing/SiliconTorch/CyanBusCRC.hpp index 2b47a41f49b4791425a913b268825c9c82790735..2cf93e5513c644c7ddb7ac117eb66ff1f32cae8e 100644 --- a/CLC-qthing/SiliconTorch/CyanBusCRC.hpp +++ b/CLC-qthing/SiliconTorch/CyanBusCRC.hpp @@ -1,3 +1,5 @@ +#pragma once + // C++ system level #include <cinttypes> diff --git a/CLC-qthing/SiliconTorch/Metrics.cpp b/CLC-qthing/SiliconTorch/Metrics.cpp index c2170fa4c3a0378f8d060ecb434057355e6f012e..0dce70f77bb3813e1ac811363d8b5fe553e315eb 100644 --- a/CLC-qthing/SiliconTorch/Metrics.cpp +++ b/CLC-qthing/SiliconTorch/Metrics.cpp @@ -103,6 +103,8 @@ namespace SiliconTorch { j["uptime"] = uptime_ms() / 1000UL; j["lifetime"] = (lifeTime + (uptime_ms() - lifeTimeSaved)) / 1000UL; + if (birth > 0) j["birth"] = birth; + publish_message(genDeviceTopic("metrics"), j.dump().c_str()); lastPublished = uptime_ms(); } diff --git a/CLC-qthing/SiliconTorch/Metrics.hpp b/CLC-qthing/SiliconTorch/Metrics.hpp index 116b8efc0fe87e1dbea7af2d74a1415fdde234b8..7b00f4193445b81fcb6cca54e817a4578e43d792 100644 --- a/CLC-qthing/SiliconTorch/Metrics.hpp +++ b/CLC-qthing/SiliconTorch/Metrics.hpp @@ -86,6 +86,8 @@ namespace SiliconTorch { uint32_t bootCnt = 0; uint32_t bootCntSaveUptime = 60; // seconds + uint64_t birth = 0; // unix timestamp of first device activation + void tickTask(); void saveBootCntTask(); diff --git a/CLC-qthing/SimpleUART.hpp b/CLC-qthing/SimpleUART.hpp index 01e5ce5c9bb532a4d73afe94a25cb13156f7b3f7..a16e17dac9ee47498c93e90380a3ce2561da10eb 100644 --- a/CLC-qthing/SimpleUART.hpp +++ b/CLC-qthing/SimpleUART.hpp @@ -1,3 +1,4 @@ +#pragma once #include <cinttypes>