summaryrefslogtreecommitdiff
path: root/dgpsip.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-29 16:28:48 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-29 16:28:48 +0000
commitcba6b916920d78ef3e002061f1229d6c4debecac (patch)
tree68c377b24671f916d36d78e83d7738f7d633c517 /dgpsip.c
parent1391a44aa66d71f74fa2513c16c8ae61e6a4e2ee (diff)
downloadgpsd-cba6b916920d78ef3e002061f1229d6c4debecac.tar.gz
Clean up DGPSIP a bit more, some variables don't need to be per-session.
Diffstat (limited to 'dgpsip.c')
-rw-r--r--dgpsip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dgpsip.c b/dgpsip.c
index 36164544..96b7771d 100644
--- a/dgpsip.c
+++ b/dgpsip.c
@@ -71,8 +71,12 @@ void dgpsip_relay(struct gps_device_t *session)
void dgpsip_report(struct gps_device_t *session)
/* may be time to ship a usage report to the DGPSIP server */
{
- if (session->fixcnt > 10 && !session->sentdgps) {
- session->sentdgps = true;
+ /*
+ * 10 is an arbitrary number, the point is to have gotten several good
+ * fixes before reporting usage to our DGPSIP server.
+ */
+ if (session->context->fixcnt > 10 && !session->context->sentdgps) {
+ session->context->sentdgps = true;
if (session->context->dsock > -1) {
char buf[BUFSIZ];
(void)snprintf(buf, sizeof(buf), "R %0.8f %0.8f %0.2f\r\n",