diff options
author | Gary E. Miller <gem@rellim.com> | 2018-10-03 14:37:55 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-10-03 14:37:55 -0700 |
commit | 39e5c4ba22d015c820cfa2d7ced1042c5cbf0620 (patch) | |
tree | 7b5ebdf5fb1fb1c327b43081420160c8e4e2f287 /ubxtool | |
parent | 5ca81f9da1cc9cdd088a220ffd83697db60f9e3a (diff) | |
download | gpsd-39e5c4ba22d015c820cfa2d7ced1042c5cbf0620.tar.gz |
ubxtool: improve decode of UBX-TIM-TIMEUTC.
Decode the flag bits in the valid byte
Diffstat (limited to 'ubxtool')
-rwxr-xr-x | ubxtool | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -925,9 +925,36 @@ class ubx(object): if 20 > m_len: return " Bad Length %s" % m_len - u = struct.unpack_from('<LLlHbbbbbb', buf, 0) - return (' iTOW:%d ms, tAcc:%d ns nano:%d ns Time: %d/%d/%d %d:%d:%d\n' - ' valid:%#x' % u) + u = struct.unpack_from('<LLlHbbbbbB', buf, 0) + s = (' iTOW:%d ms, tAcc:%d ns nano:%d ns Time: %d/%d/%d %d:%d:%d\n' + ' valid:%#x (' % u) + if 0xf7 & u[9]: + if 1 & u[9]: + s += 'validTOW ' + if 2 & u[9]: + s += 'validWKN ' + if 4 & u[9]: + s += 'validUTC ' + utcStandard = u[9] >> 4 + s += "utcStandard: " + if 1 == utcStandard: + s += 'CRL' + elif 2 == utcStandard: + s += 'NIST' + elif 3 == utcStandard: + s += 'USNO' + elif 4 == utcStandard: + s += 'BIPM' + elif 5 == utcStandard: + s += 'tbd' + elif 6 == utcStandard: + s += 'SU' + elif 7 == utcStandard: + s += 'NTSC' + else: + s += 'n/a' + s += ')' + return s def nav_velecef(self, buf): "UBX-NAV-VELECEF decode" |