Browse Source

Imported Upstream version 2.38

master
Bernd Zeimetz 11 years ago
parent
commit
5b5f63bb28
100 changed files with 40476 additions and 37749 deletions
  1. +5
    -1
      INSTALL
  2. +85
    -43
      Makefile.am
  3. +282
    -208
      Makefile.in
  4. +486
    -0
      NEWS
  5. +3
    -5
      README
  6. +13
    -64
      TODO
  7. +5
    -5
      Tachometer.h
  8. +5
    -5
      TachometerP.h
  9. +6646
    -5099
      aclocal.m4
  10. +9
    -3
      autogen.sh
  11. +71
    -0
      bits.c
  12. +44
    -39
      bits.h
  13. +110
    -63
      bits_test.c
  14. +1
    -6
      bsd-base64.c
  15. +2
    -2
      bsd-base64.h
  16. +68
    -7
      cgps.c
  17. +86
    -24
      config.guess
  18. +122
    -39
      config.sub
  19. +16761
    -21642
      configure
  20. +201
    -106
      configure.ac
  21. +182
    -0
      crc24q.c
  22. +12
    -0
      crc24q.h
  23. +26
    -34
      depcomp
  24. +12
    -10
      dgnss.c
  25. +11
    -5
      dgpsip.c
  26. +6
    -7
      display.c
  27. +4
    -0
      display.h
  28. +92
    -83
      driver_proto.c
  29. +390
    -125
      drivers.c
  30. +45
    -36
      evermore.c
  31. +192
    -167
      garmin.c
  32. +5
    -2
      garmin_txt.c
  33. +2
    -37
      geoid.c
  34. +42
    -0
      geoid_test.c
  35. +115
    -111
      gps.1
  36. +312
    -19
      gps.h
  37. +306
    -307
      gps.py
  38. +9
    -0
      gps.xml
  39. +1497
    -0
      gpscap.ini
  40. +139
    -0
      gpscap.py
  41. +29
    -6
      gpscat
  42. +64
    -56
      gpscat.1
  43. +115
    -69
      gpsctl.1
  44. +282
    -108
      gpsctl.c
  45. +85
    -6
      gpsctl.xml
  46. +468
    -318
      gpsd.8
  47. +117
    -57
      gpsd.c
  48. +0
    -503
      gpsd.h
  49. +4
    -4
      gpsd.h-head
  50. +62
    -24
      gpsd.h-tail
  51. +4
    -1
      gpsd.hotplug
  52. +18
    -5
      gpsd.php
  53. +1
    -1
      gpsd.spec
  54. +138
    -118
      gpsd.xml
  55. +25
    -3
      gpsd_config.h.in
  56. +30
    -9
      gpsd_dbus.c
  57. +6
    -6
      gpsd_dbus.h
  58. +544
    -0
      gpsdlcdd.c
  59. +11
    -8
      gpsfake
  60. +95
    -80
      gpsfake.1
  61. +59
    -165
      gpsfake.py
  62. +46
    -64
      gpsflash.1
  63. +15
    -13
      gpsflash.c
  64. +7
    -6
      gpsflash.h
  65. +38
    -0
      gpslib.c
  66. +23
    -7
      gpspacket.c
  67. +78
    -61
      gpspipe.1
  68. +113
    -19
      gpspipe.c
  69. +17
    -0
      gpspipe.xml
  70. +64
    -80
      gpsprof.1
  71. +2
    -2
      gpsutils.c
  72. +94
    -4
      hex.c
  73. +283
    -213
      install-sh
  74. +20
    -17
      isgps.c
  75. +76
    -70
      italk.c
  76. +4
    -1
      italk.h
  77. +122
    -93
      libgps.3
  78. +21
    -12
      libgps.c
  79. +14
    -2
      libgps.xml
  80. +62
    -79
      libgpsd.3
  81. +149
    -116
      libgpsd_core.c
  82. +38
    -51
      libgpsmm.3
  83. +5
    -5
      libgpsmm.h
  84. +6852
    -5832
      ltmain.sh
  85. +8
    -15
      missing
  86. +0
    -40
      mkinstalldirs
  87. +470
    -450
      navcom.c
  88. +5
    -1
      netlib.c
  89. +127
    -40
      nmea_parse.c
  90. +3
    -3
      ntpshm.c
  91. +29
    -17
      ntrip.c
  92. +286
    -130
      packet.c
  93. +0
    -135
      packet_names.h
  94. +24
    -6
      packet_states.h
  95. +39
    -9
      packet_test.c
  96. +157
    -207
      rtcm-104.5
  97. +63
    -28
      rtcm-104.xml
  98. +37
    -33
      rtcm2.c
  99. +51
    -37
      rtcm2.h
  100. +473
    -0
      rtcm3.c

+ 5
- 1
INSTALL View File

@@ -144,4 +144,8 @@ file called 'gpsd_config.inc' containing configuration information;
edit to taste. Note that for the Google Maps feature work you need
to set a valid Google API key in your config file.


13. There are regression tests to verify proper operation of gpsd, and
it can be useful to run these to verify that all is well. To run the
regression tests, first build gpsd from sources, and then run "make
testregress". It is not necessary to install first. Python is
required for regression tests.

+ 85
- 43
Makefile.am View File

@@ -1,16 +1,22 @@
# Automake description for gpsd
# $Id: Makefile.am 4683 2008-02-17 02:25:36Z ckuethe $
# $Id: Makefile.am 5108 2009-01-30 18:30:34Z esr $

#SUBDIRS = contrib

XMLTO = xmlto

#
# Build stuff depending on Motif
# Conditionally add programs depending on libraries that may or may not be present.
#
if HAVE_NCURSES
CURSESPROGS = cgps sirfmon
endif
if HAVE_MOTIF
MOTIF_PROGS = xgps xgpsspeed
MOTIF_PROGS = xgps
endif
if HAVE_XAW
XAW_PROGS = xgpsspeed
endif

XMLTO = xmlto

if HAVE_DBUS
INCLUDES = $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_API_SUBJECT_TO_CHANGE=1
@@ -18,22 +24,18 @@ DBUSPROGS = gpxlogger
gpxlogger_LDADD = $(DBUS_GLIB_LIBS) libgps.la -lm
endif

if HAVE_RTCM104
if HAVE_RTCM104V2
RTCM104PROGS = rtcmdecode
RTCM104PAGES = rtcmdecode.1
endif


if HAVE_NCURSES
CURSESPROGS = cgps sirfmon
endif
bin_PROGRAMS = $(DBUSPROGS) $(MOTIF_PROGS) $(RTCM104PROGS) $(CURSESPROGS) gpsctl gpspipe gpsflash cgpxlogger
bin_PROGRAMS = $(DBUSPROGS) $(MOTIF_PROGS) $(XAW_PROGS) $(RTCM104PROGS) $(CURSESPROGS) gpsctl gpspipe gpsflash cgpxlogger gpsdlcdd
sbin_PROGRAMS = gpsd
check_PROGRAMS = bits_test gpsmm_test packet_test mkgmtime_test
check_PROGRAMS = bits_test gpsmm_test packet_test mkgmtime_test geoid_test
if HAVE_PYTHON
dist_bin_SCRIPTS = gpsprof gpsfake gpscat
python_PYTHON = gps.py gpsfake.py
nodist_python_PYTHON = gpspacket.so
python_PYTHON = gps.py gpsfake.py gpscap.py
nodist_python_PYTHON = gpspacket.so gpslib.so
PYTHONPAGES = gpsprof.1 gpsfake.1 gpscat.1
endif

@@ -54,13 +56,13 @@ xgpsspeed_c_sources = \
xgpsspeed_SOURCES = \
$(xgpsspeed_c_sources) \
xgpsspeed.icon
xgpsspeed_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XAW_LIBS) $(XM_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)
xgpsspeed_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(XAW_LIBS) $(X_LIBS) $(X_PRE_LIBS) libgps.la -lm $(LIBPTHREAD)

#
# Build cgps
#
cgps_SOURCES = cgps.c
cgps_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) -lncurses libgps.la -lm $(LIBPTHREAD)
cgps_LDADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD)

#
# Build cgpxlogger
@@ -87,11 +89,17 @@ gpsctl_LDADD = $(LIBM) libgps.la -lm $(LIBPTHREAD)
gpspipe_SOURCES = gpspipe.c
gpspipe_LDADD = $(DBUS_LIBS) $(LIBM) libgps.la -lm

#
# Build gpsdlcdd
#
gpsdlcdd_SOURCES = gpsdlcdd.c
gpsdlcdd_LDADD = $(LIBM) libgps.la -lm

#
# Build sirfmon
#
sirfmon_SOURCES = sirfmon.c
sirfmon_LDADD = $(LIBM) -lncurses libgps.la -lm $(LIBPTHREAD)
sirfmon_LDADD = $(LIBM) $(NCURSES_LIBS) libgps.la -lm $(LIBPTHREAD)

#
# Build rtcmdecode
@@ -126,9 +134,11 @@ libgpsd_c_sources = \
dgpsip.c \
ntrip.c \
sirf.c \
superstar2.c \
report.c \
isgps.c \
rtcm.c \
rtcm2.c \
rtcm3.c \
srecord.c \
bsd-base64.c \
strl.c \
@@ -141,29 +151,31 @@ libgpsd_c_sources = \
tsip.c \
evermore.c \
italk.c \
navcom.c
navcom.c \
bits.c \
crc24q.c

libgpsd_h_sources = \
italk.h \
bsd-base64.h \
timebase.h \
bits.h \
packet_names.h \
rtcm.h \
gpsd.h
rtcm2.h \
crc24q.h

BUILT_SOURCES = packet_names.h gpsd.h

packet_names.h: packet_states.h
sed -e '/^ *\([A-Z][A-Z0-9_]*\),/s// "\1",/' -e '/_states/s//_names/' < `test -f 'packet_states.h' || echo '$(srcdir)/'`packet_states.h > packet_names.h

