From 4c098b4eaec6eb16b683f4e3f5152dd522a9817c Mon Sep 17 00:00:00 2001 From: Robin Krens Date: Sun, 11 Feb 2024 14:39:18 +0100 Subject: [PATCH] RAPacker.py: fix on package size boundary --- src/RAPacker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RAPacker.py b/src/RAPacker.py index 8480267..6652309 100644 --- a/src/RAPacker.py +++ b/src/RAPacker.py @@ -99,7 +99,7 @@ def pack_command(cmd, data): # format of data packet is [SOD|LNH|LNL|RES|DAT|SUM|ETX] def pack_pkt(res, data): SOD = 0x81 - if (len(data) >= 1024): + if (len(data) > 1024): raise Exception(f'Data packet too large, data length is {DATA_LEN} (>1024)') LNH, LNL, SUM = calc_sum(int(res), data) if not isinstance(data, bytes): -- 2.7.4