From 96d623f53bd3d33f424d41388c330ad89ceb4fde Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <67171972+IoTManagerProject@users.noreply.github.com> Date: Tue, 22 Nov 2022 16:04:50 +0100 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MqttClient.cpp | 3 +-- src/utils/SerialPrint.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index 28d37249..e86131ce 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -159,7 +159,6 @@ void mqttCallback(char* topic, uint8_t* payload, size_t length) { //здесь мы получаем события с других устройств, которые потом проверяются в сценариях этого устройства else if (topicStr.indexOf("event") != -1) { - //пока не работает сетевой обмен этот код будет закомментирован if (!jsonReadBool(settingsFlashJson, "mqttin")) { return; } @@ -167,7 +166,7 @@ void mqttCallback(char* topic, uint8_t* payload, size_t length) { String devId = selectFromMarkerToMarker(topicStr, "/", 2); String id = selectFromMarkerToMarker(topicStr, "/", 3); analyzeMsgFromNet(payloadStr, id); - //SerialPrint("i", F("=>MQTT"), "Received event from other device: '" + devId + "' " + id + " " + valAsStr); + // SerialPrint("i", F("=>MQTT"), "Received event from other device: '" + devId + "' " + id + " " + valAsStr); } } diff --git a/src/utils/SerialPrint.cpp b/src/utils/SerialPrint.cpp index d057beb3..a1e8fde2 100644 --- a/src/utils/SerialPrint.cpp +++ b/src/utils/SerialPrint.cpp @@ -17,13 +17,13 @@ void SerialPrint(const String& errorLevel, const String& module, const String& m } } - // if (errorLevel == "E") { - // cleanString(tosend); - // // создаем событие об ошибке для возможной реакции в сценарии - // if (itemId != "") { - // createItemFromNet(itemId + "_onError", tosend, -4); - // } else { - // createItemFromNet("onError", tosend, -4); - // } - // } + if (errorLevel == "E") { + cleanString(tosend); + // создаем событие об ошибке для возможной реакции в сценарии + if (itemId != "") { + createItemFromNet(itemId + "_onError", tosend, -4); + } else { + // createItemFromNet("onError", tosend, -4); + } + } } \ No newline at end of file