]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
started documentation on driver 46 (GPSD_JSON)
authorJuergen Perlinger <perlinger@ntp.org>
Sun, 16 Feb 2014 14:07:57 +0000 (15:07 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Sun, 16 Feb 2014 14:07:57 +0000 (15:07 +0100)
bk: 5300c63d9G1820UqcWrPdrEJIoD6tA

html/drivers/driver46.html [new file with mode: 0644]
html/refclock.html
ntpd/ntp_control.c

diff --git a/html/drivers/driver46.html b/html/drivers/driver46.html
new file mode 100644 (file)
index 0000000..ba2f9d2
--- /dev/null
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+    <meta http-equiv="Content-Type"
+    content="text/html;charset=iso-8859-1"><title>GPSD-NG client driver</title>
+    
+    <link href="scripts/style.css" type="text/css" rel="stylesheet">
+    <style type="text/css">
+      table.dlstable { font-size:85%; }
+      td.ttf{ font-family:Courier; font-weight:bold; }
+    </style></head>
+
+
+
+  <body>
+    <h3>GPSD NG client driver</h3>
+    <hr>
+    <h4>Synopsis</h4>
+
+    <p>
+      Address: 127.127.46.<i>u</i><br>
+      Reference ID: <tt>GPSD</tt><br>
+      Driver ID: <tt>GPSD_JSON</tt><br>
+      Serial Port: <tt>/dev/gps<i>u</i></tt> as symlink to the true
+      device (not used directly; see below)<br>
+      Features: <tt></tt>
+    </p>
+
+    <h4>Description</h4>
+
+    <p>
+      This driver is a client driver to the GPSD daemon, which over
+      the time became increasingly popular for UN*Xish platforms. GPSD
+      can manage several devices in parallel, aggregate information,
+      and acts as a data hub for client applications. GPSD can also
+      auto-detect and handle PPS hardware signals on serial
+      ports. Have a look at <a href="http://www.catb.org/gpsd/">the
+      GPSD project page</a>.
+    </p>
+    <p>
+      <b>It is imortant to understand that this driver needs a GPS
+      device with PPS support to operate.</b>
+    </p>
+    <p>
+      The GPSD-NG protocol is text based, using JSON notation to
+      transfer records in form of JSON objects. The driver uses a
+      TCP/IP connection to <tt>localhost:gpsd</tt> to connect to the
+      daemon and then requests the GPS device <tt>/dev/gps<i>u</i></tt>
+      to be watched. (Different clock units use different devices, and
+      GPSD is able to give only the relevant information to a clock
+      instance.)
+    </p>
+    <p>
+      This driver does not expect GPSD running or the clock device to
+      be present <i>a priori</i>; it will try to re-establish a lost
+      or hitherto unsuccessful connection. There is a 10 seconds delay
+      between a connection loss or failed attempt and the next
+      reconnect attempt; this makes sure that there is no thrashing on
+      the network layer.
+    </p>
+    <p>
+      The overall accuracy depends on the receiver used. The driver
+      uses the error estimations (95% probability limits) provided by
+      GPSD to set the clock precision dynamically according to these
+      readings.
+    </p>
+    <p>
+      The driver needs the VERSION, TPV and PPS objects of the GPSD
+      protocol. (Others are quietly ignored.)
+    </p>
+
+
+    <h4>Naming a Device</h4>
+    <p>
+      The GPSD driver uses the same name as the NMEA driver,
+      namely <tt>/dev/gps<i>u</i></tt>. There is a simple reason for
+      that: While the NMEA driver and the GPSD driver can be active at
+      the same time <strong>for different devices</strong>, they
+      cannot access the same device at a time. Having the same name
+      helps on that. It also eases migration from using NMEA directly
+      to using GPSD, as no new links etc need to be created.
+
+      GPSD is normally started with the device name to access; it can
+      also be instructed by hotplug scripts to add or remove devices
+      from its device pool. Luckily, the symlinks used by the NMEA
+      driver are happily accepted and used by GPSD; this makes it
+      possible to use the symlink names as device identification.
+
+    <h4>The 'mode' byte</h4>
+    <p>
+      Until now, GPSD has no mode bits.
+    </p>
+
+    <h4>Fudge Factors</h4>
+
+    <dl>
+      <dt><tt>time1 <i>time</i></tt></dt>
+      <dd>Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+      <dt><a name="fudgetime2"><tt>time2 <i>time</i></tt></a></dt>
+      <dd><it>(not used)</it></dd>
+      <dt><tt>stratum <i>number</i></tt></dt>
+      <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+      <dt><tt>refid <i>string</i></tt></dt>
+      <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with
+       default <tt>GPS</tt>.</dd>
+      <dt><tt>flag1 0 | 1</tt></dt><dd><it>(not used)</it></dd>
+      <dt><tt>flag2 0 | 1</tt></dt><dd><it>(not used)</it></dd>
+      <dt><tt>flag3 0 | 1</tt></dt><dd><it>(not used)</it></dd>
+      <dt><tt>flag4 0 | 1</tt></dt><dd><it>(not used)</it></dd>
+    </dl>
+
+    <p>Additional Information</p>
+    <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+    <hr>
+    <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+  </body></html>
index ad7048086f2d5fe732bfec516c851ba998525f27..16c50be6090b4c65116c7f2bb17b6b189caf8b82 100644 (file)
@@ -85,6 +85,7 @@
   <li class="inline"><a href="drivers/driver43.html">Type 43</a> RIPE NCC interface for Trimble Palisade</li>
   <li class="inline"><a href="drivers/driver44.html">Type 44</a> NeoClock4X - DCF77 / TDF serial line</li>
   <li class="inline"><a href="drivers/driver45.html">Type 45</a> Spectracom TSYNC PCI</li>
+  <li class="inline"><a href="drivers/driver46.html">Type 46</a> GPSD NG client protocol</li>
 </ul>
 <hr>
 <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
index c73dd7247928e691014a80ceaaac24cfe55298aa..dde46318b16a102ea2737de80180e01792e2ee87 100644 (file)
@@ -731,6 +731,7 @@ static const u_char clocktypes[] = {
        CTL_SST_TS_UHF,         /* REFCLK_RIPENCC (43) */
        CTL_SST_TS_UHF,         /* REFCLK_NEOCLOCK4X (44) */
        CTL_SST_TS_UHF,         /* REFCLK_TSYNCPCI (45) */
+       CTL_SST_TS_UHF          /* REFCLK_GPSDJSON (46) */
 };
 #endif  /* REFCLOCK */