Skip to content

Commit

Permalink
Fix KISS beacon frame length
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gretel committed Nov 21, 2024
1 parent d002a75 commit 9523595
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion RNS/Interfaces/KISSInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,13 @@ def readLoop(self):
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
Expand Down

0 comments on commit 9523595

Please sign in to comment.