Merge pull request #67 from jkingsman/respect-found-idx

Use the frame start once we've found it
This commit is contained in:
fdlamotte 2026-03-22 12:48:11 -04:00 committed by GitHub
commit 52ad5c201c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 0 deletions

View file

@ -79,6 +79,10 @@ class SerialConnection:
idx = data.find(b"\x3e")
if idx < 0: # no start of frame
return
# Discard any leading junk bytes before the actual frame marker.
# Some radios interleave console/debug text on the same UART, so
# valid companion frames may begin at an offset inside the chunk.
data = data[idx:]
self.header = data[0:1]
data = data[1:]