summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2019-04-02 14:23:24 -0700
committerFred Wright <fw@fwright.net>2019-04-02 14:23:24 -0700
commit8797a6ffaff8d224d443882dc0aeb08aecc326ff (patch)
tree0de25d65c5f25009a1951601b3bbcaa2c51661c5 /ubxtool
parent1c8fe5190b6e1428bc4bd64acf612930d1d7d91b (diff)
downloadgpsd-8797a6ffaff8d224d443882dc0aeb08aecc326ff.tar.gz
ubxtool: Fix some dual-UART issues.
1) Replaces spaces with underscores in UART names, to avoid the need for quoting arguments to -i. 2) Since most receivers only have a single UART port, and since the versions of the documentation that don't cover dual UARTs use 'UART' rather than 'UART 1', this reports just 'UART' for id 1, while accepting both forms as input. 3) Avoids accepting 'Reserved' as a valid argument to -i. Numeric 5 is still allowed. 4) Fixes decoding omissions for UART_2. TESTED: On a NEO-M8T, fully tested CFG-PRT for id 1, with limited testing of ids 2 and 5 (decode of poll). No dual-UART receivers available for full testing of id 2.
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool11
1 files changed, 7 insertions, 4 deletions
diff --git a/ubxtool b/ubxtool
index de5c3a37..67253172 100755
--- a/ubxtool
+++ b/ubxtool
@@ -142,13 +142,14 @@ class ubx(object):
# Names for portID values in UBX-CFG-PRT
port_ids = {0: 'DDC', # The inappropriate name for i2c used in the spec
- 1: 'UART 1',
- 2: 'UART 2',
+ 1: 'UART',
+ 2: 'UART_2',
3: 'USB',
4: 'SPI',
- 5: 'Reserved',
}
port_id_map = dict([x[::-1] for x in port_ids.items()])
+ port_id_map['UART_1'] = port_id_map['UART'] # Accept synonym
+ port_ids[5] = 'Reserved' # Don't include this in port_id_map
def ack_ack(self, buf):
"UBX-ACK-ACK decode"
@@ -410,12 +411,14 @@ class ubx(object):
s = [' PortID: %s reserved1: %u txReady: %#x' % (idstr, u[1], u[2])]
s.append({1: ' mode: %#x baudRate: %u',
+ 2: ' mode: %#x baudRate: %u',
3: ' reserved2: [%u %u]',
4: ' mode: %#x reserved2: %u',
0: ' mode: %#x reserved2: %u',
}.get(portid, ' ???: %u,%u') % tuple(u[3:5]))
s.append(' inProtoMask: %#x outProtoMask: %#x' % tuple(u[5:7]))
s.append({1: ' flags: %#x reserved2: %u',
+ 2: ' flags: %#x reserved2: %u',
3: ' reserved3: %u reserved4: %u',
4: ' flags: %#x reserved3: %u',
0: ' flags: %#x reserved3: %u',
@@ -444,7 +447,7 @@ class ubx(object):
dec.append('RTCM3')
s.append(' outProtoMask: %s' % ' '.join(dec))
- if portid in set([1, 4, 0]):
+ if portid in set([1, 2, 4, 0]):
dec = []
if u[7] & 0x2:
dec.append('extendedTxTimeout')