1GPSD_JSON(5)                  GPSD Documentation                  GPSD_JSON(5)
2
3
4

NAME

6       gpsd_json - gpsd request/response protocol
7

OVERVIEW

9       gpsd is a service daemon that can be used to monitor GPSes, DGPS
10       receivers, Marine AIS broadcasts, and various other location-related
11       and kinematic sensors.
12
13       Clients may communicate with gpsd via textual requests and responses
14       over a socket. It is a bad idea for applications to speak the protocol
15       directly: rather, they should use the libgps client library (for C;
16       bindings also exist for other languages) and take appropriate care to
17       conditionalize their code on the major and minor protocol version
18       symbols.
19
20       The GPSD protocol is built on top of JSON, JavaScript Object Notation,
21       as specified in RFC 7159: The JavaScript Object Notation (JSON) Data
22       Interchange Format. GPSD's use of JSON is restricted in some ways that
23       make parsing it in fixed-extent languages (such as C) easier.
24
25       A request line is introduced by "?" and may include multiple commands.
26       Commands begin with a command identifier, followed either by a
27       terminating ';' or by an equal sign "=" and a JSON object treated as an
28       argument. Any ';' or newline indication (either LF or CR-LF) after the
29       end of a command is ignored. All request lines must be composed of
30       US-ASCII characters and may be no more than 80 characters in length,
31       exclusive of the trailing newline.
32
33       Responses are JSON objects all of which have a "class" attribute the
34       value of which is either the name of the invoking command. There are
35       reports (including but not limited to as "TPV", "SKY", "DEVICE", and
36       "ERROR") which are not direct responses to commands.
37
38       The order of JSON attributes within a response object is never
39       significant, and you may specify attributes in commands in any order.
40       Responses never contain the special JSON value null; instead,
41       attributes with empty or undefined values are omitted. The length limit
42       for responses and reports is 1536 characters, including trailing
43       newline; longer responses will be truncated, so client code must be
44       prepared for the possibility of invalid JSON fragments.
45
46       In JSON reports, if an attribute is present only if the parent
47       attribute is present or has a particular range, then the parent
48       attribute is emitted first.
49
50       There is one constraint on the order in which attributes will be
51       omitted. If an optional attribute is present only when a parent
52       attribute has a specified value or range of values, the parent
53       attribute will be emitted first to make parsing easier.
54
55       The next subsection section documents the core GPSD protocol.
56       Extensions are documented in the following subsections. The extensions
57       may not be supported in your gpsd instance if it has been compiled with
58       a restricted feature set.
59

CORE SOCKET PROTOCOL

