From cf4435989e82e503c7f0e82eabefffbfd731f392 Mon Sep 17 00:00:00 2001 From: Markus Koetter Date: Tue, 15 Jul 2014 10:25:36 +0200 Subject: [PATCH] LogAnalyzer: Binary Logs may end with \xff - ignoreBadlines can be used to assume this is a proper EOF --- Tools/LogAnalyzer/DataflashLog.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tools/LogAnalyzer/DataflashLog.py b/Tools/LogAnalyzer/DataflashLog.py index aab238c8d5..4575956016 100644 --- a/Tools/LogAnalyzer/DataflashLog.py +++ b/Tools/LogAnalyzer/DataflashLog.py @@ -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: