mirror of https://github.com/ArduPilot/ardupilot
LogAnalyzer: Binary Logs may end with \xff
- ignoreBadlines can be used to assume this is a proper EOF
This commit is contained in:
parent
07a74bc39f
commit
cf4435989e
|
@ -612,7 +612,13 @@ class DataflashLog(object):
|
||||||
while len(data) > offset:
|
while len(data) > offset:
|
||||||
h = logheader.from_buffer(data, offset)
|
h = logheader.from_buffer(data, offset)
|
||||||
if not (h.head1 == 0xa3 and h.head2 == 0x95):
|
if not (h.head1 == 0xa3 and h.head2 == 0x95):
|
||||||
raise ValueError(h)
|
if ignoreBadlines == False:
|
||||||
|
raise ValueError(h)
|
||||||
|
else:
|
||||||
|
if h.head1 == 0xff and h.head2 == 0xff and h.msgid == 0xff:
|
||||||
|
print("Assuming EOF due to dataflash block tail filled with \\xff... (offset={off})".format(off=offset))
|
||||||
|
break
|
||||||
|
|
||||||
if h.msgid in self._formats:
|
if h.msgid in self._formats:
|
||||||
typ = self._formats[h.msgid]
|
typ = self._formats[h.msgid]
|
||||||
if len(data) <= offset + typ.SIZE:
|
if len(data) <= offset + typ.SIZE:
|
||||||
|
|
Loading…
Reference in New Issue