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

📄 libgps.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 NAMElibgps \- service library for communicationg with the GPS daemon.SH "SYNOPSIS".ad l.hy 0C:#include <gps\&.h>.sp.HP 30struct\ gps_data_t\ *\fBgps_open\fR\ (char\ *\fIserver\fR, char\ *\ \fIport\fR);.HP 15int\ \fBgps_query\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR, char\ *\fIrequests\fR);.HP 23void\ \fBgps_set_raw_hook\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR, void\ (*\fIhook\fR)(char\ *buf));.HP 14int\ \fBgps_poll\fR\ (struct\ gps_data_t\ *\ \fIgpsdata\fR, void\ *\fIraw_hook\fR(char\ *buf));.HP 16void\ \fBgps_close\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR);Python:import gpssession = gps\&.gps(host="localhost", port="2947")session\&.set_raw_hook(raw_hook)session\&.query(commands)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 high\-level interface is safe for multiple applications to use simultaneously; it is probably the one you want\&. The low\-level interface is documented at \fBlibgps\fR(3)\&..PPCalling \fBgpsd_open()\fR initializes a GPS\-data structure to hold the data collected by the GPS, and returns a socket attached to \fBgpsd\fR(1)\&. Negative return values indicate errors at the socket layer; see \fIgps\&.h\fR for values and explanations\&..PP\fBgpsd_close()\fR ends the session\&..PP\fBgpsd_query()\fR queries the daemon, accepts a one\-line response, and updates parts of the GPS\-data structure that correspond to data changed since the last call\&. The second argument must be a string containing letters from the command set documented at \fBgpsd\fR(1)\&. This function returns a 1 if any data changed since the last query, a 0 if no data changed, or a \-1 if there was a Unix\-level read error\&..PP\fBgpsd_poll()\fR accepts a one\-line response from the daemon and interprets it as though it were a query response (the return value is as for a query)\&. It is meant to be used after the user has issued an 'R' or 'W' command with \fBgpsd_query()\fR, telling the daemon to stream updates to the client\&. If the third argument is non\-NULL, it is used as a hook function to be called on each line of streamed data\&..PPSeveral member groups within the GPS\-data structure have last\-modified timestamps and change\-flag members associated with them; these get updated on each query or poll as well\&. Consult \fIgps\&.h\fR to learn about the data members and associated timestamps\&..PPThe Python implementation supports the same facilities as the C library\&. \fBgps_open()\fR is replaced by the initialization of a gps 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)  \fBlibgps\fR(3) .SH "AUTHOR".PPEric S\&. Raymond <esr@thyrsus\&.com>\&.

⌨️ 快捷键说明

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