summaryrefslogtreecommitdiff
path: root/gpsfake.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-12-15 00:50:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-12-15 00:50:16 +0000
commitda5f3ad0df0cc5f23d8b0f58dc5b31631577c269 (patch)
tree93b755929994c4d0ea0fe021e8df7cd390ab657b /gpsfake.py
parentbf3c7dfe628624d4a73cc6077663504c34d0edd8 (diff)
downloadgpsd-da5f3ad0df0cc5f23d8b0f58dc5b31631577c269.tar.gz
Diego Burge's driver builds, but it messes up some regression tests...
...(notably the TSIP ones). There's a conflict...
Diffstat (limited to 'gpsfake.py')
-rw-r--r--gpsfake.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/gpsfake.py b/gpsfake.py
index cbb91efc..d38948c2 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -140,6 +140,10 @@ class TestLoad:
self.legend = "gpsfake: packet %d: "
self.idoffset = 3
self.textual = False
+ elif self.sentences[0][0] == '\x02':
+ self.packtype = "Navcom binary"
+ self.legend = "gpsfake: packet %d"
+ self.textual = False
elif self.sentences[0][0] == '\x10':
self.packtype = "TSIP binary"
self.legend = "gpsfake: packet %d: "
@@ -180,6 +184,14 @@ class TestLoad:
id = ord(third) | (ord(fourth) << 8)
ndata = ord(fifth) | (ord(sixth) << 8)
return "\xff\x81" + third + fourth + fifth + sixth + self.logfp.read(2*ndata+6)
+ elif first == '\x02' and second == '\x99': # Navcom
+ third = self.logfp.read(1)
+ fourth = self.logfp.read(1)
+ fifth = self.logfp.read(1)
+ sixth = self.logfp.read(1)
+ id = ord(fourth)
+ ndata = ord(fifth) | (ord(sixth) << 8)
+ return "\x02\x99\x66" + fourth + fifth + sixth + self.logfp.read(ndata-2)
elif first == '\x10': # TSIP
packet = first + second
delcnt = 0