diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2007-12-28 03:21:02 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2007-12-28 03:21:02 +0000 |
commit | 4f70acd27661fe839d8074e505a0603e12999b4f (patch) | |
tree | 4cb61f405c7178f10ae66524f146f4131e207290 /gpsfake.py | |
parent | 35515b0d8d0b4594b90d7b6cc9cca218e89ee824 (diff) | |
download | gpsd-4f70acd27661fe839d8074e505a0603e12999b4f.tar.gz |
This change will make gpsfake less fussy about trailing \n on binary logs.
It should enable the UBX log(s) to be read.
Diffstat (limited to 'gpsfake.py')
-rw-r--r-- | gpsfake.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -131,7 +131,7 @@ class TestLoad: packet = self.packet_get() if self.predump: print `packet` - if not packet: + if not packet or packet == "\n": break else: self.sentences.append(packet) @@ -233,6 +233,8 @@ class TestLoad: # messageid = fourth ndata = ord(fifth) | (ord(sixth) << 8) return "\xb5\x62" + third + fourth + fifth + sixth + self.logfp.read(ndata+2) + elif first == "\n": # Use this to ignore trailing EOF on logs + return "\n" else: raise PacketError("unknown packet type, leader %s (0x%x)" % (`first`, ord(first))) |