summaryrefslogtreecommitdiff
path: root/gps.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-11 17:48:12 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-11 17:48:12 +0000
commitf8a78c0981fb76eedb5c0ef63db8b3ae34726008 (patch)
treedb8f48c388abe8401237dfd9d97ae4f2f09edd8c /gps.py
parent2419386a8b6112b87e2e76a0b595f94ee02ec196 (diff)
downloadgpsd-f8a78c0981fb76eedb5c0ef63db8b3ae34726008.tar.gz
Add support for the 2-field return of C to client libraries.
Diffstat (limited to 'gps.py')
-rwxr-xr-xgps.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gps.py b/gps.py
index 965344b7..ad934adb 100755
--- a/gps.py
+++ b/gps.py
@@ -148,6 +148,7 @@ class gpsdata:
self.baudrate = 0
self.stopbits = 0
self.cycle = 0
+ self.mincycle = 0
self.device = None
self.devices = []
@@ -273,8 +274,10 @@ class gps(gpsdata):
if data == '?':
self.cycle = -1
self.device = None
- else:
- self.cycle = float(data)
+ elif len(data.split()) == 2:
+ (self.cycle, self.mincycle) = map(float, data)
+ else:
+ self.mincycle = self.cycle = float(data)
elif cmd in ('D', 'd'):
self.utc = data
self.gps_time = isotime(self.utc)