diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-06-14 14:43:58 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-06-14 14:43:58 +0000 |
commit | ccaa6bece7829710449b12ff521ec7a71ada83ce (patch) | |
tree | 13b52cefedd25036ed07c3edc40867ea05af17ff | |
parent | f34215be2c5d06378a0065b2f2fb626407ce525c (diff) | |
download | gpsd-ccaa6bece7829710449b12ff521ec7a71ada83ce.tar.gz |
Documentation updates.
-rw-r--r-- | HACKING | 2 | ||||
-rw-r--r-- | gpsfake.py | 14 | ||||
-rw-r--r-- | www/faq.html | 50 |
3 files changed, 58 insertions, 8 deletions
@@ -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 @@ -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{ +<?xml version='1.0'?> +<Report xmlns:gml="http://www.opengis.net/gml"> + <items> + <Item> + <ID>35643563245</ID> + <position> + <gml:Point srsDimension="2" +srsName="urn:ogc:def:crs:EPSG:6.6:4326"> + <gml:pos>}. $p->lat. " ". $p->lon. q{</gml:pos> + </gml:Point> + </position> + </Item> + </items> +</Report> +}; +</code> +</pre></code> + +<p>This will return something like:</p> + +<code><pre> +<?xml version='1.0'?> +<Report xmlns:gml="http://www.opengis.net/gml"> + <items> + <Item> + <ID>35643563245</ID> + <position> + <gml:Point srsDimension="2" srsName="urn:ogc:def:crs:EPSG:6.6:4326"> + <gml:pos>38.865960 -77.108624</gml:pos> + </gml:Point> + </position> + </Item> + </items> +</Report> +</pre></code> + </div> <hr/> <script language="JavaScript" src="datestamp.js" type='text/javascript'></script> |