61       Here are the core-protocol responses:
62
63       TPV
64           A TPV object is a time-position-velocity report. The "class" and
65           "mode" fields will reliably be present. The "mode" field will be
66           emitted before optional fields that may be absent when there is no
67           fix. Error estimates will be emitted after the fix components
68           they're associated with. Others may be reported or not depending on
69           the fix quality.
70
71           Table 1. TPV object
72           ┌───────┬─────────┬─────────┬──────────────────┐
73Name   Always? Type    Description      
74           ├───────┼─────────┼─────────┼──────────────────┤
75           │class  │ Yes     │ string  │ Fixed: "TPV"     │
76           ├───────┼─────────┼─────────┼──────────────────┤
77           │device │ No      │ string  │ Name of          │
78           │       │         │         │ originating      │
79           │       │         │         │ device.          │
80           ├───────┼─────────┼─────────┼──────────────────┤
81           │status │ No      │ numeric │ GPS status: %d,  │
82           │       │         │         │ 2=DGPS fix,      │
83           │       │         │         │ otherwise not    │
84           │       │         │         │ present.         │
85           ├───────┼─────────┼─────────┼──────────────────┤
86           │mode   │ Yes     │ numeric │ NMEA mode: %d,   │
87           │       │         │         │ 0=no mode value  │
88           │       │         │         │ yet seen, 1=no   │
89           │       │         │         │ fix, 2=2D, 3=3D. │
90           ├───────┼─────────┼─────────┼──────────────────┤
91           │time   │ No      │ string  │ Time/date stamp  │
92           │       │         │         │ in ISO8601       │
93           │       │         │         │ format, UTC. May │
94           │       │         │         │ have a           │
95           │       │         │         │      fractional  │
96           │       │         │         │ part of up to    │
97           │       │         │         │ .001sec          │
98           │       │         │         │ precision. May   │
99           │       │         │         │ be absent if     │
100           │       │         │         │ mode             │
101           │       │         │         │         is not 2 │
102           │       │         │         │ or 3.            │
103           ├───────┼─────────┼─────────┼──────────────────┤
104           │ept    │ No      │ numeric │ Estimated        │
105           │       │         │         │ timestamp error  │
106           │       │         │         │ (%f, seconds,    │
107           │       │         │         │ 95% confidence). │
108           │       │         │         │         Present  │
109           │       │         │         │ if time is       │
110           │       │         │         │ present.         │
111           ├───────┼─────────┼─────────┼──────────────────┤
112           │lat    │ No      │ numeric │ Latitude in      │
113           │       │         │         │ degrees: +/-     │
114           │       │         │         │ signifies        │
115           │       │         │         │ North/South.     │
116           │       │         │         │ Present          │
117           │       │         │         │         when     │
118           │       │         │         │ mode is 2 or 3.  │
119           ├───────┼─────────┼─────────┼──────────────────┤
120           │lon    │ No      │ numeric │ Longitude in     │
121           │       │         │         │ degrees: +/-     │
122           │       │         │         │ signifies        │
123           │       │         │         │ East/West.       │
124           │       │         │         │ Present          │
125           │       │         │         │         when     │
126           │       │         │         │ mode is 2 or 3.  │
127           ├───────┼─────────┼─────────┼──────────────────┤
128           │alt    │ No      │ numeric │ Altitude in      │
129           │       │         │         │ meters. Present  │
130           │       │         │         │ if mode is 3.    │
131           ├───────┼─────────┼─────────┼──────────────────┤
132           │epx    │ No      │ numeric │ Longitude error  │
133           │       │         │         │ estimate in      │
134           │       │         │         │ meters, 95%      │
135           │       │         │         │ confidence.      │
136           │       │         │         │ Present          │
137           │       │         │         │         if mode  │
138           │       │         │         │ is 2 or 3 and    │
139           │       │         │         │ DOPs can be      │
140           │       │         │         │ calculated from  │
141           │       │         │         │ the satellite    │
142           │       │         │         │         view.    │
143           ├───────┼─────────┼─────────┼──────────────────┤
144           │epy    │ No      │ numeric │ Latitude error   │
145           │       │         │         │ estimate in      │
146           │       │         │         │ meters, 95%      │
147           │       │         │         │ confidence.      │
148           │       │         │         │ Present          │
149           │       │         │         │         if mode  │
150           │       │         │         │ is 2 or 3 and    │
151           │       │         │         │ DOPs can be      │
152           │       │         │         │ calculated from  │
153           │       │         │         │ the satellite    │
154           │       │         │         │         view.    │
155           ├───────┼─────────┼─────────┼──────────────────┤
156           │epv    │ No      │ numeric │ Estimated        │
157           │       │         │         │ vertical error   │
158           │       │         │         │ in meters, 95%   │
159           │       │         │         │ confidence.      │
160           │       │         │         │ Present          │
161           │       │         │         │         if mode  │
162           │       │         │         │ is 3 and DOPs    │
163           │       │         │         │ can be           │
164           │       │         │         │ calculated from  │
165           │       │         │         │ the satellite    │
166           │       │         │         │         view.    │
167           ├───────┼─────────┼─────────┼──────────────────┤
168           │track  │ No      │ numeric │ Course over      │
169           │       │         │         │ ground, degrees  │
170           │       │         │         │ from true north. │
171           ├───────┼─────────┼─────────┼──────────────────┤
172           │speed  │ No      │ numeric │ Speed over       │
173           │       │         │         │ ground, meters   │
174           │       │         │         │ per second.      │
175           ├───────┼─────────┼─────────┼──────────────────┤
176           │climb  │ No      │ numeric │ Climb (positive) │
177           │       │         │         │ or sink          │
178           │       │         │         │ (negative) rate, │
179           │       │         │         │ meters per       │
180           │       │         │         │      second.     │
181           ├───────┼─────────┼─────────┼──────────────────┤
182           │epd    │ No      │ numeric │ Direction error  │
183           │       │         │         │ estimate in      │
184           │       │         │         │ degrees, 95%     │
185           │       │         │         │ confidence.      │
186           ├───────┼─────────┼─────────┼──────────────────┤
187           │eps    │ No      │ numeric │ Speed error      │
188           │       │         │         │ estinmate in     │
189           │       │         │         │ meters/sec, 95%  │
190           │       │         │         │ confidence.      │
191           ├───────┼─────────┼─────────┼──────────────────┤
192           │epc    │ No      │ numeric │ Climb/sink error │
193           │       │         │         │ estimate in      │
194           │       │         │         │ meters/sec, 95%  │
195           │       │         │         │ confidence.      │
196           └───────┴─────────┴─────────┴──────────────────┘
197           When the C client library parses a response of this kind, it will
198           assert validity bits in the top-level set member for each field
199           actually received; see gps.h for bitmask names and values.
200
201           Here's an example:
202
203               {"class":"TPV","device":"/dev/pts/1",
204                   "time":"2005-06-08T10:34:48.283Z","ept":0.005,
205                   "lat":46.498293369,"lon":7.567411672,"alt":1343.127,
206                   "eph":36.000,"epv":32.321,
207                   "track":10.3788,"speed":0.091,"climb":-0.085,"mode":3}
208
209       SKY
210           A SKY object reports a sky view of the GPS satellite positions. If
211           there is no GPS device available, or no skyview has been reported
212           yet, only the "class" field will reliably be present.
213
214           Table 2. SKY object
215           ┌───────────┬─────────┬─────────┬──────────────────┐
216Name       Always? Type    Description      
217           ├───────────┼─────────┼─────────┼──────────────────┤
218           │class      │ Yes     │ string  │ Fixed: "SKY"     │
219           ├───────────┼─────────┼─────────┼──────────────────┤
220           │device     │ No      │ string  │ Name of          │
221           │           │         │         │ originating      │
222           │           │         │         │ device           │
223           ├───────────┼─────────┼─────────┼──────────────────┤
224           │time       │ No      │ numeric │ Time/date stamp  │
225           │           │         │         │ in ISO8601       │
226           │           │         │         │ format, UTC. May │
227           │           │         │         │ have a           │
228           │           │         │         │      fractional  │
229           │           │         │         │ part of up to    │
230           │           │         │         │ .001sec          │
231           │           │         │         │ precision.       │
232           ├───────────┼─────────┼─────────┼──────────────────┤
233           │xdop       │ No      │ numeric │ Longitudinal     │
234           │           │         │         │ dilution of      │
235           │           │         │         │ precision, a     │
236           │           │         │         │ dimensionless    │
237           │           │         │         │      factor      │
238           │           │         │         │ which should be  │
239           │           │         │         │ multiplied by a  │
240           │           │         │         │ base UERE to get │
241           │           │         │         │ an      error    │
242           │           │         │         │ estimate.        │
243           ├───────────┼─────────┼─────────┼──────────────────┤
244           │ydop       │ No      │ numeric │ Latitudinal      │
245           │           │         │         │ dilution of      │
246           │           │         │         │ precision, a     │
247           │           │         │         │ dimensionless    │
248           │           │         │         │      factor      │
249           │           │         │         │ which should be  │
250           │           │         │         │ multiplied by a  │
251           │           │         │         │ base UERE to get │
252           │           │         │         │ an      error    │
253           │           │         │         │ estimate.        │
254           ├───────────┼─────────┼─────────┼──────────────────┤
255           │vdop       │ No      │ numeric │ Altitude         │
256           │           │         │         │ dilution of      │
257           │           │         │         │ precision, a     │
258           │           │         │         │ dimensionless    │
259           │           │         │         │      factor      │
260           │           │         │         │ which should be  │
261           │           │         │         │ multiplied by a  │
262           │           │         │         │ base UERE to get │
263           │           │         │         │ an      error    │
264           │           │         │         │ estimate.        │
265           ├───────────┼─────────┼─────────┼──────────────────┤
266           │tdop       │ No      │ numeric │ Time dilution of │
267           │           │         │         │ precision, a     │
268           │           │         │         │ dimensionless    │
269           │           │         │         │      factor      │
270           │           │         │         │ which should be  │
271           │           │         │         │ multiplied by a  │
272           │           │         │         │ base UERE to get │
273           │           │         │         │ an      error    │
274           │           │         │         │ estimate.        │
275           ├───────────┼─────────┼─────────┼──────────────────┤
276           │hdop       │ No      │ numeric │ Horizontal       │
277           │           │         │         │ dilution of      │
278           │           │         │         │ precision, a     │
279           │           │         │         │ dimensionless    │
280           │           │         │         │      factor      │
281           │           │         │         │ which should be  │
282           │           │         │         │ multiplied by a  │
283           │           │         │         │ base UERE to get │
284           │           │         │         │ a      circular  │
285           │           │         │         │ error estimate.  │
286           ├───────────┼─────────┼─────────┼──────────────────┤
287           │pdop       │ No      │ numeric │ Spherical        │
288           │           │         │         │ dilution of      │
289           │           │         │         │ precision, a     │
290           │           │         │         │ dimensionless    │
291           │           │         │         │      factor      │
292           │           │         │         │ which should be  │
293           │           │         │         │ multiplied by a  │
294           │           │         │         │ base UERE to get │
295           │           │         │         │ an      error    │
296           │           │         │         │ estimate.        │
297           ├───────────┼─────────┼─────────┼──────────────────┤
298           │gdop       │ No      │ numeric │ Hyperspherical   │
299           │           │         │         │ dilution of      │
300           │           │         │         │ precision, a     │
301           │           │         │         │ dimensionless    │
302           │           │         │         │      factor      │
303           │           │         │         │ which should be  │
304           │           │         │         │ multiplied by a  │
305           │           │         │         │ base UERE to get │
306           │           │         │         │ an      error    │
307           │           │         │         │ estimate.        │
308           ├───────────┼─────────┼─────────┼──────────────────┤
309           │satellites │ Yes     │ list    │ List of          │
310           │           │         │         │ satellite        │
311           │           │         │         │ objects in       │
312           │           │         │         │ skyview          │
313           └───────────┴─────────┴─────────┴──────────────────┘
314           Many devices compute dilution of precision factors but do not
315           include them in their reports. Many that do report DOPs report only
316           HDOP, two-dimensional circular error.  gpsd always passes through
317           whatever the device actually reports, then attempts to fill in
318           other DOPs by calculating the appropriate determinants in a
319           covariance matrix based on the satellite view. DOPs may be missing
320           if some of these determinants are singular. It can even happen that
321           the device reports an error estimate in meters when the
322           corresponding DOP is unavailable; some devices use more
323           sophisticated error modeling than the covariance calculation.
324
325           The satellite list objects have the following elements:
326
327           Table 3. Satellite object
328           ┌─────┬─────────┬─────────┬──────────────────┐
329Name Always? Type    Description      
330           ├─────┼─────────┼─────────┼──────────────────┤
331           │PRN  │ Yes     │ numeric │ PRN ID of the    │
332           │     │         │         │ satellite. 1-63  │
333           │     │         │         │ are GNSS         │
334           │     │         │         │ satellites,      │
335           │     │         │         │      64-96 are   │
336           │     │         │         │ GLONASS          │
337           │     │         │         │ satellites,      │
338           │     │         │         │ 100-164 are SBAS │
339           │     │         │         │ satellites       │
340           ├─────┼─────────┼─────────┼──────────────────┤
341           │az   │ Yes     │ numeric │ Azimuth, degrees │
342           │     │         │         │ from true north. │
343           ├─────┼─────────┼─────────┼──────────────────┤
344           │el   │ Yes     │ numeric │ Elevation in     │
345           │     │         │         │ degrees.         │
346           ├─────┼─────────┼─────────┼──────────────────┤
347           │ss   │ Yes     │ numeric │ Signal strength  │
348           │     │         │         │ in dB.           │
349           ├─────┼─────────┼─────────┼──────────────────┤
350           │used │ Yes     │ boolean │ Used in current  │
351           │     │         │         │ solution?        │
352           │     │         │         │ (SBAS/WAAS/EGNOS │
353           │     │         │         │ satellites       │
354           │     │         │         │      may be      │
355           │     │         │         │ flagged used if  │
356           │     │         │         │ the solution has │
357           │     │         │         │ corrections from │
358           │     │         │         │ them,      but   │
359           │     │         │         │ not all drivers  │
360           │     │         │         │ make this        │
361           │     │         │         │ information      │
362           │     │         │         │ available.)      │
363           └─────┴─────────┴─────────┴──────────────────┘
364           Note that satellite objects do not have a "class" field, as they
365           are never shipped outside of a SKY object.
366
367           When the C client library parses a SKY response, it will assert the
368           SATELLITE_SET bit in the top-level set member.
369
370           Here's an example:
371
372               {"class":"SKY","device":"/dev/pts/1",
373                   "time":"2005-07-08T11:28:07.114Z",
374                   "xdop":1.55,"hdop":1.24,"pdop":1.99,
375                   "satellites":[
376                       {"PRN":23,"el":6,"az":84,"ss":0,"used":false},
377                       {"PRN":28,"el":7,"az":160,"ss":0,"used":false},
378                       {"PRN":8,"el":66,"az":189,"ss":44,"used":true},
379                       {"PRN":29,"el":13,"az":273,"ss":0,"used":false},
380                       {"PRN":10,"el":51,"az":304,"ss":29,"used":true},
381                       {"PRN":4,"el":15,"az":199,"ss":36,"used":true},
382                       {"PRN":2,"el":34,"az":241,"ss":43,"used":true},
383                       {"PRN":27,"el":71,"az":76,"ss":43,"used":true}]}
384
385       GST
386           A GST object is a pseudorange noise report.
387
388           Table 4. GST object
389           ┌───────┬─────────┬─────────┬──────────────────┐
390Name   Always? Type    Description      
391           ├───────┼─────────┼─────────┼──────────────────┤
392           │class  │ Yes     │ string  │ Fixed: "GST"     │
393           ├───────┼─────────┼─────────┼──────────────────┤
394           │device │ No      │ string  │ Name of          │
395           │       │         │         │ originating      │
396           │       │         │         │ device           │
397           ├───────┼─────────┼─────────┼──────────────────┤
398           │time   │ No      │ numeric │ Seconds since    │
399           │       │         │         │ the Unix epoch,  │
400           │       │         │         │ UTC. May have a  │
401           │       │         │         │ fractional part  │
402           │       │         │         │ of up to .001sec │
403           │       │         │         │ precision.       │
404           ├───────┼─────────┼─────────┼──────────────────┤
405           │rms    │ No      │ numeric │ Value of the     │
406           │       │         │         │ standard         │
407           │       │         │         │ deviation of the │
408           │       │         │         │ range inputs to  │
409           │       │         │         │ the navigation   │
410           │       │         │         │ process (range   │
411           │       │         │         │ inputs include   │
412           │       │         │         │ pseudoranges and │
413           │       │         │         │ DGPS             │
414           │       │         │         │ corrections).    │
415           ├───────┼─────────┼─────────┼──────────────────┤
416           │major  │ No      │ numeric │ Standard         │
417           │       │         │         │ deviation of     │
418           │       │         │         │ semi-major axis  │
419           │       │         │         │ of error         │
420           │       │         │         │ ellipse, in      │
421           │       │         │         │ meters.          │
422           ├───────┼─────────┼─────────┼──────────────────┤
423           │minor  │ No      │ numeric │ Standard         │
424           │       │         │         │ deviation of     │
425           │       │         │         │ semi-minor axis  │
426           │       │         │         │ of error         │
427           │       │         │         │ ellipse, in      │
428           │       │         │         │ meters.          │
429           ├───────┼─────────┼─────────┼──────────────────┤
430           │orient │ No      │ numeric │ Orientation of   │
431           │       │         │         │ semi-major axis  │
432           │       │         │         │ of error         │
433           │       │         │         │ ellipse, in      │
434           │       │         │         │ degrees from     │
435           │       │         │         │ true north.      │
436           ├───────┼─────────┼─────────┼──────────────────┤
437           │lat    │ No      │ numeric │ Standard         │
438           │       │         │         │ deviation of     │
439           │       │         │         │ latitude error,  │
440           │       │         │         │ in meters.       │
441           ├───────┼─────────┼─────────┼──────────────────┤
442           │lon    │ No      │ numeric │ Standard         │
443           │       │         │         │ deviation of     │
444           │       │         │         │ longitude error, │
445           │       │         │         │ in meters.       │
446           ├───────┼─────────┼─────────┼──────────────────┤
447           │alt    │ No      │ numeric │ Standard         │
448           │       │         │         │ deviation of     │
449           │       │         │         │ altitude error,  │
450           │       │         │         │ in meters.       │
451           └───────┴─────────┴─────────┴──────────────────┘
452           Here's an example:
453
454               {"class":"GST","device":"/dev/ttyUSB0",
455                       "time":"2010-12-07T10:23:07.096Z","rms":2.440,
456                       "major":1.660,"minor":1.120,"orient":68.989,
457                       "lat":1.600,"lon":1.200,"alt":2.520}
458
459       ATT
460           An ATT object is a vehicle-attitude report. It is returned by
461           digital-compass and gyroscope sensors; depending on device, it may
462           include: heading, pitch, roll, yaw, gyroscope, and magnetic-field
463           readings. Because such sensors are often bundled as part of
464           marine-navigation systems, the ATT response may also include water
465           depth.
466
467           The "class" and "mode" fields will reliably be present. Others may
468           be reported or not depending on the specific device type.
469
470           Table 5. ATT object
471           ┌─────────┬─────────┬─────────┬──────────────────┐
472Name     Always? Type    Description      
473           ├─────────┼─────────┼─────────┼──────────────────┤
474           │class    │ Yes     │ string  │ Fixed: "ATT"     │
475           ├─────────┼─────────┼─────────┼──────────────────┤
476           │device   │ Yes     │ string  │ Name of          │
477           │         │         │         │ originating      │
478           │         │         │         │ device           │
479           ├─────────┼─────────┼─────────┼──────────────────┤
480           │time     │ No      │ numeric │ Seconds since    │
481           │         │         │         │ the Unix epoch,  │
482           │         │         │         │ UTC. May have a  │
483           │         │         │         │      fractional  │
484           │         │         │         │ part of up to    │
485           │         │         │         │ .001sec          │
486           │         │         │         │ precision.       │
487           ├─────────┼─────────┼─────────┼──────────────────┤
488           │heading  │ No      │ numeric │ Heading, degrees │
489           │         │         │         │ from true north. │
490           ├─────────┼─────────┼─────────┼──────────────────┤
491           │mag_st   │ No      │ string  │ Magnetometer     │
492           │         │         │         │ status.          │
493           ├─────────┼─────────┼─────────┼──────────────────┤
494           │pitch    │ No      │ numeric │ Pitch in         │
495           │         │         │         │ degrees.         │
496           ├─────────┼─────────┼─────────┼──────────────────┤
497           │pitch_st │ No      │ string  │ Pitch sensor     │
498           │         │         │         │ status.          │
499           ├─────────┼─────────┼─────────┼──────────────────┤
500           │yaw      │ No      │ numeric │ Yaw in degrees   │
501           ├─────────┼─────────┼─────────┼──────────────────┤
502           │yaw_st   │ No      │ string  │ Yaw sensor       │
503           │         │         │         │ status.          │
504           ├─────────┼─────────┼─────────┼──────────────────┤
505           │roll     │ No      │ numeric │ Roll in degrees. │
506           ├─────────┼─────────┼─────────┼──────────────────┤
507           │roll_st  │ No      │ string  │ Roll sensor      │
508           │         │         │         │ status.          │
509           ├─────────┼─────────┼─────────┼──────────────────┤
510           │dip      │ No      │ numeric │ Local magnetic   │
511           │         │         │         │ inclination,     │
512           │         │         │         │ degrees,         │
513           │         │         │         │ positive when    │
514           │         │         │         │ the magnetic     │
515           │         │         │         │ field points     │
516           │         │         │         │ downward (into   │
517           │         │         │         │ the Earth).      │
518           ├─────────┼─────────┼─────────┼──────────────────┤
519           │mag_len  │ No      │ numeric │ Scalar magnetic  │
520           │         │         │         │ field strength.  │
521           ├─────────┼─────────┼─────────┼──────────────────┤
522           │mag_x    │ No      │ numeric │ X component of   │
523           │         │         │         │ magnetic field   │
524           │         │         │         │ strength.        │
525           ├─────────┼─────────┼─────────┼──────────────────┤
526           │mag_y    │ No      │ numeric │ Y component of   │
527           │         │         │         │ magnetic field   │
528           │         │         │         │ strength.        │
529           ├─────────┼─────────┼─────────┼──────────────────┤
530           │mag_z    │ No      │ numeric │ Z component of   │
531           │         │         │         │ magnetic field   │
532           │         │         │         │ strength.        │
533           ├─────────┼─────────┼─────────┼──────────────────┤
534           │acc_len  │ No      │ numeric │ Scalar           │
535           │         │         │         │ acceleration.    │
536           ├─────────┼─────────┼─────────┼──────────────────┤
537           │acc_x    │ No      │ numeric │ X component of   │
538           │         │         │         │ acceleration.    │
539           ├─────────┼─────────┼─────────┼──────────────────┤
540           │acc_y    │ No      │ numeric │ Y component of   │
541           │         │         │         │ acceleration.    │
542           ├─────────┼─────────┼─────────┼──────────────────┤
543           │acc_z    │ No      │ numeric │ Z component of   │
544           │         │         │         │ acceleration.    │
545           ├─────────┼─────────┼─────────┼──────────────────┤
546           │gyro_x   │ No      │ numeric │ X component of   │
547           │         │         │         │ acceleration.    │
548           ├─────────┼─────────┼─────────┼──────────────────┤
549           │gyro_y   │ No      │ numeric │ Y component of   │
550           │         │         │         │ acceleration.    │
551           ├─────────┼─────────┼─────────┼──────────────────┤
552           │depth    │ No      │ numeric │ Water depth in   │
553           │         │         │         │ meters.          │
554           ├─────────┼─────────┼─────────┼──────────────────┤
555           │temp     │ No      │ numeric │ Temperature at   │
556           │         │         │         │ sensor, degrees  │
557           │         │         │         │ centigrade.      │
558           └─────────┴─────────┴─────────┴──────────────────┘
559           The heading, pitch, and roll status codes (if present) vary by
560           device. For the TNT Revolution digital compasses, they are coded as
561           follows:
562
563           Table 6. Device flags
564           ┌─────┬────────────────────────────┐
565Code Description                
566           ├─────┼────────────────────────────┤
567           │C    │ magnetometer calibration   │
568           │     │ alarm                      │
569           ├─────┼────────────────────────────┤
570           │L    │ low alarm                  │
571           ├─────┼────────────────────────────┤
572           │M    │ low warning                │
573           ├─────┼────────────────────────────┤
574           │N    │ normal                     │
575           ├─────┼────────────────────────────┤
576           │O    │ high warning               │
577           ├─────┼────────────────────────────┤
578           │P    │ high alarm                 │
579           ├─────┼────────────────────────────┤
580           │V    │ magnetometer voltage level │
581           │     │ alarm                      │
582           └─────┴────────────────────────────┘
583           When the C client library parses a response of this kind, it will
584           assert ATT_IS.
585
586           Here's an example:
587
588               {"class":"ATT","time":1270938096.843,
589                   "heading":14223.00,"mag_st":"N",
590                   "pitch":169.00,"pitch_st":"N", "roll":-43.00,"roll_st":"N",
591                   "dip":13641.000,"mag_x":2454.000}
592
593       And here are the commands:
594
595       ?VERSION;
596           Returns an object with the following attributes:
597
598           Table 7. VERSION object
599           ┌────────────┬─────────┬─────────┬──────────────────┐
600Name        Always? Type    Description      
601           ├────────────┼─────────┼─────────┼──────────────────┤
602           │class       │ Yes     │ string  │ Fixed: "VERSION" │
603           ├────────────┼─────────┼─────────┼──────────────────┤
604           │release     │ Yes     │ string  │ Public release   │
605           │            │         │         │ level            │
606           ├────────────┼─────────┼─────────┼──────────────────┤
607           │rev         │ Yes     │ string  │ Internal         │
608           │            │         │         │ revision-control │
609           │            │         │         │ level.           │
610           ├────────────┼─────────┼─────────┼──────────────────┤
611           │proto_major │ Yes     │ numeric │ API major        │
612           │            │         │         │ revision level.  │
613           ├────────────┼─────────┼─────────┼──────────────────┤
614           │proto_minor │ Yes     │ numeric │ API minor        │
615           │            │         │         │ revision level.  │
616           ├────────────┼─────────┼─────────┼──────────────────┤
617           │remote      │ No      │ string  │ URL of the       │
618           │            │         │         │ remote daemon    │
619           │            │         │         │ reporting this   │
620           │            │         │         │ version. If      │
621           │            │         │         │         empty,   │
622           │            │         │         │ this is the      │
623           │            │         │         │ version of the   │
624           │            │         │         │ local daemon.    │
625           └────────────┴─────────┴─────────┴──────────────────┘
626           The daemon ships a VERSION response to each client when the client
627           first connects to it.
628
629           When the C client library parses a response of this kind, it will
630           assert the VERSION_SET bit in the top-level set member.
631
632           Here's an example:
633
634               {"class":"VERSION","version":"2.40dev",
635                   "rev":"06f62e14eae9886cde907dae61c124c53eb1101f",
636                   "proto_major":3,"proto_minor":1
637               }
638
639       ?DEVICES;
640           Returns a device list object with the following elements:
641
642           Table 8. DEVICES object
643           ┌────────┬─────────┬────────┬──────────────────┐
644Name    Always? Type   Description      
645           ├────────┼─────────┼────────┼──────────────────┤
646           │class   │ Yes     │ string │ Fixed: "DEVICES" │
647           ├────────┼─────────┼────────┼──────────────────┤
648           │devices │ Yes     │ list   │ List of device   │
649           │        │         │        │ descriptions     │
650           ├────────┼─────────┼────────┼──────────────────┤
651           │remote  │ No      │ string │ URL of the       │
652           │        │         │        │ remote daemon    │
653           │        │         │        │ reporting the    │
654           │        │         │        │ device set. If   │
655           │        │         │        │         empty,   │
656           │        │         │        │ this is a        │
657           │        │         │        │ DEVICES response │
658           │        │         │        │ from the local   │
659           │        │         │        │ daemon.          │
660           └────────┴─────────┴────────┴──────────────────┘
661           When the C client library parses a response of this kind, it will
662           assert the DEVICELIST_SET bit in the top-level set member.
663
664           Here's an example:
665
666               {"class"="DEVICES","devices":[
667                   {"class":"DEVICE","path":"/dev/pts/1","flags":1,"driver":"SiRF binary"},
668                   {"class":"DEVICE","path":"/dev/pts/3","flags":4,"driver":"AIVDM"}]}
669
670           The daemon occasionally ships a bare DEVICE object to the client
671           (that is, one not inside a DEVICES wrapper). The data content of
672           these objects will be described later as a response to the ?DEVICE
673           command.
674
675       ?WATCH;
676           This command sets watcher mode. It also sets or elicits a report of
677           per-subscriber policy and the raw bit. An argument WATCH object
678           changes the subscriber's policy. The response describes the
679           subscriber's policy. The response will also include a DEVICES
680           object.
681
682           A WATCH object has the following elements:
683
684           Table 9. WATCH object
685           ┌────────┬─────────┬─────────┬──────────────────┐
686Name    Always? Type    Description      
687           ├────────┼─────────┼─────────┼──────────────────┤
688           │class   │ Yes     │ string  │ Fixed: "WATCH"   │
689           ├────────┼─────────┼─────────┼──────────────────┤
690           │enable  │ No      │ boolean │ Enable (true) or │
691           │        │         │         │ disable (false)  │
692           │        │         │         │ watcher mode.    │
693           │        │         │         │ Default      is  │
694           │        │         │         │ true.            │
695           ├────────┼─────────┼─────────┼──────────────────┤
696           │json    │ No      │ boolean │ Enable (true) or │
697           │        │         │         │ disable (false)  │
698           │        │         │         │ dumping of JSON  │
699           │        │         │         │ reports.         │
700           │        │         │         │      Default is  │
701           │        │         │         │ false.           │
702           ├────────┼─────────┼─────────┼──────────────────┤
703           │nmea    │ No      │ boolean │ Enable (true) or │
704           │        │         │         │ disable (false)  │
705           │        │         │         │ dumping of       │
706           │        │         │         │ binary           │
707           │        │         │         │      packets as  │
708           │        │         │         │ pseudo-NMEA.     │
709           │        │         │         │ Default      is  │
710           │        │         │         │ false.           │
711           ├────────┼─────────┼─────────┼──────────────────┤
712           │raw     │ No      │ integer │ Controls 'raw'   │
713           │        │         │         │ mode. When this  │
714           │        │         │         │ attribute is set │
715           │        │         │         │ to 1      for a  │
716           │        │         │         │ channel, gpsd    │
717           │        │         │         │ reports the      │
718           │        │         │         │      unprocessed │
719           │        │         │         │ NMEA or AIVDM    │
720           │        │         │         │ data stream from │
721           │        │         │         │ whatever device  │
722           │        │         │         │ is attached.     │
723           │        │         │         │      Binary GPS  │
724           │        │         │         │ packets are      │
725           │        │         │         │ hex-dumped.      │
726           │        │         │         │ RTCM2 and RTCM3  │
727           │        │         │         │         packets  │
728           │        │         │         │ are not dumped   │
729           │        │         │         │ in raw mode.     │
730           │        │         │         │ When this        │
731           │        │         │         │ attribute is set │
732           │        │         │         │ to      2 for a  │
733           │        │         │         │ channel that     │
734           │        │         │         │ processes binary │
735           │        │         │         │ data,      gpsd  │
736           │        │         │         │ reports the      │
737           │        │         │         │ received data    │
738           │        │         │         │ verbatim         │
739           │        │         │         │      without     │
740           │        │         │         │ hex-dumping.     │
741           ├────────┼─────────┼─────────┼──────────────────┤
742           │scaled  │ No      │ boolean │ If true, apply   │
743           │        │         │         │ scaling divisors │
744           │        │         │         │ to output before │
745           │        │         │         │      dumping;    │
746           │        │         │         │ default is       │
747           │        │         │         │ false.           │
748           ├────────┼─────────┼─────────┼──────────────────┤
749           │split24 │ No      │ boolean │ If true,         │
750           │        │         │         │ aggregate AIS    │
751           │        │         │         │ type24 sentence  │
752           │        │         │         │ parts.  If       │
753           │        │         │         │ false,           │
754           │        │         │         │         report   │
755           │        │         │         │ each part as a   │
756           │        │         │         │ separate JSON    │
757           │        │         │         │ object, leaving  │
758           │        │         │         │ the              │
759           │        │         │         │         client   │
760           │        │         │         │ to match MMSIs   │
761           │        │         │         │ and aggregate.   │
762           │        │         │         │ Default is       │
763           │        │         │         │         false.   │
764           │        │         │         │ Applies only to  │
765           │        │         │         │ AIS reports.     │
766           ├────────┼─────────┼─────────┼──────────────────┤
767           │pps     │ No      │ boolean │ If true, emit    │
768           │        │         │         │ the TOFF JSON    │
769           │        │         │         │ message on each  │
770           │        │         │         │ cycle and a      │
771           │        │         │         │      PPS JSON    │
772           │        │         │         │ message when the │
773           │        │         │         │ device issues    │
774           │        │         │         │ 1PPS. Default is │
775           │        │         │         │ false.           │
776           ├────────┼─────────┼─────────┼──────────────────┤
777           │device  │ No      │ string  │ If present,      │
778           │        │         │         │ enable watching  │
779           │        │         │         │ only of the      │
780           │        │         │         │ specified device │
781           │        │         │         │      rather than │
782           │        │         │         │ all devices.     │
783           │        │         │         │ Useful with raw  │
784           │        │         │         │ and NMEA modes   │
785           │        │         │         │      in which    │
786           │        │         │         │ device responses │
787           │        │         │         │ aren't tagged.   │
788           │        │         │         │ Has no effect    │
789           │        │         │         │ when      used   │
790           │        │         │         │ with             │
791           │        │         │         │ enable:false.    │
792           ├────────┼─────────┼─────────┼──────────────────┤
793           │remote  │ No      │ string  │ URL of the       │
794           │        │         │         │ remote daemon    │
795           │        │         │         │ reporting the    │
796           │        │         │         │ watch set. If    │
797           │        │         │         │         empty,   │
798           │        │         │         │ this is a WATCH  │
799           │        │         │         │ response from    │
800           │        │         │         │ the local        │
801           │        │         │         │ daemon.          │
802           └────────┴─────────┴─────────┴──────────────────┘
803           There is an additional boolean "timing" attribute which is
804           undocumented because that portion of the interface is considered
805           unstable and for developer use only.
806
807           In watcher mode, GPS reports are dumped as TPV and SKY responses.
808           AIS, Subframe and RTCM reporting is described in the next section.
809
810           When the C client library parses a response of this kind, it will
811           assert the POLICY_SET bit in the top-level set member.
812
813           Here's an example:
814
815               {"class":"WATCH", "raw":1,"scaled":true}
816
817       ?POLL;
818           The POLL command requests data from the last-seen fixes on all
819           active GPS devices. Devices must previously have been activated by
820           ?WATCH to be pollable.
821
822           Polling can lead to possibly surprising results when it is used on
823           a device such as an NMEA GPS for which a complete fix has to be
824           accumulated from several sentences. If you poll while those
825           sentences are being emitted, the response will contain the last
826           complete fix data and may be as much as one cycle time (typically 1
827           second) stale.
828
829           The POLL response will contain a timestamped list of TPV objects
830           describing cached data, and a timestamped list of SKY objects
831           describing satellite configuration. If a device has not seen fixes,
832           it will be reported with a mode field of zero.
833
834           Table 10. POLL object
835           ┌───────┬─────────┬────────────┬──────────────────┐
836Name   Always? Type       Description      
837           ├───────┼─────────┼────────────┼──────────────────┤
838           │class  │ Yes     │ string     │ Fixed: "POLL"    │
839           ├───────┼─────────┼────────────┼──────────────────┤
840           │time   │ Yes     │ Numeric    │ Timestamp in ISO │
841           │       │         │            │ 8601 format. May │
842           │       │         │            │ have a           │
843           │       │         │            │      fractional  │
844           │       │         │            │ part of up to    │
845           │       │         │            │ .001sec          │
846           │       │         │            │ precision.       │
847           ├───────┼─────────┼────────────┼──────────────────┤
848           │active │ Yes     │ Numeric    │ Count of active  │
849           │       │         │            │ devices.         │
850           ├───────┼─────────┼────────────┼──────────────────┤
851           │tpv    │ Yes     │ JSON array │ Comma-separated  │
852           │       │         │            │ list of TPV      │
853           │       │         │            │ objects.         │
854           ├───────┼─────────┼────────────┼──────────────────┤
855           │sky    │ Yes     │ JSON array │ Comma-separated  │
856           │       │         │            │ list of SKY      │
857           │       │         │            │ objects.         │
858           └───────┴─────────┴────────────┴──────────────────┘
859           Here's an example of a POLL response:
860
861               {"class":"POLL","time":"2010-06-04T10:31:00.289Z","active":1,
862                   "tpv":[{"class":"TPV","device":"/dev/ttyUSB0",
863                           "time":"2010-09-08T13:33:06.095Z",
864                        "ept":0.005,"lat":40.035093060,
865                           "lon":-75.519748733,"track":99.4319,"speed":0.123,"mode":2}],
866                   "sky":[{"class":"SKY","device":"/dev/ttyUSB0",
867                           "time":1270517264.240,"hdop":9.20,
868                           "satellites":[{"PRN":16,"el":55,"az":42,"ss":36,"used":true},
869                                         {"PRN":19,"el":25,"az":177,"ss":0,"used":false},
870                                         {"PRN":7,"el":13,"az":295,"ss":0,"used":false},
871                                         {"PRN":6,"el":56,"az":135,"ss":32,"used":true},
872                                         {"PRN":13,"el":47,"az":304,"ss":0,"used":false},
873                                         {"PRN":23,"el":66,"az":259,"ss":0,"used":false},
874                                         {"PRN":20,"el":7,"az":226,"ss":0,"used":false},
875                                         {"PRN":3,"el":52,"az":163,"ss":32,"used":true},
876                                         {"PRN":31,"el":16,"az":102,"ss":0,"used":false}
877               ]}]}
878
879               Note
880               Client software should not assume the field inventory of the
881               POLL response is fixed for all time. As gpsd collects and
882               caches more data from more sensor types, those data are likely
883               to find their way into this response.
884
885       TOFF
886           This message is emitted on each cycle and reports the offset
887           between the host's clock time and the GPS time at top of second
888           (actually, when the first data for the reporting cycle is
889           received).
890
891           This message exactly mirrors the PPS message except for two
892           details.
893
894           TOFF emits no NTP precision, this is assumed to be -2. See the NTP
895           documentation for their definition of precision.
896
897           The TOFF message reports the GPS time as derived from the GPS
898           serial data stream. The PPS message reports the GPS time as derived
899           from the GPS PPS pulse.
900
901           A TOFF object has the following elements:
902
903           Table 11. TOFF object
904           ┌───────────┬─────────┬─────────┬──────────────────┐
905Name       Always? Type    Description      
906           ├───────────┼─────────┼─────────┼──────────────────┤
907           │class      │ Yes     │ string  │ Fixed: "TOFF"    │
908           ├───────────┼─────────┼─────────┼──────────────────┤
909           │device     │ Yes     │ string  │ Name of          │
910           │           │         │         │ originating      │
911           │           │         │         │ device           │
912           ├───────────┼─────────┼─────────┼──────────────────┤
913           │real_sec   │ Yes     │ numeric │ seconds from the │
914           │           │         │         │ GPS clock        │
915           ├───────────┼─────────┼─────────┼──────────────────┤
916           │real_nsec  │ Yes     │ numeric │ nanoseconds from │
917           │           │         │         │ the GPS clock    │
918           ├───────────┼─────────┼─────────┼──────────────────┤
919           │clock_sec  │ Yes     │ numeric │ seconds from the │
920           │           │         │         │ system clock     │
921           ├───────────┼─────────┼─────────┼──────────────────┤
922           │clock_nsec │ Yes     │ numeric │ nanoseconds from │
923           │           │         │         │ the system clock │
924           └───────────┴─────────┴─────────┴──────────────────┘
925           This message is emitted once per second to watchers of a device and
926           is intended to report the time stamps of the in-band report of the
927           GPS and seconds as reported by the system clock (which may be
928           NTP-corrected) when the first valid timestamp of the reporting
929           cycle was seen.
930
931           The message contains two second/nanosecond pairs: real_sec and
932           real_nsec contain the time the GPS thinks it was at the start of
933           the current cycle; clock_sec and clock_nsec contain the time the
934           system clock thinks it was on receipt of the first timing message
935           of the cycle. real_nsec is always to nanosecond precision.
936           clock_nsec is nanosecond precision on most systems.
937
938           Here's an example:
939
940               {"class":"TOFF","device":"/dev/ttyUSB0",
941                    "real_sec":1330212592, "real_nsec":343182,
942                    "clock_sec":1330212592,"clock_nsec":343184,
943                    "precision":-2}}
944
945       PPS
946           This message is emitted each time the daemon sees a valid PPS
947           (Pulse Per Second) strobe from a device.
948
949           This message exactly mirrors the TOFF message except for two
950           details.
951
952           PPS emits the NTP precision. See the NTP documentation for their
953           definition of precision.
954
955           The TOFF message reports the GPS time as derived from the GPS
956           serial data stream. The PPS message reports the GPS time as derived
957           from the GPS PPS pulse.
958
959           There are various sources of error in the reported clock times. The
960           speed of the serial connection between the GPS and the system adds
961           a delay to start of cycle detection. An even bigger error is added
962           by the variable computation time inside the GPS. Taken together the
963           time derived from the start of the GPS cycle can have offsets of 10
964           millisecond to 700 milliseconds and combined jjitter and wander of
965           100 to 300 millisecond.
966
967           A PPS object has the following elements:
968
969           Table 12. PPS object
970           ┌───────────┬─────────┬─────────┬──────────────────┐
971Name       Always? Type    Description      
972           ├───────────┼─────────┼─────────┼──────────────────┤
973           │class      │ Yes     │ string  │ Fixed: "PPS"     │
974           ├───────────┼─────────┼─────────┼──────────────────┤
975           │device     │ Yes     │ string  │ Name of          │
976           │           │         │         │ originating      │
977           │           │         │         │ device           │
978           ├───────────┼─────────┼─────────┼──────────────────┤
979           │real_sec   │ Yes     │ numeric │ seconds from the │
980           │           │         │         │ PPS source       │
981           ├───────────┼─────────┼─────────┼──────────────────┤
982           │real_nsec  │ Yes     │ numeric │ nanoseconds from │
983           │           │         │         │ the PPS source   │
984           ├───────────┼─────────┼─────────┼──────────────────┤
985           │clock_sec  │ Yes     │ numeric │ seconds from the │
986           │           │         │         │ system clock     │
987           ├───────────┼─────────┼─────────┼──────────────────┤
988           │clock_nsec │ Yes     │ numeric │ nanoseconds from │
989           │           │         │         │ the system clock │
990           ├───────────┼─────────┼─────────┼──────────────────┤
991           │precision  │ Yes     │ numeric │ NTP style        │
992           │           │         │         │ estimate of PPS  │
993           │           │         │         │ precision        │
994           └───────────┴─────────┴─────────┴──────────────────┘
995           This message is emitted once per second to watchers of a device
996           emitting PPS, and reports the time of the start of the GPS second
997           (when the 1PPS arrives) and seconds as reported by the system clock
998           (which may be NTP-corrected) at that moment.
999
1000           The message contains two second/nanosecond pairs: real_sec and
1001           real_nsec contain the time the GPS thinks it was at the PPS edge;
1002           clock_sec and clock_nsec contain the time the system clock thinks
1003           it was at the PPS edge. real_nsec is always to nanosecond
1004           precision. clock_nsec is nanosecond precision on most systems.
1005
1006           There are various sources of error in the reported clock times. For
1007           PPS delivered via a real serial-line strobe, serial-interrupt
1008           latency plus processing time to the timer call should be bounded
1009           above by about 10 microseconds; that can be reduced to less than 1
1010           microsecond if your kernel supports RFC 2783. USB1.1-to-serial
1011           control-line emulation is limited to about 1 millisecond. seconds.
1012
1013           Here's an example:
1014
1015               {"class":"PPS","device":"/dev/ttyUSB0",
1016                    "real_sec":1330212592, "real_nsec":343182,
1017                    "clock_sec":1330212592,"clock_nsec":343184,
1018                    "precision":-3}
1019
1020       OSC
1021           This message reports the status of a GPS-disciplined oscillator
1022           (GPSDO). The GPS PPS output (which has excellent long-term
1023           stability) is typically used to discipline a local oscillator with
1024           much better short-term stability (such as a rubidium atomic clock).
1025
1026           An OSC object has the following elements:
1027
1028           Table 13. OSC object
1029           ┌────────────┬─────────┬─────────┬──────────────────┐
1030Name        Always? Type    Description      
1031           ├────────────┼─────────┼─────────┼──────────────────┤
1032           │class       │ Yes     │ string  │ Fixed: "OSC"     │
1033           ├────────────┼─────────┼─────────┼──────────────────┤
1034           │device      │ Yes     │ string  │ Name of          │
1035           │            │         │         │ originating      │
1036           │            │         │         │ device.          │
1037           ├────────────┼─────────┼─────────┼──────────────────┤
1038           │running     │ Yes     │ boolean │ If true, the     │
1039           │            │         │         │ oscillator is    │
1040           │            │         │         │ currently        │
1041           │            │         │         │ running.         │
1042           │            │         │         │ Oscillators may  │
1043           │            │         │         │ require warm-up  │
1044           │            │         │         │ time at start of │
1045           │            │         │         │ day.             │
1046           ├────────────┼─────────┼─────────┼──────────────────┤
1047           │reference   │ Yes     │ boolean │ If true, the     │
1048           │            │         │         │ oscillator is    │
1049           │            │         │         │ receiving a GPS  │
1050           │            │         │         │ PPS signal.      │
1051           ├────────────┼─────────┼─────────┼──────────────────┤
1052           │disciplined │ Yes     │ boolean │ If true, the GPS │
1053           │            │         │         │ PPS signal is    │
1054           │            │         │         │ sufficiently     │
1055           │            │         │         │ stable and is    │
1056           │            │         │         │ being used to    │
1057           │            │         │         │ discipline the   │
1058           │            │         │         │ local            │
1059           │            │         │         │ oscillator.      │
1060           ├────────────┼─────────┼─────────┼──────────────────┤
1061           │delta       │ Yes     │ numeric │ The time         │
1062           │            │         │         │ difference (in   │
1063           │            │         │         │ nanoseconds)     │
1064           │            │         │         │ between the      │
1065           │            │         │         │ GPS-disciplined  │
1066           │            │         │         │ oscillator PPS   │
1067           │            │         │         │ output pulse and │
1068           │            │         │         │ the most recent  │
1069           │            │         │         │ GPS PPS input    │
1070           │            │         │         │ pulse.           │
1071           └────────────┴─────────┴─────────┴──────────────────┘
1072           Here's an example:
1073
1074               {"class":"OSC","running":true,"device":"/dev/ttyUSB0",
1075                   "reference":true,"disciplined":true,"delta":67}
1076
1077       ?DEVICE
1078           This command reports (when followed by ';') the state of a device,
1079           or sets (when followed by '=' and a DEVICE object) device-specific
1080           control bits, notably the device's speed and serial mode and the
1081           native-mode bit. The parameter-setting form will be rejected if
1082           more than one client is attached to the channel.
1083
1084           Pay attention to the response, because it is possible for this
1085           command to fail if the GPS does not support a speed-switching
1086           command or only supports some combinations of serial modes. In case
1087           of failure, the daemon and GPS will continue to communicate at the
1088           old speed.
1089
1090           Use the parameter-setting form with caution. On USB and Bluetooth
1091           GPSes it is also possible for serial mode setting to fail either
1092           because the serial adaptor chip does not support non-8N1 modes or
1093           because the device firmware does not properly synchronize the
1094           serial adaptor chip with the UART on the GPS chipset when the speed
1095           changes. These failures can hang your device, possibly requiring a
1096           GPS power cycle or (in extreme cases) physically disconnecting the
1097           NVRAM backup battery.
1098
1099           A DEVICE object has the following elements:
1100
1101           Table 14. DEVICE object
1102           ┌──────────┬──────────────────┬─────────┬────────────────────┐
1103Name      Always?          Type    Description        
1104           ├──────────┼──────────────────┼─────────┼────────────────────┤
1105           │class     │ Yes              │ string  │ Fixed: "DEVICE"    │
1106           ├──────────┼──────────────────┼─────────┼────────────────────┤
1107           │path      │ No               │ string  │ Name the device    │
1108           │          │                  │         │ for which the      │
1109           │          │                  │         │ control bits are   │
1110           │          │                  │         │      being         │
1111           │          │                  │         │ reported, or for   │
1112           │          │                  │         │ which they are     │
1113           │          │                  │         │ to be applied.     │
1114           │          │                  │         │ This               │
1115           │          │                  │         │         attribute  │
1116           │          │                  │         │ may be omitted     │
1117           │          │                  │         │ only when there    │
1118           │          │                  │         │ is exactly one     │
1119           │          │                  │         │         subscribed │
1120           │          │                  │         │ channel.           │
1121           ├──────────┼──────────────────┼─────────┼────────────────────┤
1122           │activated │ No               │ string  │ Time the device    │
1123           │          │                  │         │ was activated as   │
1124           │          │                  │         │ an ISO8601         │
1125           │          │                  │         │         timestamp. │
1126           │          │                  │         │ If the device is   │
1127           │          │                  │         │ inactive this      │
1128           │          │                  │         │ attribute is       │
1129           │          │                  │         │         absent.    │
1130           ├──────────┼──────────────────┼─────────┼────────────────────┤
1131           │flags     │ No               │ integer │ Bit vector of      │
1132           │          │                  │         │ property flags.    │
1133           │          │                  │         │ Currently defined  │
1134           │          │                  │         │ flags are:         │
1135           │          │                  │         │         describe   │
1136           │          │                  │         │ packet types seen  │
1137           │          │                  │         │ so far (GPS,       │
1138           │          │                  │         │ RTCM2, RTCM3,      │
1139           │          │                  │         │      AIS). Won't   │
1140           │          │                  │         │ be reported if     │
1141           │          │                  │         │ empty, e.g. before │
1142           │          │                  │         │      gpsd has seen │
1143           │          │                  │         │ identifiable       │
1144           │          │                  │         │ packets      from  │
1145           │          │                  │         │ the device.        │
1146           ├──────────┼──────────────────┼─────────┼────────────────────┤
1147           │driver    │ No               │ string  │ GPSD's name for    │
1148           │          │                  │         │ the device driver  │
1149           │          │                  │         │ type. Won't be     │
1150           │          │                  │         │ reported before    │
1151           │          │                  │         │      gpsd has seen │
1152           │          │                  │         │ identifiable       │
1153           │          │                  │         │ packets      from  │
1154           │          │                  │         │ the device.        │
1155           ├──────────┼──────────────────┼─────────┼────────────────────┤
1156           │subtype   │ When the daemon  │ string  │ Whatever version   │
1157           │          │ sees a delayed   │         │ information the    │
1158           │          │ response to a    │         │ device returned.   │
1159           │          │ probe for        │         │                    │
1160           │          │      subtype or  │         │                    │
1161           │          │ firmware-version │         │                    │
1162           │          │ information.     │         │                    │
1163           ├──────────┼──────────────────┼─────────┼────────────────────┤
1164           │bps       │ No               │ integer │ Device speed in    │
1165           │          │                  │         │ bits per second.   │
1166           ├──────────┼──────────────────┼─────────┼────────────────────┤
1167           │parity    │ No               │ string  │ N, O or E for no   │
1168           │          │                  │         │ parity, odd, or    │
1169           │          │                  │         │ even.              │
1170           ├──────────┼──────────────────┼─────────┼────────────────────┤
1171           │stopbits  │ Yes              │ string  │ Stop bits (1 or    │
1172           │          │                  │         │ 2).                │
1173           ├──────────┼──────────────────┼─────────┼────────────────────┤
1174           │native    │ No               │ integer │ 0 means NMEA mode  │
1175           │          │                  │         │ and 1 means        │
1176           │          │                  │         │      alternate     │
1177           │          │                  │         │ mode (binary if it │
1178           │          │                  │         │ has one, for SiRF  │
1179           │          │                  │         │ and Evermore       │
1180           │          │                  │         │ chipsets      in   │
1181           │          │                  │         │ particular).       │
1182           │          │                  │         │ Attempting to set  │
1183           │          │                  │         │ this mode on a     │
1184           │          │                  │         │ non-GPS            │
1185           │          │                  │         │      device will   │
1186           │          │                  │         │ yield an error.    │
1187           ├──────────┼──────────────────┼─────────┼────────────────────┤
1188           │cycle     │ No               │ real    │ Device cycle time  │
1189           │          │                  │         │ in seconds.        │
1190           ├──────────┼──────────────────┼─────────┼────────────────────┤
1191           │mincycle  │ No               │ real    │ Device minimum     │
1192           │          │                  │         │ cycle time in      │
1193           │          │                  │         │ seconds. Reported  │
1194           │          │                  │         │ from      ?DEVICE  │
1195           │          │                  │         │ when (and only     │
1196           │          │                  │         │ when) the rate is  │
1197           │          │                  │         │ switchable. It is  │
1198           │          │                  │         │      read-only and │
1199           │          │                  │         │ not settable.      │
1200           └──────────┴──────────────────┴─────────┴────────────────────┘
1201           The serial parameters will (bps, parity, stopbits) be omitted in a
1202           response describing a TCP/IP source such as an Ntrip, DGPSIP, or
1203           AIS feed; on a serial device they will always be present.
1204
1205           The contents of the flags field should be interpreted as follows:
1206
1207           Table 15. Device flags
1208           ┌───────────┬───────┬─────────────────────┐
1209C #define  Value Description         
1210           ├───────────┼───────┼─────────────────────┤
1211           │SEEN_GPS   │ 0x01  │ GPS data has been   │
1212           │           │       │ seen on this device │
1213           ├───────────┼───────┼─────────────────────┤
1214           │SEEN_RTCM2 │ 0x02  │ RTCM2 data has been │
1215           │           │       │ seen on this device │
1216           ├───────────┼───────┼─────────────────────┤
1217           │SEEN_RTCM3 │ 0x04  │ RTCM3 data has been │
1218           │           │       │ seen on this device │
1219           ├───────────┼───────┼─────────────────────┤
1220           │SEEN_AIS   │ 0x08  │ AIS data has been   │
1221           │           │       │ seen on this device │
1222           └───────────┴───────┴─────────────────────┘
1223           When the C client library parses a response of this kind, it will
1224           assert the DEVICE_SET bit in the top-level set member.
1225
1226           Here's an example:
1227
1228               {"class":"DEVICE","bps":4800,"parity":"N","stopbits":1,"native":0}
1229
1230       When a client is in watcher mode, the daemon will ship it DEVICE
1231       notifications when a device is added to the pool or deactivated.
1232
1233       When the C client library parses a response of this kind, it will
1234       assert the DEVICE_SET bit in the top-level set member.
1235
1236       Here's an example:
1237
1238           {"class":"DEVICE","path":"/dev/pts1","activated":0}
1239
1240       The daemon may ship an error object in response to a syntactically
1241       invalid command line or unknown command. It has the following elements:
1242
1243       Table 16. ERROR notification object
1244       ┌────────┬─────────┬────────┬────────────────┐
1245Name    Always? Type   Description    
1246       ├────────┼─────────┼────────┼────────────────┤
1247       │class   │ Yes     │ string │ Fixed: "ERROR" │
1248       ├────────┼─────────┼────────┼────────────────┤
1249       │message │ Yes     │ string │ Textual error  │
1250       │        │         │        │ message        │
1251       └────────┴─────────┴────────┴────────────────┘
1252
1253       Here's an example:
1254
1255           {"class":"ERROR","message":"Unrecognized request '?FOO'"}
1256
1257       When the C client library parses a response of this kind, it will
1258       assert the ERR_SET bit in the top-level set member.
1259

