<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright 2010 by the GPSD project
SPDX-License-Identifier: BSD-2-clause
-->
<!DOCTYPE refentry PUBLIC
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id='gpscat.1'>
 <refentryinfo>
  <date>6 December 2020</date>
 </refentryinfo>
 <refmeta>
  <refentrytitle>gpscat</refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo class="source">The GPSD Project</refmiscinfo>
  <refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
 </refmeta>
 <refnamediv id='name'>
  <refname>gpscat</refname>
  <refpurpose>dump the output from a GPS</refpurpose>
 </refnamediv>
 <refsynopsisdiv id='synopsis'>
  <cmdsynopsis>
   <command>gpscat</command>
   <arg choice='opt'>-? </arg>
   <arg choice='opt'>--debug <replaceable>LVL</replaceable>
   </arg>
   <arg choice='opt'>--help </arg>
   <arg choice='opt'>--packetizer </arg>
   <arg choice='opt'>--speed <replaceable>SPEED</replaceable>
   </arg>
   <arg choice='opt'>--typeflag </arg>
   <arg choice='opt'>--version </arg>
   <arg choice='opt'>-D <replaceable>LVL</replaceable>
   </arg>
   <arg choice='opt'>-h </arg>
   <arg choice='opt'>-p </arg>
   <arg choice='opt'>-s <replaceable>SPEED</replaceable>
   </arg>
   <arg choice='opt'>-t </arg>
   <arg choice='opt'>-V </arg>
   <arg choice='plain'>
    <replaceable>file-or-serial-port</replaceable>
   </arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 <refsect1 id='description'>
  <title>DESCRIPTION</title>
  <para>
   <application>gpscat</application> is a simple program for
logging and packetizing GPS data streams.  It takes input from a
specified file or serial device (presumed to have a GPS attached) and
reports to standard output. The program runs until end of input or it is
interrupted by ^C or other means. It does not terminate on a bad
packet; this is intentional.</para>
  <para>In raw mode (the default) <application>gpscat</application>
simply dumps its input to standard output.  Nonprintable characters
other than ASCII whitespace are rendered as hexadecimal string escapes.</para>
  <para>In packetizing mode, <application>gpscat</application> uses the
same code as
<citerefentry>
    <refentrytitle>gpsd</refentrytitle>
    <manvolnum>8</manvolnum>
   </citerefentry>'s
packet sniffer to break the input into packets.  Packets are reported
one per line; line breaks in the packets themselves are
escaped.</para>
  <para>This program is useful as a sanity checker when examining a new
device.  It can be used as a primitive NMEA logger, but beware that
(a) interrupting it likely to cut off output in mid-sentence, and (b)
to avoid displaying incomplete NMEA sentences right up next to shell
prompts that often contain a $, raw mode always emits an extra final
linefeed.</para>
  <para>Also, be aware that packetizing mode will produce useless
results &mdash; probably consuming the entirety of input and appearing
to hang &mdash; if it is fed data that is not a sequence of packets
of one of the known types.</para>
  <para>The program accepts the following options:</para>
  <variablelist remap='TP'>
   <varlistentry>
    <term>
     <option>-?</option>
    </term>
    <term>
     <option>-h</option>
    </term>
    <term>
     <option>--help</option>
    </term>
    <listitem>
     <para>Display program usage and exit.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-D LVL</option>
    </term>
    <term>
     <option>--debug LVL</option>
    </term>
    <listitem>
     <para>In packetizer mode, enable progress messages from the packet
getter.  Probably only of interest to developers testing packet
getter changes.  Higher arguments to <option>-D</option> produce more output.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-p</option>
    </term>
    <term>
     <option>--packetizer</option>
    </term>
    <listitem>
     <para>Invoke packetizer mode.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-s SPEED</option>
    </term>
    <term>
     <option>--speed SPEED</option>
    </term>
    <listitem>
     <para>Set the port's baud rate (and optionally its parity and stop
bits) to SPEED before reading.  Argument should begin with one of the normal integer
baud rates (300, 1200, 4800, 9600, 19200, 38400, etc.).  It may be
followed by an optional suffix [NOE][12] to set parity (None, Odd,
Even) and stop bits (1 or 2).</para>
     <para>Specifying <option>-s 4800N1</option> is frequently helpful with unknown
devices.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-t</option>
    </term>
    <term>
     <option>--typeflag</option>
    </term>
    <listitem>
     <para>Invoke packetizer mode, with the packet type and length (in
parentheses) reported before a colon and space on each line.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-V</option>
    </term>
    <term>
     <option>--version</option>
    </term>
    <listitem>
     <para>Display program version and exit.</para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>
 <refsect1 id='see_also'>
  <title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>gpsd</refentrytitle>
    <manvolnum>8</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gps</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>libgps</refentrytitle>
    <manvolnum>3</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>libgpsmm</refentrytitle>
    <manvolnum>3</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsfake</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
<citerefentry>
    <refentrytitle>gpsprof</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsctl</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsdctl</refentrytitle>
    <manvolnum>8</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsmon</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
</para>
 </refsect1>
 <refsect1 id='maintainer'>
  <title>AUTHOR</title>
  <para>Eric S. Raymond <email>esr@thyrsus.com</email>.</para>
 </refsect1>
</refentry>
