summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-05 03:00:47 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-05 03:00:47 +0000
commit3ce4cf8f1526bc468e3d2b4aaf0765feb41e10ae (patch)
tree884abde713731289933c0f37fbeab323714a4b13
parentcc7b5d9ea921a76e5d2f1d7439e33a49432e17d8 (diff)
downloadgpsd-3ce4cf8f1526bc468e3d2b4aaf0765feb41e10ae.tar.gz
Add some documentation, and a no-read timeout.
-rw-r--r--gpsd.c10
-rw-r--r--libgpsd_core.c2
-rw-r--r--www/gps-hacking.html22
3 files changed, 23 insertions, 11 deletions
diff --git a/gpsd.c b/gpsd.c
index 56234fde..2eaa5e6a 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -53,11 +53,13 @@
* that open connections and just sit there, not issuing a W or
* doing anything else that triggers a device assignment. Clients
* in watcher or raw mode that don't read their data will get dropped
- * when throttled_write() fills up the outbound buffers. Clients
- * in the original polling mode have to be timed out.
+ * when throttled_write() fills up the outbound buffers and the
+ * NOREAD_TIMEOUT expires. Clients in the original polling mode have
+ * to be timed out as well.
*/
#define ASSIGNMENT_TIMEOUT 60
#define POLLER_TIMEOUT 60*15
+#define NOREAD_TIMEOUT 60*3
#define QLEN 5
@@ -309,8 +311,8 @@ static ssize_t throttled_write(int cfd, char *buf, ssize_t len)
return status;
if (errno == EBADF)
gpsd_report(3, "Client on %d has vanished.\n", cfd);
- else if (errno == EWOULDBLOCK)
- gpsd_report(3, "Dropped client on %d to avoid overrun.\n", cfd);
+ else if (errno == EWOULDBLOCK && timestamp() - subscribers[cfd].active > NOREAD_TIMEOUT)
+ gpsd_report(3, "Client on %d timed out.\n", cfd);
else
gpsd_report(3, "Client write to %d: %s\n", cfd, strerror(errno));
detach_client(cfd);
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 470581f8..fd60825d 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -368,7 +368,7 @@ static void apply_error_model(struct gps_device_t *session)
/*
* Now we compute derived quantities. This is where the tricky error-
* modeling stuff goes. Presently we don't know how to derive
- * time or track error.
+ * time error.
*
* Field reports match the theoretical prediction that
* expected time error should be half the resolution of
diff --git a/www/gps-hacking.html b/www/gps-hacking.html
index eb0daeed..74d09ea9 100644
--- a/www/gps-hacking.html
+++ b/www/gps-hacking.html
@@ -97,11 +97,13 @@ the signals. The U.S. military knew the pattern, but nobody else did
<p>Now that 'Selective Availability' is gone, the important limits are
natural. One is a variable amount of signal lag produced as the GPS
-signals pass through the ionosphere, which partly reflects radio waves.
-This can be largely compensated for by a technique called "Differential
-GPS" or DGPS, in which your receiver takes timings both from satellites
-and ground stations. The ground stations can measure and compensate for
-the ionospheric lag. WAAS and EGNOS are similar systems.</p>
+signals pass through the ionosphere, which partly reflects radio
+waves. This can be largely compensated for by a technique called
+"Differential GPS" or DGPS, in which your receiver takes timings both
+from satellites and ground stations. The ground stations are in a
+known fixed osition, so they can compute the exact distance to
+satellites from an ephemeris. Thus, they can measure and compensate
+for the ionospheric lag. WAAS and EGNOS are similar systems.</p>
<p>DGPS itself requires out-of-band communication with a service
providing GPS signal correction information to make the GPS
@@ -202,7 +204,7 @@ that want to convey data to computers.</p>
<h2>The bad news about NMEA</h2>
-<p>That's the good news. Now for the bad news, which comes in three
+<p>That's the good news. Now for the bad news, which comes in five
pieces:</p>
<p>First, the NMEA standard does <em>not</em> specify a command
@@ -253,6 +255,14 @@ in NMEA mode. which is where it boots up. The idea seems to be
that you can switch to binary to improve your bits-per-second
in latency-critical applications.</p>
+<p>The fourth problem with NMEA is that it doesn't deliver all the
+information that the GPS has in one atomic message. In particular,
+you can't get altitude (delivered in the GPGGA sentence only) and speed
+(delivered in GPRMC and GPVTG) at the same time. This is annoying;
+ideal, you want you position/velocity/time oracle to deliver one
+observation tuple conveying all seven degrees of freedom (t, x, y, z,
+vx, vy, vz) and their error estimates.</p>
+
<h2>Learning more about NMEA</h2>
<p>The final irritation about NMEA is that it's expensive to buy a