RTCM2

1261       RTCM-104 is a family of serial protocols used for broadcasting
1262       pseudorange corrections from differential-GPS reference stations. Many
1263       GPS receivers can accept these corrections to improve their reporting
1264       accuracy.
1265
1266       RTCM-104 comes in two major and incompatible flavors, 2.x and 3.x. Each
1267       major flavor has minor (compatible) revisions.
1268
1269       The applicable standard for RTCM Version 2.x is RTCM Recommended
1270       Standards for Differential NAVSTAR GPS Service RTCM Paper 194-93/SC
1271       104-STD. For RTCM 3.1 it is RTCM Paper 177-2006-SC104-STD. Ordering
1272       instructions for both standards are accessible from the website of the
1273       Radio Technical Commission for Maritime Services[1] under
1274       "Publications".
1275
1276   RTCM WIRE TRANSMISSIONS
1277       Differential-GPS correction stations consist of a GPS reference
1278       receiver coupled to a low frequency (LF) transmitter. The GPS reference
1279       receiver is a survey-grade GPS that does GPS carrier tracking and can
1280       work out its own position to a few millimeters. It generates range and
1281       range-rate corrections and encodes them into RTCM104. It ships the
1282       RTCM104 to the LF transmitter over serial rs-232 signal at 100 baud or
1283       200 baud depending on the requirements of the transmitter.
1284
1285       The LF transmitter broadcasts the approximately 300khz radio signal
1286       that differential-GPS radio receivers pick up. Transmitters that are
1287       meant to have a higher range will need to transmit at the slower rate.
1288       The higher the data rate the harder it will be for the remote radio
1289       receiver to receive with a good signal-to-noise ration. (Higher data
1290       rate signals can't be averaged over as long a time frame, hence they
1291       appear noisier.)
1292
1293   RTCM WIRE FORMATS
1294       An RTCM 2.x message consists of a sequence of up to 33 30-bit words.
1295       The 24 most significant bits of each word are data and the six least
1296       significant bits are parity. The parity algorithm used is the same
1297       ISGPS-2000 as that used on GPS satellite downlinks. Each RTCM 2.x
1298       message consists of two header words followed by zero or more data
1299       words, depending upon message type.
1300
1301       An RTCM 3.x message begins with a fixed leader byte 0xD3. That is
1302       followed by six bits of version information and 10 bits of payload
1303       length information. Following that is the payload; following the
1304       payload is a 3-byte checksum of the payload using the Qualcomm CRC-24Q
1305       algorithm.
1306
1307   RTCM2 JSON FORMAT
1308       Each RTCM2 message is dumped as a single JSON object per message, with
1309       the message fields as attributes of that object. Arrays of satellite,
1310       station, and constellation statistics become arrays of JSON
1311       sub-objects. Each sentence will normally also have a "device" field
1312       containing the pathname of the originating device.
1313
1314       All attributes other than the device field are mandatory. Header
1315       attributes are emitted before others.
1316
1317       Header portion
1318           Table 17. SKY object
1319           ┌───────────────┬─────────┬─────────────────────────────┐
1320Name           Type    │                             │
1321           │               │         │            Description      │
1322           ├───────────────┼─────────┼─────────────────────────────┤
1323           │class          │ string  │                             │
1324           │               │         │            Fixed:           │
1325           │               │         │            "RTCM2".         │
1326           ├───────────────┼─────────┼─────────────────────────────┤
1327           │type           │ integer │                             │
1328           │               │         │            Message          │
1329           │               │         │            type (1-9).      │
1330           ├───────────────┼─────────┼─────────────────────────────┤
1331           │station_id     │ integer │                             │
1332           │               │         │            The id of        │
1333           │               │         │            the GPS          │
1334           │               │         │            reference        │
1335           │               │         │            receiver.        │
1336           │               │         │            The LF           │
1337           │               │         │            transmitters     │
1338           │               │         │            also have        │
1339           │               │         │            (different)      │
1340           │               │         │            id numbers.      │
1341           ├───────────────┼─────────┼─────────────────────────────┤
1342           │zcount         │ real    │                             │
1343           │               │         │            The              │
1344           │               │         │            reference        │
1345           │               │         │            time of the      │
1346           │               │         │            corrections      │
1347           │               │         │            in the           │
1348           │               │         │            message in       │
1349           │               │         │            seconds          │
1350           │               │         │            within the       │
1351           │               │         │            current          │
1352           │               │         │            hour. Note       │
1353           │               │         │            that it is       │
1354           │               │         │            in GPS time,     │
1355           │               │         │            which is         │
1356           │               │         │            some seconds     │
1357           │               │         │            ahead of UTC     │
1358           │               │         │            (see the         │
1359           │               │         │            U.S. Naval       │
1360           │               │         │            Observatory's    │
1361           │               │         │            table of         
1362           │               │         │            leap second      │
1363           │               │         │            corrections[2]). │
1364           ├───────────────┼─────────┼─────────────────────────────┤
1365           │seqnum         │ integer │                             │
1366           │               │         │            Sequence number. │
1367           │               │         │            Only 3 bits      │
1368           │               │         │            wide, wraps      │
1369           │               │         │            after 7.         │
1370           ├───────────────┼─────────┼─────────────────────────────┤
1371           │length         │ integer │                             │
1372           │               │         │            The number of    │
1373           │               │         │            words after the  │
1374           │               │         │            header that      │
1375           │               │         │            comprise the     │
1376           │               │         │            message.         │
1377           ├───────────────┼─────────┼─────────────────────────────┤
1378           │station_health │ integer │                             │
1379           │               │         │            Station          │
1380           │               │         │            transmission     │
1381           │               │         │            status.          │
1382           │               │         │            Indicates the    │
1383           │               │         │            health of the    │
1384           │               │         │            beacon as a      │
1385           │               │         │            reference        │
1386           │               │         │            source. Any      │
1387           │               │         │            nonzero value    │
1388           │               │         │            means the        │
1389           │               │         │            satellite is     │
1390           │               │         │            probably         │
1391           │               │         │            transmitting bad │
1392           │               │         │            data and should  │
1393           │               │         │            not be used in a │
1394           │               │         │            fix. 6 means the │
1395           │               │         │            transmission is  │
1396           │               │         │            unmonitored. 7   │
1397           │               │         │            means the        │
1398           │               │         │            station is not   │
1399           │               │         │            working          │
1400           │               │         │            properly. Other  │
1401           │               │         │            values are       │
1402           │               │         │            defined by the   │
1403           │               │         │            beacon operator. │
1404           └───────────────┴─────────┴─────────────────────────────┘
1405
1406           <message type> is one of
1407
1408           1
1409               full corrections - one message containing corrections for all
1410               GPS satellites in view. This is not common.
1411
1412           3
1413               reference station parameters - the position of the reference
1414               station GPS antenna.
1415
1416           4
1417               datum — the datum to which the DGPS data is referred.
1418
1419           5
1420               constellation health — information about the satellites the
1421               beacon can see.
1422
1423           6
1424               null message — just a filler.
1425
1426           7
1427               radio beacon almanac — information about this or other beacons.
1428
1429           9
1430               subset corrections — a message containing corrections for only
1431               a subset of the GPS satellites in view.
1432
1433           16
1434               special message — a text message from the beacon operator.
1435
1436           31
1437               GLONASS subset corrections — a message containing corrections
1438               for a set of the GLONASS satellites in view.
1439
1440       Type 1 and 9: Correction data
1441           One or more satellite objects follow the header for type 1 or type
1442           9 messages. Here is the format:
1443
1444           Table 18. Satellite object
1445           ┌──────┬─────────┬─────────────────────────┐
1446Name  Type    │                         │
1447           │      │         │            Description  │
1448           ├──────┼─────────┼─────────────────────────┤
1449           │ident │ integer │                         │
1450           │      │         │            The PRN      │
1451           │      │         │            number of    │
1452           │      │         │            the          │
1453           │      │         │            satellite    │
1454           │      │         │            for which    │
1455           │      │         │            this is      │
1456           │      │         │            correction   │
1457           │      │         │            data.        │
1458           ├──────┼─────────┼─────────────────────────┤
1459           │udre  │ integer │                         │
1460           │      │         │            User         │
1461           │      │         │            Differential │
1462           │      │         │            Range Error  │
1463           │      │         │            (0-3). See   │
1464           │      │         │            the table    │
1465           │      │         │            following    │
1466           │      │         │            for values.  │
1467           ├──────┼─────────┼─────────────────────────┤
1468           │iod   │ integer │                         │
1469           │      │         │            Issue Of     │
1470           │      │         │            Data,        │
1471           │      │         │            matching the │
1472           │      │         │            IOD for the  │
1473           │      │         │            current      │
1474           │      │         │            ephemeris of │
1475           │      │         │            this         │
1476           │      │         │            satellite,   │
1477           │      │         │            as           │
1478           │      │         │            transmitted  │
1479           │      │         │            by the       │
1480           │      │         │            satellite.   │
1481           │      │         │            The IOD is a │
1482           │      │         │            unique tag   │
1483           │      │         │            that         │
1484           │      │         │            identifies   │
1485           │      │         │            the          │
1486           │      │         │            ephemeris;   │
1487           │      │         │            the GPS      │
1488           │      │         │            using the    │
1489           │      │         │            DGPS         │
1490           │      │         │            correction   │
1491           │      │         │            and the DGPS │
1492           │      │         │            generating   │
1493           │      │         │            the data     │
1494           │      │         │            must use the │
1495           │      │         │            same orbital │
1496           │      │         │            positions    │
1497           │      │         │            for the      │
1498           │      │         │            satellite.   │
1499           ├──────┼─────────┼─────────────────────────┤
1500           │prc   │ real    │                         │
1501           │      │         │            The          │
1502           │      │         │            pseudorange  │
1503           │      │         │            error in     │
1504           │      │         │            meters for   │
1505           │      │         │            this         │
1506           │      │         │            satellite as │
1507           │      │         │            measured by  │
1508           │      │         │            the beacon   │
1509           │      │         │            reference    │
1510           │      │         │            receiver at  │
1511           │      │         │            the epoch    │
1512           │      │         │            indicated by │
1513           │      │         │            the z_count  │
1514           │      │         │            in the       │
1515           │      │         │            parent       │
1516           │      │         │            record.      │
1517           ├──────┼─────────┼─────────────────────────┤
1518           │rrc   │ real    │                         │
1519           │      │         │            The rate of  │
1520           │      │         │            change of    │
1521           │      │         │            pseudorange  │
1522           │      │         │            error in     │
1523           │      │         │            meters/sec   │
1524           │      │         │            for this     │
1525           │      │         │            satellite as │
1526           │      │         │            measured by  │
1527           │      │         │            the beacon   │
1528           │      │         │            reference    │
1529           │      │         │            receiver at  │
1530           │      │         │            the epoch    │
1531           │      │         │            indicated by │
1532           │      │         │            the z_count  │
1533           │      │         │            field in the │
1534           │      │         │            parent       │
1535           │      │         │            record. This │
1536           │      │         │            is used to   │
1537           │      │         │            calculate    │
1538           │      │         │            pseudorange  │
1539           │      │         │            errors at    │
1540           │      │         │            other        │
1541           │      │         │            epochs, if   │
1542           │      │         │            required by  │
1543           │      │         │            the GPS      │
1544           │      │         │            receiver.    │
1545           └──────┴─────────┴─────────────────────────┘
1546
1547           User Differential Range Error values are as follows:
1548
1549           Table 19. UDRE values
1550           ┌──┬──────────────────────┐
1551           │0 │ 1-sigma error  <= 1m │
1552           ├──┼──────────────────────┤
1553           │1 │ 1-sigma error  <= 4m │
1554           ├──┼──────────────────────┤
1555           │2 │ 1-sigma error  <= 8m │
1556           ├──┼──────────────────────┤
1557           │3 │ 1-sigma error  >  8m │
1558           └──┴──────────────────────┘
1559
1560           Here's an example:
1561
1562               {"class":"RTCM2","type":1,
1563                   "station_id":688,"zcount":843.0,"seqnum":5,"length":19,"station_health":6,
1564                   "satellites":[
1565                    {"ident":10,"udre":0,"iod":46,"prc":-2.400,"rrc":0.000},
1566                    {"ident":13,"udre":0,"iod":94,"prc":-4.420,"rrc":0.000},
1567                    {"ident":7,"udre":0,"iod":22,"prc":-5.160,"rrc":0.002},
1568                    {"ident":2,"udre":0,"iod":34,"prc":-6.480,"rrc":0.000},
1569                    {"ident":4,"udre":0,"iod":47,"prc":-8.860,"rrc":0.000},
1570                    {"ident":8,"udre":0,"iod":76,"prc":-7.980,"rrc":0.002},
1571                    {"ident":5,"udre":0,"iod":99,"prc":-8.260,"rrc":0.002},
1572                    {"ident":23,"udre":0,"iod":81,"prc":-8.060,"rrc":0.000},
1573                    {"ident":16,"udre":0,"iod":70,"prc":-11.740,"rrc":0.000},
1574                    {"ident":30,"udre":0,"iod":4,"prc":-18.960,"rrc":-0.006},
1575                    {"ident":29,"udre":0,"iod":101,"prc":-24.960,"rrc":-0.002}
1576               ]}
1577
1578       Type 3: Reference Station Parameters
1579           Here are the payload members of a type 3 (Reference Station
1580           Parameters) message:
1581
1582           Table 20. Reference Station Parameters
1583           ┌─────┬──────┬────────────────────────┐
1584Name Type │                        │
1585           │     │      │            Description │
1586           ├─────┼──────┼────────────────────────┤
1587           │x    │ real │                        │
1588           │     │      │            ECEF X      │
1589           │     │      │            coordinate. │
1590           ├─────┼──────┼────────────────────────┤
1591           │y    │ real │                        │
1592           │     │      │            ECEF Y      │
1593           │     │      │            coordinate. │
1594           ├─────┼──────┼────────────────────────┤
1595           │z    │ real │                        │
1596           │     │      │            ECEF Z      │
1597           │     │      │            coordinate. │
1598           └─────┴──────┴────────────────────────┘
1599
1600           The coordinates are the position of the station, in meters to two
1601           decimal places, in Earth Centred Earth Fixed coordinates. These are
1602           usually referred to the WGS84 reference frame, but may be referred
1603           to NAD83 in the US (essentially identical to WGS84 for all except
1604           geodesists), or to some other reference frame in other parts of the
1605           world.
1606
1607           An invalid reference message is represented by a type 3 header
1608           without payload fields.
1609
1610           Here's an example:
1611
1612               {"class":"RTCM2","type":3,
1613                   "station_id":652,"zcount":1657.2,"seqnum":2,"length":4,"station_health":6,
1614                   "x":3878620.92,"y":670281.40,"z":5002093.59
1615               }
1616
1617       Type 4: Datum
1618           Here are the payload members of a type 4 (Datum) message:
1619
1620           Table 21. Datum
1621           ┌───────────┬─────────┬────────────────────────┐
1622Name       Type    │                        │
1623           │           │         │            Description │
1624           ├───────────┼─────────┼────────────────────────┤
1625           │dgnss_type │ string  │                        │
1626           │           │         │            Either      │
1627           │           │         │            "GPS",      │
1628           │           │         │            "GLONASS",  │
1629           │           │         │            "GALILEO",  │
1630           │           │         │            or          │
1631           │           │         │            "UNKNOWN".  │
1632           ├───────────┼─────────┼────────────────────────┤
1633           │dat        │ integer │                        │
1634           │           │         │            0 or 1 and  │
1635           │           │         │            indicates   │
1636           │           │         │            the sense   │
1637           │           │         │            of the      │
1638           │           │         │            offset      │
1639           │           │         │            shift given │
1640           │           │         │            by dx, dy,  │
1641           │           │         │            dz. dat = 0 │
1642           │           │         │            means that  │
1643           │           │         │            the station │
1644           │           │         │            coordinates │
1645           │           │         │            (in the     │
1646           │           │         │            reference   │
1647           │           │         │            message)    │
1648           │           │         │            are         │
1649           │           │         │            referred to │
1650           │           │         │            a local     │
1651           │           │         │            datum and   │
1652           │           │         │            that adding │
1653           │           │         │            dx, dy, dz  │
1654           │           │         │            to that     │
1655           │           │         │            position    │
1656           │           │         │            will render │
1657           │           │         │            it in GNSS  │
1658           │           │         │            coordinates │
1659           │           │         │            (WGS84 for  │
1660           │           │         │            GPS). If    │
1661           │           │         │            dat = 1     │
1662           │           │         │            then the    │
1663           │           │         │            ref station │
1664           │           │         │            position is │
1665           │           │         │            in GNSS     │
1666           │           │         │            coordinates │
1667           │           │         │            and adding  │
1668           │           │         │            dx, dy, dz  │
1669           │           │         │            will give   │
1670           │           │         │            it referred │
1671           │           │         │            to the      │
1672           │           │         │            local       │
1673           │           │         │            datum.      │
1674           ├───────────┼─────────┼────────────────────────┤
1675           │datum_name │ string  │                        │
1676           │           │         │            A standard  │
1677           │           │         │            name for    │
1678           │           │         │            the datum.  │
1679           ├───────────┼─────────┼────────────────────────┤
1680           │dx         │ real    │                        │
1681           │           │         │            X offset.   │
1682           ├───────────┼─────────┼────────────────────────┤
1683           │dy         │ real    │                        │
1684           │           │         │            Y offset.   │
1685           ├───────────┼─────────┼────────────────────────┤
1686           │dz         │ real    │                        │
1687           │           │         │            Z offset.   │
1688           └───────────┴─────────┴────────────────────────┘
1689
1690           <dx> <dy> <dz> are offsets to convert from local datum to GNSS
1691           datum or vice versa. These fields are optional.
1692
1693           An invalid datum message is represented by a type 4 header without
1694           payload fields.
1695
1696       Type 5: Constellation Health
1697           One or more of these follow the header for type 5 messages — one
1698           for each satellite.
1699
1700           Here is the format:
1701
1702           Table 22. Constellation health
1703           ┌────────────┬─────────┬──────────────────────────┐
1704Name        Type    │                          │
1705           │            │         │            Description   │
1706           ├────────────┼─────────┼──────────────────────────┤
1707           │ident       │ integer │                          │
1708           │            │         │            The PRN       │
1709           │            │         │            number of     │
1710           │            │         │            the           │
1711           │            │         │            satellite.    │
1712           ├────────────┼─────────┼──────────────────────────┤
1713           │iodl        │ bool    │                          │
1714           │            │         │            True          │
1715           │            │         │            indicates     │
1716           │            │         │            that this     │
1717           │            │         │            information   │
1718           │            │         │            relates to    │
1719           │            │         │            the           │
1720           │            │         │            satellite     │
1721           │            │         │            information   │
1722           │            │         │            in an         │
1723           │            │         │            accompanying  │
1724           │            │         │            type 1 or     │
1725           │            │         │            type 9        │
1726           │            │         │            message.      │
1727           ├────────────┼─────────┼──────────────────────────┤
1728           │health      │ integer │ 0 indicates that the     │
1729           │            │         │ satellite is healthy.    │
1730           │            │         │ Any other value          │
1731           │            │         │      indicates a         │
1732           │            │         │ problem (coding is not   │
1733           │            │         │ known)..PP               │
1734           ├────────────┼─────────┼──────────────────────────┤
1735           │snr         │ integer │                          │
1736           │            │         │            The           │
1737           │            │         │            carrier/noise │
1738           │            │         │            ratio of the  │
1739           │            │         │            received      │
1740           │            │         │            signal in     │
1741           │            │         │            the range 25  │
1742           │            │         │            to 55         │
1743           │            │         │            dB(Hz).       │
1744           ├────────────┼─────────┼──────────────────────────┤
1745           │health_en   │ bool    │                          │
1746           │            │         │            If set to     │
1747           │            │         │            True it       │
1748           │            │         │            indicates     │
1749           │            │         │            that the      │
1750           │            │         │            satellite is  │
1751           │            │         │            healthy even  │
1752           │            │         │            if the        │
1753           │            │         │            satellite     │
1754           │            │         │            navigation    │
1755           │            │         │            data says it  │
1756           │            │         │            is unhealthy. │
1757           ├────────────┼─────────┼──────────────────────────┤
1758           │new_data    │ bool    │ True indicates that the  │
1759           │            │         │ IOD for this satellite   │
1760           │            │         │ will                     │
1761           │            │         │         soon be updated  │
1762           │            │         │ in type 1 or 9           │
1763           │            │         │ messages..PP             │
1764           ├────────────┼─────────┼──────────────────────────┤
1765           │los_warning │ bool    │                          │
1766           │            │         │            Line-of-sight │
1767           │            │         │            warning. True │
1768           │            │         │            indicates     │
1769           │            │         │            that the      │
1770           │            │         │            satellite     │
1771           │            │         │            will shortly  │
1772           │            │         │            go unhealthy. │
1773           ├────────────┼─────────┼──────────────────────────┤
1774           │tou         │ integer │                          │
1775           │            │         │            Healthy time  │
1776           │            │         │            remaining in  │
1777           │            │         │            seconds.      │
1778           └────────────┴─────────┴──────────────────────────┘
1779
1780       Type 6: Null
1781           This just indicates a null message. There are no payload fields.
1782
1783       Unknown message
1784           This format is used to dump message words in hexadecimal when the
1785           message type field doesn't match any of the known ones.
1786
1787           Here is the format:
1788
1789           Table 23. Unknown Message
1790           ┌─────┬──────┬────────────────────────┐
1791Name Type │                        │
1792           │     │      │            Description │
1793           ├─────┼──────┼────────────────────────┤
1794           │data │ list │                        │
1795           │     │      │            A list of   │
1796           │     │      │            strings.    │
1797           └─────┴──────┴────────────────────────┘
1798
1799           Each string in the array is a hex literal representing 30 bits of
1800           information, after parity checks and inversion. The high two bits
1801           should be ignored.
1802
1803       Type 7: Radio Beacon Almanac
1804           Here is the format:
1805
1806           Table 24. Contellation health
1807           ┌───────────┬─────────┬───────────────────────────┐
1808Name       Type    │                           │
1809           │           │         │            Description    │
1810           ├───────────┼─────────┼───────────────────────────┤
1811           │lat        │ real    │                           │
1812           │           │         │            Latitude in    │
1813           │           │         │            degrees, of    │
1814           │           │         │            the LF         │
1815           │           │         │            transmitter    │
1816           │           │         │            antenna for    │
1817           │           │         │            the station    │
1818           │           │         │            for which      │
1819           │           │         │            this is an     │
1820           │           │         │            almanac.       │
1821           │           │         │            North is       │
1822           │           │         │            positive.      │
1823           ├───────────┼─────────┼───────────────────────────┤
1824           │lon        │ real    │                           │
1825           │           │         │            Longitude      │
1826           │           │         │            in degrees,    │
1827           │           │         │            of the LF      │
1828           │           │         │            transmitter    │
1829           │           │         │            antenna for    │
1830           │           │         │            the station    │
1831           │           │         │            for which      │
1832           │           │         │            this is an     │
1833           │           │         │            almanac.       │
1834           │           │         │            East is        │
1835           │           │         │            positive.      │
1836           ├───────────┼─────────┼───────────────────────────┤
1837           │range      │ integer │ Published range of the    │
1838           │           │         │ station in km..PP         │
1839           ├───────────┼─────────┼───────────────────────────┤
1840           │frequency  │ real    │                           │
1841           │           │         │            Station        │
1842           │           │         │            broadcast      │
1843           │           │         │            frequency      │
1844           │           │         │            in kHz.        │
1845           ├───────────┼─────────┼───────────────────────────┤
1846           │health     │ integer │                           │
1847           │           │         │            <health> is    │
1848           │           │         │            the health     │
1849           │           │         │            of the         │
1850           │           │         │            station for    │
1851           │           │         │            which this     │
1852           │           │         │            is an          │
1853           │           │         │            almanac. If    │
1854           │           │         │            it is          │
1855           │           │         │            non-zero,      │
1856           │           │         │            the station    │
1857           │           │         │            is issuing     │
1858           │           │         │            suspect        │
1859           │           │         │            data and       │
1860           │           │         │            should not     │
1861           │           │         │            be used for    │
1862           │           │         │            fixes. The     │
1863           │           │         │            ITU and        │
1864           │           │         │            RTCM104        │
1865           │           │         │            standards      │
1866           │           │         │            differ         │
1867           │           │         │            about the      │
1868           │           │         │            mode           │
1869           │           │         │            detailed       │
1870           │           │         │            interpretation │
1871           │           │         │            of the         │
1872           │           │         │            <health>       │
1873           │           │         │            field and      │
1874           │           │         │            even about     │
1875           │           │         │            its bit        │
1876           │           │         │            width.         │
1877           ├───────────┼─────────┼───────────────────────────┤
1878           │station_id │ integer │                           │
1879           │           │         │            The id of the  │
1880           │           │         │            transmitter.   │
1881           │           │         │            This is not    │
1882           │           │         │            the same as    │
1883           │           │         │            the reference  │
1884           │           │         │            id in the      │
1885           │           │         │            header, the    │
1886           │           │         │            latter being   │
1887           │           │         │            the id of the  │
1888           │           │         │            reference      │
1889           │           │         │            receiver.      │
1890           ├───────────┼─────────┼───────────────────────────┤
1891           │bitrate    │ integer │                           │
1892           │           │         │            The            │
1893           │           │         │            transmitted    │
1894           │           │         │            bitrate.       │
1895           └───────────┴─────────┴───────────────────────────┘
1896
1897           Here's an example:
1898
1899               {"class":"RTCM2","type":9,"station_id":268,"zcount":252.6,
1900                       "seqnum":4,"length":5,"station_health":0,
1901                       "satellites":[
1902                           {"ident":13,"udre":0,"iod":3,"prc":-25.940,"rrc":0.066},
1903                           {"ident":2,"udre":0,"iod":73,"prc":0.920,"rrc":-0.080},
1904                           {"ident":8,"udre":0,"iod":22,"prc":23.820,"rrc":0.014}
1905               ]}
1906
1907       Type 13: GPS Time of Week
1908           Here are the payload members of a type 13 (Groumf Tramitter
1909           Parameters) message:
1910
1911           Table 25. Grund Transmitter Parameters
1912           ┌──────────┬─────────┬─────────────────────────┐
1913Name      Type    │                         │
1914           │          │         │            Description  │
1915           ├──────────┼─────────┼─────────────────────────┤
1916           │status    │ bool    │                         │
1917           │          │         │            If True,     │
1918           │          │         │            signals      │
1919           │          │         │            user to      │
1920           │          │         │            expect a     │
1921           │          │         │            type 16      │
1922           │          │         │            explanatory  │
1923           │          │         │            message      │
1924           │          │         │            associated   │
1925           │          │         │            with this    │
1926           │          │         │            station.     │
1927           │          │         │            Probably     │
1928           │          │         │            indicates    │
1929           │          │         │            some sort    │
1930           │          │         │            of unusual   │
1931           │          │         │            event.       │
1932           ├──────────┼─────────┼─────────────────────────┤
1933           │rangeflag │ bool    │                         │
1934           │          │         │            If True,     │
1935           │          │         │            indicates    │
1936           │          │         │            that the     │
1937           │          │         │            estimated    │
1938           │          │         │            range is     │
1939           │          │         │            different    │
1940           │          │         │            from that    │
1941           │          │         │            found in     │
1942           │          │         │            the Type 7   │
1943           │          │         │            message      │
1944           │          │         │            (which       │
1945           │          │         │            contains     │
1946           │          │         │            the          │
1947           │          │         │            beacon's     │
1948           │          │         │            listed       │
1949           │          │         │            range).      │
1950           │          │         │            Generally    │
1951           │          │         │            indicates a  │
1952           │          │         │            range        │
1953           │          │         │            reduction    │
1954           │          │         │            due to       │
1955           │          │         │            causes such  │
1956           │          │         │            as poor      │
1957           │          │         │            ionospheric  │
1958           │          │         │            conditions   │
1959           │          │         │            or reduced   │
1960           │          │         │            transmission │
1961           │          │         │            power.       │
1962           ├──────────┼─────────┼─────────────────────────┤
1963           │lat       │ real    │                         │
1964           │          │         │            Degrees      │
1965           │          │         │            latitude,    │
1966           │          │         │            signed.      │
1967           │          │         │            Positive is  │
1968           │          │         │            N, negative  │
1969           │          │         │            is S.        │
1970           ├──────────┼─────────┼─────────────────────────┤
1971           │lon       │ real    │                         │
1972           │          │         │            Degrees      │
1973           │          │         │            longitude,   │
1974           │          │         │            signed.      │
1975           │          │         │            Positive is  │
1976           │          │         │            E, negative  │
1977           │          │         │            is W.        │
1978           ├──────────┼─────────┼─────────────────────────┤
1979           │range     │ integer │                         │
1980           │          │         │            Transmission │
1981           │          │         │            range in km  │
1982           │          │         │            (1-1024).    │
1983           └──────────┴─────────┴─────────────────────────┘
1984
1985           This message type replaces message type 3 (Reference Station
1986           Parameters) in RTCM 2.3.
1987
1988       Type 14: GPS Time of Week
1989           Here are the payload members of a type 14 (GPS Time of Week)
1990           message:
1991
1992           Table 26. Reference Station Parameters
1993           ┌─────────┬─────────┬────────────────────────┐
1994Name     Type    │                        │
1995           │         │         │            Description │
1996           ├─────────┼─────────┼────────────────────────┤
1997           │week     │ integer │                        │
1998           │         │         │            GPS week    │
1999           │         │         │            (0-123).    │
2000           ├─────────┼─────────┼────────────────────────┤
2001           │hour     │ integer │                        │
2002           │         │         │            Hour of     │
2003           │         │         │            week        │
2004           │         │         │            (0-167).    │
2005           ├─────────┼─────────┼────────────────────────┤
2006           │leapsecs │ integer │                        │
2007           │         │         │            Leap        │
2008           │         │         │            Seconds     │
2009           │         │         │            (0-63).     │
2010           └─────────┴─────────┴────────────────────────┘
2011
2012           Here's an example:
2013
2014               {"class":"RTCM2","type":14,"station_id":652,"zcount":1657.2,
2015                       "seqnum":3,"length":1,"station_health":6,"week":601,"hour":109,
2016                       "leapsecs":15}
2017
2018       Type 16: Special Message
2019           Table 27. Special Message
2020           ┌────────┬────────┬────────────────────────┐
2021Name    Type   │                        │
2022           │        │        │            Description │
2023           ├────────┼────────┼────────────────────────┤
2024           │message │ string │                        │
2025           │        │        │            A text      │
2026           │        │        │            message     │
2027           │        │        │            sent by the │
2028           │        │        │            beacon      │
2029           │        │        │            operator.   │
2030           └────────┴────────┴────────────────────────┘
2031
2032       Type 31: Correction data
2033           One or more GLONASS satellite objects follow the header for type 1
2034           or type 9 messages. Here is the format:
2035
2036           Table 28. Satellite object
2037           ┌───────┬──────────┬────────────────────────────────┐
2038Name   Type     │                                │
2039           │       │          │            Description         │
2040           ├───────┼──────────┼────────────────────────────────┤
2041           │ident  │ integer  │                                │
2042           │       │          │            The PRN             │
2043           │       │          │            number of           │
2044           │       │          │            the                 │
2045           │       │          │            satellite           │
2046           │       │          │            for which           │
2047           │       │          │            this is             │
2048           │       │          │            correction          │
2049           │       │          │            data.               │
2050           ├───────┼──────────┼────────────────────────────────┤
2051           │udre   │ integer  │                                │
2052           │       │          │            User                │
2053           │       │          │            Differential        │
2054           │       │          │            Range Error         │
2055           │       │          │            (0-3). See          │
2056           │       │          │            the table           │
2057           │       │          │            following           │
2058           │       │          │            for values.         │
2059           ├───────┼──────────┼────────────────────────────────┤
2060           │change │ boolean  │                                │
2061           │       │          │            Change-of-ephemeris │
2062           │       │          │            bit.                │
2063           ├───────┼──────────┼────────────────────────────────┤
2064           │tod    │ uinteger │                                │
2065           │       │          │            Count of 30-second  │
2066           │       │          │            periods since the   │
2067           │       │          │            top of the hour.    │
2068           ├───────┼──────────┼────────────────────────────────┤
2069           │prc    │ real     │                                │
2070           │       │          │            The pseudorange     │
2071           │       │          │            error in meters for │
2072           │       │          │            this satellite as   │
2073           │       │          │            measured by the     │
2074           │       │          │            beacon reference    │
2075           │       │          │            receiver at the     │
2076           │       │          │            epoch indicated by  │
2077           │       │          │            the z_count in the  │
2078           │       │          │            parent record.      │
2079           ├───────┼──────────┼────────────────────────────────┤
2080           │rrc    │ real     │                                │
2081           │       │          │            The rate of change  │
2082           │       │          │            of pseudorange      │
2083           │       │          │            error in meters/sec │
2084           │       │          │            for this satellite  │
2085           │       │          │            as measured by the  │
2086           │       │          │            beacon reference    │
2087           │       │          │            receiver at the     │
2088           │       │          │            epoch indicated by  │
2089           │       │          │            the z_count field   │
2090           │       │          │            in the parent       │
2091           │       │          │            record. This is     │
2092           │       │          │            used to calculate   │
2093           │       │          │            pseudorange errors  │
2094           │       │          │            at other epochs, if │
2095           │       │          │            required by the GPS │
2096           │       │          │            receiver.           │
2097           └───────┴──────────┴────────────────────────────────┘
2098
2099           Here's an example:
2100
2101               {"class":"RTCM2","type":31,"station_id":652,"zcount":1642.2,
2102                   "seqnum":0,"length":14,"station_health":6,
2103                   "satellites":[
2104                       {"ident":5,"udre":0,"change":false,"tod":0,"prc":132.360,"rrc":0.000},
2105                       {"ident":15,"udre":0,"change":false,"tod":0,"prc":134.840,"rrc":0.002},
2106                       {"ident":14,"udre":0,"change":false,"tod":0,"prc":141.520,"rrc":0.000},
2107                       {"ident":6,"udre":0,"change":false,"tod":0,"prc":127.000,"rrc":0.000},
2108                       {"ident":21,"udre":0,"change":false,"tod":0,"prc":128.780,"rrc":0.000},
2109                       {"ident":22,"udre":0,"change":false,"tod":0,"prc":125.260,"rrc":0.002},
2110                       {"ident":20,"udre":0,"change":false,"tod":0,"prc":117.280,"rrc":-0.004},
2111                       {"ident":16,"udre":0,"change":false,"tod":17,"prc":113.460,"rrc":0.018}
2112               ]}
2113

