summaryrefslogtreecommitdiff
path: root/gps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2004-08-23 20:14:55 +0000
committerEric S. Raymond <esr@thyrsus.com>2004-08-23 20:14:55 +0000
commitca0ef394be04205b387fc1e5d656b1a90cd1e703 (patch)
tree2b108668369a8b6f50a539654304068fbea0bb91 /gps.c
parentfa71a26b510934bcdbf1ae609b5476fc7d937da9 (diff)
downloadgpsd-ca0ef394be04205b387fc1e5d656b1a90cd1e703.tar.gz
Make sure everything shipped to clients by gpsd is NUL-terminated.
Enable '!' and '?' responses to tag data invalid due to no fix or stale. But this is just a checkpoint; timeouts, and stale data warnings, will go away in the next commit.
Diffstat (limited to 'gps.c')
-rw-r--r--gps.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gps.c b/gps.c
index be6f2aae..3ca55a65 100644
--- a/gps.c
+++ b/gps.c
@@ -409,17 +409,20 @@ void update_display(char *message)
sprintf(s, "%f", gpsdata.track);
XmTextFieldSetString(text_6, s);
- switch (gpsdata.mode) {
- case 2:
- sprintf(s, "2D %sFIX", (gpsdata.status==2) ? "DIFF ": "");
- break;
- case 3:
- sprintf(s, "3D %sFIX", (gpsdata.status==2) ? "DIFF ": "");
- break;
- default:
- sprintf(s, "NO FIX");
- break;
- }
+ if (!gpsdata.online)
+ sprintf(s, "OFFLINE");
+ else
+ switch (gpsdata.mode) {
+ case 2:
+ sprintf(s, "2D %sFIX",(gpsdata.status==STATUS_DGPS_FIX)?"DIFF ":"");
+ break;
+ case 3:
+ sprintf(s, "3D %sFIX",(gpsdata.status==STATUS_DGPS_FIX)?"DIFF ":"");
+ break;
+ default:
+ sprintf(s, "NO FIX");
+ break;
+ }
XmTextFieldSetString(text_7, s);
draw_graphics(&gpsdata);