Browse Source

Imported Upstream version 3.12

master
Bernd Zeimetz 5 years ago
parent
commit
df045a788a
100 changed files with 4966 additions and 4137 deletions
  1. +1
    -0
      .splintrc
  2. +9
    -6
      INSTALL
  3. +117
    -99
      NEWS
  4. +171
    -111
      SConstruct
  5. +96
    -91
      TODO
  6. +4
    -3
      ais_json.c
  7. +26
    -0
      bits.c
  8. +6
    -0
      bits.h
  9. +117
    -36
      build.txt
  10. +18
    -26
      cgps.c
  11. +25
    -0
      compiler.h
  12. +17
    -0
      devtools/README
  13. +19
    -0
      devtools/do-build
  14. +119
    -0
      devtools/easyinverse.pl
  15. +125
    -0
      devtools/identify_failing_build_options.py
  16. +1
    -1
      devtools/sizes
  17. +76
    -71
      driver_ais.c
  18. +21
    -23
      driver_evermore.c
  19. +112
    -108
      driver_garmin.c
  20. +47
    -49
      driver_garmin_txt.c
  21. +83
    -78
      driver_geostar.c
  22. +42
    -41
      driver_italk.c
  23. +105
    -96
      driver_navcom.c
  24. +208
    -179
      driver_nmea0183.c
  25. +108
    -103
      driver_nmea2000.c
  26. +47
    -42
      driver_oncore.c
  27. +20
    -25
      driver_proto.c
  28. +4
    -4
      driver_rtcm2.c
  29. +2
    -2
      driver_rtcm3.c
  30. +186
    -157
      driver_sirf.c
  31. +44
    -37
      driver_superstar2.c
  32. +95
    -94
      driver_tsip.c
  33. +92
    -86
      driver_ubx.c
  34. +34
    -38
      driver_zodiac.c
  35. +118
    -95
      drivers.c
  36. +42
    -69
      gps.h
  37. +53
    -61
      gps/fake.py
  38. +12
    -6
      gps2udp.c
  39. +51
    -50
      gps_maskdump.c
  40. +14
    -6
      gpscap.ini
  41. +1
    -1
      gpscap.py
  42. +2
    -2
      gpscat
  43. +12
    -1
      gpsctl.1
  44. +100
    -90
      gpsctl.c
  45. +19
    -0
      gpsctl.xml
  46. +15
    -3
      gpsd.8
  47. +269
    -278
      gpsd.c
  48. +170
    -85
      gpsd.h-tail
  49. +2
    -0
      gpsd.hotplug
  50. +4
    -0
      gpsd.rules.in
  51. +28
    -11
      gpsd.xml
  52. +9
    -56
      gpsd_json.5
  53. +338
    -526
      gpsd_json.c
  54. +9
    -40
      gpsd_json.xml
  55. +9
    -1
      gpsdecode.1
  56. +133
    -89
      gpsdecode.c
  57. +9
    -0
      gpsdecode.xml
  58. +49
    -40
      gpsfake
  59. +3
    -7
      gpsfake.1
  60. +7
    -6
      gpsfake.xml
  61. +5
    -1
      gpsmon.1
  62. +103
    -110
      gpsmon.c
  63. +10
    -2
      gpsmon.xml
  64. +17
    -3
      gpspacket.c
  65. +1
    -1
      gpspipe.1
  66. +8
    -2
      gpspipe.c
  67. +1
    -1
      gpspipe.xml
  68. +82
    -38
      gpsprof
  69. +31
    -30
      gpssim.py
  70. +44
    -3
      gpsutils.c
  71. +14
    -18
      gpxlogger.c
  72. +1
    -1
      hex.c
  73. +68
    -68
      isgps.c
  74. +128
    -25
      json.c
  75. +13
    -1
      json.h
  76. +7
    -5
      lcdgps.c
  77. +12
    -6
      leapsecond.py
  78. +1
    -0
      leapseconds.cache
  79. +7
    -0
      libgps.3
  80. +9
    -0
      libgps.h
  81. +10
    -0
      libgps.xml
  82. +32
    -23
      libgps_core.c
  83. +36
    -45
      libgps_json.c
  84. +5
    -1
      libgps_shm.c
  85. +54
    -273
      libgps_sock.c
  86. +288
    -275
      libgpsd_core.c
  87. +40
    -0
      maintainers.txt
  88. +22
    -11
      maskaudit.py.in
  89. +121
    -0
      matrix.c
  90. +11
    -0
      matrix.h
  91. +14
    -6
      monitor_garmin.c
  92. +3
    -3
      monitor_italk.c
  93. +33
    -20
      monitor_nmea0183.c
  94. +3
    -1
      monitor_oncore.c
  95. +1
    -1
      monitor_proto.c
  96. +22
    -11
      monitor_sirf.c
  97. +2
    -2
      monitor_superstar2.c
  98. +9
    -9
      monitor_tnt.c
  99. +18
    -7
      monitor_ubx.c
  100. +5
    -5
      net_dgpsip.c

+ 1
- 0
.splintrc View File

@@ -9,6 +9,7 @@
-predboolint
-nestedextern
-abstract
-fixedformalarray

-Ddbus_uint32_t=uint
-Disgps30bits_t=uint


+ 9
- 6
INSTALL View File

@@ -14,11 +14,14 @@ steps will be very frustrating. In this command
stty -F /dev/ttyXXX ispeed 4800 && cat </dev/ttyXXX

replace ttyXXX with the filename of the port. This will probably be
either /dev/ttyUSB0 or /dev/ttyS0. When you run this command, you
should see text lines beginning with $ come to stdout (possibly after
a short initial burst of binary garbage). If you don't see this, you
may have OS-level problems with your serial support, but more likely
have the wrong device. Look again.
either /dev/ttyUSB0 or /dev/ttyS0. If you are on a *BSD Unix or MacOS X,
replace -F with -f.

When you run this command, you should see text lines beginning with $
come to stdout (possibly after a short initial burst of binary
garbage). If you don't see this, you may have OS-level problems with
your serial support, but more likely have the wrong device. Look
again.

If you have trouble with the preceding step, check your cabling
first. Verify that the device is connected and that its power LED
@@ -82,7 +85,7 @@ various additional features have additional prerequisites:
|libtinfo5 | shared low-level terminfo library (see below)
|libusb-1.0.x or later | better USB device discovery
|Qt + qmake | libQgpsmm depends on this
|python2.6+ | required for various clients and utilities
|python2.x, x >=6 | required for various clients and utilities
|pgtk-2/cairo bindings | the main test client, xgps, needs this
|==========================================================================



+ 117
- 99
NEWS View File

@@ -1,8 +1,27 @@
GPSD project news

* Sat 23 Aug 2014 Eric S. Raymond <esr@snark.thyrsus.com> - 3.11
A bug that prevented track interpolation has been fixed.
We now get vertical error position and speed estimates from the
3.12: 2015-02-22 (Eric S. Raymond <esr@snark.thyrsus.com>)
The daemon's power utilization has been reduced by changing from
non-blocking to blocking I/O; this may be significant on mobile devices.
Better protection against false matches of Inland AIS messages; this
required a libgps version bump to 22 (as a side effect, per-device
footprint has decreased). PPS feature is no longer marked
experimental/unstable. Sentence tag fields have been dropped from
the JSON reports. GNSS and GLONASS SKY reports are now
merged. Addressed versions of AIS Type 25 and 26 are now
handled. The 'nmea' build option is now 'nmea0183'. New 'minimal'
option sets all boolean options not explicitly set on the build
command line to false. The 'limited_max_devices' option is now
'max_devices'; the 'limited_max_clients' option is now 'max_clients'
The previously deprecated 'libQgpsmm' option has been removed; use 'qt'.
A bug fix for error modeling when NMEA 0183 reports empty DOP
fields. On OS X, the "osx-pl203" driver has been explicitly listed
as unsupported. The last remnants of the old pre-JSON query protocol
have been removed from the client library.

3.11: 2014-07-23 (Eric S. Raymond <esr@snark.thyrsus.com>)
A bug that prevented track interpolation has been fixed.
We now get vertical error position and speed estimates from the
u-blox driver rather than having to interpolate them.
Some unusual AIS talker IDs (NMEA 4.0 station classes) are supported.
chrpath is no longer a dependency for building and testing, and
@@ -10,7 +29,7 @@
large PPS offsets. Improved recovery from device flakeouts,
gpsmon argument parsing.

