diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-03-07 15:32:23 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-03-07 15:32:23 +0000 |
commit | 0f3dfccad575ac35ef0c41beb3c6340c1b2d1939 (patch) | |
tree | 3ffde35783e7d84a842f61597bca19992a551038 /www | |
parent | 964fa5d02a151ed772a7eb36df0543fa98b9ab39 (diff) | |
download | gpsd-0f3dfccad575ac35ef0c41beb3c6340c1b2d1939.tar.gz |
.cycle_chars is gone, replaced by min_cycle.
Diffstat (limited to 'www')
-rw-r--r-- | www/hacking.html | 35 | ||||
-rw-r--r-- | www/writing-a-driver.xml | 32 |
2 files changed, 10 insertions, 57 deletions
diff --git a/www/hacking.html b/www/hacking.html index ffac068e..9ee7f89b 100644 --- a/www/hacking.html +++ b/www/hacking.html @@ -105,7 +105,6 @@ file in the source distribution.</p> <li><a href="#reports">Where to put the data you get from the GPS</a></li> <li><a href="#confidence">Report errors with a 95% confidence interval</a></li> <li><a href="#logfiles">Log files for regression testing</a></li> -<li><a href="#throughput">Throughput computation for baud rate changes</a></li> </ol> <li><a href="#buffering">The buffering problem</a></li> <ol> @@ -995,7 +994,7 @@ the null-terminated array in drivers.c.</p> it should live in its own C source file named after the driver type. Add it to the libgps_c_sources name list in Makefile.am</p> -<p>The easiest way write a driver is probably to copy the driver_proto.c +<p>The easiest way to write a driver is probably to copy the driver_proto.c file in the source distribution, change names appropriately, and write the guts of the analyzer and writer functions. Look in gpsutils.c before you do; driver helper functions live there. Also read some @@ -1005,7 +1004,7 @@ existing drivers for clues.</p> On Writing A GPSD Driver.</a></para> <p>There's a second kind of driver architecture for -<code>gpsmon</code>, the real-timr packet monitor and diagnostic tool. +<code>gpsmon</code>, the real-time packet monitor and diagnostic tool. It works from monitor-object definitions that include a pointer to the device driver for the GPS type you want to monitor. See monitor_proto.c for a prototype and technical details.</p> @@ -1151,36 +1150,6 @@ logfile format.</p> portion during which the GPS has no fix, a portion during which it has a fix but is stationary, and a portion during which it is moving.</p> -<h3 id="throughput">Throughput computation for baud rate changes</h3> - -<p>At low baud rates it is possible to try to push more characters of -NMEA through per cycle than the time to transmit will allow. Here -are the maxima to use for computation:</p> - -<div> </div> - -<table border='1'> -<tr><td>ZDA </td><td>36</td></tr> -<tr><td>GLL </td><td>47</td></tr> -<tr><td>GGA </td><td>82</td></tr> -<tr><td>VTG </td><td>46</td></tr> -<tr><td>RMC </td><td>77</td></tr> -<tr><td>GSA </td><td>67</td></tr> -<tr><td>GSV </td><td>60 (per line, thus 180 for a set of 3)</td></tr> -</table> - -<p>The transmit time for a cycle (which must be less than 1 second) -is the total character count multiplied by 10 and divided by the -baud rate.</p> - -<p>A typical budget is GGA, RMC, GSA, 3*GSV = 82+75+67+(3*60) = 404.</p> - -<p>When you write a driver that includes the capability to change -sampling rates, you must fill in the cycle_chars member with -a maximum character length so the daemon framework code will -be able to compute when a sample-rate change will work. If -you have to estimate this number, err on the high side.</p> - <h1 id="buffering">The buffering problem</h1> <p>Considered in the abstract, the cleanest thing for a diff --git a/www/writing-a-driver.xml b/www/writing-a-driver.xml index 6b6c673b..13834893 100644 --- a/www/writing-a-driver.xml +++ b/www/writing-a-driver.xml @@ -616,10 +616,9 @@ write of the data, which is provided by the default routine <function>pass_rtcm</function>. If the device does not accept differential data, the value is NULL.</para> -<!-- modified by ESR, 2009 --> <para><structfield>.speed_switcher</structfield> points to a block of code to change baud rate, parity, and stop bits (if supported). If -your ddevice can support some speed/parity/stopbits combinations but +your device can support some speed/parity/stopbits combinations but not others, it should return false on a mode-change request it can't handle.</para> @@ -629,7 +628,10 @@ binary mode (1).</para> <para><structfield>.rate_switcher</structfield> points to a block of code to change the maximum number of fixes your device can generate -in 1 second.</para> +in 1 second. If this method is present, you should also fill in +<structfield>.min_cycle</structfield> tio indicate the device's +minimum cycle time in seconds; a 0 value indicates that it is limited +only by yjr data throughput of the reporting channel.</para> <para><structfield>.control_send</structfield> points to a block of code that can take a buffer full of message payload, wrap iit in @@ -643,11 +645,12 @@ possible, assemble your packet in <structfield>session->msgbuflen</structfield>; this will allow gpsmon to display the control messages it sends for you.</para> -<para><structfield>.cycle_chars</structfield> is explained in +<!-- deleted by ESR, 2009 --> +<!-- <para><structfield>.cycle_chars</structfield> is explained in <quote>Throughput computation for baud rate changes</quote> in the <quote>Hacker's Guide to GPSD</quote> in the general documentation. It's only necessary to fill this in if you have -<structfield>.rate_switcher</structfield> capability</para> +<structfield>.rate_switcher</structfield> capability</para> --> <para><structfield>.revert</structfield> points to a block of code that is conditionally run each time the device is closed if @@ -666,25 +669,6 @@ which is run unconditionally each time the device is to be closed. <quote><option>-n</option> </quote> switch is not active.) This is also where you should undo any port parameter changes you made in <structfield>.probe_detect</structfield>above.</para> - -<!-- deleted by ESR, 2009 --> -<!-- <para><structfield>.cycle</structfield> is a number giving the number of -fixes per second you can get. Gets updated if you can rate-switch -and user gives a <application>gpsd</application> 'C' command.</para> --> - -<!-- modified by ESR, 2009 --> -<para>The connection between some of the above was confirmed with Eric -Raymond as follows.</para> <para>The inter-relationship between -<structfield>.speed_switcher</structfield>, -<structfield>.rate_switcher</structfield>, -<structfield>.cycle_chars</structfield> is:-</para> <para>If we can change -baud rate (<structfield>.speed_switcher</structfield>) and we can -alter the rate at which fixes are delivered -(<structfield>.rate_switcher</structfield>), then we need to know the -number of characters in a fix string -(<structfield>.cycle_chars</structfield>) so that we can compute the -minimum reporting cycle time we can ask -for.</para> </sect1> <sect1><title>Details of the driver parser</title> |