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

RTCM2

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

RTCM3 DUMP FORMAT

2150       The support for RTCM104v3 dumping is incomplete and buggy. Do not
2151       attempt to use it for production! Anyone interested in it should read
2152       the source code.
2153

AIS DUMP FORMATS

2155       AIS support is an extension. It may not be present if your instance of
2156       gpsd has been built with a restricted feature set.
2157
2158       AIS packets are dumped as JSON objects with class "AIS". Each AIS
2159       report object contains a "type" field giving the AIS message type and a
2160       "scaled" field telling whether the remainder of the fields are dumped
2161       in scaled or unscaled form. (These will be emitted before any
2162       type-specific fields.) It will also contain a "device" field naming the
2163       data source. Other fields have names and types as specified in the
2164       AIVDM/AIVDO Protocol Decoding document on the GPSD project website;
2165       each message field table may be directly interpreted as a specification
2166       for the members of the corresponding JSON object type.
2167
2168       By default, certain scaling and conversion operations are performed for
2169       JSON output. Latitudes and longitudes are scaled to decimal degrees
2170       rather than the native AIS unit of 1/10000th of a minute of arc. Ship
2171       (but not air) speeds are scaled to knots rather than tenth-of-knot
2172       units. Rate of turn may appear as "nan" if is unavailable, or as one of
2173       the strings "fastright" or "fastleft" if it is out of the AIS encoding
2174       range; otherwise it is quadratically mapped back to the turn sensor
2175       number in degrees per minute. Vessel draughts are converted to decimal
2176       meters rather than native AIS decimeters. Various other scaling
2177       conversions are described in "AIVDM/AIVDO Protocol Decoding".
2178

SUBFRAME DUMP FORMATS

2180       Subframe support is always compiled into gpsd but many GPSes do not
2181       output subframe data or the gpsd driver may not support subframes.
2182
2183       Subframe packets are dumped as JSON objects with class "SUBFRAME". Each
2184       subframe report object contains a "frame" field giving the subframe
2185       number, a "tSV" field for the transmitting satellite number, a "TOW17"
2186       field containing the 17 MSBs of the start of the next 12-second message
2187       and a "scaled" field telling whether the remainder of the fields are
2188       dumped in scaled or unscaled form. It will also contain a "device"
2189       field naming the data source. Each SUBFRAME object will have a
2190       sub-object specific to that subframe page type. Those sub-object fields
2191       have names and types similar to those specified in the IS-GPS-200E
2192       document; each message field table may be directly interpreted as a
2193       specification for the members of the corresponding JSON object type.
2194

SEE ALSO

2196       gpsd(8), libgps(3),
2197

AUTHOR

2199       The protocol was designed and documented by Eric S. Raymond.
2200

NOTES

2202        1. Radio Technical Commission for Maritime Services
2203           http://www.rtcm.org/
2204
2205        2. table of leap second corrections
2206           ftp://maia.usno.navy.mil/ser7/tai-utc.dat
2207
2208
2209
2210The GPSD Project                  17 Jun 2018                     GPSD_JSON(5)
Impressum