summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2007-01-27 07:27:42 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2007-01-27 07:27:42 +0000
commit067072633930483e8de71a87d329c35ae7229597 (patch)
tree1401571dec0adb0d1d164b57ceaf9b2802de7c3e /gpsd.c
parent68397cc87ed96ca75e1aabfc84a9d5c7dfca3f61 (diff)
downloadgpsd-067072633930483e8de71a87d329c35ae7229597.tar.gz
Better error modelling.
Each fix updates the error estimates using the generic model unless the driver provides a better error model. This means that we use the old generic model for most of our drivers, but some devices provide their own error estimates - if so, we'll use those instead. Original diff from Diego Berge, with some corrections from me.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/gpsd.c b/gpsd.c
index e39d7b6d..bedc921b 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -900,16 +900,16 @@ static int handle_gpsd_request(struct subscriber_t* sub, char *buf, int buflen)
sub->fixbuffer.altitude);
else
(void)strlcat(phrase, " ?", BUFSIZ);
- if (isnan(sub->fixbuffer.eph)==0)
+ if (isnan(sub->device->gpsdata.fix.eph)==0)
(void)snprintf(phrase+strlen(phrase),
sizeof(phrase)-strlen(phrase),
- " %.2f", sub->fixbuffer.eph);
+ " %.2f", sub->device->gpsdata.fix.eph);
else
(void)strlcat(phrase, " ?", BUFSIZ);
- if (isnan(sub->fixbuffer.epv)==0)
+ if (isnan(sub->device->gpsdata.fix.epv)==0)
(void)snprintf(phrase+strlen(phrase),
sizeof(phrase)-strlen(phrase),
- " %.2f", sub->fixbuffer.epv);
+ " %.2f", sub->device->gpsdata.fix.epv);
else
(void)strlcat(phrase, " ?", BUFSIZ);
if (isnan(sub->fixbuffer.track)==0)
@@ -927,23 +927,23 @@ static int handle_gpsd_request(struct subscriber_t* sub, char *buf, int buflen)
sub->fixbuffer.climb);
else
(void)strlcat(phrase, " ?", BUFSIZ);
- if (isnan(sub->fixbuffer.epd)==0)
+ if (isnan(sub->device->gpsdata.fix.epd)==0)
(void)snprintf(phrase+strlen(phrase),
sizeof(phrase)-strlen(phrase),
" %.4f",
- sub->fixbuffer.epd);
+ sub->device->gpsdata.fix.epd);
else
(void)strlcat(phrase, " ?", BUFSIZ);
- if (isnan(sub->fixbuffer.eps)==0)
+ if (isnan(sub->device->gpsdata.fix.eps)==0)
(void)snprintf(phrase+strlen(phrase),
sizeof(phrase)-strlen(phrase),
- " %.2f", sub->fixbuffer.eps);
+ " %.2f", sub->device->gpsdata.fix.eps);
else
(void)strlcat(phrase, " ?", BUFSIZ);
- if (isnan(sub->fixbuffer.epc)==0)
+ if (isnan(sub->device->gpsdata.fix.epc)==0)
(void)snprintf(phrase+strlen(phrase),
sizeof(phrase)-strlen(phrase),
- " %.2f", sub->fixbuffer.epc);
+ " %.2f", sub->device->gpsdata.fix.epc);
else
(void)strlcat(phrase, " ?", BUFSIZ);
if (sub->fixbuffer.mode > 0)
@@ -1657,8 +1657,6 @@ int main(int argc, char *argv[])
gps_merge_fix(&sub->fixbuffer,
changed,
&sub->device->gpsdata.fix);
- gpsd_error_model(sub->device,
- &sub->fixbuffer, &sub->oldfix);
}
}
}