модуль логгирования, начало

This commit is contained in:
Dmitry Borisenko
2022-08-13 12:18:58 +02:00
parent 72b54eb5bb
commit 1f9f746149
9 changed files with 195 additions and 126 deletions

View File

@@ -0,0 +1,35 @@
#include "Global.h"
#include "classes/IoTItem.h"
class Loging : public IoTItem {
private:
String logval;
public:
Loging(String parameters) : IoTItem(parameters) {
jsonRead(parameters, F("logid"), logval);
}
// void setValue(IoTValue Value) {
// value = Value;
// regEvent((String)(int)value.valD, "Loging");
// }
void doByInterval() {
Serial.println("logging test " + logval);
String value = getItemValue(logval);
if (value == "") {
SerialPrint("E", F("Logging"), F("no value set"));
} else {
Serial.println("value " + value);
}
}
};
void* getAPI_Loging(String subtype, String param) {
if (subtype == F("Loging")) {
return new Loging(param);
} else {
return nullptr;
}
}