* Fri 22 Nov 2013 Eric S. Raymond <esr@snark.thyrsus.com> - 3.10
3.10: 2013-11-22 (Eric S. Raymond <esr@snark.thyrsus.com>)
AIS: Adds gps2udp, an AIS data relay, split24 option supports
passing through Type 24 halves; support for Inland AIS; "scaled" no
longer controls dumping of controlled-vocabulary fields; instead,
@@ -21,7 +40,7 @@
mode and speed switching in the UBX driver. PPS message now ships
nsec. PPS events are visible in gpsmon. Time-reporting fix to TSIP.

* Wed 1 May 2013 Eric S. Raymond <esr@snark.thyrsus.com> - 3.9
3.9: 2013-05-01 (Eric S. Raymond <esr@snark.thyrsus.com>)
Note to packagers: this is an urgent release that fixes a possible
DoS or security hole! Armor the AIS driver against an implausible
overrun attack. A (different) fix for our first malformed-packet
@@ -29,7 +48,7 @@
driver. New FAQ entry on how to know WAAS/EGNOS is working.
New -u and -uu options enable usec timestamps on gpspipe output.

* Mon 25 Feb 2013 Eric S. Raymond <esr@snark.thyrsus.com> - 3.8
3.8: 2013-02-25 (Eric S. Raymond <esr@snark.thyrsus.com>)
Fix various minor errors in the AIVDM/AIVDO description. Repair the
xmlto support in the build system. Add two more regression
tests. Significant improvements to NMEA2000 support. Upgrade the PHP
@@ -37,13 +56,13 @@
chipset. Added a nautical-style display to xgpsspeed. Minor
improvements to leapsecond.py.

* Mon 02 Jul 2012 Eric S. Raymond <esr@snark.thyrsus.com> - 3.7
3.7: 2012-07-02 (Eric S. Raymond <esr@snark.thyrsus.com>)
Snap release to get the midnight change in the default leap-second
constant out the door. Port tests now pass on all Debian supported
architectures, including the Sparc and s390 that were giving us
trouble before. Pre-2003 Delorme Earthmate works again.

* Wed 23 May 2012 Eric S. Raymond <esr@snark.thyrsus.com> - 3.6
3.6: 2012-05-23 (Eric S. Raymond <esr@snark.thyrsus.com>)
It's the Fernando Poo Day release. Code has zero detectible defects
under Coverity scanning and cppcheck 1.52; this is mainly a cleanup
release to get those minor fixes into the field. If a leap-second
@@ -53,7 +72,7 @@
chrpath is no longer a build dependency; see build.txt for
explanation.

* Sat 14 Apr 2012 Eric S. Raymond <esr@snark.thyrsus.com> - 3.5
3.5: 2012-04-14 (Eric S. Raymond <esr@snark.thyrsus.com>)
Use pselect when it's available to cut down on wakeups and improve
signal handling. New {PPS} message exporting clock drift. The AIVDM
driver now handles up to 16 interleaved 24A and 24B pair-halves.
@@ -62,17 +81,17 @@
PPS code now just accepts any handshake pin. A bug that sometimes
caused RTCM packets to be dropped rather than relayed is fixed.

* Thu 12 Jan 2012 Eric S. Raymond <esr@snark.thyrsus.com> - 3.4
3.4: 2012-01-12 (Eric S. Raymond <esr@snark.thyrsus.com>)
Don't barf when chrpath is not available, fall back to static linking;
helps people not running Linux.

* Sat Oct 29 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 3.3
3.3: 2011-10-29 (Eric S. Raymond <esr@snark.thyrsus.com>)
Improvements to build and release-procedure documentation. Make
sirf=no build work again. Main reason for this release is to make
chrpath a mandatory build dependency and explain why in the build
documentation.

* Wed Oct 25 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 3.2
3.2: 2011-10-25 (Eric S. Raymond <esr@snark.thyrsus.com>)
In the build recipe, (1) set pkgconfig properly for 64-bit Fedora
systems, (2) clean up various derived files including *.pyc on scons
-c, (3) add an option to disable stripping of binaries (strip=no),
@@ -90,7 +109,7 @@
device; the Jackson Labs Fury. The chrpath utility has become a
build prerequisite.

* Sun Aug 28 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 3.1
3.1: 2011-07-28 (Eric S. Raymond <esr@snark.thyrsus.com>)
The Irene release, rocking you like a hurricane and brought to you
from the storm shelter in my basement. This is a snap release mainly
to get some scons recipe cleanups out the door. Parallelized builds
@@ -107,14 +126,14 @@
suppresses backgrounding; privileges are now dropped as in normal
background operation.

* Fri Aug 19 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 3.0
3.0: 2011-07-19 (Eric S. Raymond <esr@snark.thyrsus.com>)
POLL subobject name changes: fixes -> tpv, skyview -> sky.
Fix a timestamp-clobbering bug in the C library revealed by an
obscure car-nav device, the MyGuide 3100. The DEVICE 'activated'
attribute becomes an ISO8601 string; the client libraries will
still backward-compatibly read a float value. gps_unpack() is
now a documented part of the library API. There is now a
shared-memory export from the daemon that can be accessed through
shared-memory export from the daemon that can be accessed through
the C and C++ client libraries. xgps and cgps may now display
the Maidenhead grid locator for current lat/lon. xgps displays
GST noise statistics if they are available. Codebase now has
@@ -125,7 +144,7 @@
for live-feeding GPSD data to Google Earth. The hotplug sequence no
longer requires Python.

* Mon Mar 21 2011 Eric S. Raymond <esr@snark.thyrsus.com> - 2.96
2.96: 2011-03-21 (Eric S. Raymond <esr@snark.thyrsus.com>)
Bumped maximum channel count to 32 to accommodate GPS+GLONASS devices.
API version bumped to 5, redesign finished (changes are documented
in the Client HOWTO). cgps now handles resize signals. Code can now
@@ -134,18 +153,18 @@
log file. A gpsd client can now set any locale it likes, and JSON
will still be parsed using the C locale matching the daemon's. Clients
are no longer required to define a gpsd_report() hook. gpsd no longer
emits probe strings to unidentified USB devices at startup.
emits probe strings to unidentified USB devices at startup.
JSON timestamps in TPV and SKY are now ISO8601 rather than seconds since
the Unix epoch; the library handles the older style backward-compatibly.
the Unix epoch; the library handles the older style backward-compatibly.
GPGST sentences are now parsed for noise statistics when a device emits them.
AIS and RTCM2 JSON dumps have device fields. JSON reports now include 50bps
subframe data if the device allows access to it. gpsdecode can now dump NMEA
GPS binary, and subframe data to JSON. The RTCM2 code now understands and
GPS binary, and subframe data to JSON. The RTCM2 code now understands and
analyzes RTCM2.3 messages 13, 14, and 31, and has been checked against another
analyzer. The ancient Sager dump format for RTCM2 is abolished in favor of
a JSON profile.

* Tue Jul 13 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.95
2.95: 2010-07-13 (Eric S. Raymond <esr@snark.thyrsus.com>)
The autonomous robot submarine total world domination release!
Rationalize clearing and generation of DOPs, this makes epx/epy much
more generally available. Fixed the test productions for the udev
@@ -165,7 +184,7 @@
in -c mode, as string fields can contain commas. Corrected error
in reporting of AIS rate-of-turn fields.

* Tue Apr 20 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.94
2.94: 2010-04-20 (Eric S. Raymond <esr@snark.thyrsus.com>)
Error-checking in the 50bps subframe code has been greatly improved.
The Garmin GPS driver can now use libusb, if it is present, to do
device discovery. The libgps library has been split apart; the
@@ -176,7 +195,7 @@
extracting the leap-second offset; they should prevent many cases
where gpsd might previously have used an invalid leap-second offset.

* Fri Apr 16 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.93
2.93: 2010-04-16 (Eric S. Raymond <esr@snark.thyrsus.com>)
Support for JSON dumping and parsing of AIS message types 25 and 26,
not yet observed in the wild on AISHub. Fix Debian bug #569703. by
removing non-streaming mode from the Python exerciser. Fix Debian
@@ -197,12 +216,12 @@
There is now a gpsdfake diagnostic tool that fakes being gpsd shipping
arbitrary specified data to clients.

* Wed Mar 3 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.92
2.92: 2010-03-03 (Eric S. Raymond <esr@snark.thyrsus.com>)
Fix a packaging error. The new Python library module was
inadvertently omitted from the 2.91 tarball. Also, improve the json
import test slightly.

* Mon Mar 1 2010 Eric S. Raymond <esr@snark.thyrsus.com> - 2.91
2.91: 2010-03-01 (Eric S. Raymond <esr@snark.thyrsus.com>)
We have support for NMEA GLONASS sentences, and a regression test.
Clients now get a DEVICE notification on every driver switch. It is
possible to specify a TCP/IP AIS feed such as AISHub as a data
@@ -217,7 +236,7 @@
modeling has been fixed. Old protocol has been removed from the
daemon; the library still speaks it.

