[SYS] Add utc & unix timestamp options to SYStoMQTT and Sensor messages (#1533)

Add optional timestamps to the SYStoMQTT and modules messages
Also, the sync with the NTP time server now occurs every hour (can be defined with TimeBetweenCheckingSYS in UserConfig.h)
This commit is contained in:
ilgrank authored and GitHub committed 2023-03-17 10:49:27 -05:00
1 parent 3b4af96990
commit c8510f2605
3 files changed
+61 -16

No files matched your search

+8
View File
@@ -592,6 +592,14 @@ void procBLETask(void* pvParameters) {
String mac_adress = advertisedDevice->getAddress().toString().c_str();
mac_adress.toUpperCase();
BLEdata["id"] = (char*)mac_adress.c_str();
# if defined(ESP8266) || defined(ESP32)
# if message_UTCtimestamp == true
BLEdata["UTCtime"] = UTCtimestamp();
# endif
# if message_unixtimestamp == true
BLEdata["unixtime"] = unixtimestamp();
# endif
# endif
BLEdata["mac_type"] = advertisedDevice->getAddress().getType();
BLEdata["adv_type"] = advertisedDevice->getAdvType();
Log.notice(F("Device detected: %s" CR), (char*)mac_adress.c_str());