summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-29 22:11:41 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-29 22:11:41 +0000
commitf8520b70ae0fa109c83459969331dab556cf36fe (patch)
tree1f5cebd08740818539fc045b18b463148350185c
parentca542608a24f07363895bf221497163e98d77d69 (diff)
downloadgpsd-f8520b70ae0fa109c83459969331dab556cf36fe.tar.gz
First version of gpsctrl, untested.
This will replace garminctl, sirfctl, and itraxctl.
-rw-r--r--Makefile.am45
-rw-r--r--gpsctrl.c129
-rw-r--r--gpsd.spec.in8
-rw-r--r--libgps.3208
-rw-r--r--libgps.xml4
5 files changed, 259 insertions, 135 deletions
diff --git a/Makefile.am b/Makefile.am
index b01be71c..f3f1c024 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,7 @@ RTCM104PROGS = rtcmdecode
RTCM104PAGES = rtcmdecode.1
endif
-bin_PROGRAMS = $(DBUSPROGS) $(MOTIF_PROGS) $(RTCM104PROGS) garminctl itraxctl sirfmon gpspipe gpsflash cgps cgpxlogger
+bin_PROGRAMS = $(DBUSPROGS) $(MOTIF_PROGS) $(RTCM104PROGS) gpsctrl gpspipe gpsflash cgps cgpxlogger sirfmon
sbin_PROGRAMS = gpsd
check_PROGRAMS = bits_test gpsmm_test packet_test
if HAVE_PYTHON
@@ -64,32 +64,22 @@ cgpxlogger_SOURCES = cgpxlogger.c
cgpxlogger_LDADD = $(LIBC) $(LIBNSL) $(LIBSOCKET) libgps.la -lm $(LIBPTHREAD)
#
-# Build garminctl
-#
-garminctl_SOURCES = garminctl.c
-garminctl_LDADD = $(LIBM) -lncurses libgps.la -lm $(LIBPTHREAD)
-
-#
# Build gpsd
#
-gpsd_SOURCES = \
- gpsd_dbus.h \
- gpsd_dbus.c \
- gpsd.c
+gpsd_SOURCES = gpsd_dbus.h gpsd_dbus.c gpsd.c
gpsd_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm $(LIBPTHREAD)
#
-# Build gpspipe
+# Build gpsctrl
#
-gpspipe_SOURCES = \
- gpspipe.c
-gpspipe_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm
+gpsctrl_SOURCES = gpsctrl.c
+gpsctrl_LDADD = $(LIBM) libgps.la -lm $(LIBPTHREAD)
#
-# Build itraxctl
+# Build gpspipe
#
-itraxctl_SOURCES = itraxctl.c
-itraxctl_LDADD = $(LIBM) -lncurses libgps.la -lm $(LIBPTHREAD)
+gpspipe_SOURCES = gpspipe.c
+gpspipe_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm
#
# Build sirfmon
@@ -189,8 +179,7 @@ man_MANS = \
sirfmon.1 \
$(RTCM104PAGES) \
$(PYTHONPAGES) \
- garminctl.1 \
- itraxctl.1 \
+ gpsctrl.1 \
gpspipe.1 \
gpsflash.1 \
rtcm-104.5 \
@@ -211,11 +200,8 @@ libgpsmm.3: libgpsmm.xml
libgpsd.3: libgpsd.xml
-$(XMLTO) man libgpsd.xml
-garminctl.1: garminctl.xml
- -$(XMLTO) man garminctl.xml
-
-itraxctl.1: itraxctl.xml
- -$(XMLTO) man itraxctl.xml
+gpsctrl.1: gpsctrl.xml
+ -$(XMLTO) man gpsctrl.xml
gpsprof.1: gpsprof.xml
-$(XMLTO) man gpsprof.xml
@@ -258,8 +244,7 @@ EXTRA_DIST = \
libgpsmm.xml \
gpsprof.xml \
gpsfake.xml \
- garminctl.xml \
- itraxctl.xml \
+ gpsctrl.xml \
sirfmon.xml \
gpspipe.xml \
rtcmdecode.xml \
@@ -296,10 +281,8 @@ splint:
-splint -exportlocal $(cgps_SOURCES)
@echo "Running splint on xgpsspeed..."
-splint -exportlocal $(xgpsspeed_c_sources)
- @echo "Running splint on garminctl..."
- -splint $(garminctl_SOURCES)
- @echo "Running splint on itraxctl..."
- -splint $(itraxctl_SOURCES)
+ @echo "Running splint on gpsctrl..."
+ -splint $(gpsctrl_SOURCES)
@echo "Running splint on sirfmon..."
-splint $(sirfmon_SOURCES)
@echo "Running splint on gpspipe..."
diff --git a/gpsctrl.c b/gpsctrl.c
new file mode 100644
index 00000000..337fa455
--- /dev/null
+++ b/gpsctrl.c
@@ -0,0 +1,129 @@
+/*
+ * gpsctrl.c -- tweak the control settings on a GPS
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <getopt.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "gpsd_config.h"
+#include "gps.h"
+
+int main(int argc, char **argv)
+{
+ int option, status;
+ char *err_str, *device = NULL, *speed = NULL;
+ char buf[80];
+ bool to_binary = false, to_nmea = false;
+ struct gps_data_t *gpsdata;
+
+ while ((option = getopt(argc, argv, "bhns:V")) != -1) {
+ switch (option) {
+ case 'b':
+ to_binary = true;
+ break;
+ case 'n':
+ to_nmea = true;
+ break;
+ case 's':
+ speed = optarg;
+ break;
+ case 'V':
+ (void)fprintf(stderr, "gpsctrl at svn revision $Rev$\n");
+ break;
+ case 'h':
+ default:
+ fprintf(stderr, "usage: gpsctrl [-b | -n] [-s speed] [-V]\n");
+ break;
+ }
+ }
+
+ if (optind < argc)
+ device = argv[optind];
+
+ if (to_nmea && to_binary) {
+ (void)fprintf(stderr, "gpsctrl: make up your mind, would you?\n");
+ exit(0);
+ }
+
+ if (speed==NULL && !to_nmea && !to_binary)
+ exit(0);
+
+ /* Open the stream to gpsd. */
+ /*@i@*/gpsdata = gps_open(NULL, NULL);
+ if (!gpsdata) {
+ switch (errno) {
+ case NL_NOSERVICE: err_str = "can't get service entry"; break;
+ case NL_NOHOST: err_str = "can't get host entry"; break;
+ case NL_NOPROTO: err_str = "can't get protocol entry"; break;
+ case NL_NOSOCK: err_str = "can't create socket"; break;
+ case NL_NOSOCKOPT: err_str = "error SETSOCKOPT SO_REUSEADDR"; break;
+ case NL_NOCONNECT: err_str = "can't connect to host"; break;
+ default: err_str = "Unknown"; break;
+ }
+ (void)fprintf( stderr,
+ "gpsctrl: no gpsd running or network error: %d, %s\n",
+ errno, err_str);
+ exit(2);
+ }
+
+ (void)gps_query(gpsdata, "k\n");
+ if (gpsdata->ndevices == 0) {
+ (void)fprintf(stderr, "gpsctrl: no devices connected.\n");
+ (void)gps_close(gpsdata);
+ exit(1);
+ } else if (gpsdata->ndevices > 1 && device == NULL) {
+ (void)fprintf(stderr,
+ "gpsctrl: multiple devices and no device specified.\n");
+ (void)gps_close(gpsdata);
+ exit(1);
+ }
+
+ if (gpsdata->ndevices > 1) {
+ int i;
+ assert(device != NULL);
+ for (i = 0; i < gpsdata->ndevices; i++)
+ if (strcmp(device, gpsdata->devicelist[i]) == 0)
+ goto foundit;
+ (void)fprintf(stderr, "gpsctrl: specified device not found.\n");
+ (void)gps_close(gpsdata);
+ exit(1);
+ foundit:
+ (void)strcpy(buf, "F=");
+ (void)strncat(buf, device, sizeof(buf)-3);
+ (void)strcat(buf, "\n");
+ (void)gps_query(gpsdata, buf);
+ }
+
+ status = 0;
+ if (to_nmea) {
+ (void)gps_query(gpsdata, "n=0\n");
+ if (gpsdata->driver_mode != 0) {
+ (void)fprintf(stderr, "gpsctrl: mode change failed\n");
+ status = 1;
+ }
+ }
+ else if (to_binary) {
+ (void)gps_query(gpsdata, "n=1\n");
+ if (gpsdata->driver_mode != 1) {
+ (void)fprintf( stderr, "gpsctrl: mode change failed\n");
+ status = 1;
+ }
+ }
+ if (speed != NULL) {
+ (void)strcpy(buf, "B=");
+ (void)strncat(buf, speed, sizeof(buf)-3);
+ (void)strcat(buf, "\n");
+ (void)gps_query(gpsdata, buf);
+ if (atoi(speed) != (int)gpsdata->baudrate) {
+ (void)fprintf( stderr, "gpsctrl: speed change failed\n");
+ status = 1;
+ }
+ }
+ (void)gps_close(gpsdata);
+ exit(status);
+}
diff --git a/gpsd.spec.in b/gpsd.spec.in
index fba72a2d..f707b6cf 100644
--- a/gpsd.spec.in
+++ b/gpsd.spec.in
@@ -91,6 +91,7 @@ cp gpsd.hotplug gpsd.usermap "$RPM_BUILD_ROOT"%{_sysconfdir}/hotplug/usb/
%defattr(-,root,root,-)
%doc README INSTALL COPYING
%attr(755, root, root) %{_sbindir}/gpsd
+%attr(755, root, root) %{_sbindir}/gpsctrl
%attr(755, root, root) %{_bindir}/gpsprof
%attr(755, root, root) %{_bindir}/sirfmon
%{_libdir}/libgps.la
@@ -99,6 +100,7 @@ cp gpsd.hotplug gpsd.usermap "$RPM_BUILD_ROOT"%{_sysconfdir}/hotplug/usb/
%{_mandir}/man8/gpsd.8*
%{_mandir}/man1/gpsprof.1*
%{_mandir}/man1/sirfmon.1*
+%{_mandir}/man1/gpsctrl.1*
%{_sysconfdir}/hotplug/usb/gpsd.hotplug
%{_sysconfdir}/hotplug/usb/gpsd.usermap
/usr/lib/python*/site-packages/gps.py*
@@ -149,9 +151,9 @@ cp gpsd.hotplug gpsd.usermap "$RPM_BUILD_ROOT"%{_sysconfdir}/hotplug/usb/
and client sessions. Eliminate use of fuser(1) in gpsfake. Get gpsd
working with EarthMates again, this had been broken since 2.15. Massive
string safety audit and OpenBSD port by Chris Kuethe. J command added.
- sirfctl, itraxctl and garminctl added. Switched to lesstif from openmotif.
- Better auto detection of DLE-le packet protocols, notaby TSIP and Garmin
- binary. Fixed buggy parsing and generation of PGRME.
+ The gpsctrl tool was added. Switched to lesstif from openmotif.
+ Better auto detection of DLE-le packet protocols, notaby TSIP and
+ Garmin binary. Fixed buggy parsing and generation of PGRME.
* Fri Jun 9 2006 Eric S. Raymond <esr@snark.thyrsus.com> - 2.33-1
- Fix bad unit conversion in V output. Clean up some man-page messes.
diff --git a/libgps.3 b/libgps.3
index d153cd38..a8583f71 100644
--- a/libgps.3
+++ b/libgps.3
@@ -1,117 +1,130 @@
-.\"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 NAME
+.\" ** You probably do not want to edit this file directly **
+.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
+.\" Instead of manually editing it, you probably should edit the DocBook XML
+.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
+.TH "3" "3" "14 Aug 2004" "Linux" "Linux"
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
libgps \- C service library for communicating with the GPS daemon
.SH "SYNOPSIS"
-.ad l
-.hy 0
-
-
+.PP
+\fB
C:
-#include <gps\&.h>
-
+#include <gps.h>
-.sp
-.HP 30
-struct\ gps_data_t\ *\fBgps_open\fR\ (char\ *\fIserver\fR, char\ *\ \fIport\fR);
-.HP 15
-int\ \fBgps_query\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR, char\ *\fIrequests\fR);
-.HP 23
-void\ \fBgps_set_raw_hook\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR, void\ (*\fIhook\fR)(struct\ gps_data_t\ *,\ char\ *buf));
+\fR
+.HP 28
+\fBstruct\ gps_data_t\ *\fBgps_open\fR\fR\fB(\fR\fBchar\ *\fR\fB\fIserver\fR\fR\fB, \fR\fBchar\ *\ \fR\fB\fIport\fR\fR\fB);\fR
.HP 14
-int\ \fBgps_poll\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR);
-.HP 16
-void\ \fBgps_close\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR);
-.HP 23
-void\ \fBgps_set_callback\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR, void\ (*\fIcallback\fR)(struct\ gps_data_t\ *sentence,\ char\ *buf), pthread_t\ *\fIhandler\fR);
-.HP 23
-void\ \fBgps_del_callback\fR\ (struct\ gps_data_t\ *\fIgpsdata\fR, pthread\ *\fIhandler\fR);
-.HP 18
-void\ \fBrtcm_unpack\fR\ (struct\ rtcm_t\ *\fIrtcmp\fR, char\ *\fIbuf\fR);
-
-
+\fBint\ \fBgps_query\fR\fR\fB(\fR\fBstruct\ gps_data_t\ *\fR\fB\fIgpsdata\fR\fR\fB, \fR\fBchar\ *\fR\fB\fIrequests\fR\fR\fB);\fR
+.HP 22
+\fBvoid\ \fBgps_set_raw_hook\fR\fR\fB(\fR\fBstruct\ gps_data_t\ *\fR\fB\fIgpsdata\fR\fR\fB, \fR\fBvoid\ (*\fR\fB\fIhook\fR\fR\fB)(struct\ gps_data_t\ *,\ char\ *buf)\fR\fB);\fR
+.HP 13
+\fBint\ \fBgps_poll\fR\fR\fB(\fR\fBstruct\ gps_data_t\ *\fR\fB\fIgpsdata\fR\fR\fB);\fR
+.HP 15
+\fBvoid\ \fBgps_close\fR\fR\fB(\fR\fBstruct\ gps_data_t\ *\fR\fB\fIgpsdata\fR\fR\fB);\fR
+.HP 22
+\fBvoid\ \fBgps_set_callback\fR\fR\fB(\fR\fBstruct\ gps_data_t\ *\fR\fB\fIgpsdata\fR\fR\fB, \fR\fBvoid\ (*\fR\fB\fIcallback\fR\fR\fB)(struct\ gps_data_t\ *sentence,\ char\ *buf)\fR\fB, \fR\fBpthread_t\ *\fR\fB\fIhandler\fR\fR\fB);\fR
+.HP 22
+\fBvoid\ \fBgps_del_callback\fR\fR\fB(\fR\fBstruct\ gps_data_t\ *\fR\fB\fIgpsdata\fR\fR\fB, \fR\fBpthread\ *\fR\fB\fIhandler\fR\fR\fB);\fR
+.HP 17
+\fBvoid\ \fBrtcm_unpack\fR\fR\fB(\fR\fBstruct\ rtcm_t\ *\fR\fB\fIrtcmp\fR\fR\fB, \fR\fBchar\ *\fR\fB\fIbuf\fR\fR\fB);\fR
+.PP
+\fB
Python:
import gps
-session = gps\&.gps(host="localhost", port="2947")
+session = gps.gps(host="localhost", port="2947")
-session\&.set_raw_hook(raw_hook)
+session.set_raw_hook(raw_hook)
-session\&.query(commands)
+session.query(commands)
-session\&.poll()
+session.poll()
del session
-
-.sp
-.ad
-.hy
-
+\fR
.SH "DESCRIPTION"
-
-.PP
-\fIlibgps\fR 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 that 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)\&.
-
-.PP
-Calling \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)\&. \fBgpsd_open()\fR returns NULL on errors\&. errno is set depending on the error returned from the the socket layer; see \fIgps\&.h\fR for values and explanations\&.
-
-.PP
-\fBgpsd_close()\fR ends the session\&.
-
-.PP
-\fBgpsd_poll()\fR accepts a response, or sequence of responses, from the daemon and interprets it as though it were a query response (the return value is as for a query)\&. \fBgpsd_poll()\fR returns the validity mask of the received structure\&. This function does a blocking read waiting for data from the daemon; it returns 0 for success, or \-1 on a Unix\-level read error\&.
-
.PP
-\fBgpsd_query()\fR writes a command to 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 0 on success, or a \-1 if there was a Unix\-level read error\&.
-
-.PP
-\fBgps_set_raw_hook()\fR takes a function you specify and run it (synchronously) on the raw data pulled by a \fBgpsd_query()\fR or \fBgpsd_poll()\fR call\&. The arguments passed to this hook will be a pointer to a structure containing parsed data, and a buffer containining the raw gpsd response\&.
-
-.PP
-\fBgps_set_callback()\fR takes a function you specify and run it asynchronously each time new data arrives from gpsd, using POSIX threads\&. For example, you can call gps_set_callback(gpsdata, my_function, handler) once in your program, and from there on your gpsdata structure will be parsed by your \fBmy_function()\fR each time new data are available\&. \fBmy_function()\fR could change some global variables in your program based on received data; it is your responsibility to ensure that your program uses mutexes or other mechanisms to avoid race conditions\&.
-
-.PP
-\fBgps_del_callback()\fR deregisters the callback function previously set with \fBgps_set_callback()\fR\&. After the invocation of this funcion no operation will be done when new data arrives\&.
-
-.PP
-Consult \fIgps\&.h\fR to learn more about the data members and associated timestamps\&. Note that information will accumulate in the session structure over time, and the 'valid' field is not automatically zeroed by each poll\&. It is up to the client to zero that field when appropriate and to keep an eye on the fix and sentence timestamps\&.
-
-.PP
-The \fBrtcm_unpack()\fR will be useful when you are connected to an RTCM\-104 source in raw mode\&. Use it as part of a raw hook, calling it with the address of the struct rtcm_t element of your session structure buffer as first argument and the buffer as the second\&. It will unpack a line of RTCM data into the structure\&. This function returns 0 when it has read the last line of an RTCM\-104 message, a positive int when it expects more dump lines, and a negative int on parse failure\&. You must zero out the struct rtcm_t each time before this function is called on a new header (H) line, as it relies on the message type field being initially zero and uses it to track what kind of following line is expected\&.
-
-.PP
-The 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, and have the same names as the corresponding C functions\&. Resources within the session object will be properly released when it is garbage\-collected\&.
-
+\fIlibgps\fR
+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 that is safe for multiple applications to use simultaneously; it is probably the one you want. The low\-level interface is documented at
+\fBlibgpsd\fR(3).
+.PP
+Calling
+\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).
+\fBgpsd_open()\fR
+returns NULL on errors. errno is set depending on the error returned from the the socket layer; see
+\fIgps.h\fR
+for values and explanations.
+.PP
+\fBgpsd_close()\fR
+ends the session.
+.PP
+\fBgpsd_poll()\fR
+accepts a response, or sequence of responses, from the daemon and interprets it as though it were a query response (the return value is as for a query).
+\fBgpsd_poll()\fR
+returns the validity mask of the received structure. This function does a blocking read waiting for data from the daemon; it returns 0 for success, or \-1 on a Unix\-level read error.
+.PP
+\fBgpsd_query()\fR
+writes a command to 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 0 on success, or a \-1 if there was a Unix\-level read error.
+.PP
+\fBgps_set_raw_hook()\fR
+takes a function you specify and run it (synchronously) on the raw data pulled by a
+\fBgpsd_query()\fR
+or
+\fBgpsd_poll()\fR
+call. The arguments passed to this hook will be a pointer to a structure containing parsed data, and a buffer containining the raw
+gpsd
+response.
+.PP
+\fBgps_set_callback()\fR
+takes a function you specify and run it asynchronously each time new data arrives from
+gpsd, using POSIX threads. For example, you can call gps_set_callback(gpsdata, my_function, handler) once in your program, and from there on your gpsdata structure will be parsed by your
+\fBmy_function()\fR
+each time new data are available.
+\fBmy_function()\fR
+could change some global variables in your program based on received data; it is your responsibility to ensure that your program uses mutexes or other mechanisms to avoid race conditions.
+.PP
+\fBgps_del_callback()\fR
+deregisters the callback function previously set with
+\fBgps_set_callback()\fR. After the invocation of this funcion no operation will be done when new data arrives.
+.PP
+Consult
+\fIgps.h\fR
+to learn more about the data members and associated timestamps. Note that information will accumulate in the session structure over time, and the 'valid' field is not automatically zeroed by each poll. It is up to the client to zero that field when appropriate and to keep an eye on the fix and sentence timestamps.
+.PP
+The
+\fBrtcm_unpack()\fR
+will be useful when you are connected to an RTCM\-104 source in raw mode. Use it as part of a raw hook, calling it with the address of the
+struct rtcm_t
+element of your session structure buffer as first argument and the buffer as the second. It will unpack a line of RTCM data into the structure. This function returns 0 when it has read the last line of an RTCM\-104 message, a positive int when it expects more dump lines, and a negative int on parse failure. You must zero out the
+struct rtcm_t
+each time before this function is called on a new header (H) line, as it relies on the message type field being initially zero and uses it to track what kind of following line is expected.
+.PP
+The 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, and have the same names as the corresponding C functions. Resources within the session object will be properly released when it is garbage\-collected.
.SH "CODE EXAMPLE"
-
.PP
-The following is an excerpted and simplified version of the libgps interface code from \fBgps\fR(1)\&. The function \fBhandle_input()\fR is a trivial pies of code that calls gps_poll(gpsdata)\&.
-
+The following is an excerpted and simplified version of the libgps interface code from
+\fBgps\fR(1). The function
+\fBhandle_input()\fR
+is a trivial pies of code that calls gps_poll(gpsdata).
+.sp
.nf
-
gpsdata = gps_open(server, port);
build_gui(toplevel);
@@ -125,16 +138,13 @@ The following is an excerpted and simplified version of the libgps interface cod
(void)XtAppMainLoop(app);
(void)gps_close(gpsdata);
-
.fi
-
.SH "SEE ALSO"
-
.PP
- \fBgpsd\fR(8), \fBgps\fR(1), \fBlibgps\fR(3)\&. \fBlibgpsmm\fR(3)\&.
-
+\fBgpsd\fR(8),
+\fBgps\fR(1),
+\fBlibgps\fR(3).
+\fBlibgpsmm\fR(3).
.SH "AUTHOR"
-
.PP
-Eric S\&. Raymond <esr@thyrsus\&.com>, Thread\-callback methods in the C binding added by Alfredo Pironti <alfredio@users\&.sourceforge\&.net>\&.
-
+Eric S. Raymond <esr@thyrsus.com>, Thread\-callback methods in the C binding added by Alfredo Pironti <alfredo@users.sourceforge.net>.
diff --git a/libgps.xml b/libgps.xml
index 6dbf8ed6..6b2d37a8 100644
--- a/libgps.xml
+++ b/libgps.xml
@@ -94,7 +94,7 @@ to which the GPS is attached. This page describes the high-level
interface that is safe for multiple applications to use simultaneously; it
is probably the one you want. The low-level interface is documented
at
-<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
+<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para>Calling <function>gpsd_open()</function> initializes a GPS-data
structure to hold the data collected by the GPS, and returns a socket
@@ -213,7 +213,7 @@ code that calls gps_poll(gpsdata).
<refsect1 id='author'><title>AUTHOR</title>
<para>Eric S. Raymond &lt;esr@thyrsus.com&gt;, Thread-callback methods
in the C binding added by Alfredo Pironti
-&lt;alfredio@users.sourceforge.net&gt;.</para>
+&lt;alfredo@users.sourceforge.net&gt;.</para>
</refsect1>
</refentry>