gpsd.h: gpsd.h-head gpsd.h-tail gpsd_config.h
cp gpsd.h-head gpsd.h
cat $(srcdir)/gpsd.h-head >gpsd.h
grep VERSION gpsd_config.h >>gpsd.h
grep ENABLE gpsd_config.h >>gpsd.h
cat gpsd.h-tail >>gpsd.h
cat $(srcdir)/gpsd.h-tail >>gpsd.h

libgps_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
rtcm.h libgpsmm.cpp packet_states.h
rtcm2.h libgpsmm.cpp packet_states.h
nodist_libgps_la_SOURCES = packet_names.h
libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)

@@ -173,10 +185,10 @@ libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)
# install may require --root depending on what you're doing.
# python setup.py install --root=$DESTIR --prefix=$PREFIX
if HAVE_PYTHON
PYEXTENSIONS = gpspacket.so
noinst_SCRIPTS = gpspacket.so setup.py
PYEXTENSIONS = gpspacket.so gpslib.so
noinst_SCRIPTS = gpspacket.so gpslib.so setup.py

gpspacket.so: gpspacket.c libgps.la
gpspacket.so gpslib.so: gpspacket.c gpslib.c libgps.la
(pwd="`pwd`"; cd $(srcdir) && $(PYTHON) setup.py build_ext --build-lib "$$pwd" --build-temp "$$pwd/build" --include-dirs "$$pwd")
endif
# Clean up after Python
@@ -202,7 +214,13 @@ packet_test_SOURCES = packet_test.c
packet_test_LDADD = $(LIBC) libgps.la -lm

#
# Build packets tester
# Build geoid model tester
#
geoid_test_SOURCES = geoid_test.c
geoid_test_LDADD = $(LIBC) libgps.la -lm

#
# Build time functions tester
#
mkgmtime_test_SOURCES = mkgmtime_test.c
mkgmtime_test_LDADD = $(LIBC) libgps.la -lm
@@ -284,6 +302,7 @@ EXTRA_DIST = \
INSTALL \
COPYING \
TODO \
NEWS \
AUTHORS \
dgpsip-servers \
floattest.c \
@@ -314,29 +333,30 @@ EXTRA_DIST = \
valgrind-audit \
valgrind-suppressions \
gpspacket.c \
gpslib.c \
driver_proto.c \
logextract \
striplog \
setup.py \
packet_states.h \
libgps.pc.in \
libgpsd.pc.in
libgpsd.pc.in \
gpscap.ini

CLEANFILES = $(BUILT_SOURCES) floattest *.core $(PYEXTENSIONS)

pkgconfig_DATA = libgps.pc libgpsd.pc
pkgconfigdir = $(libdir)/pkgconfig

# This is not distributed
# These are not distributed
libgps: libgps.c .libs/libgps.a
$(CC) $(CFLAGS) -o libgps -lm -DTESTMAIN $(LIBPTHREAD) -g libgps.c .libs/libgps.a

# Report splint warnings
SPLINTOPTS = -I/usr/include/dbus-1.0/
splint:
SPLINTOPTS = -I/usr/include/dbus-1.0/ +quiet
splint: gpsd.h packet_names.h
@echo "Running splint on daemon and libraries..."
@echo "Expect 'gpsd.c:230:39: Line expects to suppress 1 error, found 0 errors'"
-splint $(SPLINTOPTS) -redef $(gpsd_c_sources) $(libgpsd_c_sources)
-splint $(SPLINTOPTS) -exportlocal -redef $(gpsd_c_sources) $(libgpsd_c_sources)
@echo "Running splint on xgps..."
-splint $(SPLINTOPTS) -exportlocal $(xgps_SOURCES)
@echo "Running splint on cgps..."
@@ -357,10 +377,12 @@ splint:
-splint $(SPLINTOPTS) $(bits_test_SOURCES)
@echo "Running splint on packet_test test harness..."
-splint $(SPLINTOPTS) $(packet_test_SOURCES)
@echo "Running splint on geoid_test test harness..."
-splint $(SPLINTOPTS) $(geoid_test_SOURCES)

# Bogon-checking the Python tools
pychecker:
for f in gps.py gpsfake.py; do pychecker $$f; done
for f in gps.py gpsfake.py leapsecond.py; do pychecker $$f; done

