From efc1f50465f22050495299935365fc51d887c091 Mon Sep 17 00:00:00 2001 From: MarcelloZanghieri2 Date: Sun, 14 Dec 2025 16:49:23 +0100 Subject: [PATCH] Select length's LS byte in `GXDLMS.getHdlcFrame()` --- Gurux.DLMS.python/gurux_dlms/GXDLMS.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gurux.DLMS.python/gurux_dlms/GXDLMS.py b/Gurux.DLMS.python/gurux_dlms/GXDLMS.py index be6704b..aa25453 100644 --- a/Gurux.DLMS.python/gurux_dlms/GXDLMS.py +++ b/Gurux.DLMS.python/gurux_dlms/GXDLMS.py @@ -963,9 +963,9 @@ def getHdlcFrame(cls, settings, frame_, data): | (((len(secondaryAddress) + len(primaryAddress) + len1) >> 8) & 0x7) ) if len1 == 0: - bb.setUInt8(5 + len(secondaryAddress) + len(primaryAddress) + len1) + bb.setUInt8((5 + len(secondaryAddress) + len(primaryAddress) + len1) & 0xFF) else: - bb.setUInt8(7 + len(secondaryAddress) + len(primaryAddress) + len1) + bb.setUInt8((7 + len(secondaryAddress) + len(primaryAddress) + len1) & 0xFF) bb.set(primaryAddress) bb.set(secondaryAddress) if frame_ == 0: