From 9523595282780a45d622ef2c2ad0a5801000b410 Mon Sep 17 00:00:00 2001 From: gretel Date: Tue, 19 Nov 2024 20:55:16 +0100 Subject: [PATCH] Fix KISS beacon frame length Fix frame length handling to meet minimum length requirements (15 bytes) for TNCs like Direwolf. Previously, raw beacon data was being sent directly, causing frame length errors. Changed code to pad beacon data with zeros to ensure minimum frame length. --- RNS/Interfaces/KISSInterface.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/RNS/Interfaces/KISSInterface.py b/RNS/Interfaces/KISSInterface.py index 4dad095..a071368 100644 --- a/RNS/Interfaces/KISSInterface.py +++ b/RNS/Interfaces/KISSInterface.py @@ -319,7 +319,13 @@ class KISSInterface(Interface): if time.time() > self.first_tx + self.beacon_i: RNS.log("Interface "+str(self)+" is transmitting beacon data: "+str(self.beacon_d.decode("utf-8")), RNS.LOG_DEBUG) self.first_tx = None - self.processOutgoing(self.beacon_d) + + # Pad to minimum length + frame = bytearray(self.beacon_d) + while len(frame) < 15: + frame.append(0x00) + + self.processOutgoing(bytes(frame)) except Exception as e: self.online = False