diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2004-08-22 04:46:57 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2004-08-22 04:46:57 +0000 |
commit | 3e0c0fad73dfec837ddae6f5a0d15978d3135a2f (patch) | |
tree | f0118af1fd106057dc42e9aa075cf334718b34b0 /libgpsd.xml | |
parent | 647808e9daa70a3646eb1197bb38e6a48fe772c6 (diff) | |
download | gpsd-3e0c0fad73dfec837ddae6f5a0d15978d3135a2f.tar.gz |
Completing the name swap.
Diffstat (limited to 'libgpsd.xml')
-rw-r--r-- | libgpsd.xml | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/libgpsd.xml b/libgpsd.xml new file mode 100644 index 00000000..434050fe --- /dev/null +++ b/libgpsd.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> +<refentry> +<refentryinfo><date>14 Aug 2004</date></refentryinfo> +<refmeta> +<refentrytitle>3</refentrytitle> +<manvolnum>3</manvolnum> +<refmiscinfo class='source'>Linux</refmiscinfo> +</refmeta> +<refnamediv id='name'> +<refname>libgps</refname> +<refpurpose>service library for GPS applications</refpurpose> +</refnamediv> +<refsynopsisdiv id='synopsis'> +<funcsynopsis> +<funcsynopsisinfo> + +#include <gpsd.h> + +struct gps_session_t session; + +</funcsynopsisinfo> +<funcprototype> +<funcdef>void <function>gpsd_init</function></funcdef> + <paramdef>struct gps_t * <parameter>session</parameter></paramdef> + <paramdef>int <parameter>timeout</parameter></paramdef> + <paramdef>char <parameter>devtype</parameter></paramdef> + <paramdef>char * <parameter>dgpsserver</parameter></paramdef> +</funcprototype> +<funcprototype> +<funcdef>int <function>gpsd_activate</function></funcdef> + <paramdef>struct gps_t * <parameter>session</parameter></paramdef> +</funcprototype> +<funcprototype> +<funcdef>void <function>gpsd_deactivate</function></funcdef> + <paramdef>struct gps_t * <parameter>session</parameter></paramdef> +</funcprototype> +<funcprototype> +<funcdef>int <function>gpsd_poll</function></funcdef> + <paramdef>struct gps_t * <parameter>session</parameter></paramdef> +</funcprototype> +<funcprototype> +<funcdef>void <function>gpsd_wrap</function></funcdef> + <paramdef>struct gps_t * <parameter>session</parameter></paramdef> +</funcprototype> + +<funcprototype> +<funcdef>void <function>gpscli_report</function></funcdef> + <paramdef>int <parameter>d</parameter></paramdef> + <paramdef>const char * <parameter>fmt</parameter></paramdef> + <paramdef><parameter>...</parameter></paramdef> +</funcprototype> + +</funcsynopsis> +</refsynopsisdiv> + +<refsect1 id='description'><title>DESCRIPTION</title> +<para><emphasis remap='B'>libgps</emphasis> +is a service library which supports querying GPS devices; link it with +the linker option -lgps. There are +two interfaces supported in it; one high-level interface that +goes through +<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry> +and is intended for concurrent use by several applications, and one +low-level interface that speaks directly with the serial or USB device +to which the GPS is attached. This page describes the low-level +interface, whic +<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry> +itself uses. See +<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry> +for a description of the high-level interface, which is almost +certainly what you want.</para> + +<para>Calling +<function>gpsd_init()</function> +initializes a session structure to hold the data collected by the GPS. +You must specify a timeout in seconds after which data will be +considered stale. You must specify one of the following device types:</para> +<itemizedlist> + <listitem><para>Generic NMEA 0183 GPS</para></listitem> + <listitem><para>TripMate GPS</para></listitem> + <listitem><para>EarthMate GPS</para></listitem> + <listitem><para>Log file to be played back.</para></listitem> +</itemizedlist> + +<para>It is generally safe to specify 'n', as most modern GPSes speak +NMEA.</para> + +<para>You may optionally specify a DGPS server, either as a string +containing a server name or a string containining server name followed +by a colon and a port name or number. To specify no DGPS, pass the +null pointer.</para> + +<para>After the session structure has been set up, you may modify some +of its members.</para> + +<variablelist> +<varlistentry> +<term><structfield>gpsd_device</structfield></term> +<listitem> +<para>This member should hold the path name of the device; it defaults to +<filename>/dev/gps</filename>.</para> +</listitem> +</varlistentry> +<varlistentry> +<term><structfield>baudrate</structfield></term> +<listitem> +<para>Communication speed in bits per second. The default is set by +the driver type.</para> +</listitem> +</varlistentry> +<varlistentry> +<term><structfield>raw_hook</structfield></term> +<listitem> +<para>A hook function to be executed on each NMEA +sentence as it is read from the GPS. The data from non-NMEA GPSes like +the EarthMate will be translated to an NMEA sentence before being +passed to the hook.</para> +</listitem> +</varlistentry> +</variablelist> + +<para><function>gpsd_activate()</function> +initializes the connection to the GPS. +<function>gpsd_deactivate()</function> +closes the connection. These functions are provided so that +long-running programs can release a connection when there is no +activity requiring the GPS, and re-acquire it later.</para> + +<para><function>gpsd_poll()</function> +queries the GPS and updates the part of the session structure that +holds position, speed, GPS signal quality, and other data returned +by the GPS. It returns the number of characters waiting (-1 if the +GPS is inaccessible)</para> + +<para><function>gpsd_wrap()</function> +ends the session, implicitly performing a +<function>gpsd_deactivate()</function>.</para> + +<para>The calling application must define one additional function: +<function>gpscli_report()</function>. +The library will use this to ordinary status messages. Use +first argument of 0 for errors, 1 for ordinary status messages, +and 2 or higher for debugging messages.</para> + +<para>The +.B debug +member of the session structure controls which messages are displayed. +It defaults to 1, but can be altered by the calling program.</para> +</refsect1> + +<refsect1 id='see_also'><title>SEE ALSO</title> +<para> +<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry> +<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry> +</para> +</refsect1> + +<refsect1 id='author'><title>AUTHOR</title> +<para>Eric S. Raymond <esr@thyrsus.com> based partly on earlier work by +Remco Treffkorn, Derrick Brashear, and Russ Nelson.</para> +</refsect1> +</refentry> + |