summaryrefslogtreecommitdiff
path: root/gpsd.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2004-11-10 01:46:09 +0000
committerEric S. Raymond <esr@thyrsus.com>2004-11-10 01:46:09 +0000
commit8cf26f6c639f5de56ea5ddb1df754cc5bb2d1539 (patch)
tree8ed0a6c1c76d08d69dd5fcdff79a70953fe917f7 /gpsd.py
parent24144c6ce5c5ab74d3b8072ecc4edc50f31de232 (diff)
downloadgpsd-8cf26f6c639f5de56ea5ddb1df754cc5bb2d1539.tar.gz
Empty-field check for altitude.
Diffstat (limited to 'gpsd.py')
-rwxr-xr-xgpsd.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/gpsd.py b/gpsd.py
index bd03c009..35185321 100755
--- a/gpsd.py
+++ b/gpsd.py
@@ -125,15 +125,17 @@ class NMEA:
def processGPGGA(self,words):
self.update_timestamp(None, words[0])
self.__do_lat_lon(words[1:])
- newstatus = int(words[5])
- self.data.status_stamp.changed = (self.data.status != newstatus)
- self.data.status = newstatus
- self.data.status_stamp.refresh()
- newaltitude = float(words[8])
- self.data.altitude_stamp.changed = (self.data.altitude != newaltitude)
- self.data.altitude = newaltitude
- self.data.altitude_stamp.refresh()
- self.logger(3, "GPGGA sets status %d\n" % self.data.status);
+ if words[8]:
+ newaltitude = float(words[8])
+ self.data.altitude_stamp.changed = (self.data.altitude != newaltitude)
+ self.data.altitude = newaltitude
+ self.data.altitude_stamp.refresh()
+ if words[5]:
+ newstatus = int(words[5])
+ self.data.status_stamp.changed = (self.data.status != newstatus)
+ self.data.status = newstatus
+ self.data.status_stamp.refresh()
+ self.logger(3, "GPGGA sets status %d\n" % self.data.status);
def processGPGSA(self,words):
newmode = int(words[1])