summaryrefslogtreecommitdiff
path: root/gpscat
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2008-07-13 09:41:20 +0000
committerEric S. Raymond <esr@thyrsus.com>2008-07-13 09:41:20 +0000
commit6a084b39c8f3081a7a737dbd7c5868a7f63eada4 (patch)
tree419335d26152f9396e6dd40289e9e8755ec0eb0f /gpscat
parent78c28e4fdf6e738aa2ec72539c12edad39dc46ce (diff)
downloadgpsd-6a084b39c8f3081a7a737dbd7c5868a7f63eada4.tar.gz
Packet state machine now recognizes RTCM3 packets correctly.
Update the packet regression test load. Introduce new EOF_PACKET type to signal that the packet getter sees EOF. All regression tests pass.
Diffstat (limited to 'gpscat')
-rwxr-xr-xgpscat7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpscat b/gpscat
index 0bbba455..47981ad4 100755
--- a/gpscat
+++ b/gpscat
@@ -108,10 +108,13 @@ if __name__ == '__main__':
buf = ""
else:
(type, packet) = getter.get(tty)
- if packet == '':
+ length = len(packet)
+ if type == gpspacket.EOF_PACKET:
break
+ elif type == gpspacket.BAD_PACKET or length == 0:
+ continue
if typeflag:
- sys.stdout.write(`type` + " (" + `len(packet)` + "): " + hexdump(packet) + "\n")
+ sys.stdout.write(`type` + " (" + `length` + "): " + hexdump(packet) + "\n")
else:
sys.stdout.write(hexdump(packet) + "\n")
except KeyboardInterrupt: