<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright 2004 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='xgps.1'>
 <refentryinfo>
  <date>6 December 2020</date>
 </refentryinfo>
 <refmeta>
  <refentrytitle>xgps</refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo class="source">The GPSD Project</refmiscinfo>
  <refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
 </refmeta>
 <refnamediv id='name'>
  <refname>xgps</refname>
  <refname>xgpsspeed</refname>
  <refpurpose>sample clients for gpsd</refpurpose>
 </refnamediv>
 <refsynopsisdiv id='synopsis'>
  <cmdsynopsis>
   <command>xgps</command>
   <arg choice='opt'>-? </arg>
   <arg choice='opt'>--help </arg>
   <arg choice='opt'>--debug <replaceable>DEBUG-LEVEL</replaceable>
   </arg>
   <arg choice='opt'>--device <replaceable>DEVICE</replaceable>
   </arg>
   <arg choice='opt'>--host <replaceable>HOST</replaceable>
   </arg>
   <arg choice='opt'>--llfmt <group>
     <arg>d</arg>
     <arg>m</arg>
     <arg>s</arg>
    </group>
   </arg>
   <arg choice='opt'>--port <replaceable>PORT</replaceable>
   </arg>
   <arg choice='opt'>--rotate <replaceable>DEGREES</replaceable>
   </arg>
   <arg choice='opt'>--sats <replaceable>NSATS</replaceable>
   </arg>
   <arg choice='opt'>--units <group>
     <arg>i</arg>
     <arg>n</arg>
     <arg>m</arg>
    </group>
   </arg>
   <arg choice='opt'>--version </arg>
   <arg choice='opt'>-D <replaceable>LVL</replaceable>
   </arg>
   <arg choice='opt'>-h </arg>
   <arg choice='opt'>-l <group>
     <arg>d</arg>
     <arg>m</arg>
     <arg>s</arg>
    </group>
   </arg>
   <arg choice='opt'>-r <replaceable>DEGREES</replaceable>
   </arg>
   <arg choice='opt'>-s <replaceable>NSATS</replaceable>
   </arg>
   <arg choice='opt'>-u <group>
     <arg>i</arg>
     <arg>n</arg>
     <arg>m</arg>
    </group>
   </arg>
   <arg choice='opt'>-V </arg>
   <group>
    <replaceable>server</replaceable>
    <group>
     <replaceable>:port</replaceable>
     <group>
      <replaceable>:device</replaceable>
     </group>
    </group>
   </group>
  </cmdsynopsis>
  <cmdsynopsis>
   <command>xgpsspeed</command>
   <arg choice='opt'>-? </arg>
   <arg choice='opt'>--debug <replaceable>DEBUG-LEVEL</replaceable>
   </arg>
   <arg choice='opt'>--device <replaceable>DEVICE</replaceable>
   </arg>
   <arg choice='opt'>--help </arg>
   <arg choice='opt'>--host <replaceable>HOST</replaceable>
   </arg>
   <arg choice='opt'>--landspeed </arg>
   <arg choice='opt'>--maxspeed <replaceable>MAXSPEED</replaceable>
   </arg>
   <arg choice='opt'>--nautical </arg>
   <arg choice='opt'>--port <replaceable>PORT</replaceable>
   </arg>
   <arg choice='opt'>--rotate <replaceable>DEGREES</replaceable>
   </arg>
   <arg choice='opt'>--speedunits
              <group choice='req'>
     <arg>mph</arg>
     <arg>kmh</arg>
     <arg>knots</arg>
    </group>
   </arg>
   <arg choice='opt'>--version </arg>
   <arg choice='opt'>-D <replaceable>LVL</replaceable>
   </arg>
   <arg choice='opt'>-h </arg>
   <arg choice='opt'>-r <replaceable>DEGREES</replaceable>
   </arg>
   <arg choice='opt'>-V </arg>
   <group>
    <replaceable>server</replaceable>
    <group>
     <replaceable>:port</replaceable>
     <group>
      <replaceable>:device</replaceable>
     </group>
    </group>
   </group>
  </cmdsynopsis>
 </refsynopsisdiv>
 <refsect1 id='description'>
  <title>DESCRIPTION</title>
  <para>These are two sample clients shipped with
<application>gpsd</application>. They have some common options:</para>
  <variablelist>
   <varlistentry>
    <term>
     <option>-?</option>
    </term>
    <term>
     <option>-h</option>
    </term>
    <term>
     <option>--help</option>
    </term>
    <listitem>
     <para>Causes the client to emit a summary of its options and then exit.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-device DEVICE</option>
    </term>
    <listitem>
     <para>The device on the host to connect
to. The default is empty (any).</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-D LVL</option>
    </term>
    <term>
     <option>--debug LVL</option>
    </term>
    <listitem>
     <para>Sets the debug
level; it is primarily for use by GPSD developers.  It enables
various progress messages to standard error.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>--host HOST</option>
    </term>
    <listitem>
     <para>The host (server) to connect to. The default is localhost.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-p PORT</option>
    </term>
    <term>
     <option>--port PORT</option>
    </term>
    <listitem>
     <para>The port to connect to. The default is 2947.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-V</option>
    </term>
    <term>
     <option>--version</option>
    </term>
    <listitem>
     <para>The <option>-V, --version</option> option causes each client to dump
the package version and exit.</para>
    </listitem>
   </varlistentry>
  </variablelist>
  <para>By default, clients collect data from all compatible devices on
localhost, using the default GPSD port 2947. An optional argument to any
client may specify a server to get data from. A colon-separated suffix
is taken as a port number. If there is a second colon-separated
suffix, that is taken as a specific device name to be
watched. However, if the server specification contains square
brackets, the part inside them is taken as an IPv6 address and
port/device suffixes are only parsed after the trailing bracket.
Possible cases look like this:</para>
  <para>The options for xgps can be placed in the XGPSOPTS environment variable.
XGPSOPTS is processed before the CLI options.</para>
  <variablelist>
   <varlistentry>
    <term>localhost:/dev/ttyS1</term>
    <listitem>
     <para>Look at the default port of localhost, trying both
IPv4 and IPv6 and watching output from serial device 1.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>example.com:2317</term>
    <listitem>
     <para>Look at port 2317 on example.com, trying both
IPv4 and IPv6.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>71.162.241.5:2317:/dev/ttyS3</term>
    <listitem>
     <para>Look at port 2317 at the specified IPv4
address, collecting data from attached serial device 3.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:2317:/dev/ttyS5</term>
    <listitem>
     <para>Look at port 2317 at the specified IPv6
address, collecting data from attached serial device 5.</para>
    </listitem>
   </varlistentry>
  </variablelist>
  <refsect2>
   <title>xgps</title>
   <para>
    <application>xgps</application> is a simple sample client for
<application>gpsd</application> with an X interface. It displays
current GPS position/time/velocity information and (for GPSes that
support the feature) the locations of accessible satellites.</para>
   <para>In the sky view, satellites are color-coded to indicate quality
of signal; consult the data display to the left for exact figures in
dB.  Diamond-shaped icons indicate GLONASS satellites, squares are used
for SBAS (e.g. WAAS, EGNOS), circles indicate GPS, and down-, up-,
right-, and left-pointing triangles, respectively, indicate Galileo,
BeiDou, QZSS, and other systems' satellites (e.g. IMES, IRNSS, as well
as unknown systems).  Filled icons were used in the current fix,
outline icons were not.  Hovering over a symbol with the mouse pointer
will temporarily display a small popup window with the satellite
details from the Satellite List pane.</para>
   <variablelist>
    <varlistentry>
     <term>
      <option>-l FMT</option>
     </term>
     <term>
      <option>--llfmt FMT</option>
     </term>
     <listitem>
      <para>Set
the format of latitude and longitude reports. The value 'd' produces
decimal degrees and is the default. The value 'm' produces degrees and
decimal minutes. The value 's' produces degrees, minutes, and decimal
seconds.</para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>
      <option>-r DEG</option>
     </term>
     <term>
      <option>--rotate DEG</option>
     </term>
     <listitem>
      <para>Accepts an argument in
degrees, to rotate the skyview counterclockwise.</para>
     </listitem>
    </varlistentry>
   </variablelist>
   <para>
    <application>xgps</application> looks at variables in the
environment to figure out the units for display &mdash; imperial,
nautical, or metric. Here are the variables and values
checked:</para>
   <screen>
    GPSD_UNITS one of:
              i          = miles/feet
              imperial   = miles/feet
              n          = knots/feet
              nautical   = knots/feet
              m          = km/meters
              metric     = km/meters
    LC_MEASUREMENT
              en_US      = miles/feet
              C          = miles/feet
              POSIX      = miles/feet
              [other]    = km/meters
    LANG
              en_US      = miles/feet
              C          = miles/feet
              POSIX      = miles/feet
              [other]    = km/meters
</screen>
   <para>These preferences may be overridden by the <option>-u, --units</option>
option.</para>
   <para>The <option>-u</option> option can be used to set
the system units for display; follow the keyword with 'i' for
'imperial' for American units (International Feet in altitude and error
estimates, miles per hour in speeds), 'n' for 'nautical' (feet in altitude
and error estimates, knots in speed) or 'm' for 'metric' (meters in
altitude and error estimates, kilometers per hour in speeds).</para>
   <para>Note: The USA Survey Foot is not supported.</para>
  </refsect2>
  <refsect2>
   <title>xgpsspeed</title>
   <para>
    <application>xgpsspeed</application> is a speedometer
that uses position information from the GPS.  </para>
   <para>The default display mode is a speed and track presentation
modeled after a marine navigation display; for backward compatibility
the <option>--nautical</option> option forces this mode.
The <option>--landspeed</option> option produces a simple
speedometer.</para>
   <para>The <option>--speedunits</option> option can be used to set the
speed units for display; follow the keyword with "knots" for nautical
miles per hour, "kmh" for kilometers per hour, or "mph" for miles per
hour. The default is miles per hour.</para>
   <para>In the nautical mode only, <option>--maxspeed</option> sets the
maximum on the speedometer.</para>
  </refsect2>
 </refsect1>
 <refsect1 id='environment'>
  <title>ENVIRONMENT</title>
  <para>The environment variable <envar>GPSD_UNITS</envar> is checked
if no unit system is specified on the command line or in
<envar>XPGSOPTS</envar> it may be set to 'i'. 'imperial', 'm', 'metric', or
'n', 'nautical'.</para>
  <para>
   <envar>LC_MEASUREMENT</envar> and then <envar>LANG</envar> are
checked if no unit system has been specified on the command line, in
<envar>XPGSOPTS</envar> or in <envar>GPSD_UNITS</envar>. If the value
is 'C', 'POSIX', or begins with
'en_US' the unit system is set to imperial. The default
if no system has been selected defaults to metric.</para>
  <para>The <option>XGPSOPTS></option> environment variable may be set to
pass commonly used command line options to <command>xgps</command>
and <command>xgpsspeed</command>.  This is often used to set the
<option>-u</option> option for locale specific units.
<option>XGPSOPTS</option> is processed before the CLI options.</para>
 </refsect1>
 <refsect1 id='see_also'>
  <title>SEE ALSO</title>
  <para>
   <citerefentry>
    <refentrytitle>gpsd</refentrytitle>
    <manvolnum>8</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>gpsctl</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpscat</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>,
<citerefentry>
    <refentrytitle>gpsprof</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
<citerefentry>
    <refentrytitle>gpspipe</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
<citerefentry>
    <refentrytitle>gpsmon</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
<citerefentry>
    <refentrytitle>gpxlogger</refentrytitle>
    <manvolnum>1</manvolnum>
   </citerefentry>.
</para>
 </refsect1>
 <refsect1 id='maintainer'>
  <title>AUTHORS</title>
  <para>
Remco Treffcorn, Derrick Brashear, Russ Nelson &amp; Eric S. Raymond,
Chen Wei <email>weichen302@aol.com</email> (xgpsspeed),
Robin Wittler <email>real@the-real.org</email> (xgpsspeed).
</para>
  <para>This manual page by Eric S. Raymond <email>esr@thyrsus.com</email>
  </para>
 </refsect1>
</refentry>
