Skip to content

Commit bf04f34

Browse files
committed
MAVExplorer.py: add ability to reassemble chunked MSG messages
1 parent 8947768 commit bf04f34

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

MAVProxy/tools/MAVExplorer.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -908,18 +908,21 @@ def get_error_code(subsys, ecode):
908908
mstr = m.text
909909

910910
# special handling for statustext:
911-
if hasattr(m, 'id') and hasattr(m, 'chunk_seq') and m.chunk_seq != 0: # assume STATUSTEXT
912-
if m.id != statustext_current_id:
911+
chunking_id = getattr(m, "id", getattr(m, "ID", None))
912+
chunking_seq = getattr(m, "chunk_seq", getattr(m, "Seq", None))
913+
914+
if chunking_id is not None and chunking_seq is not None and chunking_id != 0:
915+
if chunking_id != statustext_current_id:
913916
if statustext_accumulation is not None:
914917
print_if_match(statustext_timestring, statustext_accumulation)
915918
statustext_accumulation = ""
916-
statustext_current_id = m.id
919+
statustext_current_id = chunking_id
917920
statustext_next_seq = 0
918921
statustext_timestring = timestring(m)
919-
if m.chunk_seq != statustext_next_seq:
922+
if chunking_seq != statustext_next_seq:
920923
statustext_accumulation += "..."
921-
statustext_next_seq = m.chunk_seq + 1
922-
statustext_accumulation += m.text
924+
statustext_next_seq = chunking_seq + 1
925+
statustext_accumulation += getattr(m, "text", getattr(m, 'Message'))
923926
continue
924927

925928
print_if_match(timestring(m), mstr)

0 commit comments

Comments
 (0)