From d219a594c50a9a4d9cfd63899c4ef29c7c961a90 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Fri, 7 May 2021 23:16:07 +0300 Subject: [PATCH] modbus mask==3 : incremented value + swap, 4: no increment and swap --- lighthub/item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 7aa0e03..a3c14ac 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -1521,7 +1521,9 @@ int Item::modbusDimmerSet(int addr, uint16_t _reg, int _regType, int _mask, uint break; case 2: break; - case 3: //Swap high and low bytes + case 3: + value++; + case 4: //Swap high and low bytes t = (value & 0xff00) >> 8; value <<=8; value |= t;