Skip to content
Snippets Groups Projects
Commit 0ec527f7 authored by fxk8y's avatar fxk8y :spider:
Browse files

Adding include-guard

parent ee4dcff2
No related branches found
No related tags found
No related merge requests found
#pragma once
#include <cinttypes> #include <cinttypes>
#include <string> #include <string>
......
#pragma once
// C++ system level // C++ system level
#include <cinttypes> #include <cinttypes>
......
...@@ -103,6 +103,8 @@ namespace SiliconTorch { ...@@ -103,6 +103,8 @@ namespace SiliconTorch {
j["uptime"] = uptime_ms() / 1000UL; j["uptime"] = uptime_ms() / 1000UL;
j["lifetime"] = (lifeTime + (uptime_ms() - lifeTimeSaved)) / 1000UL; j["lifetime"] = (lifeTime + (uptime_ms() - lifeTimeSaved)) / 1000UL;
if (birth > 0) j["birth"] = birth;
publish_message(genDeviceTopic("metrics"), j.dump().c_str()); publish_message(genDeviceTopic("metrics"), j.dump().c_str());
lastPublished = uptime_ms(); lastPublished = uptime_ms();
} }
......
...@@ -86,6 +86,8 @@ namespace SiliconTorch { ...@@ -86,6 +86,8 @@ namespace SiliconTorch {
uint32_t bootCnt = 0; uint32_t bootCnt = 0;
uint32_t bootCntSaveUptime = 60; // seconds uint32_t bootCntSaveUptime = 60; // seconds
uint64_t birth = 0; // unix timestamp of first device activation
void tickTask(); void tickTask();
void saveBootCntTask(); void saveBootCntTask();
......
#pragma once
#include <cinttypes> #include <cinttypes>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment