-
Notifications
You must be signed in to change notification settings - Fork 3
/
gpsd_json.xml
2347 lines (2124 loc) · 67.1 KB
/
gpsd_json.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright (c) 2010 by the GPSD project
BSD terms apply: see the file COPYING in the distribution root for details.
-->
<!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY gpsdsock "/var/run/gpsd.sock">
]>
<refentry id='gpsd_json.5'>
<refentryinfo><date>28 Aug 2011</date></refentryinfo>
<refmeta>
<refentrytitle>gpsd_json</refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class="source">The GPSD Project</refmiscinfo>
<refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>gpsd_json</refname>
<refpurpose>gpsd request/response protol</refpurpose>
</refnamediv>
<refsect1 id='overview'><title>OVERVIEW</title>
<para><application>gpsd</application> is a service daemon that can be used
to monitor GPSes, DGPS receivers, Marine AIS broadcasts, and various other
location-related and kinematic sensors.</para>
<para>Clients may communicate with <application>gpsd</application> via
textual requests and responses over a socket. It is a bad idea for
applications to speak the protocol directly: rather, they should use
the <application>libgps</application> client library (for C; bindings
also exist for other languages) and take appropriate care to
conditionalize their code on the major and minor protocol version
symbols.</para>
<para>The GPSD protocol is built on top of JSON, JavaScript
Object Notation. GPSD's use of JSON is restricted in some ways
that make parsing it in fixed-extent languages (such as C) easier.</para>
<para>A request line is introduced by "?" and may include multiple
commands. Commands begin with a command identifier, followed either
by a terminating ';' or by an equal sign "=" and a JSON object treated
as an argument. Any ';' or newline indication (either LF or CR-LF)
after the end of a command is ignored. All request lines must be
composed of US-ASCII characters and may be no more than 80 characters
in length, exclusive of the trailing newline.</para>
<para>Responses are JSON objects all of which have a "class" attribute
the value of which is either the name of the invoking command. There
are reports (including but not limited to as "TPV", "SKY", "DEVICE",
and "ERROR") which are not direct responses to commands.</para>
<para> The order of JSON attributes within a response object is never
significant, and you may specify attributes in commands in any
order. Responses never contain the special JSON value null; instead,
attributes with empty or undefined values are omitted. The length
limit for responses and reports is 1536 characters, including trailing
newline; longer responses will be truncated, so client code must be
prepared for the possibility of invalid JSON fragments.</para>
<para>In JSON reports, if an attribute is present only if the parent
attribute is present or has a particular range, then the parent
attribute is emitted first.</para>
<para>There is one constraint on the order in which attributes will
be omitted. If an optional attribute is present only when a parent
attribute has a specified value or range of values, the parent
attribute will be emitted first to make parsing easier.</para>
<para>The next subsection section documents the core GPSD protocol.
Extensions are documented in the following subsections. The extensions
may not be supported in your <application>gpsd</application> instance
if it has been compiled with a restricted feature set.</para>
</refsect1>
<refsect1 id='core-protocol'><title>CORE SOCKET PROTOCOL</title>
<para>Here are the core-protocol responses:</para>
<variablelist>
<varlistentry>
<term>TPV</term>
<listitem>
<para>A TPV object is a time-position-velocity report. The "class" and "mode"
fields will reliably be present. The "mode" field will be emitted
before optional fields that may be absent when there is no fix. Error
estimates will be emitted after the fix components they're associated with.
Others may be reported or not depending on the fix quality.</para>
<table frame="all" pgwide="0"><title>TPV object</title>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "TPV"</entry>
</row>
<row>
<entry>device</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Name of originating device.</entry>
</row>
<row>
<entry>mode</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>NMEA mode: %d, 0=no mode value yet seen, 1=no fix, 2=2D, 3=3D.</entry>
</row>
<row>
<entry>time</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Time/date stamp in ISO8601 format, UTC. May have a
fractional part of up to .001sec precision. May be absent if mode
is not 2 or 3.</entry>
</row>
<row>
<entry>ept</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Estimated timestamp error (%f, seconds, 95% confidence).
Present if time is present.</entry>
</row>
<row>
<entry>lat</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Latitude in degrees: +/- signifies North/South. Present
when mode is 2 or 3.</entry>
</row>
<row>
<entry>lon</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Longitude in degrees: +/- signifies East/West. Present
when mode is 2 or 3.</entry>
</row>
<row>
<entry>alt</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Altitude in meters. Present if mode is 3.</entry>
</row>
<row>
<entry>epx</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Longitude error estimate in meters, 95% confidence. Present
if mode is 2 or 3 and DOPs can be calculated from the satellite
view.</entry>
</row>
<row>
<entry>epy</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Latitude error estimate in meters, 95% confidence. Present
if mode is 2 or 3 and DOPs can be calculated from the satellite
view.</entry>
</row>
<row>
<entry>epv</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Estimated vertical error in meters, 95% confidence. Present
if mode is 3 and DOPs can be calculated from the satellite
view.</entry>
</row>
<row>
<entry>track</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Course over ground, degrees from true north.</entry>
</row>
<row>
<entry>speed</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Speed over ground, meters per second.</entry>
</row>
<row>
<entry>climb</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Climb (positive) or sink (negative) rate, meters per
second.</entry>
</row>
<row>
<entry>epd</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Direction error estimate in degrees, 95% confidence.</entry>
</row>
<row>
<entry>eps</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Speed error estinmate in meters/sec, 95% confidence.</entry>
</row>
<row>
<entry>epc</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Climb/sink error estimate in meters/sec, 95% confidence.</entry>
</row>
</tbody>
</tgroup>
</table>
<para>When the C client library parses a response of this kind, it
will assert validity bits in the top-level set member for each
field actually received; see gps.h for bitmask names and values.</para>
<para>Here's an example:</para>
<programlisting>
{"class":"TPV","device":"/dev/pts/1",
"time":"2005-06-08T10:34:48.283Z","ept":0.005,
"lat":46.498293369,"lon":7.567411672,"alt":1343.127,
"eph":36.000,"epv":32.321,
"track":10.3788,"speed":0.091,"climb":-0.085,"mode":3}
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>SKY</term>
<listitem>
<para>A SKY object reports a sky view of the GPS satellite positions.
If there is no GPS device available, or no skyview has been reported
yet, only the "class" field will reliably be present.</para>
<table frame="all" pgwide="0"><title>SKY object</title>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "SKY"</entry>
</row>
<row>
<entry>device</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Name of originating device</entry>
</row>
<row>
<entry>time</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Time/date stamp in ISO8601 format, UTC. May have a
fractional part of up to .001sec precision.</entry>
</row>
<row>
<entry>xdop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Longitudinal dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get an
error estimate.</entry>
</row>
<row>
<entry>ydop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Latitudinal dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get an
error estimate.</entry>
</row>
<row>
<entry>vdop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Altitude dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get an
error estimate.</entry>
</row>
<row>
<entry>tdop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Time dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get an
error estimate.</entry>
</row>
<row>
<entry>hdop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Horizontal dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get a
circular error estimate.</entry>
</row>
<row>
<entry>pdop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Spherical dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get an
error estimate.</entry>
</row>
<row>
<entry>gdop</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Hyperspherical dilution of precision, a dimensionless
factor which should be multiplied by a base UERE to get an
error estimate.</entry>
</row>
<row>
<entry>satellites</entry>
<entry>Yes</entry>
<entry>list</entry>
<entry>List of satellite objects in skyview</entry>
</row>
</tbody>
</tgroup>
</table>
<para>Many devices compute dilution of precision factors but do not
include them in their reports. Many that do report DOPs report only
HDOP, two-dimensional circular error. <application>gpsd</application>
always passes through whatever the device actually reports, then
attempts to fill in other DOPs by calculating the appropriate
determinants in a covariance matrix based on the satellite view. DOPs
may be missing if some of these determinants are singular. It can even
happen that the device reports an error estimate in meters when the
corresponding DOP is unavailable; some devices use more sophisticated
error modeling than the covariance calculation.</para>
<para>The satellite list objects have the following elements:</para>
<table frame="all" pgwide="0"><title>Satellite object</title>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>PRN</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>PRN ID of the satellite. 1-63 are GNSS satellites,
64-96 are GLONASS satellites, 100-164 are SBAS satellites</entry>
</row>
<row>
<entry>az</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>Azimuth, degrees from true north.</entry>
</row>
<row>
<entry>el</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>Elevation in degrees.</entry>
</row>
<row>
<entry>ss</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>Signal strength in dB.</entry>
</row>
<row>
<entry>used</entry>
<entry>Yes</entry>
<entry>boolean</entry>
<entry>Used in current solution? (SBAS/WAAS/EGNOS satellites
may be flagged used if the solution has corrections from them,
but not all drivers make this information available.)</entry>
</row>
</tbody>
</tgroup>
</table>
<para>Note that satellite objects do not have a "class" field, as
they are never shipped outside of a SKY object.</para>
<para>When the C client library parses a SKY response, it
will assert the SATELLITE_SET bit in the top-level set member.</para>
<para>Here's an example:</para>
<programlisting>
{"class":"SKY","device":"/dev/pts/1",
"time":"2005-07-08T11:28:07.114Z",
"xdop":1.55,"hdop":1.24,"pdop":1.99,
"satellites":[
{"PRN":23,"el":6,"az":84,"ss":0,"used":false},
{"PRN":28,"el":7,"az":160,"ss":0,"used":false},
{"PRN":8,"el":66,"az":189,"ss":44,"used":true},
{"PRN":29,"el":13,"az":273,"ss":0,"used":false},
{"PRN":10,"el":51,"az":304,"ss":29,"used":true},
{"PRN":4,"el":15,"az":199,"ss":36,"used":true},
{"PRN":2,"el":34,"az":241,"ss":43,"used":true},
{"PRN":27,"el":71,"az":76,"ss":43,"used":true}]}
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>GST</term>
<listitem>
<para>A GST object is a pseudorange noise report.</para>
<table frame="all" pgwide="0"><title>GST object</title>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "GST"</entry>
</row>
<row>
<entry>device</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Name of originating device</entry>
</row>
<row>
<entry>time</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Seconds since the Unix epoch, UTC. May have a
fractional part of up to .001sec precision.</entry>
</row>
<row>
<entry>rms</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Value of the standard deviation of the range inputs to the
navigation process (range inputs include pseudoranges and DGPS
corrections).</entry>
</row>
<row>
<entry>major</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Standard deviation of semi-major axis of error ellipse, in meters.</entry>
</row>
<row>
<entry>minor</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Standard deviation of semi-minor axis of error ellipse, in meters.</entry>
</row>
<row>
<entry>orient</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Orientation of semi-major axis of error ellipse, in degrees from true north.</entry>
</row>
<row>
<entry>lat</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Standard deviation of latitude error, in meters.</entry>
</row>
<row>
<entry>lon</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Standard deviation of longitude error, in meters.</entry>
</row>
<row>
<entry>alt</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Standard deviation of altitude error, in meters.</entry>
</row>
</tbody>
</tgroup>
</table>
<para>Here's an example:</para>
<programlisting>
{"class":"GST","device":"/dev/ttyUSB0",
"time":"2010-12-07T10:23:07.096Z","rms":2.440,
"major":1.660,"minor":1.120,"orient":68.989,
"lat":1.600,"lon":1.200,"alt":2.520}
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>ATT</term>
<listitem>
<para>An ATT object is a vehicle-attitude report. It is returned by
digital-compass and gyroscope sensors; depending on device, it may
include: heading, pitch, roll, yaw, gyroscope, and magnetic-field
readings. Because such sensors are often bundled as part of
marine-navigation systems, the ATT response may also include
water depth.</para>
<para>The "class" and "mode" fields will reliably be present. Others
may be reported or not depending on the specific device type.</para>
<table frame="all" pgwide="0"><title>ATT object</title>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "ATT"</entry>
</row>
<row>
<entry>device</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Name of originating device</entry>
</row>
<row>
<entry>time</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>Seconds since the Unix epoch, UTC. May have a
fractional part of up to .001sec precision.</entry>
</row>
<row>
<entry>heading</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Heading, degrees from true north.</entry>
</row>
<row>
<entry>mag_st</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Magnetometer status.</entry>
</row>
<row>
<entry>pitch</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Pitch in degrees.</entry>
</row>
<row>
<entry>pitch_st</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Pitch sensor status.</entry>
</row>
<row>
<entry>yaw</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Yaw in degrees</entry>
</row>
<row>
<entry>yaw_st</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Yaw sensor status.</entry>
</row>
<row>
<entry>roll</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Roll in degrees.</entry>
</row>
<row>
<entry>roll_st</entry>
<entry>No</entry>
<entry>string</entry>
<entry>Roll sensor status.</entry>
</row>
<row>
<entry>dip</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Local magnetic inclination, degrees, positive when the magnetic
field points downward (into the Earth).</entry>
</row>
<row>
<entry>mag_len</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Scalar magnetic field strength.</entry>
</row>
<row>
<entry>mag_x</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>X component of magnetic field strength.</entry>
</row>
<row>
<entry>mag_y</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Y component of magnetic field strength.</entry>
</row>
<row>
<entry>mag_z</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Z component of magnetic field strength.</entry>
</row>
<row>
<entry>acc_len</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Scalar acceleration.</entry>
</row>
<row>
<entry>acc_x</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>X component of acceleration.</entry>
</row>
<row>
<entry>acc_y</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Y component of acceleration.</entry>
</row>
<row>
<entry>acc_z</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Z component of acceleration.</entry>
</row>
<row>
<entry>gyro_x</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>X component of acceleration.</entry>
</row>
<row>
<entry>gyro_y</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Y component of acceleration.</entry>
</row>
<row>
<entry>depth</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Water depth in meters.</entry>
</row>
<row>
<entry>temperature</entry>
<entry>No</entry>
<entry>numeric</entry>
<entry>Temperature at sensor, degrees centigrade.</entry>
</row>
</tbody>
</tgroup>
</table>
<para>The heading, pitch, and roll status codes (if present) vary by device.
For the TNT Revolution digital compasses, they are coded as follows: </para>
<table frame="all" pgwide="0"><title>Device flags</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Code</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>C</entry>
<entry>magnetometer calibration alarm</entry>
</row>
<row>
<entry>L</entry>
<entry>low alarm</entry>
</row>
<row>
<entry>M</entry>
<entry>low warning</entry>
</row>
<row>
<entry>N</entry>
<entry>normal</entry>
</row>
<row>
<entry>O</entry>
<entry>high warning</entry>
</row>
<row>
<entry>P</entry>
<entry>high alarm</entry>
</row>
<row>
<entry>V</entry>
<entry>magnetometer voltage level alarm</entry>
</row>
</tbody>
</tgroup>
</table>
<para>When the C client library parses a response of this kind, it
will assert ATT_IS.</para>
<para>Here's an example:</para>
<programlisting>
{"class":"ATT","time":1270938096.843,
"heading":14223.00,"mag_st":"N",
"pitch":169.00,"pitch_st":"N", "roll":-43.00,"roll_st":"N",
"dip":13641.000,"mag_x":2454.000}
</programlisting>
</listitem>
</varlistentry>
</variablelist>
<para>And here are the commands:</para>
<variablelist>
<varlistentry>
<term>?VERSION;</term>
<listitem><para>Returns an object with the following attributes:</para>
<table frame="all" pgwide="0"><title>VERSION object</title>
<tgroup cols="4" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "VERSION"</entry>
</row>
<row>
<entry>release</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Public release level</entry>
</row>
<row>
<entry>rev</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Internal revision-control level.</entry>
</row>
<row>
<entry>proto_major</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>API major revision level.</entry>
</row>
<row>
<entry>proto_minor</entry>
<entry>Yes</entry>
<entry>numeric</entry>
<entry>API minor revision level.</entry>
</row>
<row>
<entry>remote</entry>
<entry>No</entry>
<entry>string</entry>
<entry>URL of the remote daemon reporting this version. If
empty, this is the version of the local daemon.</entry>
</row>
</tbody>
</tgroup>
</table>
<para>The daemon ships a VERSION response to each client when the
client first connects to it.</para>
<para>When the C client library parses a response of this kind, it
will assert the VERSION_SET bit in the top-level set member.</para>
<para>Here's an example:</para>
<programlisting>
{"class":"VERSION","version":"2.40dev",
"rev":"06f62e14eae9886cde907dae61c124c53eb1101f",
"proto_major":3,"proto_minor":1
}
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>?DEVICES;</term>
<listitem><para>Returns a device list object with the
following elements:</para>
<table frame="all" pgwide="0"><title>DEVICES object</title>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "DEVICES"</entry>
</row>
<row>
<entry>devices</entry>
<entry>Yes</entry>
<entry>list</entry>
<entry>List of device descriptions</entry>
</row>
<row>
<entry>remote</entry>
<entry>No</entry>
<entry>string</entry>
<entry>URL of the remote daemon reporting the device set. If
empty, this is a DEVICES response from the local daemon.</entry>
</row>
</tbody>
</tgroup>
</table>
<para>When the C client library parses a response of this kind, it
will assert the DEVICELIST_SET bit in the top-level set member.</para>
<para>Here's an example:</para>
<programlisting>
{"class"="DEVICES","devices":[
{"class":"DEVICE","path":"/dev/pts/1","flags":1,"driver":"SiRF binary"},
{"class":"DEVICE","path":"/dev/pts/3","flags":4,"driver":"AIVDM"}]}
</programlisting>
<para>The daemon occasionally ships a bare DEVICE object to the client
(that is, one not inside a DEVICES wrapper). The data content of these
objects will be described later as a response to the ?DEVICE command.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>?WATCH;</term>
<listitem>
<para>This command sets watcher mode. It also sets or elicits a report
of per-subscriber policy and the raw bit. An argument WATCH object
changes the subscriber's policy. The response describes the
subscriber's policy. The response will also include a DEVICES
object.</para>
<para>A WATCH object has the following elements:</para>
<table frame="all" pgwide="0"><title>WATCH object</title>
<tgroup cols="4" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Name</entry>
<entry>Always?</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>class</entry>
<entry>Yes</entry>
<entry>string</entry>
<entry>Fixed: "WATCH"</entry>
</row>
<row>
<entry>enable</entry>
<entry>No</entry>
<entry>boolean</entry>
<entry>Enable (true) or disable (false) watcher mode. Default
is true.</entry>
</row>
<row>
<entry>json</entry>
<entry>No</entry>
<entry>boolean</entry>
<entry>Enable (true) or disable (false) dumping of JSON reports.
Default is false.</entry>
</row>
<row>
<entry>nmea</entry>
<entry>No</entry>
<entry>boolean</entry>
<entry>Enable (true) or disable (false) dumping of binary
packets as pseudo-NMEA. Default
is false.</entry>
</row>
<row>
<entry>raw</entry>
<entry>No</entry>
<entry>integer</entry>
<entry>Controls 'raw' mode. When this attribute is set to 1
for a channel, <application>gpsd</application> reports the
unprocessed NMEA or AIVDM data stream from whatever device is attached.
Binary GPS packets are hex-dumped. RTCM2 and RTCM3
packets are not dumped in raw mode. When this attribute is set to
2 for a channel that processes binary data,
<application>gpsd</application> reports the received data verbatim
without hex-dumping.</entry>
</row>
<row>
<entry>scaled</entry>
<entry>No</entry>
<entry>boolean</entry>
<entry>If true, apply scaling divisors to output before
dumping; default is false.</entry>
</row>
<row>
<entry>split24</entry>
<entry>No</entry>
<entry>boolean</entry>
<entry>If true, aggregate AIS type24 sentence parts. If false,
report each part as a separate JSON object, leaving the
client to match MMSIs and aggregate. Default is
false. Applies only to AIS reports.</entry>
</row>
<row>
<entry>device</entry>
<entry>No</entry>
<entry>string</entry>
<entry>If present, enable watching only of the specified device
rather than all devices. Useful with raw and NMEA modes
in which device responses aren't tagged. Has no effect when
used with enable:false.</entry>
</row>
<row>
<entry>remote</entry>
<entry>No</entry>
<entry>string</entry>
<entry>URL of the remote daemon reporting the watch set. If
empty, this is a WATCH response from the local daemon.</entry>
</row>