⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libgps.xml

📁 很好的一个gps daemon驱动,简单实用
💻 XML
字号:
<?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"><!-- lifted from troff+man by doclifter --><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 communicationg with the GPS daemon</refpurpose></refnamediv><refsynopsisdiv id='synopsis'><funcsynopsis><funcsynopsisinfo>C:#include &lt;gps.h&gt;</funcsynopsisinfo><funcprototype><funcdef>struct gps_data_t *<function>gps_open</function></funcdef>    <paramdef>char *<parameter>server</parameter></paramdef>    <paramdef>char * <parameter>port</parameter></paramdef></funcprototype><funcprototype><funcdef>int <function>gps_query</function></funcdef>    <paramdef>struct gps_data_t *<parameter>gpsdata</parameter></paramdef>    <paramdef>char *<parameter>requests</parameter></paramdef></funcprototype><funcprototype><funcdef>void <function>gps_set_raw_hook</function></funcdef>    <paramdef>struct gps_data_t *<parameter>gpsdata</parameter></paramdef>    <paramdef>void (*<parameter>hook</parameter>)(char *buf)</paramdef></funcprototype><funcprototype><funcdef>int <function>gps_poll</function></funcdef>    <paramdef>struct gps_data_t * <parameter>gpsdata</parameter></paramdef>    <paramdef>void *<parameter>raw_hook</parameter>(char *buf)</paramdef></funcprototype><funcprototype><funcdef>void <function>gps_close</function></funcdef>    <paramdef>struct gps_data_t *<parameter>gpsdata</parameter></paramdef></funcprototype><funcsynopsisinfo>Python:import gpssession = gps.gps(host="localhost", port="2947")session.set_raw_hook(raw_hook)session.query(commands)session.poll()del session</funcsynopsisinfo></funcsynopsis></refsynopsisdiv><refsect1 id='description'><title>DESCRIPTION</title><para><emphasis remap='B'>libgps</emphasis> is a service library whichsupports querying GPS devices; link it with the linker option-lgps. There are two interfaces supported in it; one high-levelinterface that goes through<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry>and is intended for concurrent use by several applications, and onelow-level interface that speaks directly with the serial or USB deviceto which the GPS is attached. This page describes the high-levelinterface is safe for multiple applications to use simultaneously; itis probably the one you want.  The low-level interface is documentedat<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para><para>Calling <function>gpsd_open()</function> initializes a GPS-datastructure to hold the data collected by the GPS, and returns a socketattached to<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry>. Negativereturn values indicate errors at the socket layer; see<filename>gps.h</filename> for values and explanations.</para><para><function>gpsd_close()</function> ends the session.</para><para><function>gpsd_query()</function> queries the daemon, accepts aone-line response, and updates parts of the GPS-data structure thatcorrespond to data changed since the last call.  The second argumentmust be a string containing letters from the command set documented at<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.This function returns a 1 if any data changed since the last query, a0 if no data changed, or a -1 if there was a Unix-level read error.</para><para><function>gpsd_poll()</function> accepts a one-line response fromthe daemon and interprets it as though it were a query response (thereturn value is as for a query).  It is meant to be used after theuser has issued an 'R' or 'W' command with<function>gpsd_query()</function>, telling the daemon to stream updatesto the client.  If the third argument is non-NULL, it is used as ahook function to be called on each line of streamed data. </para><para>Several member groups within the GPS-data structure havelast-modified timestamps and change-flag members associated with them;these get updated on each query or poll as well.Consult <filename>gps.h</filename> to learn about the data members and associated timestamps.</para><para>The Python implementation supports the same facilities as the Clibrary.  <function>gps_open()</function> is replaced by theinitialization of a gps session object; the other calls are methods ofthat object.  Resources within the session object will be properlyreleased when it is garbage-collected.</para></refsect1><refsect1 id='see_also'><title>SEE ALSO</title><para><citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>1</manvolnum></citerefentry><citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry></para></refsect1><refsect1 id='author'><title>AUTHOR</title><para>Eric S. Raymond &lt;esr@thyrsus.com&gt;.</para></refsect1></refentry>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -