summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-06-14 14:43:58 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-06-14 14:43:58 +0000
commitccaa6bece7829710449b12ff521ec7a71ada83ce (patch)
tree13b52cefedd25036ed07c3edc40867ea05af17ff
parentf34215be2c5d06378a0065b2f2fb626407ce525c (diff)
downloadgpsd-ccaa6bece7829710449b12ff521ec7a71ada83ce.tar.gz
Documentation updates.
-rw-r--r--HACKING2
-rw-r--r--gpsfake.py14
-rw-r--r--www/faq.html50
3 files changed, 58 insertions, 8 deletions
diff --git a/HACKING b/HACKING
index 77e9352b..a2537687 100644
--- a/HACKING
+++ b/HACKING
@@ -501,7 +501,7 @@ is so you can use it to set the system clock.
The hotplug interface works pretty nicely for telling gpsd which
device to look at, at least on my FC3/FC4/FC5 Linux machines. The fly
-in the ointment is that I'm using a deprecated version of the
+in the ointment is that we're using a deprecated version of the
interface, the old-style /etc/hotplug version with usermap files.
It is unlikely this interface will be dropped by distro makers any
diff --git a/gpsfake.py b/gpsfake.py
index b4231c12..63447afb 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -28,11 +28,11 @@ from some specified logfile; gpsd reads the slave side. A fake GPS is
identified by the string naming its slave device.
TestSession also has methods to start and end client sessions. Daemon
-responses to a client are fed to a hook function which, by default, discards
-them. You can change the hook to sys.stdout.write dump responses to standard
-output (this is what the gpsfake executable does) or do something more exotic
-A client session is identified by a small integer that counts the number of
-client session starts.
+responses to a client are fed to a hook function which, by default,
+discards them. You can change the hook to sys.stdout.write() to dump
+responses to standard output (this is what the gpsfake executable
+does) or do something more exotic. A client session is identified by a
+small integer that counts the number of client session starts.
There are a couple of convenience methods. TestSession.wait() does nothing,
allowing a specified number of seconds to elapse. TestSession.client_query()
@@ -57,7 +57,7 @@ which is fed to the daemon character by character,
There are some limitations. Trying to run more than one instance of
TestSession concurrently will fail as the daemon instances contend for
-port 2947. Due to indeterminacy in thread timings, it is not guaranteed
+port 12000. Due to indeterminacy in thread timings, it is not guaranteed
that runs with identical options will present exactly the same
sentences to the daemon at the same times from start.
@@ -71,7 +71,7 @@ import sys, os, time, signal, pty, termios
import string, exceptions, threading, socket
import gps
-# So we can do regression tests without stepping omn a production daemon
+# So we can do regression tests without stepping on a production daemon
# According to IANA port 12000 belongs to an IBM SNA service. Picking an
# obsolete service seems safer than picking an unused number that IANA might
# allocate in the future.
diff --git a/www/faq.html b/www/faq.html
index 1d90a178..df411d10 100644
--- a/www/faq.html
+++ b/www/faq.html
@@ -426,6 +426,56 @@ No more U.S.-centric date-format assumptions! Also, as previously
noted, the seconds part may have one or more digits of decimal fractional
seconds.</p>
+<h1 id='web'>How do I get gpsd data into a web page?</h1>
+
+<p>The easy way is to use a perl CGI script that leverages
+Net::GPSD like this...</p>
+
+<code><pre>
+#!/usr/bin/perl -w
+use strict;
+use Net::GPSD;
+
+my $g=new Net::GPSD;
+my $p=$g->get;
+
+print qq{
+&lt;?xml version='1.0'?&gt;
+&lt;Report xmlns:gml="http://www.opengis.net/gml"&gt;
+ &lt;items&gt;
+ &lt;Item&gt;
+ &lt;ID&gt;35643563245&lt;/ID&gt;
+ &lt;position&gt;
+ &lt;gml:Point srsDimension="2"
+srsName="urn:ogc:def:crs:EPSG:6.6:4326"&gt;
+ &lt;gml:pos&gt;}. $p-&gt;lat. " ". $p-&gt;lon. q{&lt;/gml:pos&gt;
+ &lt;/gml:Point&gt;
+ &lt;/position&gt;
+ &lt;/Item&gt;
+ &lt;/items&gt;
+&lt;/Report&gt;
+};
+&lt;/code&gt;
+</pre></code>
+
+<p>This will return something like:</p>
+
+<code><pre>
+&lt;?xml version='1.0'?&gt;
+&lt;Report xmlns:gml="http://www.opengis.net/gml"&gt;
+ &lt;items&gt;
+ &lt;Item&gt;
+ &lt;ID&gt;35643563245&lt;/ID&gt;
+ &lt;position&gt;
+ &lt;gml:Point srsDimension="2" srsName="urn:ogc:def:crs:EPSG:6.6:4326"&gt;
+ &lt;gml:pos&gt;38.865960 -77.108624&lt;/gml:pos&gt;
+ &lt;/gml:Point&gt;
+ &lt;/position&gt;
+ &lt;/Item&gt;
+ &lt;/items&gt;
+&lt;/Report&gt;
+</pre></code>
+
</div>
<hr/>
<script language="JavaScript" src="datestamp.js" type='text/javascript'></script>