* Fri Dec 4 2009 Eric S. Raymond <esr@snark.thyrsus.com> - 2.90
2.90: 2009-12-04 (Eric S. Raymond <esr@snark.thyrsus.com>)
GPSD-NG, the new JSON-based command protocol, is now deployed; as a
consequence, AIS is now fully supported in both daemon and client.
Detection of end of a fix-reporting cycle is now reliable;
@@ -231,7 +250,7 @@
interleaving test sentences from each. gpsd now accepts error
estimates from the NMEA $GPGBS sentence.

* Wed Mar 18 2009 Eric S. Raymond <esr@snark.thyrsus.com> - 2.39
2.39: 2009-03-18 (Eric S. Raymond <esr@snark.thyrsus.com>)
Fixed potential core dump in C client handling of "K" responses.
Made device hotplugging work again; had been broken by changes in udev.
Introduced major and minor API version symbols into the public interfaces.
@@ -247,7 +266,7 @@
library now works correctly in locales where the decimal separator is
not a period.

* Tue Feb 10 2009 Eric S. Raymond <esr@snark.thyrsus.com> - 2.38
2.38: 2009-02-10 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -263,12 +282,12 @@
and returns, 'rtcm104v2' rather than 'rtcm104'; this is design forward
for when RTCM104v3 is fully working.

* Sun Feb 17 2008 Chris Kuethe <ckuethe@mainframe.cx> - 2.37
2.37: 2008-02-17 (Chris Kuethe <ckuethe@mainframe.cx>)
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
2.36: 2008-01-01 (Eric S. Raymond <esr@snark.thyrsus.com>)
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.
@@ -277,7 +296,7 @@
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
2.35: 2007-12-10 (Eric S. Raymond <esr@snark.thyrsus.com>)
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.
@@ -287,7 +306,7 @@
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
2.34: 2006-12-14 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -301,20 +320,20 @@
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
2.33: 2006-06-09 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.32: 2006-03-12 (Eric S. Raymond <esr@snark.thyrsus.com>)
Cleanup of the xgps layout, and minor memory-leak fixes for xgps. Fix
to cope with Antares u-blox 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
2.31: 2006-02-17 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -322,13 +341,13 @@
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
2.30: 2005-09-14 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.29: 2005-07-19 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -339,13 +358,13 @@
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
2.28: 2005-07-06 (Eric S. Raymond <esr@snark.thyrsus.com>)
The 2.27 source tarball somehow got truncated on upload.
Due to procedural mechanics at Berlios, 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
2.27: 2005-07-06 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -362,7 +381,7 @@
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
2.26: 2005-06-22 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -379,7 +398,7 @@
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
2.25: 2005-05-21 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -390,7 +409,7 @@
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
2.24: 2005-05-17 (Eric S. Raymond <esr@snark.thyrsus.com>)
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.
@@ -398,7 +417,7 @@
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
2.23: 2005-05- 4 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -408,18 +427,18 @@
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
2.22: 2005-04-25 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.21: 2005-04-12 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.20: 2005-03-31 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -428,20 +447,20 @@
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
2.19: 2005-03-26 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.18-1: 2005-03-23 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.17: 2005-03-16 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -449,13 +468,13 @@
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
2.16: 2005-03-11 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.15: 2005-03-02 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -466,14 +485,14 @@
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
2.14: 2005-02-25 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.13: 2005-02-21 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -485,7 +504,7 @@
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
2.12: 2005-02-15 (Eric S. Raymond <esr@snark.thyrsus.com>)
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.
@@ -496,7 +515,7 @@
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
2.11: 2005-02-10 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -505,21 +524,21 @@
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
2.10: 2005-02-01 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.9: 2005-01-27 (Eric S. Raymond <esr@snark.thyrsus.com>)
Python files restored to RPM.

* Thu Jan 27 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.8-1
2.8: 2005-01-27 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.7: 2005-01-14 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -529,18 +548,18 @@
pidfile. Audited for potential buffer overruns, found and fixed
two.

* Sat Jan 01 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.6-1
2.6: 2005-01-01 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.5: 2004-12-23 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.4: 2004-12-09 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -548,12 +567,12 @@
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
2.3: 2004-10-25 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
2.2: 2004-10-18 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -561,7 +580,7 @@
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
2.1: 2004-09-30 (Eric S. Raymond <esr@snark.thyrsus.com>)
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.
@@ -570,20 +589,20 @@
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
2.0: 2004-09-16 (Eric S. Raymond <esr@snark.thyrsus.com>)
Packaging fixes for 2.0 release.

* Wed Sep 8 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 1.98-1
1.98: 2004-09-08 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
1.97: 2004-08-08 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
1.96: 2004-08-31 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -592,22 +611,22 @@
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
1.95: 2004-08-25 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
1.94: 2004-08-24 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
1.93: 2004-08-23 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
1.92: 2004-08-22 (Eric S. Raymond <esr@snark.thyrsus.com>)
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
@@ -615,7 +634,7 @@
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
1.91: 2004-08-21 (Eric S. Raymond <esr@snark.thyrsus.com>)
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;
@@ -623,43 +642,43 @@
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
1.90: 2004-08-15 (Eric S. Raymond <esr@snark.thyrsus.com>)
Creation of specfile.

