diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2008-07-13 09:41:20 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2008-07-13 09:41:20 +0000 |
commit | 6a084b39c8f3081a7a737dbd7c5868a7f63eada4 (patch) | |
tree | 419335d26152f9396e6dd40289e9e8755ec0eb0f /gpscat | |
parent | 78c28e4fdf6e738aa2ec72539c12edad39dc46ce (diff) | |
download | gpsd-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-x | gpscat | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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: |