diff options
Diffstat (limited to 'ubxtool')
-rwxr-xr-x | ubxtool | 50 |
1 files changed, 45 insertions, 5 deletions
@@ -1593,6 +1593,41 @@ class ubx(object): return None + id_map = { + 0: {"name": "GPS", + "sig": {0: "L1C/A", 3: "L2 CL", 4: "L2 CM"}}, + 1: {"name": "SBAS", + "sig": {0: "L1C/A", 3: "L2 CL", 4: "L2 CM"}}, + 2: {"name": "QZSS", + "sig": {0: "E1 C", 1: "E1 B", 5: "E5 bl", 6: "E5 bQ"}}, + 3: {"name": "GLONASS", + "sig": {0: "B1|D1", 1: "B1|D2", 2: "B2|D1", 3: "B2|D2"}}, + 4: {"name": "Galileo", + "sig": {0: "L1C/A"}}, + 5: {"name": "BeiDou", + "sig": {0: "L1C/A", 3: "L2 CL", 4: "L2 CM"}}, + 6: {"name": "GLONASS", + "sig": {0: "L1 OF", 2: "L2 OF"}}, + } + + def gnss_s(self, gnssId, svId, sigId): + """Verbose decode of gnssId, svId and sigId""" + + s = '' + + if gnssId in self.id_map: + if "name" not in self.id_map[gnssId]: + s = "%d PRN %d sigId %d" % (gnssId, svId, sigId) + elif sigId not in self.id_map[gnssId]["sig"]: + s = "%s PRN %d sigId %d" % (self.id_map[gnssId]["name"], svId, sigId) + else: + s = "%s PRN %d sigId %s" % (self.id_map[gnssId]["name"], svId, + self.id_map[gnssId]["sig"][sigId]) + else: + s = "%d PRN %d sigId %d" % (gnssId, svId, sigId) + + return s + def ack_ack(self, buf): """UBX-ACK-ACK decode""" m_len = len(buf) @@ -3073,8 +3108,13 @@ class ubx(object): while 0 < m_len: u = struct.unpack_from('<ddfBBBBHBBBBB', buf, 16 + i * 32) s += ('\n prmes %.3f cpMes %.3f doMes %f\n' - ' gnssId %u svId %u sigId %u freqId %u locktime %u cno %u\n' + ' gnssId %u svId %u sigId %u freqId %u locktime %u ' + 'cno %u\n' ' prStdev %u, cpStdev %u doStdev %u trkStat %u' % u) + + if VERB_DECODE < opts['verbosity']: + s += '\n (%s)' % self.gnss_s(u[3], u[4], u[5]) + m_len -= 32 i += 1 return s @@ -3089,8 +3129,8 @@ class ubx(object): return " Bad Length %s" % m_len u = struct.unpack_from('<BBLLLLLLLLLL', buf, 0) - s = (' chn:%d s svid %3d\n' - ' dwrd:%08x %08x %08x %08x %08x\n' + s = (' chn %d s svid %3d\n' + ' dwrd %08x %08x %08x %08x %08x\n' ' %08x %08x %08x %08x %08x' % u) return s @@ -3103,7 +3143,7 @@ class ubx(object): return " Bad Length %s" % m_len u = struct.unpack_from('<BBBBBBBB', buf, 0) - s = (' gnssId:%u svId %3u reserved1 %u freqId %u numWords %u\n' + s = (' gnssId %u svId %3u reserved1 %u freqId %u numWords %u\n' ' reserved2 %u version %u reserved3 %u\n' % u) s += ' dwrd' for i in range(8, m_len - 1, 4): @@ -3122,7 +3162,7 @@ class ubx(object): return " Bad Length %s" % m_len u = struct.unpack_from('<LhBB', buf, 0) - s = ' iTOW:%d ns week:%d numVis:%d numSV:%d' % u + s = ' iTOW %d week %d numVis %d numSV %d' % u m_len -= 8 i = 0 |