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

RTCM2

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

RTCM3 DUMP FORMAT

2308       The support for RTCM104v3 dumping is incomplete and buggy. Do not
2309       attempt to use it for production! Anyone interested in it should read
2310       the source code.
2311

AIS DUMP FORMATS

2313       AIS support is an extension. It may not be present if your instance of
2314       gpsd has been built with a restricted feature set.
2315
2316       AIS packets are dumped as JSON objects with class "AIS". Each AIS
2317       report object contains a "type" field giving the AIS message type and a
2318       "scaled" field telling whether the remainder of the fields are dumped
2319       in scaled or unscaled form. (These will be emitted before any
2320       type-specific fields.) It will also contain a "device" field naming the
2321       data source. Other fields have names and types as specified in the
2322       AIVDM/AIVDO Protocol Decoding document on the GPSD project website;
2323       each message field table may be directly interpreted as a specification
2324       for the members of the corresponding JSON object type.
2325
2326       By default, certain scaling and conversion operations are performed for
2327       JSON output. Latitudes and longitudes are scaled to decimal degrees
2328       rather than the native AIS unit of 1/10000th of a minute of arc. Ship
2329       (but not air) speeds are scaled to knots rather than tenth-of-knot
2330       units. Rate of turn may appear as "nan" if is unavailable, or as one of
2331       the strings "fastright" or "fastleft" if it is out of the AIS encoding
2332       range; otherwise it is quadratically mapped back to the turn sensor
2333       number in degrees per minute. Vessel draughts are converted to decimal
2334       meters rather than native AIS decimeters. Various other scaling
2335       conversions are described in "AIVDM/AIVDO Protocol Decoding".
2336

SUBFRAME DUMP FORMATS

2338       Subframe support is always compiled into gpsd but many GPSes do not
2339       output subframe data or the gpsd driver may not support subframes.
2340
2341       Subframe packets are dumped as JSON objects with class "SUBFRAME". Each
2342       subframe report object contains a "frame" field giving the subframe
2343       number, a "tSV" field for the transmitting satellite number, a "TOW17"
2344       field containing the 17 MSBs of the start of the next 12-second message
2345       and a "scaled" field telling whether the remainder of the fields are
2346       dumped in scaled or unscaled form. It will also contain a "device"
2347       field naming the data source. Each SUBFRAME object will have a
2348       sub-object specific to that subframe page type. Those sub-object fields
2349       have names and types similar to those specified in the IS-GPS-200E
2350       document; each message field table may be directly interpreted as a
2351       specification for the members of the corresponding JSON object type.
2352

SEE ALSO

2354       gpsd(8), libgps(3),
2355

AUTHOR

2357       The protocol was designed and documented by Eric S. Raymond.
2358

NOTES

2360        1. Radio Technical Commission for Maritime Services
2361           http://www.rtcm.org/
2362
2363        2. table of leap second corrections
2364           ftp://maia.usno.navy.mil/ser7/tai-utc.dat
2365
2366
2367
2368The GPSD Project                 23 June 2019                     GPSD_JSON(5)
Impressum