summaryrefslogtreecommitdiff
path: root/gpsfake.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2007-12-28 03:21:02 +0000
committerEric S. Raymond <esr@thyrsus.com>2007-12-28 03:21:02 +0000
commit4f70acd27661fe839d8074e505a0603e12999b4f (patch)
tree4cb61f405c7178f10ae66524f146f4131e207290 /gpsfake.py
parent35515b0d8d0b4594b90d7b6cc9cca218e89ee824 (diff)
downloadgpsd-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.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gpsfake.py b/gpsfake.py
index 22dd0119..693be678 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -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)))