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

📄 libgpsd.3

📁 很好的一个gps daemon驱动,简单实用
💻 3
字号:
.\"Generated by db2man.xsl. Don't modify this, modify the source..de Sh \" Subsection.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Ip \" List item.br.ie \\n(.$>=3 .ne \\$3.el .ne 3.IP "\\$1" \\$2...TH "3" 3 "14 Aug 2004" "" "".SH NAMElibgpsd \- service library for GPS applications.SH "SYNOPSIS".ad l.hy 0C:#include <gpsd\&.h>.sp.HP 16void\ \fBgpsd_init\fR\ (struct\ gps_t\ *\ \fIsession\fR, char\ \fIdevtype\fR, char\ *\ \fIdgpsserver\fR);.HP 19int\ \fBgpsd_activate\fR\ (struct\ gps_t\ *\ \fIsession\fR);.HP 22void\ \fBgpsd_deactivate\fR\ (struct\ gps_t\ *\ \fIsession\fR);.HP 15int\ \fBgpsd_poll\fR\ (struct\ gps_t\ *\ \fIsession\fR);.HP 16void\ \fBgpsd_wrap\fR\ (struct\ gps_t\ *\ \fIsession\fR);.HP 18void\ \fBgpsd_report\fR\ (int\ \fId\fR, const\ char\ *\ \fIfmt\fR, \fI\&.\&.\&.\fR);Python:import gpsdsession = gpsd\&.gpsd(device="/dev/gps", bps=4800,                 devtype='n', dgps=None, logger=None)session\&.activate()session\&.deactivate()session\&.set_raw_hook(hook=None)session\&.poll()del session.sp.ad.hy.SH "DESCRIPTION".PPlibgps 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 \fBgpsd\fR(1) 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 \fBgpsd\fR(1) itself uses\&. See \fBgpsd\fR(3) for a description of the high\-level interface, which is almost certainly what you want\&..PPCalling \fBgpsd_init()\fR initializes a session structure to hold the data collected by the GPS\&..PPYou must specify a device type by key letter; to list key letters, run \fBgpsd \-h\fR\&. It is generally safe to specify 'n', as most modern GPSes speak NMEA\&..PPYou 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\&..PPAfter the session structure has been set up, you may modify some of its members\&..TPgpsd_deviceThis member should hold the path name of the device; it defaults to \fI/dev/gps\fR\&..TPbaudrateCommunication speed in bits per second\&. The default is set by the driver type\&..TPraw_hookA 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\&..PP\fBgpsd_activate()\fR initializes the connection to the GPS\&. \fBgpsd_deactivate()\fR 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\&..PP\fBgpsd_poll()\fR 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).PP\fBgpsd_wrap()\fR ends the session, implicitly performing a \fBgpsd_deactivate()\fR\&..PPThe calling application must define one additional function: \fBgpsd_report()\fR\&. 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\&..PPThe Python implementation supports the same facilities as the C library, but only for straight NMEA devices with a 1\-second send cycle (no Zodiac binary\-protocol support)\&. \fBgps_init()\fR is replaced by the initialization of a gpsd session object; the other calls are methods of that object\&. Resources within the session object will be properly released when it is garbage\-collected\&..SH "SEE ALSO".PP \fBgpsd\fR(1)  \fBlibgpsd\fR(3) .SH "AUTHOR".PPEric S\&. Raymond <esr@thyrsus\&.com> based partly on earlier work by Remco Treffkorn, Derrick Brashear, and Russ Nelson\&.

⌨️ 快捷键说明

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