version:
@echo $(VERSION)
@@ -389,11 +411,15 @@ raw-regress:
gps-makeregress: gpsd
$(srcdir)/regress-driver -b $(srcdir)/test/stable/*.log

# To build an individual test for a load named foo.log, put it in
# test/stable and do this:
# regress-driver -b test/stable/foo.log

# Regression-test the RTCM decoder.
rtcm-regress: rtcmdecode
@echo "Testing RTCM decoding..."
@mkdir -p test
@for f in $(srcdir)/test/*.rtcm; do \
@for f in $(srcdir)/test/*.rtcm2; do \
echo "Testing $${f}..."; \
$(srcdir)/rtcmdecode <$${f} >test/test.chk; \
diff -ub $${f}.chk test/test.chk; \
@@ -402,7 +428,7 @@ rtcm-regress: rtcmdecode

# Rebuild the RTCM regression tests.
rtcm-makeregress: rtcmdecode
@for f in $(srcdir)/test/*.rtcm; do \
@for f in $(srcdir)/test/*.rtcm2; do \
$(srcdir)/rtcmdecode < $${f} > $${f}.chk; \
done

@@ -416,6 +442,16 @@ packet-makeregress: packet_test
@mkdir -p test
$(srcdir)/packet_test >test/packet.test.chk

# Regression-test the geoid tester.
geoid-regress: geoid_test
@echo "Testing the geoid model..."
@$(srcdir)/geoid_test 37.371192 122.014965 | diff -u $(srcdir)/test/geoid.test.chk -

# Rebuild the packet-getter regression test
geoid-makeregress: geoid_test
@mkdir -p test
$(srcdir)/geoid_test 37.371192 122.014965 >test/geoid.test.chk

# Test RTCM encoding using passthrough mode.
undump-regress: rtcmdecode
@echo "Testing RTCM encoding..."
@@ -426,12 +462,18 @@ undump-regress: rtcmdecode

# Regression-test the calendar functions
time_regress: mkgmtime_test
mkgmtime_test
./mkgmtime_test

# Do all normal regression tests
testregress: gps-regress rtcm-regress packet-regress undump-regress time_regress
@echo "Regressions complete."

# We would like "${MAKE} check" to run the regression tests. automake
# appears to have support for running programs, but not make targets.
# Perhaps the tests should be moved into scripts, but then it's not
# clear how to deal with $(srcdir).
# TESTS=testregress

#
# Productions for testing unstable drivers.
#
@@ -448,15 +490,15 @@ unstable-makeregress: gpsd
# This is how to ship a release to Berlios incomoing.
# It requires developer access verified via ssh.
#
upload-ftp:
sha1 gpsd-$(VERSION).tar.gz >gpsd.sum
lftp -c "mput gpsd-$(VERSION).tar.gz gpsd.sum" ftp://ftp.berlios.de/incoming
upload-ftp: dist
shasum gpsd-$(VERSION).tar.gz >gpsd.sum
lftp -c "open ftp://ftp.berlios.de/incoming; mput gpsd-$(VERSION).tar.gz gpsd.sum"

#
# This is how to tag a release for the SVN repository.
# It requires developer access verified via ssh.
#
REPO=http://svn.berlios.de/svnroot/repos/gpsd
REPO=https://svn.berlios.de/svnroot/repos/gpsd
svn-tag:
svn copy $(REPO)/trunk $(REPO)/tags/release-$(VERSION) \
-m "Tagged for external release $(VERSION)"


+ 282
- 208
Makefile.in
File diff suppressed because it is too large
View File


+ 486
- 0
NEWS View File

@@ -0,0 +1,486 @@
* Tue Feb 10 Eric S. Raymond <esr@snark.thyrsus.com> - 2.38
Regression test load for RoyalTek RGM3800 and Blumax GPS-009 added.
Scaling on E error-estimate fields fixed to match O. Listen on
localhost only by default to avoid security problems; this can be
overridden with the -G command-line option. The packet-state machine
can now recognize RTCM3 packets, though support is not yet complete.
Added support for ublox5 and mkt-3301 devices. Add a wrapper around
gpsd_hexdump to save CPU. Lots of little fixes to various packet
parsers. Always keep the device open: "-n" is not optional any more.
xgpsspeed no longer depends on Motif. gpsctl can now ship arbitrary
payloads to a device. It's possible to send binary through the
control channel with the new "&" command. Experimental new driver
for Novatel SuperStarII. The 'g' mode switch command now requires,
and returns, 'rtcm104v2' rather than 'rtcm104'; this is design forward
for when RTCM104v2 is fully working.

* Sun Feb 17 2008 Chris Kuethe <ckuethe@mail.berlios.de> - 2.37
The C++ bindings, Garmin USB support, and multiple instances of ntp
pps thread starting were fixed. Handling of odd PPS signals was
improved. The eye candy in the PHP visualizers was fixed.

* Tue Jan 1 2008 Eric S. Raymond <esr@snark.thyrsus.com> - 2.36
Urgent fix to leap-day calculation affecting dates from today to
28 Feb on generic NMEA GPSes, Zodiacs, and SirFs emitting message 0x62.
Integrated Garmin Simple Text Protocol driver from Peter Slansky.
Minor fixes in error modeling and a better NaN guard stabilize the
Trimble regression tests. Remove the wired-in NTP time offset from the
NMEA driver, this could only have worked by accident and should be
set in ntpd.conf. Integrated Ashtech driver from Chris Kuethe.

* Mon Dec 10 2007 Eric S. Raymond <esr@snark.thyrsus.com> - 2.35-1
Navcom driver merged. Removed -d -f and -p options of gpsd; these
have been undocumented for a while. Make gpsd play well with pkgconfig.
Incorrect computation of VDOP when GPSes didn't supply it has been fixed.
The xgps code has been revamped and now has a much nicer interface.
Add -b (no-configuration) option as a sadly clumsy workaround for some
problems with Bluetooth receivers. Added tests for Haicom-305N and Pharos
360; separated out the tests for the unstable Trimble drivers.
32-vs-64-bit problems in the regression tests have been solved.

* Thu Dec 14 2006 Eric S. Raymond <esr@snark.thyrsus.com> - 2.34-1
Fix for byte-swapping of Zodiac control messages on big-endian hardware.
Disable iTalk by default and note that it needs to be tested. Command line
arguments can now be DGPSIP or NTRIP URLs; -d is deprecated. Added udev
rules. Address excessive processor and memory utilization on SBCs; it's
now possible to configure compile-time limits on the number of devices
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.
The gpsctl and gpscat tools and the gpsd.phps script were added. Switched
to lesstif from openmotif. Better autodetection of DLE-led packet
protocols (notably TSIP and Garmin binary) and of SiRFStar I and III
devices. 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.
Fixed buggy libgps parsing of multiple responses. It's now possible
to lock gpsd to a fixed speed at compile time for embedded use. Added
NTRIP support, thanks to Ville Nuorvala. O command now ships an
explicit mode field.

* Sun Mar 12 2006 Eric S. Raymond <esr@snark.thyrsus.com> - 2.32-1
Cleanup of the xgps layout, and minor memory-leak fixes for xgps. Fix
to cope with Antares uBlox by Andreas Stricker. Minor fix to libgps
cgpxlogger. Merge cgpxlogger and gpxlogger documentation onto
the xgps(1) manual page and rename it gps(1).

* Fri Feb 17 2006 Eric S. Raymond <esr@snark.thyrsus.com> - 2.31-1
Now builds and runs under Cygwin. Correct the speed units in
synthetic NMEA. Slightly better time handling under NMEA. Daemon
now builds with all but NMEA disabled. Update the leap-second
offset. cgpxlogger introduced. Upgrade gpxlogger to DBUS 0.60
conformance. Jason von Nieda's patch may fix the chronic TSIP
driver problems.

* Wed Sep 14 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.30-1
Prevent core dump on -d option. The .log extension is no longer required for
test loads. cgps and xgps now have configurable latitude/longitude formats
via the -l option. Introduced new 'g' command that allows clients to
specify whether they want GPS or RTCM104 information.

* Fri Aug 19 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.29-1
Added Sony CXD2951 support, untested. All error estimates are
now nailed to 95% confidence interval. Added rtcmdecode and its
documentation; also, gpsd can now monitor serial devices emitting
RTCM104 and display differential-GPS data in a readable format.
Added dangerous alpha version of gpsflash. Work around a nasty bug
in SiRFStar III firmware version < 3.1.1. Added support for True
North Technologies Revolution 2X Digital compass. Added the
gpxlogger client for systems with DBUS support and the gpspipe
and cgps clients for general use.

* Wed Jul 6 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.28-1
The 2.27 source tarball somehow got truncated on upload.
Due to procedural mechanics at berlios.de, shipping a new release
seems to be the least painful way to recover. This release is
identical to 2.27 except the roadmap stuff has been added to TODO.

* Wed Jul 06 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.27
Arrange for the daemon to remove its pid file on exit. Fix some
buffering problems with the Python side of the hotplug interface.
gpsfake can now run sessions under a monitor like Valgrind. Most
of the gpsfake logic now lives in a module that can be used to write
other test loads; its progress baton is now optional. Fixed
some minor bugs found by valgrind audit, including (1) a slow
memory leak, (2) a possible but unconfirmed file-descriptor leak,
and (3) a subtle error in the channel-assignment logic that only
showed up with multiple sessions active. In fact, the daemon code
no longer uses dynamic-memory allocation at all. Also, the code
no longer relies on FIONREAD working. The track error field in the
O response is now computed. The project website has some new eye candy.
Client connections now time out when the mode is neither raw nor watcher.
Fixed a core-dump that could happen if C, B or I commands were issued
at odd times.

* Wed Jun 22 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.26
Time DOP and total DOP are now passed on from GPSes that report
them. Ensure longitude has a leading zero when <100, for
compatibility with gpsdrive. Synchronous and thread hooks are now
separate in the client library. Packet-sniffing on a new device no
longer holds up incoming data on already-connected ones. There is
now a super-raw mode (R=2) that dumps a hex-encoding of every binary
packet received to the client; sirfmon uses it to operate through
the daemon if one is running. Support for Trimble TSIP GPSes
merged. gpsfake now works with SiRF and Zodiac logs. Python library
supports thread callbacks. New -p option of gpsfake supports
regression testing of the daemon, and there is a test suite included
with the distribution. PPS support is turned off, as there is some
pthreads problem that sometimes kills the daemon on pthreads exit.
Correct off-by-one error in GPZDA processing. The code has been
audited and cleaned with splint (www.splint.org).

* Sat May 21 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.25-1
Various signedness and scaling fixes and an OpenBSD port patch for the
Zodiac driver. Command-line arguments to gpsd are now treated as a default
device list; -f is still supported but deprecated. sirfmon now tries not
changing the line speed first, so it syncs up much faster. Prevent a
potential buffer overrun in the client library. PPS-thread support is now
on by default. Lots of documentation improvements. D-BUS broadcast support
by Amaury Jacquot. Added Alfredo Pironti's thread-callback and C++
support. gpsd no longer uses the system clock for anything, so it
can be used to set that clock.

* Tue May 17 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.24-1
Crazy-speed bug is finally fixed. Autobauding now starts with the
current speed of the device, not the stored gpsd speed; this means
hunting only takes place when device and GPS speed aren't matched.
xgpsspeed unit-conversion bug introduced in 2.22 is fixed. Satellite
display now really shows 12 channels, not just 11. Major improvements
in ntp notifications.

* Wed May 4 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.23-1
For better security, the daemon now drops root privileges after startup.
gpsd-clients is now a separate RPM; this is helpful on lean systems
that don't run X. The O command now reports speeds in meters per second
rather than knots, client code has been adjusted so there is no user-visible
change. We now compute the missing components of DOP when using SiRF chips.
/dev/gps is no longer special; there is no default GPS device unless you
specify one. The intermittent processor-hogging problem introduced by the
control-channel change in 2.21 has been solved.

* Mon Apr 25 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.22-1
SiRF-binary driver can now get leap-second corrections from subframe data.
Device add/delete commands now send back OK or ERROR. Error-modeling
corrections from the SiRF folks. Higher precision in position reports.

* Tue Apr 12 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.21-1
Add tag and timestamp to Y response. Use computed geoid separation as
SiRF packet 42 is flaky. Security fix: hotplug scripts now do device
add/removes through a separate local control channel. True multi-device
support is in place. When in watcher mode, device switches are announced.

* Thu Mar 31 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.20-1
Rob Janssen's patches to fix timezone issues and improve cooperation
with NTP. License changed to BSD so linking to libgps won't make people
nervous. gpsprobe and gpsd.py are obsolete and have been removed, the
autoprobe and profiling capabilities in the daemon more than replace
them. gpsprof now ships self-contained GNUPLOT scripts to stdout,
so they can be saved and redisplayed. Zodiac sort of works again, but
occasionally spins madly during autobauding.

* Sat Mar 26 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.19-1
Fix brown-paper-bag bug with NMEA parsing. Set SiRF GPSes to use
SBAS. sirfmon now displays SBAS parameters, and is included in the
installed programs. Add to FAQ a fix for spurious high speeds reported
in XTrac mode. We now interpret GPZDA. We no longer fudge a missing
ddmmyy in NMEA timestamps from the system clock, so replay will work better.

* Wed Mar 23 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.18-1
First cut at cooperating with NTP. Major library restructuring;
a fix is now a data structure of its own, and per-field timestamps
are gone. Use new 'o' command for watcher mode. Compute some estimated
error bounds.

* Wed Mar 16 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.17
Fix packet-engine problem that made disconnect/reconnect unreliable
(important!). Fix bonehead error in interpretation of PGRME. We
don't use O_SYNC (it turned out not to be reliable) so remove it to make
life easier under Mac OS X. Allow gpsfake to accept subsecond cycle times.
Add a FAQ to the HTML documentation. gps_poll() now handles multi-line
responses. Add N command for switching driver modes.

* Fri Mar 11 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.16-1
New F command allows changing the GPS device after startup time.
Hotplug scripts to go with it are now installed by the RPM. The
Garmin probe is working. The -T and -s options are gone. We have
achieved zero configuration!

* Wed Mar 02 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.15-1
A new packet engine autobauds much more quickly, and now iterates
over both 1 and 2 stopbits. Explicit support for FV18 (the -T f
option) is gone; instead, gpsd syncs with any 7N2 device and always
ships a suitable init string. New E command, supporting the Garmin
position-error sentence or computing these numbers from DOP and an
error model. New U command reports climb/sink from GPSes that report
vertical velocity. There is a prototype driver for SiRF-binary GPses,
invoked automatically when SiRF packets present themselves on the
wire after device open.

* Fri Feb 25 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.14-1
Pass zero magnetic variation in generated NMEA from binary GPSes
correctly. Use O_SYNC rather than timeouts to guarantee that
baud-rate change strings get to the GPS before changing the line
parameters. Introduced I command. Spatial scattergram plotting
moved from gpsprobe to gpsprof.

* Mon Feb 21 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.13-1
Correct a bug in binary-protocol dumping (applies to Zodiac and
Garmin only). Gary Miller's patch to deal gracefully with GPSes
like the Magellan EC10X that send only GPRMC and never GPGGA or
GPGSA, and thus never set mode or status fields. Fixed buggy
handling of units options in xgps and xgpsspeed. Bumped library
major version, since seen_sentences is now exposed and drivers have
more capabilities. Stricter NMEA buffer validation. Withdrew the
change that always passed up a timestamp; on SiRF receivers, the year
part is garbage when the PVT fields are garbage. Can now recognize
SiRF GPSes. Experimental baud-switching support for Zodiac.

* Tue Feb 15 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.12-1
Fixed core-dump bug in processing of the GLL variant that does not
include an FAA Mode Indicator. When using the NMEA driver, gpsd now
hunts for a baud rate rather than requiring a fixed one to be set.
A new 'B' command returns the RS232 parameters, and a new 'C'
command returns the update cycle time. Added gpsfake test harness.
Alpha driver for Garmin binary protocol added, requires Linux
garmin_usb kernel driver. The daemon now always passes up a
timestamp for every sentence that has one, even if the PVT fields
aren't valid.

* Thu Feb 10 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.11-1
Added gpsprof and the capability to generate GPS latency profiles.
gpsprobe now hunts through plausible baud rates when looking for NMEA
data from a GPS. The -b (baudrate) option fixes a speed, disabling
the baud-matching logic. Also, gpsprobe can now recognize SiRF
protocol, though not speak it. Fixed a math domain error in
gps.EarthDistance due to numeric blowup on points very close together,
and another in gps.MeterOffset() that was screwing up gpsprobe plots.

* Tue Feb 1 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.10
Add -N option to explicitly foreground the daemon. Fixed a bug
that was causing gpsd to keep reopening the GPS device after
leaving raw or watcher mode. Fixed Gary Miller's core-dump bug.

* Thu Jan 27 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.9-1
Python files restored to RPM.

* Thu Jan 27 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.8-1
Embarrassing typo fix in gps.py. Avoid buffer overrun in xgps.c.
Plug Debian security bug 292347, CVE number CAN-2004-1388.
This version issued on an emergency basis without Python libraries,
which have packaging problems due to the 2.3/2.4 transition.

* Fri Jan 14 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.7-1
More compiler-warning cleanups. gps client name changed to xgps.
Added --speedunits option to xgpsspeed, --speedunits and --altunits
options to xgps. Improved GPGSV parsing so it copes gracefully if
we start in the middle of a sequence. Merged Petter Reinholdtsen's
fix for GPGSA lists with holes. In xgps, satellites used in the
last fix are now dotted in the middle. New -P option to create
pidfile. Audited for potential buffer overruns, found and fixed
two.

* Sat Jan 01 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.6-1
Petter Reinholdtsen's fix for gps.py buffering. Fix syntax errors
in udev scriptlets. Clean up after GCC warning messages. Drop use of
vsprintf, so we get a link-time error on systems that might produce
buffer overruns (all modern Unixes support vsnsprintf which is safe).

* Thu Dec 23 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.5.1
Use gmtime instead of localtime when guessing the day or year of a date;
this avoids jitter in the day after 19:00 GMT. Added -v option to dump
version and exit. Commented out a crash-causing debug line in gps.py.

* Thu Dec 9 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.4-1
Minor bugs in gpsd.py fixed. M now returns 0 status if GPGSA not yet
seen; this change also fixes a bug where gpsd claimed it was confused
if GPGSA had not been seen and status was set. RPM will now install
a udevd rule if the host system uses it. Don't set the online flag
on activate. HP port changes and -Wall cleanup. James Cameron's
fixes to clean up gps.c and use X timeouts rather than alarms.

* Mon Oct 25 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.3-1
Documentation and comment fixes. Last two globals removed from
low-level interface; library should now be fully re-entrant. Mac OS X
port fixes. Q command fix from Robin L Darroch <robin@spade-men.com>.

* Mon Oct 18 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.2-1
Documentation improvements. BSD port fixes. Bug fix: speed timestamp
wasn't initialized properly in libgps. Device is now an optional
command-line argument of gpsprobe, in line with the clients. gpsd.py
now should handle fvwm devices correctly. Values in gps data
panel are now labeled with units. Attempted fix for 2.1 bug of DTR
not being pulled low on exit.

* Thu Sep 30 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.1-1
Various internal cleanups, including fossil removal in the
configuration machinery. FV-18, Tripmate, Earthmate and are now
enabled but can be disable with --disable-$NAME at configure time.
When you call configure with --disable-shared, libgps is linked
statically to the binaries (native libs are still linked
shared). Fixed buggy handling of -p option in gps.c and xgpsspeed.c;
it's now an optional command-line argument.

* Thu Sep 16 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.0-1
Packaging fixes for 2.0 release.

* Wed Sep 8 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.98-1
Only do one getdtablesize() call, otherwise we do several
getrlimits() each poll cycle. TripMate is working. gpsprobe now
deduces NMEA version. Zodiac Earthmate seems to work.

* Wed Sep 08 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.97-1
Removed PRWIZCH support (it still passes through in raw mode).
Build Motif-dependent programs conditionally. Added gpsprobe.
Fixed a brown-paper-bag-bug in 1.96 RPM packaging.

* Tue Aug 31 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.96-1
Implemented non-blocking writes to clients, so a stalled client
cannot stall gpsd. Fixed a nasty array-overrun bug. Timestamps
are now in ISO8601 format, with sub-second precision if the GPS
delivers that. First cuts at Python interfaces included. libgps.a
interface now bundles session fd into an allocated session block.
Automake-based build machinery from Jens Oberender; RPM now
installs shared libraries. FV18 driver added. Offline timer in GPS.

* Wed Aug 25 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.95-1
Fixed broken 'make dist', missing display.c and Tachometer.c
are in there now.

* Tue Aug 24 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.94-1
Fix embarrassing bug -- watcher mode did not work for more than one
client at a time. Y command now carries information about which
satellites were used in the last fix. New timeout mechanism, no
longer dependent on FIONREAD.

* Mon Aug 23 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.93-1
Fourth prerelease. Daemon-side timeouts are gone, they complicated
the interface without adding anything. Command responses now
contain ? to tag invalid data. -D2 feature of 1.92 backed out.

* Sun Aug 22 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.92-1
Third prerelease. Clients in watcher mode now get notified when
the GPS goes online or offline. Major name changes -- old libgps
is new libgpsd and vice-versa (so the high-level interface is more
prominent). Specfile now includes code to install gpsd so it will
be started at boot time. -D2 now causes command error messages
to be echoed to the client.

* Sat Aug 21 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.91-1
Second pre-2.0 release. Features a linkable C library that hides the
details of communicating with the daemon. The daemon now recovers
gracefully from having the GPS unplugged and plugged in at any time;
one of the bits of status it can report is whether the GPS is online.
The gps and xgpsspeed clients now query the daemon; their code
for direct access to the serial port has been deliberately removed.

* Sun Aug 15 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.90
Creation of specfile.

* Sun Mar 21 2004 Remco Treffkorn <remco@rvt.com> - ?
Without PRWIZCH sentence: sat. colors in gps according to ss, grey==lt20,
yellow==lt40 else green.
Added L Q and I to the protocol. Removed G and T.
Changed the timeout mechanism. Try to not return Lat/Lon/Alt if
validity is in doubt.

* Thu Jan 29 2004 Remco Treffkorn <remco@rvt.com> - ?
Make applications null-terminate their resource lists.

* Sat Dec 20 2003 Remco Treffkorn <remco@rvt.com> - ?
Removed <varargs.h> from netlib. Not needed, and new gcc does not support
it any more.

* Wed Aug 20 2003 Remco Treffkorn <remco@rvt.com> - 1.10
Add install target. Fix clean target. Make GPS timeout configurable.
Make xgpsspeed build with Apple's X11.
Make sure that we don't segfault if the NMEA is badly formed.

* Mon Aug 18 2003 Remco Treffkorn <remco@rvt.com> - ?
Use cfset[io]speed() to set speed in serial.h. Glibc is quite insane
and I am tired to chase it, so I give up. Hope this works for BSD.
Set status and mode 0 after GPS timeout (5 sec) - Cougar <cougar@random.ee>

* Sun Feb 16 2003 Remco Treffkorn <remco@rvt.com> - 1.09
Include sys/time.h in gpsd.c for struct timeval.

* Sun Nov 03 2002 Remco Treffkorn <remco@rvt.com> - ?
G or g command returns six-digit Maidenhead grid square (like FN12fx)

* Thu Oct 03 2002 Remco Treffkorn <remco@rvt.com> - 1.08
Added sockopt SO_REUSEADDR to netlib.c passive_sock.

* Tue Feb 05 2002 Remco Treffkorn <remco@rvt.com> - 1.07
em.c uses <time.h> (as it should). Removed some <sys/time.h>
where they were not needed.
Russ Nelson: Improved Earthmate support: added state machine for
EARTHA recognizer, removed alignment problems seen on ARM architecture.
Added setsockopt to add SO_REUSEADDR, so that
gpsd can stop and immediately restart. Added support for bitrates
higher than 38400, needed for the SIRF chipset.
Derrick: my patch causes longitude when under 100 degrees to be printed
zero-padded as needed, the latitude same deal under 10, fixes the GGA
sentence to not erroneously print fix type (2/3) instead of fix quality,
and calculates fix type correctly.

* Fri Aug 11 2000 Remco Treffkorn <remco@rvt.com> - 1.06
Change from C++ (/) to C comments (/* */)for compatibility.
Added -n (need init) flag.
Don't init unless lat/lon specified.
Remove gps.mayko.com as the default hostname.

* Fri May 12 2000 Remco Treffkorn <remco@rvt.com> - 1.05
(even though version.h says 1.04)
Added some includes to xgpsspeed.c for portability.
Fix problem with flags being overwritten, and using the wrong port
variable also in xgpsspeed.c
Add a note about Y2K compatibility fix.
Pass latitude and longitude into em_init().

* Fri Mar 17 2000 Remco Treffkorn <remco@rvt.com> - 1.02
(even though version.h says 1.01)

* Sun Mar 05 2000 Remco Treffkorn <remco@rvt.com> - 1.01
Updated to IANA port.
Fixes to DGPS support.

* Sun Jan 02 2000 Remco Treffkorn <remco@rvt.com> - 1.0
Added DGPS fixes from Curt Mills. (See README for contact info.)

* Mon Dec 13 1999 Remco Treffkorn <remco@rvt.com> - 0.99dgps
Added minimal DGPS support by Derrick J Brashear

* Sat Jul 17 1999 Remco Treffkorn <remco@rvt.com> - 0.99
Rockwell binary is now translated to NMEA format, so that
clients like gps will work with an EarthMate.
Added speedometer application. Thanks to Derrick J Brashear
for his work (see README for contact info).

* Thu Mar 04 1999 Remco Treffkorn <remco@rvt.com> - 0.96
Changed EarthMate support. Rockwell binary is now almost properly
supported. Only the minimum required information is extracted.