RTCM3 DUMP FORMAT

2115       The support for RTCM104v3 dumping is incomplete and buggy. Do not
2116       attempt to use it for production! Anyone interested in it should read
2117       the source code.
2118

AIS DUMP FORMATS

2120       AIS support is an extension. It may not be present if your instance of
2121       gpsd has been built with a restricted feature set.
2122
2123       AIS packets are dumped as JSON objects with class "AIS". Each AIS
2124       report object contains a "type" field giving the AIS message type and a
2125       "scaled" field telling whether the remainder of the fields are dumped
2126       in scaled or unscaled form. (These will be emitted before any
2127       type-specific fields.) It will also contain a "device" field naming the
2128       data source. Other fields have names and types as specified in the
2129       AIVDM/AIVDO Protocol Decoding document on the GPSD project website;
2130       each message field table may be directly interpreted as a specification
2131       for the members of the corresponding JSON object type.
2132
2133       By default, certain scaling and conversion operations are performed for
2134       JSON output. Latitudes and longitudes are scaled to decimal degrees
2135       rather than the native AIS unit of 1/10000th of a minute of arc. Ship
2136       (but not air) speeds are scaled to knots rather than tenth-of-knot
2137       units. Rate of turn may appear as "nan" if is unavailable, or as one of
2138       the strings "fastright" or "fastleft" if it is out of the AIS encoding
2139       range; otherwise it is quadratically mapped back to the turn sensor
2140       number in degrees per minute. Vessel draughts are converted to decimal
2141       meters rather than native AIS decimeters. Various other scaling
2142       conversions are described in "AIVDM/AIVDO Protocol Decoding".
2143

