mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 07:32:18 +03:00
модуль логгирования, начало
This commit is contained in:
35
src/modules/virtual/Logging/Loging.cpp
Normal file
35
src/modules/virtual/Logging/Loging.cpp
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user