From f4f110e165f290c31692427591bce6798d666870 Mon Sep 17 00:00:00 2001 From: Robin Krens Date: Tue, 13 Feb 2024 20:08:36 +0100 Subject: [PATCH] RAPacker: data package can aso start with 0x81 --- src/RAPacker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/RAPacker.py b/src/RAPacker.py index 676a296..52fa9fd 100644 --- a/src/RAPacker.py +++ b/src/RAPacker.py @@ -97,8 +97,10 @@ def pack_command(cmd, data): return fmt # format of data packet is [SOD|LNH|LNL|RES|DAT|SUM|ETX] -def pack_pkt(res, data): +def pack_pkt(res, data, ack=False): SOD = 0x01 # TODO: check if 0x81 header needed + if ack: + SOD = 0x81 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) -- 2.7.4