* Sat Feb 06 1999 Remco Treffkorn <remco@rvt.com> - 0.95
Added support for EarthMate receivers. Since I do not have one, this is
untested.
If it works, it does the following: You start gpsd with a baudrate of 9600
and give it the -Te option. If gpsd gets the EartMate it will enable the
receiver and then attempt to switch it into NMEA mode. If the EarthMate id
is not received, but a binary data header is received, then we will try to
switch NMEA too.

* Sun Jan 24 1999 Remco Treffkorn <remco@rvt.com> - 0.94
Y2K compliant ;-) (... is NOT. Look for "FIXME:" in nmea_parse.c)

* Tue Jan 27 1998 Remco Treffkorn <remco@rvt.com> - 0.93
using GNU autoconf now.
combined gpsd + gpsclient. No more init files, command line only.

* Tue May 13 1997 Remco Treffkorn <remco@rvt.com> - 0.9
some cleanups in the ini code. version 0.9 ...

* Fri Apr 25 1997 Remco Treffkorn <remco@rvt.com> - 0.8
version 0.8, some bug fixes. New MODE member, STATUS member changed.

* Mon Apr 21 1997 Remco Treffkorn <remco@rvt.com> - 0.7
released version 0.7

+ 3
- 5
README View File

@@ -1,4 +1,4 @@
$Id: README 4447 2007-12-05 11:22:48Z esr $
$Id: README 4893 2009-01-05 17:13:19Z esr $

COPYRIGHT
=========
@@ -64,9 +64,7 @@ mailing list occasionally.

Eric S. Raymond drastically rewrote this code to clean it up and extend it.
The 2.X architecture has become significantly different and far more
modularized.

His new features include:
modularized. His new features include:
* Documentation (what a concept!)
* Cleaned up, simplified command-line options.
* Now understands the GLL (Geographic position - Latitude, Longitude)
@@ -118,6 +116,6 @@ application engineer at SiRF. He assisted us with the correction and
tuning of the SiRF binary-protocol driver, shedding a good deal of
light on murky aspects of the chip's behavior.

We are delighted to acknowlege the assistance of Timo Ylhainen, VP of
We are also delighted to acknowlege the assistance of Timo Ylhainen, VP of
Software Operations at Fastrax. He clarified a number of points about
the iTalk protocol, helping to further development of iTalk support.

+ 13
- 64
TODO View File

@@ -1,4 +1,4 @@
$Id: TODO 4671 2008-01-21 15:36:55Z esr $
$Id: TODO 5047 2009-01-21 08:50:40Z esr $

This is the gpsd to-do list. If you're viewing it with Emacs, try
doing Ctl-C Ctl-t and browsing through the outline headers. Ctl-C Ctl-a
@@ -23,12 +23,19 @@ to reverse his refusal to send us an eval unit.

** To do:

*** Command to ship RTCM corrections to a specified device

At the moment, if a GPS accepts RTCM corrections and they are
available, gpsd ships them to the device from which the GPS is
reporting fix data. Some GPSes have auxiliary ports for RTCM;
there should be a (privileged) command to redirect RTCM connections.

*** libgps should try to automatically try to reconnect when a poll fails

Petter Reinholdtsen suggests:

At the moment, when a gpsd client using libgps is connected to the
gpsd server, and the server is restarted, the client looses the
gpsd server, and the server is restarted, the client loses the
connection and do not update any more.

It would be nice if the gps_poll() and gps_query() would try to
@@ -62,21 +69,6 @@ version bump.)

This is Berlios FR #3789.

*** Optimize the use of gpsd_hexdump and gpsd_report

These functions still consume a significant (ie. non-zero) fraction of
CPU time at -D0 or -D1. Possible solutions include a wrapper around
gpsd_hexdump to only dump when the debug level is high enough, or
modifying gpsd_report to handle the hexdump call. This may require (at
worst) a library version number increment, or at least changing every
invocation of gpsd_hexdump. Not something to be done lightly.

*** Change O output precision to %.9f for degrees and %.3f for meters

This corresponds to 1mm accuracy, which is better than the horizontal
accuracy of RTK GPS. This will be revisited; receivers are commercially
available that claim to have 0.1mm accuracy

*** Full Python wrapper for libgpsd

This would be useful for test code of all kinds.
@@ -122,15 +114,6 @@ GPSD_UNITS environment variable and chooses its UI mode depending on
whether or not it's running under X. There is controversy about this
proposal on the dev list.

*** send/expect for the NMEA driver initializer

We've had one report of a GPS, the Garmin GPS-10, which gpsd puts in a
bad state because the device chokes on having all of our NMEA probe strings
shoved at it without having time to respond. A simple send-expect
function (ship given string, wait until specified reply arrives or time
out) would solve this problem and might help avoid problems with other
GPSes we haven't encountered yet.

*** SiRF firmware uploader

Chris Kuethe has shipped a 0.0 pre-alpha version. It is not yet
@@ -166,26 +149,11 @@ protocol, flexible enough to handle all the quantities required, and it
is actually in use in production reference networks. RT-IGS is also a
packet-oriented format, rather than a file-oriented format like RINEX.

*** RTCM support.

We have an RTCM packet decoder, and untested scratch code to serve
RTCM packets to port 2101. Here's the plan for the rest of it:

1) Inversion needs to be done somewhere in the encoding logic.
*** RTCM3 support.

2) Wolfgang's decoder-hardening patches.

3) Test productions. I have one that tests dumping and one that uses
passthrough mode to test that pack() and repack() are inverse. We
should have an undumping torture test.

4) What about rtcm_output_magnavox() anyway? Should that be made
available as an output mode of rtcmdecode and documented?

5) Extend the test framework so we can verify RTCM service.

6) Generate and broadcast RTCM corrections from an attached device?
Might not be possible -- appears to need nanosecond timing.
Previous plans for more RTCM2 support seem to have been overtaken by
events, e.g. the world moving to RTCM3. There is an incomplete
decoder which needs to be finished.

*** Do the research to figure out just what is going on with status bits

@@ -225,25 +193,6 @@ an elevation test.

** Future features (?)

*** iTalk support

There is a minimally functional driver for the Fastrax iTalk3 protocol.
It is still very much a work in progress. It is now compiled in by default
so that we can collect bug reports. Version 3 of iTalk is not backwards
compatible; we do not anticipate supporting previous versions unless
someone requests it and is able to provide us hardware.

*** Navcom support

Initial support for the Navcom binary protocol has been committed to
allow for in-tree development. It is compiled in by default.

*** UBX support

There is a minimally functional driver for the uBlox UBX protocol. It is
still very much a work in progress. It is now compiled in by default so
that we can collect bug reports.

*** Support for more survey / professional / up-scale receivers.

Devices such as the Javad JNSCore, Hemisphere Crescent, Septentrio


+ 5
- 5
Tachometer.h View File

@@ -1,8 +1,8 @@
/* $Id: Tachometer.h 3486 2006-09-21 00:58:22Z ckuethe $ */
/* Tachometer.h -- tachometer widget interface */
#ifndef _Tachometer_h
#define _Tachometer_h
/* $Id: Tachometer.h 4794 2008-08-03 16:42:57Z ckuethe $ */
#ifndef _GPSD_TACHOMETER_H_
#define _GPSD_TACHOMETER_H_

/* Tachometer.h -- tachometer widget interface */
#include <X11/Xaw/Simple.h>

/* Resources:
@@ -46,4 +46,4 @@ extern WidgetClass tachometerWidgetClass;
typedef struct _TachometerClassRec *TachometerWidgetClass;
typedef struct _TachometerRec *TachometerWidget;

#endif /* _Tachometer_h */
#endif /* _GPSD_TACHOMETER_H_ */

+ 5
- 5
TachometerP.h View File

@@ -1,8 +1,8 @@
/* $Id: TachometerP.h 3486 2006-09-21 00:58:22Z ckuethe $ */
/* TachometerP.h -- Tachometer widget private data */
#ifndef _TachometerP_h
#define _TachometerP_h
/* $Id: TachometerP.h 4794 2008-08-03 16:42:57Z ckuethe $ */
#ifndef _GPSD_TACHOMETERP_H_
#define _GPSD_TACHOMETERP_H_

/* TachometerP.h -- Tachometer widget private data */
#include <Tachometer.h>
#include <X11/Xaw/SimpleP.h>

@@ -38,4 +38,4 @@ typedef struct _TachometerRec {
TachometerPart tachometer;
} TachometerRec;

#endif /* _TachometerP_h */
#endif /* _GPSD_TACHOMETERP_H_ */

+ 6646
- 5099
aclocal.m4
File diff suppressed because it is too large
View File


+ 9
- 3
autogen.sh View File

@@ -1,5 +1,5 @@
#!/bin/sh
# $Id: autogen.sh 3486 2006-09-21 00:58:22Z ckuethe $
# $Id: autogen.sh 5000 2009-01-13 20:43:34Z ckuethe $

# Automakeversion
AM_1=1
@@ -70,7 +70,10 @@ if [ "$AC_ERROR" = "1" ]; then
fi

# Check libtool version
LT_VERSION=`libtool --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\).*$#\1 \2#p'`
if [ -z "$LIBTOOL" ] ; then
LIBTOOL="libtool"
fi
LT_VERSION=`${LIBTOOL} --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\).*$#\1 \2#p'`
LT_V1=`echo $LT_VERSION | awk '{print $1}'`
LT_V2=`echo $LT_VERSION | awk '{print $2}'`

