Browse Source

LogAnalyzer: Binary Logs may end with \xff

- ignoreBadlines can be used to assume this is a proper EOF
master
Markus Koetter 11 years ago committed by Craig Elder
parent
commit
cf4435989e
  1. 8
      Tools/LogAnalyzer/DataflashLog.py

8
Tools/LogAnalyzer/DataflashLog.py

@ -612,7 +612,13 @@ class DataflashLog(object): @@ -612,7 +612,13 @@ class DataflashLog(object):
while len(data) > offset:
h = logheader.from_buffer(data, offset)
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:
typ = self._formats[h.msgid]
if len(data) <= offset + typ.SIZE:

Loading…
Cancel
Save