diff options
author | Gary E. Miller <gem@rellim.com> | 2018-09-19 15:06:11 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-09-19 15:06:11 -0700 |
commit | 8b5b82fec49e929fa344eb3aa36526aa1a9f0e9a (patch) | |
tree | ab99f67bd8317e50116f1499f241ac3df68c8f29 /contrib | |
parent | 258e33a298396ea99db1ff393fadb66fb32c8c3f (diff) | |
download | gpsd-8b5b82fec49e929fa344eb3aa36526aa1a9f0e9a.tar.gz |
ubxtool: better decode of UBX-CFG-PMS
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/ubxtool | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/ubxtool b/contrib/ubxtool index 1494c356..2e3c3512 100755 --- a/contrib/ubxtool +++ b/contrib/ubxtool @@ -156,7 +156,7 @@ class ubx(object): s += 'pdwnOnSCD ' if u[0] & 0x10: s += 'recovery ' - s += (')\npinSwitch: %d, pinSCD: %d, pinOCD: %d reconfig: %d\n' % + s += (')\n pinSwitch: %d, pinSCD: %d, pinOCD: %d reconfig: %d\n' % (u[1] & 0x1f, (u[1] >> 5) & 0x1f, (u[1] >> 10) & 0x1f, u[1] >> 15)) return s @@ -320,9 +320,20 @@ class ubx(object): if 8 > m_len: return "Bad Length %s" % m_len + values = {0: "Full power", + 1: "Balanced", + 2: "Interval", + 3: "Aggresive with 1Hz", + 4: "Aggresive with 2Hz", + 5: "Aggresive with 4Hz", + 0xff: "Invalid" + } u = struct.unpack_from('<BBHHBB', buf, 0) s = (' version: %u powerSetupValue: %u' - ' period: %u onTime: %#x reserved1[ %u %u]' % u) + ' period: %u onTime: %#x reserved1[%u %u]' % u) + if u[0] in values: + s += "\n powerSetupValue: %s" % values[u[0]] + return s def cfg_prt(self, buf): |