@@ -93,9 +96,12 @@ if [ "$LT_ERROR" = "1" ]; then
tput sgr0
fi

if [ -z "$LIBTOOLIZE" ] ; then
LIBTOOLIZE="libtoolize"
fi
echo Configuring build environment for gpsd
aclocal \
&& libtoolize --force --copy \
&& ${LIBTOOLIZE} --force --copy \
&& autoheader --force \
&& automake --add-missing --foreign --copy --include-deps \
&& autoconf --force \


+ 71
- 0
bits.c View File

@@ -0,0 +1,71 @@
/*
* Bitfield extraction functions. In each, start is a bit index (not a byte
* index) and width is a bit width (bounded above by the bit width of long
* long).
*
* The sbits() function assumes twos-complement arithmetic.
*/
#include <assert.h>

#include "bits.h"
#ifdef DEBUG
#include <stdio.h>
#include "gpsd_config.h"
#include "gpsd.h"
#endif /* DEBUG */



#define BITS_PER_BYTE 8

unsigned long long ubits(char buf[], unsigned int start, unsigned int width)
/* extract a bitfield from the buffer as an unsigned big-endian long */
{
unsigned long long fld = 0;
unsigned int i;
unsigned end;

/*@i1@*/assert(width <= sizeof(long long) * BITS_PER_BYTE);
for (i = start / BITS_PER_BYTE; i < (start + width + BITS_PER_BYTE - 1) / BITS_PER_BYTE; i++) {
fld <<= BITS_PER_BYTE;
fld |= (unsigned char)buf[i];
}
#ifdef DEBUG
printf("Extracting %d:%d from %s: segment 0x%llx = %lld\n", start, width,
gpsd_hexdump(buf, 12), fld, fld);
#endif /* DEBUG */

end = (start + width) % BITS_PER_BYTE;
if (end != 0) {
fld >>= (BITS_PER_BYTE - end);
#ifdef DEBUG
printf("After downshifting by %d bits: 0x%llx = %lld\n",
BITS_PER_BYTE - end, fld, fld);
#endif /* DEBUG */
}

fld &= ~(0xffffffff << width);
#ifdef DEBUG
printf("After selecting out the bottom %u bits: 0x%llx = %lld\n",
width, fld, fld);
#endif /* DEBUG */

return fld;
}

signed long long sbits(char buf[], unsigned int start, unsigned int width)
/* extract a bitfield from the buffer as a signed big-endian long */
{
unsigned long long un = ubits(buf, start, width);
signed long long fld;

/*@ +relaxtypes */
if (un & (1 << width))
fld = -(un & ~(1 << width));
else
fld = (signed long long)un;
return fld;
/*@ -relaxtypes */
}


+ 44
- 39
bits.h View File

@@ -1,11 +1,13 @@
/* $Id: bits.h 4030 2006-11-30 07:29:25Z esr $ */
/* $Id: bits.h 4794 2008-08-03 16:42:57Z ckuethe $ */
#ifndef _GPSD_BITS_H_
#define _GPSD_BITS_H_

/*
* bits.h - extract binary data from message buffer
*
* These macros extract bytes, words, longwords, floats or doubles from
* a message that contains these items in either MSB-first or LSB-first
* byte order. To specify which, define one of LITTLE_ENDIAN_PROTOCOL
* or BIG_ENDIAN_PROTOCOL before including this header.
* These macros extract bytes, words, longwords, floats, doubles, or
* bitfields of arbitrary length and size from a message that contains
* these items in either MSB-first or LSB-first byte order.
*
* By defining the GET_ORIGIN and PUT_ORIGIN macros before including
* this header, it's possible to change the origin of the indexing.
@@ -18,8 +20,8 @@
* Both 32- and 64-bit systems with gcc are OK with this set.
*/

#ifndef BITS_H
#define BITS_H
#include <stdint.h>
union int_float {
int32_t i;
float f;
@@ -29,7 +31,6 @@ union long_double {
int64_t l;
double d;
};
#endif /* BITS_H */

#ifndef GET_ORIGIN
#define GET_ORIGIN 0
@@ -43,43 +44,47 @@ union long_double {
#define getub(buf, off) ((u_int8_t)buf[(off)-(GET_ORIGIN)])
#define putbyte(buf,off,b) do {buf[(off)-(PUT_ORIGIN)] = (unsigned char)(b);} while (0)

#ifdef LITTLE_ENDIAN_PROTOCOL
/* little-endian access */
#define getlesw(buf, off) ((int16_t)(((u_int16_t)getub((buf), (off)+1) << 8) | (u_int16_t)getub((buf), (off))))
#define getleuw(buf, off) ((u_int16_t)(((u_int16_t)getub((buf), (off)+1) << 8) | (u_int16_t)getub((buf), (off))))
#define getlesl(buf, off) ((int32_t)(((u_int16_t)getleuw((buf), (off)+2) << 16) | (u_int16_t)getleuw((buf), (off))))
#define getleul(buf, off) ((u_int32_t)(((u_int16_t)getleuw((buf),(off)+2) << 16) | (u_int16_t)getleuw((buf), (off))))

#define getsw(buf, off) ((int16_t)(((u_int16_t)getub((buf), (off)+1) << 8) | (u_int16_t)getub((buf), (off))))
#define getuw(buf, off) ((u_int16_t)(((u_int16_t)getub((buf), (off)+1) << 8) | (u_int16_t)getub((buf), (off))))
#define getsl(buf, off) ((int32_t)(((u_int16_t)getuw((buf), (off)+2) << 16) | (u_int16_t)getuw((buf), (off))))
#define getul(buf, off) ((u_int32_t)(((u_int16_t)getuw((buf),(off)+2) << 16) | (u_int16_t)getuw((buf), (off))))
#define putleword(buf, off, w) do {putbyte(buf, (off)+1, (w) >> 8); putbyte(buf, (off), (w));} while (0)
#define putlelong(buf, off, l) do {putleword(buf, (off)+2, (l) >> 16); putleword(buf, (off), (l));} while (0)
#define getlesL(buf, off) ((int64_t)(((u_int64_t)getleul(buf, (off)+4) << 32) | getleul(buf, (off))))
#define getleuL(buf, off) ((u_int64_t)(((u_int64_t)getleul(buf, (off)+4) << 32) | getleul(buf, (off))))

#define putword(buf, off, w) do {putbyte(buf, (off)+1, (w) >> 8); putbyte(buf, (off), (w));} while (0)
#define putlong(buf, off, l) do {putword(buf, (off)+2, (l) >> 16); putword(buf, (off), (l));} while (0)
#define getsL(buf, off) ((int64_t)(((u_int64_t)getul(buf, (off)+4) << 32) | getul(buf, (off))))
#define getuL(buf, off) ((u_int64_t)(((u_int64_t)getul(buf, (off)+4) << 32) | getul(buf, (off))))

#else
#define getlef(buf, off) (i_f.i = getlesl(buf, off), i_f.f)
#define getled(buf, off) (l_d.l = getlesL(buf, off), l_d.d)

/* SiRF and most other GPS protocols use big-endian (network byte order) */
#define getsw(buf, off) ((int16_t)(((u_int16_t)getub(buf, (off)) << 8) | (u_int16_t)getub(buf, (off)+1)))
#define getuw(buf, off) ((u_int16_t)(((u_int16_t)getub(buf, (off)) << 8) | (u_int16_t)getub(buf, (off)+1)))
#define getsl(buf, off) ((int32_t)(((u_int16_t)getuw(buf, (off)) << 16) | getuw(buf, (off)+2)))
#define getul(buf, off) ((u_int32_t)(((u_int16_t)getuw(buf, (off)) << 16) | getuw(buf, (off)+2)))
#define getsL(buf, off) ((int64_t)(((u_int64_t)getul(buf, (off)) << 32) | getul(buf, (off)+4)))
#define getuL(buf, off) ((u_int64_t)(((u_int64_t)getul(buf, (off)) << 32) | getul(buf, (off)+4)))
#define getbesw(buf, off) ((int16_t)(((u_int16_t)getub(buf, (off)) << 8) | (u_int16_t)getub(buf, (off)+1)))
#define getbeuw(buf, off) ((u_int16_t)(((u_int16_t)getub(buf, (off)) << 8) | (u_int16_t)getub(buf, (off)+1)))
#define getbesl(buf, off) ((int32_t)(((u_int16_t)getbeuw(buf, (off)) << 16) | getbeuw(buf, (off)+2)))
#define getbeul(buf, off) ((u_int32_t)(((u_int16_t)getbeuw(buf, (off)) << 16) | getbeuw(buf, (off)+2)))
#define getbesL(buf, off) ((int64_t)(((u_int64_t)getbeul(buf, (off)) << 32) | getbeul(buf, (off)+4)))
#define getbeuL(buf, off) ((u_int64_t)(((u_int64_t)getbeul(buf, (off)) << 32) | getbeul(buf, (off)+4)))

#define putword(buf,off,w) do {putbyte(buf, (off) ,(w) >> 8); putbyte(buf, (off)+1, (w));} while (0)
#define putlong(buf,off,l) do {putword(buf, (off) ,(l) >> 16); putword(buf, (off)+2, (l));} while (0)
#define putbeword(buf,off,w) do {putbyte(buf, (off) ,(w) >> 8); putbyte(buf, (off)+1, (w));} while (0)
#define putbelong(buf,off,l) do {putbeword(buf, (off) ,(l) >> 16); putbeword(buf, (off)+2, (l));} while (0)

#endif

#define getf(buf, off) (i_f.i = getsl(buf, off), i_f.f)
#define getd(buf, off) (l_d.l = getsL(buf, off), l_d.d)
#define getbef(buf, off) (i_f.i = getbesl(buf, off), i_f.f)
#define getbed(buf, off) (l_d.l = getbesL(buf, off), l_d.d)


/* Zodiac protocol description uses 1-origin indexing by little-endian word */
#define getword(n) ( (session->packet.outbuffer[2*(n)-2]) \
| (session->packet.outbuffer[2*(n)-1] << 8))
#define getlong(n) ( (session->packet.outbuffer[2*(n)-2]) \
| (session->packet.outbuffer[2*(n)-1] << 8) \
| (session->packet.outbuffer[2*(n)+0] << 16) \
| (session->packet.outbuffer[2*(n)+1] << 24))
#define getstring(t, s, e) \
(void)memcpy(t, session->packet.outbuffer+2*(s)-2, 2*((e)-(s)+1))
#define getwordz(buf, n) ( (buf[2*(n)-2]) \
| (buf[2*(n)-1] << 8))
#define getlongz(buf, n) ( (buf[2*(n)-2]) \
| (buf[2*(n)-1] << 8) \
| (buf[2*(n)+0] << 16) \
| (buf[2*(n)+1] << 24))
#define getstringz(to, from, s, e) \
(void)memcpy(to, from+2*(s)-2, 2*((e)-(s)+1))