* Sun Mar 21 2004 Remco Treffkorn <remco@rvt.com> - ?
?: 2004-03-21 (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> - ?
?: 2004-01-29 (Remco Treffkorn <remco@rvt.com>)
Make applications null-terminate their resource lists.

* Sat Dec 20 2003 Remco Treffkorn <remco@rvt.com> - ?
?: 2003-12-20 (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
1.10: 2003-08-20 (Remco Treffkorn <remco@rvt.com>)
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> - ?
?: 2003-08-18 (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
1.09: 2003-02-16 (Remco Treffkorn <remco@rvt.com>)
Include sys/time.h in gpsd.c for struct timeval.

* Sun Nov 03 2002 Remco Treffkorn <remco@rvt.com> - ?
?: 2002-11-03 (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
1.08: 2002-10-03 (Remco Treffkorn <remco@rvt.com>)
Added sockopt SO_REUSEADDR to netlib.c passive_sock.

* Tue Feb 05 2002 Remco Treffkorn <remco@rvt.com> - 1.07
1.07: 2002-02-05 (Remco Treffkorn <remco@rvt.com>)
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
@@ -672,13 +691,13 @@
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
1.06: 2000-08-11 (Remco Treffkorn <remco@rvt.com>)
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
1.05: 2000-05-12 (Remco Treffkorn <remco@rvt.com>)
(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
@@ -686,30 +705,29 @@
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
1.02: 2000-03-17 (Remco Treffkorn <remco@rvt.com>)
(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.
1.01: 2000-03-05 (Remco Treffkorn <remco@rvt.com>)
Updated to IANA port. Fixes to DGPS support.

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

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

* Sat Jul 17 1999 Remco Treffkorn <remco@rvt.com> - 0.99
0.99: 1999-07-17 (Remco Treffkorn <remco@rvt.com>)
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
0.96: 1999-03-04 (Remco Treffkorn <remco@rvt.com>)
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
0.95: 1999-02-06 (Remco Treffkorn <remco@rvt.com>)
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
@@ -718,18 +736,18 @@
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
0.94: 1999-01-24 (Remco Treffkorn <remco@rvt.com>)
Y2K compliant ;-) (... is NOT. Look for "FIXME:" in nmea_parse.c)

* Tue Jan 27 1998 Remco Treffkorn <remco@rvt.com> - 0.93
0.93: 1998-01-27 (Remco Treffkorn <remco@rvt.com>)
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
0.9: 1997-05-13 (Remco Treffkorn <remco@rvt.com>)
some cleanups in the ini code. version 0.9 ...

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

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

+ 171
- 111
SConstruct View File

@@ -24,10 +24,10 @@
# * Coveraging mode: gcc "-coverage" flag requires a hack for building the python bindings

# Release identification begins here
gpsd_version = "3.11"
gpsd_version = "3.12"

# library version
libgps_version_current = 21
libgps_version_current = 22
libgps_version_revision = 0
libgps_version_age = 0
libgpsd_version_current = 22
@@ -60,9 +60,9 @@ devmail = "gpsd-dev@lists.nongnu.org"
usermail = "gpsd-users@lists.nongnu.org"
annmail = "gpsd-announce@nongnu.org"
ircchan = "irc://chat.freenode.net/#gpsd"
tiplink = "<a href='http://gittip.com/esr'>leave a tip at Gittip</a>"
tipwidget = "<script data-gittip-username='esr' \
data-gittip-widget='button' src='//gttp.co/v1.js'></script>"
tiplink = "<a href='http://gratipay.com/esr'>leave a tip at Gratipay</a>"
tipwidget = "<script data-gratipay-username='esr' \
data-gratipay-widget='button' src='//gttp.co/v1.js'></script>"
# Hosting information ends here

EnsureSConsVersion(2,0,1)
@@ -98,7 +98,7 @@ imloads = True

boolopts = (
# GPS protocols
("nmea", True, "NMEA support"),
("nmea0183", True, "NMEA0183 support"),
("ashtech", True, "Ashtech support"),
("earthmate", True, "DeLorme EarthMate Zodiac support"),
("evermore", True, "EverMore binary support"),
@@ -108,7 +108,7 @@ boolopts = (
("geostar", True, "Geostar Protocol support"),
("itrax", True, "iTrax hardware support"),
("mtk3301", True, "MTK-3301 support"),
("navcom", True, "Navcom support"),
("navcom", True, "Navcom NCT support"),
("oncore", True, "Motorola OnCore chipset support"),
("sirf", True, "SiRF chipset support"),
("superstar2", True, "Novatel SuperStarII chipset support"),
@@ -125,19 +125,19 @@ boolopts = (
("oceanserver", True, "OceanServer support"),
("rtcm104v2", True, "rtcm104v2 support"),
("rtcm104v3", True, "rtcm104v3 support"),
("passthrough", True, "build support for passing through JSON"),
# Time service
("ntpshm", True, "NTP time hinting support"),
("pps", True, "PPS time syncing support"),
# Export methods
("socket_export", True, "data export over sockets"),
("dbus_export", False, "enable DBUS export support"),
("dbus_export", True, "enable DBUS export support"),
("shm_export", True, "export via shared memory"),
# Communication
('usb', True, "libusb support for USB devices"),
("bluez", True, "BlueZ support for Bluetooth devices"),
("ipv6", True, "build IPv6 support"),
("netfeed", True, "build support for handling TCP/IP data sources"),
("passthrough", True, "build support for passing through JSON"),
# Other daemon options
("force_global", False, "force daemon to listen on all addressses"),
("timing", False, "latency timing support"),
@@ -145,16 +145,14 @@ boolopts = (
("systemd", systemd, "systemd socket activation"),
# Client-side options
("clientdebug", True, "client debugging support"),
("oldstyle", True, "oldstyle (pre-JSON) protocol support"),
("ncurses", True, "build with ncurses"),
("libgpsmm", True, "build C++ bindings"),
("libQgpsmm", True, "build QT bindings (deprecated alias)"),
("qt", True, "build QT bindings"),
# Daemon options
("reconfigure", True, "allow gpsd to change device settings"),
("controlsend", True, "allow gpsctl/gpsmon to change device settings"),
("cheapfloats", True, "float ops are cheap, compute error estimates"),
("nofloats", False, "float ops are expensive, suppress error estimates"),
("squelch", False, "squelch gpsd_report/gpsd_hexdump to save cpu"),
("ncurses", True, "build with ncurses"),
# Build control
("shared", True, "build shared libraries, not static"),
("implicit_link", imloads,"implicit linkage is supported in shared libs"),
@@ -162,10 +160,13 @@ boolopts = (
("debug", False, "include debug information in build"),
("profiling", False, "build with profiling enabled"),
("coveraging", False, "build with code coveraging enabled"),
("strip", True, "build with stripping of binaries enabled"),
("nostrip", False, "don't symbol-strip binaries at link time"),
("chrpath", False, "use chrpath to edit library load paths"),
("manbuild", True, "build help in man and HTML formats"),
("leapfetch", True, "fetch up-to-date data on leap seconds."),
("minimal", False, "turn off every option not set on the command line"),
# Test control
("slow", False, "run tests with realistic (slow) delays"),
)
for (name, default, help) in boolopts:
opts.Add(BoolVariable(name, help, default))
@@ -182,14 +183,13 @@ nonboolopts = (
("prefix", "/usr/local", "installation directory prefix"),
("python_libdir", sysconfig.get_python_lib(plat_specific=1),
"Python module directory prefix"),
("limited_max_clients", 0, "maximum allowed clients"),
("limited_max_devices", 0, "maximum allowed devices"),
("max_clients", '64', "maximum allowed clients"),
("max_devices", '4', "maximum allowed devices"),
("fixed_port_speed", 0, "fixed serial port speed"),
("fixed_stop_bits", 0, "fixed serial port stop bits"),
("target", "", "cross-development target"),
("sysroot", "", "cross-development system root"),
)

for (name, default, help) in nonboolopts:
opts.Add(name, help, default)

@@ -207,7 +207,6 @@ pathopts = (
for (name, default, help) in pathopts:
opts.Add(PathVariable(name, help, default, PathVariable.PathAccept))


#
# Environment creation
#
@@ -223,6 +222,7 @@ import_env = (
'PKG_CONFIG_LIBDIR', # Pass more environment variables to pkg-config (required for crossbuilds)
'STAGING_DIR', # Required by the OpenWRT and CeroWrt builds.
'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds.
'WRITE_PAD', # So we can test WRITE_PAD values on the fly.
)
envs = {}
for var in import_env:
@@ -235,6 +235,12 @@ env = Environment(tools=["default", "tar", "textfile"], options=opts, ENV=envs)
opts.Save('.scons-option-cache', env)
env.SConsignFile(".sconsign.dblite")

# Minimal build turns off every option not set on the command line,
if env['minimal']:
for (name, default, help) in boolopts:
if default == True and not ARGUMENTS.get(name):
env[name] = False

for (name, default, help) in pathopts:
env[name] = env.subst(env[name])

@@ -271,17 +277,17 @@ for key, value in os.environ.iteritems():
# $SRCDIR replaces occurrences for $(srcdir) in the autotools build.
env['SRCDIR'] = '.'

# We may need to force slow regression tests to get around race
# conditions in the pty layer, especially on a loaded machine.
if env["slow"]:
env['REGRESSOPTS'] = "-S"
else:
env['REGRESSOPTS'] = ""

def announce(msg):
if not env.GetOption("silent"):
print msg

# We need to define -D_GNU_SOURCE
env.Append(CFLAGS='-D_GNU_SOURCE')

# And we need some libraries
env.MergeFlags("-lm")
env.MergeFlags("-pthread")

# DESTDIR environment variable means user wants to prefix the installation root.
DESTDIR = os.environ.get('DESTDIR', '')

@@ -308,9 +314,13 @@ if env["shared"]:
if 'MORECFLAGS' in os.environ:
env.Append(CFLAGS=Split(os.environ['MORECFLAGS']))

# Don't change CFLAGS if already set by environment.
if not 'CFLAGS' in os.environ:
if '-Wmissing-prototypes' not in env['CFLAGS']:
env.Append(CFLAGS=['-Wmissing-prototypes'])

# Don't change CCFLAGS if already set by environment.
if not 'CCFLAGS' in os.environ:
env.Append(CCFLAGS=['-Wmissing-prototypes'])
env.Append(CCFLAGS=['-Wmissing-declarations'])
# Should we build with profiling?
if env['profiling']:
@@ -487,7 +497,11 @@ else:
for option in ('-Wextra','-Wall', '-Wno-uninitialized','-Wno-missing-field-initializers',
'-Wcast-align','-Wmissing-declarations', '-Wmissing-prototypes',
'-Wstrict-prototypes', '-Wpointer-arith', '-Wreturn-type'):
config.CheckCompilerOption(option)
if option not in config.env['CFLAGS']:
config.CheckCompilerOption(option)

if config.CheckCompilerOption("-pthread"):
env.MergeFlags("-pthread")

env.Prepend(LIBPATH=[os.path.realpath(os.curdir)])
if env["shared"] and env["chrpath"]:
@@ -571,10 +585,13 @@ else:

if env['dbus_export'] and config.CheckPKG('dbus-1'):
confdefs.append("#define HAVE_DBUS 1\n")
dbus_libs = pkg_config('dbus-1')
dbus_libs = ["-ldbus-1"]
env.MergeFlags(pkg_config("dbus-1"))
else:
confdefs.append("/* #undef HAVE_DBUS */\n")
dbus_libs = []
if env["dbus_export"]:
announce("Turning off dbus-export support, library not found.")
env["dbus_export"] = False

if env['bluez'] and config.CheckPKG('bluez'):
@@ -583,6 +600,8 @@ else:
else:
confdefs.append("/* #undef HAVE_BLUEZ */\n")
bluezlibs = []
if env["bluez"]:
announce("Turning off Bluetooth support, library not found.")
env["bluez"] = False

#in_port_t is not defined on Android
@@ -605,6 +624,11 @@ else:
announce("You do not have kernel CANbus available.")
env["nmea2000"] = False

if config.CheckHeader("termios.h"):
confdefs.append("#define HAVE_TERMIOS_H 1\n")
else:
confdefs.append("/* #undef HAVE_TERMIOS_H */\n")

# endian.h is required for rtcm104v2 unless the compiler defines
# __ORDER_BIG_ENDIAN__, __ORDER_LITTLE_ENDIAN__ and __BYTE_ORDER__
if config.CheckCompilerDefines("__ORDER_BIG_ENDIAN__") \
@@ -679,7 +703,7 @@ else:
else:
confdefs.append("#define COMPAT_SELECT\n")

if config.CheckHeader(["sys/time.h", "sys/timepps.h"]):
if config.CheckHeader(["sys/types.h", "sys/time.h", "sys/timepps.h"]):
confdefs.append("#define HAVE_SYS_TIMEPPS_H 1\n")
kpps = True
else:
@@ -749,7 +773,10 @@ pid_t getsid(pid_t pid);
env['BUILDERS']["HTML"] = Builder(action=htmlbuilder,
src_suffix=".xml", suffix=".html")

qt_network = env['qt'] and env['libQgpsmm'] and config.CheckPKG('QtNetwork')
# Determine if Qt network libraries are present, and if not, force qt to off
qt_network = config.CheckPKG('QtNetwork')
if not qt_network:
env["qt"] = False

env = config.Finish()

@@ -770,7 +797,7 @@ pid_t getsid(pid_t pid);
announce("Adjust your PYTHONPATH to see library directories under /usr/local/lib")

# Should we build the Qt binding?
if qt_network:
if env["qt"]:
qt_env = env.Clone()
qt_env.MergeFlags('-DUSE_QT')
try:
@@ -820,6 +847,7 @@ libgpsd_sources = [
"geoid.c",
"isgps.c",
"libgpsd_core.c",
"matrix.c",
"net_dgpsip.c",
"net_gnss_dispatch.c",
"net_ntrip.c",
@@ -923,7 +951,7 @@ def VersionedSharedLibraryInstall(env, destination, libs):
for linksuffix in [shlib_suffix, major_name, minor_name]:
linkname = re.sub(suffix_re, linksuffix, lib)
env.AddPostAction(ilibs, 'cd %s; rm -f %s; ln -s %s %s' % (destination, linkname, lib, linkname))
env.Clean(lib, linkname)
env.Clean(lib, linkname)
return ilibs

if not env["shared"]:
@@ -946,14 +974,14 @@ compiled_gpslib = Library(env=env,
target="gps",
sources=libgps_sources,
version=libgps_version,
parse_flags=dbus_libs + rtlibs)
parse_flags=rtlibs)
env.Clean(compiled_gpslib, "gps_maskdump.c")

compiled_gpsdlib = Library(env=env,
target="gpsd",
sources=libgpsd_sources,
version=libgpsd_version,
parse_flags=usblibs + rtlibs + bluezlibs)
parse_flags=usblibs + rtlibs + bluezlibs + ["-lgps"])

libraries = [compiled_gpslib, compiled_gpsdlib]

@@ -976,14 +1004,14 @@ if qt_env:
compile_flags = qt_env['CFLAGS']
qtobjects.append(qt_env.SharedObject(src.split(".")[0] + '-qt', src,
CC=compile_with,
CFLAGS=compile_flags,
parse_flags=dbus_libs))
CFLAGS=compile_flags))
compiled_qgpsmmlib = Library(qt_env, "Qgpsmm", qtobjects, libgps_version)
libraries.append(compiled_qgpsmmlib)

# The libraries have dependencies on system libraries
# libdbus appears multiple times because the linker only does one pass.

gpslibs = ["-lgps", "-lm"]
gpslibs = ["-lgps", "-lm"] + dbus_libs
gpsdlibs = ["-lgpsd"] + usblibs + bluezlibs + gpslibs

# Source groups
@@ -996,7 +1024,7 @@ if env['systemd']:
gpsmon_sources = [
'gpsmon.c',
'monitor_italk.c',
'monitor_nmea.c',
'monitor_nmea0183.c',
'monitor_oncore.c',
'monitor_sirf.c',
'monitor_superstar2.c',
@@ -1009,8 +1037,7 @@ gpsmon_sources = [

gpsd_env = env.Clone()

gpsd = gpsd_env.Program('gpsd', gpsd_sources,
parse_flags = gpsdlibs + dbus_libs)
gpsd = gpsd_env.Program('gpsd', gpsd_sources, parse_flags = gpsdlibs)
env.Depends(gpsd, [compiled_gpsdlib, compiled_gpslib])

gpsdecode = env.Program('gpsdecode', ['gpsdecode.c'], parse_flags=gpsdlibs)
@@ -1048,22 +1075,23 @@ if env["ncurses"]:
# Test programs
test_float = env.Program('test_float', ['test_float.c'])
test_geoid = env.Program('test_geoid', ['test_geoid.c'], parse_flags=gpsdlibs)
env.Depends(test_geoid, [compiled_gpsdlib, compiled_gpslib])
test_json = env.Program('test_json', ['test_json.c'], parse_flags=gpslibs)
env.Depends(test_json, compiled_gpslib)
test_mkgmtime = env.Program('test_mkgmtime', ['test_mkgmtime.c'], parse_flags=gpslibs)
env.Depends(test_mkgmtime, compiled_gpslib)
test_mktime = env.Program('test_mktime', ['test_mktime.c'], parse_flags=gpslibs)
env.Depends(test_mktime, compiled_gpslib)
test_trig = env.Program('test_trig', ['test_trig.c'], parse_flags=["-lm"])
test_packet = env.Program('test_packet', ['test_packet.c'], parse_flags=gpsdlibs)
env.Depends(test_packet, [compiled_gpsdlib, compiled_gpslib])
test_bits = env.Program('test_bits', ['test_bits.c'], parse_flags=gpslibs)
env.Depends(test_bits, [compiled_gpsdlib, compiled_gpslib])
test_matrix = env.Program('test_matrix', ['test_matrix.c'], parse_flags=gpsdlibs)
env.Depends(test_matrix, [compiled_gpsdlib, compiled_gpslib])
test_gpsmm = env.Program('test_gpsmm', ['test_gpsmm.cpp'], parse_flags=gpslibs)
env.Depends(test_gpsmm, compiled_gpslib)
test_libgps = env.Program('test_libgps', ['test_libgps.c'], parse_flags=gpslibs)
env.Depends(test_libgps, compiled_gpslib)
testprogs = [test_float, test_trig, test_bits, test_packet,
test_mkgmtime, test_geoid, test_libgps]
testprogs = [test_float, test_trig, test_bits, test_matrix, test_packet,
test_mktime, test_geoid, test_libgps]
if env['socket_export']:
testprogs.append(test_json)
if env["libgpsmm"]:
@@ -1073,6 +1101,7 @@ if env["libgpsmm"]:
if not env['python']:
python_built_extensions = []
python_targets = []
python_progs = []
else:
python_progs = ["gpscat", "gpsfake", "gpsprof", "xgps", "xgpsspeed", "gegps"]
python_modules = Glob('gps/*.py')
@@ -1347,7 +1376,7 @@ if env["shared"] and env["chrpath"]:
env.AddPostAction(binaryinstall, '$CHRPATH -r "%s" "$TARGET"' \
% (installdir('libdir', False), ))

if not env['debug'] and not env['profiling'] and env['strip']:
if not env['debug'] and not env['profiling'] and not env['nostrip']:
env.AddPostAction(binaryinstall, '$STRIP $TARGET')

if not env['python']:
@@ -1357,7 +1386,7 @@ else:
python_module_dir = python_lib_dir + os.sep + 'gps'
python_extensions_install = python_env.Install( DESTDIR + python_module_dir,
python_built_extensions)
if not env['debug'] and not env['profiling'] and env['strip']:
if not env['debug'] and not env['profiling'] and not env['nostrip']:
python_env.AddPostAction(python_extensions_install, '$STRIP $TARGET')

python_modules_install = python_env.Install( DESTDIR + python_module_dir,
@@ -1447,7 +1476,7 @@ splint_table = [
('splint-gpsdecode',['gpsdecode.c'],'gpsdecode', ['']),
('splint-gpxlogger',['gpxlogger.c'],'gpxlogger', ['']),
('splint-test_packet',['test_packet.c'],'test_packet test harness', ['']),
('splint-test_mkgmtime',['test_mkgmtime.c'],'test_mkgmtime test harness', ['']),
('splint-test_mktime',['test_mktime.c'],'test_mktime test harness', ['']),
('splint-test_geoid',['test_geoid.c'],'test_geoid test harness', ['']),
('splint-test_json',['test_json.c'],'test_json test harness', ['']),
]
@@ -1466,7 +1495,16 @@ Utility("scan-build", ["gpsd.h", "packet_names.h"],

# Sanity-check Python code.
pylint = Utility("pylint", ["jsongen.py", "maskaudit.py", python_built_extensions],
['''pylint --rcfile=/dev/null --dummy-variables-rgx='^_' --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" --reports=n --disable=F0001,C0103,C0111,C1001,C0301,C0302,C0322,C0324,C0323,C0321,R0201,R0801,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,W0110,W0201,W0121,W0232,W0234,W0401,W0403,W0141,W0142,W0603,W0614,W0621,E1101,E1102,F0401 jsongen.py leapsecond.py maskaudit.py gpsprof.py gpscat.py gpsfake.py gegps.py gps/*.py xgps'''])
['''pylint --rcfile=/dev/null --dummy-variables-rgx='^_' --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" --reports=n --disable=F0001,C0103,C0111,C1001,C0301,C0302,C0322,C0324,C0323,C0321,C0330,R0201,R0801,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,W0110,W0201,W0121,W0123,W0232,W0234,W0401,W0403,W0141,W0142,W0603,W0614,W0640,W0621,E1101,E1102,E1103,F0401 gps/*.py *.py ''' + " ".join(python_progs)])

# Additional Python readablity style checks
pep8 = Utility("pep8", ["jsongen.py", "maskaudit.py", python_built_extensions],
['''pep8 --ignore=E501,W602,E122 {} gps/[a-zA-Z]*.py *.py'''.format(" ".join(python_progs))])

# Additional Python readablity style checks
flake8 = Utility("flake8", ["jsongen.py", "maskaudit.py", python_built_extensions],
['''flake8 --ignore=E501,W602,E122 {} gps/[a-zA-Z]*.py *.py'''.format(" ".join(python_progs))])


# Check the documentation for bogons, too
Utility("xmllint", glob.glob("*.xml"),
@@ -1498,6 +1536,11 @@ bits_regress = Utility('bits-regress', [test_bits], [
'$SRCDIR/test_bits --quiet'
])

# Unit-test the bitfield extractor
matrix_regress = Utility('matrix-regress', [test_matrix], [
'$SRCDIR/test_matrix --quiet'
])

# Check that all Python modules compile properly
if env['python']:
def check_compile(target, source, env):
@@ -1511,38 +1554,51 @@ else:
python_compilation_regress = None

# using regress-drivers requires socket_export being enabled.
if env['socket_export']:
# Regression-test the daemon
gps_regress = Utility("gps-regress", [gpsd, python_built_extensions],
'$SRCDIR/regress-driver test/daemon/*.log')
if not env['socket_export']:
announce("GPS regression tests suppressed because socket_export is off.")
gps_regress = None
else:
# Regression-test the daemon. But first:
# (1) Clear GPSD's SHM segment in case a previous abort didn't. This
# prevents spurious error messages.
# (2) Dump the platform and its delay parameters.
# The ":;" in this production and the next one forestalls an attempt by
# SCons to install up to date versions of gpsfake and gpsctl if it can
# find older versions of them in a directory on your $PATH.
gps_regress = Utility("gps-regress", [gpsd, gpsctl, python_built_extensions],
':; $SRCDIR/gpsfake -T; $SRCDIR/regress-driver $REGRESSOPTS test/daemon/*.log')

# Build the regression tests for the daemon.
# Note: You'll have to do this whenever the default leap second
# changes in timebase.h. The problem is in the SiRF tests;
# that driver relies on the default until it gets the current
# offset from subframe data.
Utility('gps-makeregress', [gpsd, python_built_extensions],
'$SRCDIR/regress-driver -b test/daemon/*.log')
Utility('gps-makeregress', [gpsd, gpsctl, python_built_extensions],
':; $SRCDIR/gpsfake -T; $SRCDIR/regress-driver -b $REGRESSOPTS test/daemon/*.log')

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

# Regression-test the RTCM decoder.
rtcm_regress = Utility('rtcm-regress', [gpsdecode], [
'@echo "Testing RTCM decoding..."',
'@for f in $SRCDIR/test/*.rtcm2; do '
'echo "Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.chk $${TMPFILE}; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing idempotency of JSON dump/decode for RTCM2"',
'@TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -e -j <test/synthetic-rtcm2.json >$${TMPFILE}; '
'grep -v "^#" test/synthetic-rtcm2.json | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
if not env["rtcm104v2"]:
announce("RTCM2 regression tests suppressed because rtcm104v2 is off.")
rtcm_regress = None
else:
rtcm_regress = Utility('rtcm-regress', [gpsdecode], [
'@echo "Testing RTCM decoding..."',
'@for f in $SRCDIR/test/*.rtcm2; do '
'echo "Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.chk $${TMPFILE}; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing idempotency of JSON dump/decode for RTCM2"',
'@TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -e -j <test/synthetic-rtcm2.json >$${TMPFILE}; '
'grep -v "^#" test/synthetic-rtcm2.json | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
])

# Rebuild the RTCM regression tests.
@@ -1553,43 +1609,47 @@ Utility('rtcm-makeregress', [gpsdecode], [
])

# Regression-test the AIVDM decoder.
aivdm_regress = Utility('aivdm-regress', [gpsdecode], [
'@echo "Testing AIVDM decoding w/ CSV format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo "Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -c <$${f} >$${TMPFILE}; '
'diff -ub $${f}.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing AIVDM decoding w/ JSON unscaled format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo " Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.ju.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing AIVDM decoding w/ JSON scaled format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo " Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.js.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing idempotency of unscaled JSON dump/decode for AIS"',
'@TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -e -j <$SRCDIR/test/sample.aivdm.ju.chk >$${TMPFILE}; '
'grep -v "^#" $SRCDIR/test/sample.aivdm.ju.chk | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
# Parse the unscaled json reference, dump it as scaled json,
# and finally compare it with the scaled json reference
'@echo "Testing idempotency of scaled JSON dump/decode for AIS"',
'@TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -e -j <$SRCDIR/test/sample.aivdm.ju.chk >$${TMPFILE}; '
'grep -v "^#" $SRCDIR/test/sample.aivdm.js.chk | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
if not env["aivdm"]:
announce("AIVDM regression tests suppressed because aivdm is off.")
aivdm_regress = None
else:
aivdm_regress = Utility('aivdm-regress', [gpsdecode], [
'@echo "Testing AIVDM decoding w/ CSV format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo "Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -c <$${f} >$${TMPFILE}; '
'diff -ub $${f}.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing AIVDM decoding w/ JSON unscaled format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo " Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.ju.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing AIVDM decoding w/ JSON scaled format..."',
'@for f in $SRCDIR/test/*.aivdm; do '
'echo " Testing $${f}..."; '
'TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -j <$${f} >$${TMPFILE}; '
'diff -ub $${f}.js.chk $${TMPFILE} || echo "Test FAILED!"; '
'rm -f $${TMPFILE}; '
'done;',
'@echo "Testing idempotency of unscaled JSON dump/decode for AIS"',
'@TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -u -e -j <$SRCDIR/test/sample.aivdm.ju.chk >$${TMPFILE}; '
'grep -v "^#" $SRCDIR/test/sample.aivdm.ju.chk | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
# Parse the unscaled json reference, dump it as scaled json,
# and finally compare it with the scaled json reference
'@echo "Testing idempotency of scaled JSON dump/decode for AIS"',
'@TMPFILE=`mktemp -t gpsd-test-XXXXXXXXXXXXXX.chk`; '
'$SRCDIR/gpsdecode -e -j <$SRCDIR/test/sample.aivdm.ju.chk >$${TMPFILE}; '
'grep -v "^#" $SRCDIR/test/sample.aivdm.js.chk | diff -ub - $${TMPFILE}; '
'rm -f $${TMPFILE}; ',
])

# Rebuild the AIVDM regression tests.
@@ -1629,8 +1689,8 @@ maidenhead_locator_regress = Utility('maidenhead-locator-regress', [python_built
])

# Regression-test the calendar functions
time_regress = Utility('time-regress', [test_mkgmtime], [
'$SRCDIR/test_mkgmtime'
time_regress = Utility('time-regress', [test_mktime], [
'$SRCDIR/test_mktime'
])

# Regression test the unpacking code in libgps
@@ -1670,12 +1730,13 @@ flocktest = Utility("flocktest", [], "cd devtools; ./flocktest " + gitrepo)
describe = Utility('describe', [],
['@echo "Run normal regression tests for %s..."' %(rev.strip(),)])
testclean = Utility('test_cleanup', [],
'rm -f test_bits test_geoid test_json test_libgps test_mkgmtime test_packet')
'rm -f test_bits test_matrix test_geoid test_json test_libgps test_mktime test_packet')
check = env.Alias('check', [
describe,
python_compilation_regress,
method_regress,
bits_regress,
matrix_regress,
gps_regress,
rtcm_regress,
aivdm_regress,
@@ -1701,7 +1762,6 @@ if env.WhereIs('asciidoc'):
'protocol-evolution',
'protocol-transition',
'gpsd-time-service-howto',
'calibrate-gpsd-ntpd-howto',
'client-howto']
asciidocs = ["www/" + stem + ".html" for stem in txtfiles] \
+ ["www/installation.html"]
@@ -1845,7 +1905,7 @@ Utility('udev-test', '', [

# Ordinary cleanup
clean = env.Clean(build,
map(glob.glob,("*.[oa]", "*.[1358]", "*.os", "*.os.*", "*.gcno", "*.pyc", "gps/*.pyc", "TAGS")) + testprogs + \
map(glob.glob,("*.[oa]", "*.[1358]", "*.os", "*.os.*", "*.gcno", "*.pyc", "gps/*.pyc", "TAGS", "config.log")) + testprogs + \
generated_sources + base_manpages.keys() + \
map(lambda f: f[:-3], templated))



+ 96
- 91
TODO View File

@@ -8,6 +8,16 @@ the "Hacking Guide" on the project website.
The list of bugs exposed by gpsd in other software has moved to
the "Upstream Bugs" page on the project website.

** Documentation **

We now have two different calibration procedures in the Tine Service
HOWTO. One was written by Gary and is based on peerstats; the other by
Sanjeev Gupta and is based on loopstats.

Can these be merged? How do we know which is appropriate to use when?
What could we build in the way of tools and visualization aids to make
the calibration process less annoying?

** Bugs in gpsd and its clients:

*** Tracker bugs
@@ -16,62 +26,110 @@ See the GPSD bug tracker on the project website, but don't be
surprised if it's empty or very sparse. Our rate of new defects per
month is quite low.

*** Documentation
*** RFC2783 bugs

Consider merging the calibration draft into the Time Service HOWTO.
**** detangle TIOCMIWAIT and RFC2783

*** Time tracking
Currently, the code for RFC2783 seems to depend (logically) on
TIOCMIWAIT support. However, RFC2783 (and really, no standard)
defines TIOCMIWAIT, and NetBSD (and probably FreeBSD) do not implement
it. So, there really should be two separate implementations, one that
works with TIOCMIWAIT (and thus only on Linux and OpenBSD) and one
that assumes only RFC2783 (and thus works on Linux, FreeBSD and
NetBSD, as well as any future system that complies with RFC2783 and
uses the serial port for time_pps_init).

Our goal is to be independent of the system clock.
*** Client bugs

**** Compile the GPS week of the build into the build
**** In gpsmon's PPS Offset field

The obvious place tp put this is in timebase.h. Not too expensive;
will typically cause extra work once per seven days. The benefit is that
we can compare received week to the compiled in week and if the latter
is less know that a rollover has occurred.
Presently PPS Offset is displayed in direct mode for NMEA, SiRF, and
UBX devices. Others should probably do likewise, notably the
Motorola Oncore and Garmin drivers.

**** Maybe apply wraparound compensation ****
*** Dispatcher/network issues

See <http://www.febo.com/pipermail/time-nuts/2013-August/079271.html>
**** Reading AISHub data via UDP confuses xgps with short writes

**** Track gpsd's confidence in the GPS time it's seeing
To reproduce, "gpsd -D 5 -N -n udp://192.168.1.3:12346" (only
works inside thyrsus.com) and run xgps. Probably some kind of
packet aggregation issue as it doesn't happen with test logs.

This would increase when we see a leap-second offset or get GPZDA from
the device, decrease when we detect a rollover. Some devices that are
known to deliver high-quality time (notably u-blox GPSes) would peg the
confidence measure at a high level. We'd use the confidence level to
control (a) whether gpsd ships to NTP, and (b) how it sets time
uncertainty in output JSON.
*** Driver issues

*** Client bugs
**** RTCM3 analysis is incomplete

**** In gpsmon's PPS Offset field
We can presently decode RTCM3 messages of type 1001-1014, 1029, and
1033. This is not the complete set. We need more test data with
different types in them, and a copy of the RTCM3 standard at latest
revision (all we have is revision 3).

Presently PPS Offset is displayed in direct mode for NMEA, SiRF, and
UBX devices. Others should probably do likewise, notably the
Motorola Oncore and Garmin drivers.
The support for unpacking RTCM3 sentences in the client library is
limited to 1001, 1002, 1007, 1008, 1009, 1010, 1014, and 1033. There
are some design issues with the baby JSON parser that are going to
make extending this set difficult.

**** gpsmon driver switching and blocking on error
**** Reporting code for specialized Type 6 and 8 AIS messages is incomplete.

Hal Murray reports:
This one is mine and Kurt Schwehr's. Support is currently nearly
complete; the only missing cases are a handful of IMO 236 and IMO 289
message 6 and 8 subtypes - specifically, 6/23, 8/21, 8/22, 8/24, and
8/26.

If I run .gpsmon /dev/ttyUSB0
** New features **

It starts up in NMEA0183 mode as I expect.
"i" switches to SiRF, again, as I expect.
*** Time tracking

"n" switches the display to NMEA layout, but the header still says SiRF.
Another "n" now says: Device type has no mode switcher.
At this point, "i" doesn't do anything. (no pause either)
Our goal is to be independent of the system clock.

The second 'n' is losing information that it shouldn't.
**** Maybe apply wraparound compensation ****

If I start over and feed it an "f", it starts blinking "Unknown command "f"
The logging and display update stops. After I type another character, it
clears the blinking error message and stars logging/updating again.
See <http://www.febo.com/pipermail/time-nuts/2013-August/079271.html>

Display update should not stop while this is going on.
**** Track gpsd's confidence in the GPS time it's seeing

This would increase when we see a leap-second offset or get GPZDA from
the device, decrease when we detect a rollover. Some devices that are
known to deliver high-quality time (notably u-blox GPSes) would peg the
confidence measure at a high level. We'd use the confidence level to
control (a) whether gpsd ships to NTP, and (b) how it sets time
uncertainty in output JSON.

*** Optionally use tag blocks in NMEA output

Ed W. writes:
>Feature request: I would like to see an option to get the NMEA data
>out of gpsd, but augmented with a timestamp on each sentence and
>details of which input fed in the data. TAG blocks appear to solve
>that problem perfectly. So the feature request is simply an option
>that inserts a TAG block for each emitted sentence from GPSd with a
>timestamp and some handle which references the input method for the
>sentence.
>
>I think all this is effectively emitted with the JSON output (?), so
>really this is just adding it to the NMEA sentence output options via
>the TAG structure

However, Iván Sánchez Ortega notes:

>There is one *big* problem with using TAG blocks to timestamp the sentences.
>The standards (as far as I/we know) say that the timestamp is **either** the
>number of seconds **or** milliseconds since the UNIX epoch, but we do **not**
>know if the initial state should be secs, msecs, or nothing. We do not know
>how clients reading that TAGblocked NMEA stream should ask GPSD to switch the
>timestamp units (or enable/disable them).
>
>There are a few sentences introduced in NMEA 4.00 that supposedly allow that -
>the client sends a sentence to the server, and then the server starts
>TAGblocking sentences. But, alas, there are no examples anywhere.
>
>>From my personal experience, the way to know if a TAGblocked timestamp is in
>seconds or milliseconds is ask the people in charge of setting up the
>device/service. Perhaps some devices output only secs/msecs, and some other
>accept the NMEA 4.00 TAGblock configuration sentences.
>
>I, for one, would like to see the secs/msecs problem solved before GPSD
>embarks on the enterprise of writing TAGblocks.

*** Time offset debugging in gpsmon ***

@@ -86,6 +144,8 @@ Hall Murray:
> Or perhaps a higher level keyboard command to switch into timekeeping
> debugging mode rather than position debugging mode.

Add PPS offset to each PPS bar.

**** Speed, mode and rate-changes in client-mode gpsmon.

Are not implemented. In theory they could be.
@@ -123,61 +183,6 @@ Anthony Stirk <upuaut@gmail.com> writes on Wed May 21 06:09:00 2014:
A possibility: drop the chip to low-power mode when it can see > 4
sats, revert to normal otherwise.

*** Dispatcher/network issues

**** Reading AISHub data via UDP confuses xgps with short writes

To reproduce, "gpsd -D 5 -N -n udp://192.168.1.3:12346" (only
works inside thyrsus.com) and run xgps. Probably some kind of
packet aggregation issue as it doesn't happen with test logs.

*** Driver issues

**** RTCM3 analysis is incomplete

We can presently decode RTCM3 messages of type 1001-1014, 1029, and
1033. This is not the complete set. We need more test data with
different types in them, and a copy of the RTCM3 standard at latest
revision (all we have is revision 3).

The support for unpacking RTCM3 sentences in the client library is
limited to 1001, 1002, 1007, 1008, 1009, 1010, 1014, and 1033. There
are some design issues with the baby JSON parser that are going to
make extending this set difficult.

**** Reporting code for specialized Type 6 and 8 AIS messages is incomplete.

This one is mine and Kurt Schwehr's. Support is currently nearly
complete; the only missing cases are a handful of IMO 236 and IMO 289
message 6 and 8 subtypes - specifically, 6/23, 8/21, 8/22, 8/24, and
8/26.

**** Addressed case of AIS Types 25 and 26 is not handled.

We'd need machinery to shift a byte array 30 bits left...

**** AIS struct needs a 'structured' bit detected by the driver ****

Turns out that dispatching JSON dump on Types 6 and 8 by DAC/FID
isn't reliable, because sometimes unstructured Type 8s can
false-match with a structured type. Observed in the wild with
an unstructured Type 8 misconstrued as an Inland AIS Type 10.
To fix this, the driver needs to store the 'structured' bit in
the AIS structure. Will require a library bump, but afterwards
some code can be removed from the JSON dumper.

When this happens, also dump AIS text fields unconditionally (not on
"scaled"). xgps may need changes.

Also, in gps.h, move the tag field to privdata.

** To do:

*** On next API bump ***

In struct gpsdata_t, move the device list out of the union and move
the tag field to private data.

*** Make subframe reports available in the C API.

gpsd now reports subframes when they're available, but the C client


+ 4
- 3
ais_json.c View File

@@ -19,11 +19,10 @@ representations to libgps structures.
#include "gps.h"
#include "json.h"
#ifdef SOCKET_EXPORT_ENABLE
#include "libgps.h"

/* FIXME: kluges because we don't want to include gpsd.h here */
/* kluge because we don't want to include gpsd.h here */
extern int gpsd_hexpack(/*@in@*/const char *, /*@out@*/char *, size_t);
int json_ais_read(const char *, char *, size_t, struct ais_t *,
/*@null@*/const char **);

/*@ -mustdefine @*/
static void lenhex_unpack(const char *from,
@@ -268,6 +267,7 @@ int json_ais_read(const char *buf,
lenhex_unpack(data, &ais->type6.bitcount,
ais->type6.bitdata, sizeof(ais->type6.bitdata));
}
ais->type6.structured = structured;
} else if (strstr(buf, "\"type\":7,") != NULL
|| strstr(buf, "\"type\":13,") != NULL) {
status = json_read_object(buf, json_ais7, endptr);
@@ -413,6 +413,7 @@ int json_ais_read(const char *buf,
lenhex_unpack(data, &ais->type8.bitcount,
ais->type8.bitdata, sizeof(ais->type8.bitdata));
}
ais->type8.structured = structured;
} else if (strstr(buf, "\"type\":9,") != NULL) {
status = json_read_object(buf, json_ais9, endptr);
} else if (strstr(buf, "\"type\":10,") != NULL) {


+ 26
- 0
bits.c View File

@@ -14,6 +14,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <string.h>

#include "bits.h"

@@ -130,6 +131,31 @@ void putbef32(char *buf, int off, float val)
/*@+shiftimplementation -ignoresigns@*/
}


void shiftleft(unsigned char *data, int size, unsigned short left)
{
/*@+matchanyintegral +ignoresigns -type -shiftnegative@*/
unsigned char *byte;

if (left >= CHAR_BIT) {
size -= left/CHAR_BIT;
memmove(data, data + left/CHAR_BIT, (size + CHAR_BIT - 1)/CHAR_BIT);
left %= CHAR_BIT;
}

for (byte = data; size--; ++byte )
{
unsigned char bits;
if (size)
bits = byte[1] >> (CHAR_BIT - left);
else
bits = 0;
*byte <<= left;
*byte |= bits;
}
/*@-matchanyintegral -ignoresigns +type +shiftnegative@*/
}

#ifdef __UNUSED__
void putbed64(char *buf, int off, double val)
{


+ 6
- 0
bits.h View File

@@ -15,6 +15,10 @@
#define _GPSD_BITS_H_

#include <stdint.h>
#include <limits.h>

/* number of bytes requited to contain a bit array of specified length */
#define BITS_TO_BYTES(bitlen) (((bitlen) + CHAR_BIT - 1) / CHAR_BIT)

/* these are independent of byte order */
#define getsb(buf, off) ((int8_t)buf[off])
@@ -50,6 +54,8 @@ extern double getbed64(const char *, int);
extern void putbef32(char *, int, float);
extern void putbed64(char *, int, double);

extern void shiftleft(unsigned char *, int, unsigned short);

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


+ 117
- 36
build.txt View File

@@ -1,7 +1,7 @@
= Building GPSD from source =

This is a guide to building GPSD from a bare source tree. It includes
guidance on how to cross-build the package.
guidance on how to cross-build the package.

Some hints for people building binary packages are in packaging/readme.txt.

@@ -12,20 +12,49 @@ Some hints for people building binary packages are in packaging/readme.txt.
Under Linux, assuming you have all your build prerequisites in place,
this line will do:

scons && scons check && sudo scons udev-install
scons && scons check && sudo scons udev-install

If you get any errors, you need to read the detailed instructions that follow.

== Supported platforms ==

Native-build success should be expected on the following platforms,
provided you have the prerequisites listed in the next section
installed:

* Any desktop or server Linux distribution.
* OpenWRT and derivatives such as CeroWRT.
* FreeBSD, NetBSD, OpenBSD
* Android, using the official Google toolchain from the NDK

We consider failure to build and function on any of these platforms
a serious bug; if you encounter it, please complain on the
development list.

Macintosh OS X has been dropped from the list of supported platforms
due to serial-layer flakiness that has persisted through 10.9 and
10.10.

A Cygwin port is in progress but not complete.

Cross-compilation to embedded Linuxes (in addition to the OpenWRT family)
is usually fairly straightforward. An illustrative build transcript
is included at the end of this file.

== Check your build prerequisites ==

Necessary components for any build:

|============================================================================
|C compiler | gpsd and client library are written in C
|Python | some code is generated from python scripts
|scons | for executing the build recipe
|Python 2.x, x >= 6 | some code is generated from python scripts
|scons | for executing the build recipe
|============================================================================

Note: There must be a Python 2 interpreter named 'python' in your path,
or the regression tests will fail. On some systems you might need to
arrange this by putting symlink in a local directory on $PATH.

=== C compiler ===

C99 conformance is required in the compiler. The C code depends on one
@@ -39,7 +68,7 @@ older than 4.1.1; there are several known issues with older versions,
including (a) non-standards-conformant floating-point generation that
messes up regression testing, (b) a compiler bug affecting RTCM2 code
generation, (c) the option -Wno-missing-field-initializers is
unavailable, leading to a flood of warnings (this is due to generated
unavailable, leading to a flood of warnings (this is due to generated
code and cannot be fixed).

The shared-memory interface relies on one GCCism, but the code is
@@ -53,12 +82,12 @@ You will need Python 2.5 or later for the build.
While Python is required to build GPSD from source (the build uses
some code generators in Python), it is not required to run the service
daemon. In particular, you can cross-compile onto an embedded system
without having to take Python with you.
without having to take Python with you.

You will need both basic Python and (if your package system makes the
distinction) the Python development package used for building C
extensions. Usually these are called "python" and "python-dev". You
will know you are missing the latter if your compilation fails
will know you are missing the latter if your compilation fails
because of a missing Python.h.

The xgps test client requires the following Python extensions:
@@ -79,7 +108,7 @@ Having the following optional components on your system will enable
various additional capabilities and extensions:

|============================================================================
|C++ compiler | allows building libgpsmm C++ wrapper for client library
|C++ compiler | allows building libgpsmm C++ wrapper for client library
|Qt 4.53+ | allows building libQgpsmm C++ wrapper for client library
|libcap | Capabilities library, allows 1PPS support under Linux
|curses | curses screen-painting library, allows building cgps
@@ -90,10 +119,10 @@ this and use it to discover Garmin USB GPSes, rather than groveling
<