From d0c6bdbc2e36bfa5deb184cd6a5f5fb7987fde89 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Mon, 20 May 2019 17:53:18 -0700 Subject: ubxtool: Convert CFG-CFG to flag_s() --- ubxtool | 63 ++++++++++++++++++++++++--------------------------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/ubxtool b/ubxtool index d7c1ea1a..5c603867 100755 --- a/ubxtool +++ b/ubxtool @@ -1682,32 +1682,25 @@ class ubx(object): return s - def cfg_cfg_mask(self, mask): - """decode Mask in UBX-CFG-CFG, return string""" - s = '' - if mask & 0x1: - s += 'ioPort ' - if mask & 0x2: - s += 'msgConf ' - if mask & 0x4: - s += 'infMsg ' - if mask & 0x8: - s += 'navConf ' - if mask & 0x10: - s += 'rxmConf ' - if mask & 0x100: - # not on M8030 - s += 'senConf ' - if mask & 0x200: - s += 'rinvConf ' - if mask & 0x400: - s += 'antConf ' - if mask & 0x800: - s += 'logConf ' - if mask & 0x1000: - s += 'ftsConf ' + cfg_cfg_mask = { + 0x1: 'ioPort', + 0x2: 'msgConf', + 0x4: 'infMsg', + 0x8: 'navConf', + 0x10: 'rxmConf', + 0x100: 'senConf', # not on M8030 + 0x200: 'rinvConf', + 0x400: 'antConf', + 0x800: 'logConf', + 0x1000: 'ftsConf', + } - return s + cfg_cfg_dev = { + 0x1: 'devBBR', + 0x2: 'devFlash', + 0x4: 'devEEPROM', + 0x10: 'devSpiFlash', + } def cfg_cfg(self, buf): """UBX-CFG-CFG decode""" @@ -1720,24 +1713,16 @@ class ubx(object): else: u = struct.unpack_from('