Исправляем ошибку вызова gettime

This commit is contained in:
2022-04-27 10:55:56 +03:00
parent c658343e7f
commit 0f685a5f49
2 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,6 @@ class IarduinoRTC : public IoTItem {
jsonRead(parameters, "dat", _dat);
jsonRead(parameters, "defFormat", _defFormat);
jsonRead(parameters, "ticker", _ticker);
_defFormat = _defFormat + " "; // костыль против обрезки последнего символа в библиотеке
switch (_chipNum) {
case 0:
@@ -50,16 +49,17 @@ class IarduinoRTC : public IoTItem {
void doByInterval() {
value.isDecimal = false;
value.valS = watch->gettime(_defFormat);
value.valS = watch->gettime(_defFormat.c_str());
if (_ticker) regEvent(value.valS, "time ticker");
}
IoTValue execute(String command, std::vector<IoTValue> &param) {
IoTValue tmpValue;
if (command == "getTime") {
if (param.size()) {
value.isDecimal = false;
value.valS = watch->gettime(param[0].valS);
return value;
tmpValue.isDecimal = false;
tmpValue.valS = watch->gettime(param[0].valS.c_str());
return tmpValue;
}
} else if (command == "saveSysTime") {
tm localTimeVar;

View File

@@ -54,7 +54,7 @@ class SysExt : public IoTItem {
} else if (command == "getTime") {
if (param.size()) {
value.isDecimal = false;
value.valS = watch->gettime(param[0].valS);
value.valS = watch->gettime(param[0].valS.c_str());
return value;
}
}