/* bitfield extraction */
extern unsigned long long ubits(char buf[], unsigned int, unsigned int);
extern signed long long sbits(char buf[], unsigned int, unsigned int);

#endif /* _GPSD_BITS_H_ */

+ 110
- 63
bits_test.c View File

@@ -1,4 +1,4 @@
/* $Id: bits_test.c 3486 2006-09-21 00:58:22Z ckuethe $ */
/* $Id: bits_test.c 4900 2009-01-05 21:47:53Z esr $ */
/* test harness for bits.h */

#include <stdio.h>
@@ -23,7 +23,7 @@ static unsigned long long uL1,uL2;
static float f1;
static double d1;

static void dumpall(void)
static void bedumpall(void)
{
(void)printf("getsb: %016llx %016llx %016llx %016llx\n",
(ubig)sb1, (ubig)sb2,
@@ -31,94 +31,141 @@ static void dumpall(void)
(void)printf("getub: %016llx %016llx %016llx %016llx\n",
(ubig)ub1, (ubig)ub2,
(ubig)getub(buf, 0), (ubig)getub(buf, 8));
(void)printf("getsw: %016llx %016llx %016llx %016llx\n",
(void)printf("getbesw: %016llx %016llx %016llx %016llx\n",
(ubig)sw1, (ubig)sw2,
(ubig)getsw(buf, 0), (ubig)getsw(buf, 8));
(void)printf("getuw: %016llx %016llx %016llx %016llx\n",
(ubig)getbesw(buf, 0), (ubig)getbesw(buf, 8));
(void)printf("getbeuw: %016llx %016llx %016llx %016llx\n",
(ubig)uw1, (ubig)uw2,
(ubig)getuw(buf, 0), (ubig)getuw(buf, 8));
(void)printf("getsl: %016llx %016llx %016llx %016llx\n",
(ubig)getbeuw(buf, 0), (ubig)getbeuw(buf, 8));
(void)printf("getbesl: %016llx %016llx %016llx %016llx\n",
(ubig)sl1, (ubig)sl2,
(ubig)getsl(buf, 0), (ubig)getsl(buf, 8));
(void)printf("getul: %016llx %016llx %016llx %016llx\n",
(ubig)getbesl(buf, 0), (ubig)getbesl(buf, 8));
(void)printf("getbeul: %016llx %016llx %016llx %016llx\n",
(ubig)ul1, (ubig)ul2,
(ubig)getul(buf, 0), (ubig)getul(buf, 8));
(void)printf("getsL: %016llx %016llx %016llx %016llx\n",
(ubig)getbeul(buf, 0), (ubig)getbeul(buf, 8));
(void)printf("getbesL: %016llx %016llx %016llx %016llx\n",
(ubig)sL1, (ubig)sL2,
(ubig)getsL(buf, 0), (ubig)getsL(buf, 8));
(void)printf("getuL: %016llx %016llx %016llx %016llx\n",
(ubig)getbesL(buf, 0), (ubig)getbesL(buf, 8));
(void)printf("getbeuL: %016llx %016llx %016llx %016llx\n",
(ubig)uL1, (ubig)uL2,
(ubig)getuL(buf, 0), (ubig)getuL(buf, 8));
(void)printf("getf: %f %f\n", f1, getf(buf, 24));
(void)printf("getd: %.16f %.16f\n", d1, getd(buf, 16));
(ubig)getbeuL(buf, 0), (ubig)getbeuL(buf, 8));
(void)printf("getbef: %f %f\n", f1, getbef(buf, 24));
(void)printf("getbed: %.16f %.16f\n", d1, getbed(buf, 16));
}

static void ledumpall(void)
{
(void)printf("getsb: %016llx %016llx %016llx %016llx\n",
(ubig)sb1, (ubig)sb2,
(ubig)getsb(buf, 0), (ubig)getsb(buf, 8));
(void)printf("getub: %016llx %016llx %016llx %016llx\n",
(ubig)ub1, (ubig)ub2,
(ubig)getub(buf, 0), (ubig)getub(buf, 8));
(void)printf("getlesw: %016llx %016llx %016llx %016llx\n",
(ubig)sw1, (ubig)sw2,
(ubig)getlesw(buf, 0), (ubig)getlesw(buf, 8));
(void)printf("getleuw: %016llx %016llx %016llx %016llx\n",
(ubig)uw1, (ubig)uw2,
(ubig)getleuw(buf, 0), (ubig)getleuw(buf, 8));
(void)printf("getlesl: %016llx %016llx %016llx %016llx\n",
(ubig)sl1, (ubig)sl2,
(ubig)getlesl(buf, 0), (ubig)getlesl(buf, 8));
(void)printf("getleul: %016llx %016llx %016llx %016llx\n",
(ubig)ul1, (ubig)ul2,
(ubig)getleul(buf, 0), (ubig)getleul(buf, 8));
(void)printf("getlesL: %016llx %016llx %016llx %016llx\n",
(ubig)sL1, (ubig)sL2,
(ubig)getlesL(buf, 0), (ubig)getlesL(buf, 8));
(void)printf("getleuL: %016llx %016llx %016llx %016llx\n",
(ubig)uL1, (ubig)uL2,
(ubig)getleuL(buf, 0), (ubig)getleuL(buf, 8));
(void)printf("getlef: %f %f\n", f1, getlef(buf, 24));
(void)printf("getled: %.16f %.16f\n", d1, getled(buf, 16));
}

struct unsigned_test {
unsigned int start, width;
unsigned long long expected;
char *description;
};

/*@ -duplicatequals +ignorequals @*/
int main(void)
{
struct unsigned_test *up, unsigned_tests[] = {
{0, 1, 0, "first bit of first byte"},
{0, 8, 0x01,"first 8 bits"},
{32, 7, 2, "first seven bits of fifth byte"},
{56, 12, 0x8f, "12 bits crossing 7th to 8th bytes (08ff)"},
{78, 4, 11, "2 bits crossing 8th to 9th byte (fefd)"},
};

unsigned char *sp;

memcpy(buf,"\x01\x02\x03\x04\x05\x06\x07\x08",8);
memcpy(buf+8,"\xff\xfe\xfd\xfc\xfb\xfa\xf9\xf8",8);
memcpy(buf+16,"\x40\x09\x21\xfb\x54\x44\x2d\x18",8);
memcpy(buf+24,"\x40\x49\x0f\xdb",4);

(void)fputs("Test data:", stdout);
for (sp = buf; sp < buf + 28; sp++)
(void)printf(" %02x", *sp);
(void)putc('\n', stdout);

/* big-endian test */
printf("Big-endian\n");
#include "bits.h"
printf("Big-endian:\n");
sb1 = getsb(buf, 0);
sb2 = getsb(buf, 8);
ub1 = getub(buf, 0);
ub2 = getub(buf, 8);
sw1 = getsw(buf, 0);
sw2 = getsw(buf, 8);
uw1 = getuw(buf, 0);
uw2 = getuw(buf, 8);
sl1 = getsl(buf, 0);
sl2 = getsl(buf, 8);
ul1 = getul(buf, 0);
ul2 = getul(buf, 8);
sL1 = getsL(buf, 0);
sL2 = getsL(buf, 8);
uL1 = getuL(buf, 0);
uL2 = getuL(buf, 8);
f1 = getf(buf, 24);
d1 = getd(buf, 16);

dumpall();

#undef getub
#undef getsb
#undef getuw
#undef getsw
#undef getul
#undef getsl
#undef getuL
#undef getsL
#undef putword
#undef putlong
sw1 = getbesw(buf, 0);
sw2 = getbesw(buf, 8);
uw1 = getbeuw(buf, 0);
uw2 = getbeuw(buf, 8);
sl1 = getbesl(buf, 0);
sl2 = getbesl(buf, 8);
ul1 = getbeul(buf, 0);
ul2 = getbeul(buf, 8);
sL1 = getbesL(buf, 0);
sL2 = getbesL(buf, 8);
uL1 = getbeuL(buf, 0);
uL2 = getbeuL(buf, 8);
f1 = getbef(buf, 24);
d1 = getbed(buf, 16);
bedumpall();

/* little-endian test */
#define LITTLE_ENDIAN_PROTOCOL
printf("Little-endian\n");
#include "bits.h"
printf("Little-endian:\n");
sb1 = getsb(buf, 0);
sb2 = getsb(buf, 8);
ub1 = getub(buf, 0);
ub2 = getub(buf, 8);
sw1 = getsw(buf, 0);
sw2 = getsw(buf, 8);
uw1 = getuw(buf, 0);
uw2 = getuw(buf, 8);
sl1 = getsl(buf, 0);
sl2 = getsl(buf, 8);
ul1 = getul(buf, 0);
ul2 = getul(buf, 8);
sL1 = getsL(buf, 0);
sL2 = getsL(buf, 8);
uL1 = getuL(buf, 0);
uL2 = getuL(buf, 8);
f1 = getf(buf, 24);
d1 = getd(buf, 16);
dumpall();
sw1 = getlesw(buf, 0);
sw2 = getlesw(buf, 8);
uw1 = getleuw(buf, 0);
uw2 = getleuw(buf, 8);
sl1 = getlesl(buf, 0);
sl2 = getlesl(buf, 8);
ul1 = getleul(buf, 0);
ul2 = getleul(buf, 8);
sL1 = getlesL(buf, 0);
sL2 = getlesL(buf, 8);
uL1 = getleuL(buf, 0);
uL2 = getleuL(buf, 8);
f1 = getlef(buf, 24);
d1 = getled(buf, 16);
ledumpall();


(void)printf("Testing bitfield extraction:\n");
for (up = unsigned_tests;
up < unsigned_tests+sizeof(unsigned_tests)/sizeof(unsigned_tests[0]);
up++) {
unsigned long long res = ubits((char *)buf, up->start, up->width);
(void)printf("ubits(..., %d, %d) %s should be %llu, is %llu: %s\n",
up->start, up->width, up->description, up->expected, res,
res == up->expected ? "succeeded" : "FAILED");
}

exit(0);
}

+ 1
- 6
bsd-base64.c View File

@@ -1,4 +1,4 @@
/* $Id: bsd-base64.c 3666 2006-10-26 23:11:51Z ckuethe $ */
/* $Id: bsd-base64.c 5052 2009-01-21 10:42:24Z esr $ */
/* $OpenBSD: base64.c,v 1.3 1997/11/08 20:46:55 deraadt Exp $ */

/*
@@ -46,11 +46,6 @@
#if !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)

#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>


+ 2
- 2
bsd-base64.h View File

@@ -1,4 +1,4 @@
/* $Id: bsd-base64.h 3666 2006-10-26 23:11:51Z ckuethe $ */
/* $Id: bsd-base64.h 4794 2008-08-03 16:42:57Z ckuethe $ */
#ifndef _BSD_BASE64_H
#define _BSD_BASE64_H

@@ -12,4 +12,4 @@ int b64_pton(char const *src, u_char *target, size_t targsize);
# define __b64_pton b64_pton
#endif /* HAVE___B64_NTOP */

#endif /* _BSD_BINRESVPORT_H */
#endif /* _BSD_BASE64_H */

+ 68
- 7
cgps.c View File

@@ -1,4 +1,4 @@
/* $Id: cgps.c 4547 2007-12-13 01:38:22Z esr $ */
/* $Id: cgps.c 5053 2009-01-21 11:44:35Z esr $ */
/*
* Copyright (c) 2005 Jeff Francis <jeff@gritch.org>
*
@@ -84,12 +84,14 @@

#include <sys/types.h>
#include <sys/select.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
#include <unistd.h>
#endif /* S_SPLINT_S */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <math.h>
#include <errno.h>
#include <assert.h>
@@ -117,6 +119,7 @@ static WINDOW *datawin, *satellites, *messages;

static int raw_flag=0;
static int silent_flag=0;
static int magnetic_flag=0;
static int fixclear_flag=0;
static int compass_flag=0;
static int got_gps_type=0;
@@ -124,6 +127,55 @@ static char gps_type[26];
static int window_length;
static int display_sats;

/* Convert true heading to magnetic. Taken from the Aviation
Formulary v1.43. Valid to within two degrees within the
continiental USA except for the following airports: MO49 MO86 MO50
3K6 02K and KOOA. AK correct to better than one degree. Western
Europe correct to within 0.2 deg.

If you're not in one of these areas, I apologize, I don't have the
math to compute your varation. This is obviously extremely
floating-point heavy, so embedded people, beware of using.

Note that there are issues with using magnetic heading. This code
does not account for the possibility of travelling into or out of
an area of valid calculation beyond forcing the magnetic conversion
off. A better way to communicate this to the user is probably
desirable (in case the don't notice the subtle change from "(mag)"
to "(true)" on their display).
*/
static float true2magnetic(double lat, double lon, double heading)
{
/* Western Europe */
/*@ -evalorder +relaxtypes @*/
if((lat > 36.0) && (lat < 68.0) &&
(lon > -10.0) && (lon < 28.0)) {
return( 10.4768771667158 - (0.507385322418858 * lon) + (0.00753170031703826 * pow(lon, 2))
- (1.40596203924748e-05 * pow(lon, 3)) - (0.535560699962353 * lat)
+ (0.0154348808069955 * lat * lon) - (8.07756425110592e-05 * lat * pow(lon, 2))
+ (0.00976887198864442 * pow(lat, 2)) - (0.000259163929798334 * lon * pow(lat, 2))
- (3.69056939266123e-05 * pow(lat, 3)) + heading);
}
lon=0.0-lon;
/* USA */
if((lat > 24.0) && (lat < 50.0) &&
(lon > 66.0) && (lon < 125.0)) {
return( (-65.6811) + (0.99 * lat) + (0.0128899 * pow(lat, 2)) - (0.0000905928 * pow(lat, 3)) + (2.87622 * lon)
- (0.0116268 * lat * lon) - (0.00000603925 * lon * pow(lat, 2)) - (0.0389806 * pow(lon, 2))
- (0.0000403488 * lat * pow(lon, 2)) + (0.000168556 * pow(lon, 3)) + heading);
}
/* AK */
if((lat > 54.0) &&
(lon > 130.0) && (lon < 172.0)) {
return( 618.854 + (2.76049 * lat) - (0.556206 * pow(lat, 2)) + (0.00251582 * pow(lat, 3)) - (12.7974 * lon)
+ (0.408161 * lat * lon) + (0.000434097 * lon * pow(lat, 2)) - (0.00602173 * pow(lon, 2))
- (0.00144712 * lat * pow(lon, 2)) + (0.000222521 * pow(lon, 3)) + heading);
}
magnetic_flag=0;
return(heading);
/*@ +evalorder -relaxtypes @*/
}

/* Function to call when we're all done. Does a bit of clean-up. */
static void die(int sig UNUSED)
{
@@ -347,7 +399,7 @@ static void update_compass_panel(struct gps_data_t *gpsdata,

/* Fill in the heading. */
if (isnan(gpsdata->fix.track)==0) {
(void)snprintf(scr, sizeof(scr), "%.1f", gpsdata->fix.track);
(void)snprintf(scr, sizeof(scr), "%.1f degrees", gpsdata->fix.track);
} else
(void)snprintf(scr, sizeof(scr), "n/a");
(void)mvwprintw(datawin, 2, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr);
@@ -487,7 +539,11 @@ static void update_gps_panel(struct gps_data_t *gpsdata,

/* Fill in the heading. */
if (gpsdata->fix.mode >= MODE_2D && isnan(gpsdata->fix.track)==0)
(void)snprintf(scr, sizeof(scr), "%.1f degrees", gpsdata->fix.track);
if(magnetic_flag==0) {
(void)snprintf(scr, sizeof(scr), "%.1f deg (true)", gpsdata->fix.track);
} else {
(void)snprintf(scr, sizeof(scr), "%.1f deg (mag) ", true2magnetic(gpsdata->fix.latitude, gpsdata->fix.longitude, gpsdata->fix.track));
}
else
(void)snprintf(scr, sizeof(scr), "n/a");
(void)mvwprintw(datawin, 6, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr);
@@ -555,7 +611,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata,

/* Fill in the estimated track error. */
if (isnan(gpsdata->fix.epd)==0)
(void)snprintf(scr, sizeof(scr), "+/- %.1f deg", (gpsdata->fix.epd));
(void)snprintf(scr, sizeof(scr), "+/- %d deg", (int)(gpsdata->fix.epd));
else
(void)snprintf(scr, sizeof(scr), "n/a");
(void)mvwprintw(datawin, 12, DATAWIN_VALUE_OFFSET + 5, "%-*s", 22, scr);
@@ -597,6 +653,8 @@ static void usage( char *prog)
" d = DD.dddddd\n"
" m = DD MM.mmmm'\n"
" s = DD MM' SS.sss\"\n"
" -m Display heading as the estimated magnetic heading\n"
" Valid only for USA (Lower 48 + AK) and Western Europe.\n"
, prog);

exit(1);
@@ -614,8 +672,11 @@ int main(int argc, char *argv[])
int data;

/* Process the options. Print help if requested. */
while ((option = getopt(argc, argv, "hVl:sj")) != -1) {
while ((option = getopt(argc, argv, "hVl:sjm")) != -1) {
switch (option) {
case 'm':
magnetic_flag=1;
break;
case 's':
silent_flag=1;
break;
@@ -623,7 +684,7 @@ int main(int argc, char *argv[])
fixclear_flag=1;
break;
case 'V':
(void)fprintf(stderr, "SVN ID: $Id: cgps.c 4547 2007-12-13 01:38:22Z esr $ \n");
(void)fprintf(stderr, "SVN ID: $Id: cgps.c 5053 2009-01-21 11:44:35Z esr $ \n");
exit(0);
case 'l':
switch ( optarg[0] ) {


+ 86
- 24
config.guess View File

@@ -1,9 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.

timestamp='2005-06-30'
timestamp='2008-01-23'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -55,8 +56,8 @@ version="\
GNU config.guess ($timestamp)

Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -106,7 +107,7 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -125,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ;'
esac ; set_cc_for_build= ;'

# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@@ -206,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@@ -325,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:*)
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@@ -527,7 +532,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[45])
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -623,8 +628,7 @@ EOF
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
# avoid double evaluation of $set_cc_for_build
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
eval $set_cc_for_build

# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -765,12 +769,19 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@@ -780,9 +791,18 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
@@ -795,7 +815,7 @@ EOF
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:*)
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
@@ -816,6 +836,16 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
@@ -852,7 +882,11 @@ EOF
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
@@ -871,9 +905,16 @@ EOF
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
@@ -917,9 +958,15 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -962,7 +1009,7 @@ EOF
LIBC=gnulibc1
# endif
#else
#ifdef __INTEL_COMPILER
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
@@ -972,7 +1019,11 @@ EOF
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
@@ -1174,6 +1225,15 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1183,7 +1243,6 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1262,6 +1321,9 @@ EOF
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
esac

#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1422,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run ($0) is already up to date, please