From 0c37b51b8bfac00cd8096be7d79b19f68c2937ec Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Wed, 8 May 2019 15:14:34 -0700 Subject: ubxtool: Add decode for gnssId and sigId to RAWX decode. gnss_s() can be used by other decodes. --- ubxtool | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) (limited to 'ubxtool') diff --git a/ubxtool b/ubxtool index c178aba0..be4ebdca 100755 --- a/ubxtool +++ b/ubxtool @@ -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('