mirror of
https://github.com/svpcom/wfb-ng.git
synced 2025-02-21 16:03:49 -04:00
Fix reporting of lost mavlink sync
This commit is contained in:
parent
b30303fbbc
commit
fa3f43736e
@ -184,6 +184,7 @@ class SerialProxyProtocol(Protocol, ProxyProtocol):
|
||||
buffer = bytearray()
|
||||
mlist = []
|
||||
skip = 0
|
||||
bad = 0
|
||||
|
||||
while True:
|
||||
# GC
|
||||
@ -215,10 +216,14 @@ class SerialProxyProtocol(Protocol, ProxyProtocol):
|
||||
|
||||
mlen += (25 if flags & 0x01 else 12)
|
||||
else:
|
||||
log.msg('skip bad byte %x' % (version,))
|
||||
skip += 1
|
||||
bad += 1
|
||||
continue
|
||||
|
||||
if bad:
|
||||
log.msg('skip %d bad bytes before sync' % (bad,))
|
||||
bad = 0
|
||||
|
||||
if len(buffer) - skip < mlen:
|
||||
break
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user