From e9355ef1421e5943f08995a5ee969594551ba0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B5?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Tue, 31 Oct 2023 00:13:09 +0300 Subject: [PATCH] modbus v2 fix --- lighthub/modules/out_modbus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lighthub/modules/out_modbus.cpp b/lighthub/modules/out_modbus.cpp index 4c20a05..95c097b 100644 --- a/lighthub/modules/out_modbus.cpp +++ b/lighthub/modules/out_modbus.cpp @@ -707,14 +707,14 @@ if (isTimeOver(store->timestamp,millis(),store->pollingInterval) && ( !mbusSlenc if (itemParametersObj && itemParametersObj->type ==aJson_Object) { aJsonObject *execObj = itemParametersObj->child; - while (execObj && (execObj->type == aJson_Object) || (execObj->type == aJson_Array)) + while (execObj && ((execObj->type == aJson_Object) || (execObj->type == aJson_Array))) { if (execObj->subtype & MB_SEND_ERROR) execObj->subtype&=~ MB_SEND_ERROR; if ((execObj->subtype & 0x3) >= MB_SEND_ATTEMPTS) { //execObj->subtype&=~ MB_NEED_SEND; //Clean ERROR, NEED, Attempts - errorSerial<<"MBUS: send failed "<itemArr->name<itemArr->name<<"/"<name<subtype = 0; } @@ -805,7 +805,7 @@ aJsonObject * itemParametersObj = aJson.getArrayItem(item->itemArg, 2); if (itemParametersObj && itemParametersObj->type ==aJson_Object) { aJsonObject *execObj = aJson.getObjectItem(itemParametersObj,suffixStr); - if (execObj && (execObj->type == aJson_Object) || (execObj->type == aJson_Array)) + if (execObj && ((execObj->type == aJson_Object) || (execObj->type == aJson_Array))) { /* aJsonObject *polledValue = aJson.getObjectItem(execObj,"@S");