1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!--
3This file is Copyright (c) 2010 by the GPSD project
4SPDX-License-Identifier: BSD-2-clause
5-->
6<!DOCTYPE refentry PUBLIC
7   "-//OASIS//DTD DocBook XML V4.1.2//EN"
8   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
9<refentry id='gpsdecode.1'>
10<refentryinfo><date>13 Jul 2005</date></refentryinfo>
11<refmeta>
12<refentrytitle>gpsdecode</refentrytitle>
13<manvolnum>1</manvolnum>
14<refmiscinfo class="source">The GPSD Project</refmiscinfo>
15<refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
16</refmeta>
17<refnamediv id='name'>
18<refname>gpsdecode</refname>
19<refpurpose>decode GPS, RTCM or AIS streams into a readable format</refpurpose>
20</refnamediv>
21<refsynopsisdiv id='synopsis'>
22
23<cmdsynopsis>
24  <command>gpsdecode</command>
25      <arg choice='opt'>-c</arg>
26      <arg choice='opt'>-d</arg>
27      <arg choice='opt'>-e</arg>
28      <arg choice='opt'>-j</arg>
29      <arg choice='opt'>-m</arg>
30      <arg choice='opt'>-n</arg>
31      <arg choice='opt'>-s</arg>
32      <arg choice='opt'>-t <replaceable>typelist</replaceable></arg>
33      <arg choice='opt'>-u</arg>
34      <arg choice='opt'>-v</arg>
35      <arg choice='opt'>-D <replaceable>debuglevel</replaceable></arg>
36      <arg choice='opt'>-V</arg>
37</cmdsynopsis>
38</refsynopsisdiv>
39
40<refsect1 id='description'><title>DESCRIPTION</title>
41
42<para>This tool is a batch-mode decoder for NMEA and various binary
43packet formats associated with GPS, AIS, and differential-correction
44services.  It produces a JSON dump on standard output from binary on
45standard input. The JSON is the same format documented in
46<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>;
47this tool uses the same decoding logic as gpsd, but with a simpler
48interface intended for batch processing of data files.</para>
49
50<para>All sensor-input formats known to the GPSD project can be
51decoded by this tool.  These include: NMEA, AIVDM (the NMEA-derived
52sentence format used by AIS, the marine Automatic Identification
53System), RTCM2, and all supported GPS binary formats (notably
54including SiRF). See
55<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
56for applicable standards and known limitations of the decoding
57logic.</para>
58
59<para>You can use this tool with
60<citerefentry><refentrytitle>nc</refentrytitle><manvolnum>1</manvolnum></citerefentry>
61to examine AIS feeds from AIS pooling services, RTCM feeds from RTCM
62receivers or NTRIP broadcasters.</para>
63
64</refsect1>
65<refsect1 id='options'><title>OPTIONS</title>
66
67<para>The <option>-d</option> option tells the program to decode
68packets presented on standard input to standard output. This is the
69default behavior.</para>
70
71<para>The <option>-j</option> explicitly sets the output dump format
72to JSON (the default behavior).</para>
73
74<para>With the <option>-m</option> option, dump minimum lengths for
75each packet type in the input (ignoring comment packets).  This is
76probably of interest only to GSD developers.</para>
77
78<para>The <option>-n</option> enables dumping in generated
79pseudo-NME0183.</para>
80
81<para>The <option>-e</option> option option tells the program to
82encode JSON on standard input to JSON on standard output. This option
83is only useful for regression-testing of the JSON dumping and parsing
84code.</para>
85
86<para>The <option>-s</option> option option tells the program to report
87AIS Type 24 sentence halves separately rather than attempting to
88aggregate them.</para>
89
90<para>The <option>-t</option> accepts a comma-separated list of
91numeric types.  Packets with a numeric AIS, RTCM2, or RTCM3 type are
92passed through and output only if they match a type in the
93list. Packets of other kinds (in particular GPS packets) are
94passed through unconditionally.</para>
95
96<para>The <option>-u</option> suppresses scaling of AIS data to float
97quantities and text expansion of numeric codes.  A dump with this
98option is lossless.</para>
99
100<para>The <option>-v</option> enables dumping of textual packets
101to output as they are received on input, immediately preceding
102corresponding output.</para>
103
104<para>The <option>-c</option> sets the AIS dump format to separate
105fields with an ASCII pipe symbol.  Fields are dumped in the order they
106occur in the AIS packet. Numerics are not scaled (-u is
107forced). Strings are unpacked from six-bit to full ASCII</para>
108
109<para>The <option>-V</option> option directs the program to emit its
110version number, then exit.</para>
111
112<para>The <option>-D</option> option sets a debug verbosity level.  It is
113mainly of interest to developers.</para>
114
115</refsect1>
116<refsect1 id='json_ais'><title>AIS DSV FORMAT</title>
117
118<para>With the <option>-c</option> option, dump lines are values of AIS
119payload fields, pipe-separated, in the order that they occur in the
120payload. Spans of fields expressing a date are emitted as an ISO8601
121timestamp (look for colons and the trailing Z indicating Zulu/UTC
122time), and the 19-bit group of TDMA status fields found at the end of
123message types 1-4 are are dumped as a single unsigned integer (in hex
124preceded by "0x"). Unused regional-authority fields are also dumped
125(in hex preceded by "0x"). Variable-length binary fields are dumped as
126an integer bit length, followed by a colon, followed by a hex
127dump.</para>
128
129</refsect1>
130<refsect1 id='see_also'><title>SEE ALSO</title>
131<para>
132<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
133<citerefentry><refentrytitle>gpsctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
134<citerefentry><refentrytitle>gpsdctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
135<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
136<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
137<citerefentry><refentrytitle>libgpsmm</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
138<citerefentry><refentrytitle>gpsprof</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
139<citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
140</para>
141</refsect1>
142<refsect1 id='maintainer'><title>AUTHOR</title>
143
144<para>Eric S. Raymond <email>esr@thyrsus.com</email>.</para>
145</refsect1>
146
147</refentry>
148