From e2a7e74ea32e3d1a37d516033a1cd82e835f9211 Mon Sep 17 00:00:00 2001 From: "Dr.-Ing. Amilcar do Carmo Lucas" Date: Tue, 23 Jan 2024 10:08:02 +0100 Subject: [PATCH 1/2] VER messages should not be affected by --condition nor --reduction --- tools/mavlogdump.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mavlogdump.py b/tools/mavlogdump.py index 055d5954f..f02b7688a 100755 --- a/tools/mavlogdump.py +++ b/tools/mavlogdump.py @@ -136,7 +136,7 @@ def reduce_rate_msg(m, reduction_rate): '''return True if this msg should be discarded by reduction''' global last_msg_rate_t mtype = m.get_type() - if mtype in ['PARM','MSG','FMT','FMTU','MULT','MODE','EVT','UNIT']: + if mtype in ['PARM','MSG','FMT','FMTU','MULT','MODE','EVT','UNIT', 'VER']: return False t = getattr(m,'_timestamp',None) if t is None: @@ -258,7 +258,7 @@ def match_type(mtype, patterns): continue if not mavutil.evaluate_condition(args.condition, mlog.messages) and ( - not (m_type in ['FMT', 'FMTU', 'MULT', 'PARM', 'MODE', 'UNIT'] and args.meta)): + not (m_type in ['FMT', 'FMTU', 'MULT', 'PARM', 'MODE', 'UNIT', 'VER'] and args.meta)): continue if args.source_system is not None and args.source_system != m.get_srcSystem(): continue From 35bc0c1c4e8028eb1e8b97d8bc45795fbd80d320 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 21 Jan 2024 21:10:35 +1100 Subject: [PATCH 2/2] mavparm: only look for 0x in strings --- mavparm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mavparm.py b/mavparm.py index 1fc224587..a2fcef518 100644 --- a/mavparm.py +++ b/mavparm.py @@ -50,7 +50,7 @@ def mavset(self, mav, name, value, retries=3, parm_type=None): return False numeric_value, = struct.unpack(">f", vstr) else: - if value.lower().startswith('0x'): + if isinstance(value, str) and value.lower().startswith('0x'): numeric_value = int(value[2:], 16) else: numeric_value = float(value)