SUBFRAME DUMP FORMATS

2145       Subframe support is always compiled into gpsd but many GPSes do not
2146       output subframe data or the gpsd driver may not support subframes.
2147
2148       Subframe packets are dumped as JSON objects with class "SUBFRAME". Each
2149       subframe report object contains a "frame" field giving the subframe
2150       number, a "tSV" field for the transmitting satellite number, a "TOW17"
2151       field containing the 17 MSBs of the start of the next 12-second message
2152       and a "scaled" field telling whether the remainder of the fields are
2153       dumped in scaled or unscaled form. It will also contain a "device"
2154       field naming the data source. Each SUBFRAME object will have a
2155       sub-object specific to that subframe page type. Those sub-object fields
2156       have names and types similar to those specified in the IS-GPS-200E
2157       document; each message field table may be directly interpreted as a
2158       specification for the members of the corresponding JSON object type.
2159

SEE ALSO

2161       gpsd(8), libgps(3),
2162

AUTHOR

2164       The protocol was designed and documented by Eric S. Raymond.
2165

NOTES

2167        1. Radio Technical Commission for Maritime Services
2168           http://www.rtcm.org/
2169
2170        2. table of leap second corrections
2171           ftp://maia.usno.navy.mil/ser7/tai-utc.dat
2172
2173
2174
2175The GPSD Project                  28 Aug 2011                     GPSD_JSON(5)
Impressum