Browse Source

New upstream version 3.21.1~dev

master upstream/3.21.1_dev
Bernd Zeimetz 2 years ago
parent
commit
4e2f5ac1f4
  1. 89
      .ci-build/build.sh
  2. 24
      .ci-build/test_options.sh
  3. 166
      .gitlab-ci.yml
  4. 21
      .travis.yml
  5. 15
      Android.bp
  6. 4
      COPYING
  7. 322
      INSTALL.adoc
  8. 43
      NEWS
  9. 7
      Qgpsmm.pc.in
  10. 3338
      SConscript
  11. 2928
      SConstruct
  12. 131
      SUPPORT.adoc
  13. 9
      TODO
  14. 564
      Tachometer.c
  15. 52
      Tachometer.h
  16. 44
      TachometerP.h
  17. 470
      ais_json.c
  18. 1223
      ais_json.i
  19. 85
      android/gps_test.c
  20. 12
      android/gpsd_config.in
  21. 111
      build.adoc
  22. 217
      clients/cgps.c
  23. 212
      clients/gegps.py.in
  24. 614
      clients/gps2udp.c
  25. 206
      clients/gpscat.py.in
  26. 373
      clients/gpscsv.py.in
  27. 1080
      clients/gpsd.php.in
  28. 129
      clients/gpsdctl.c
  29. 869
      clients/gpsdecode.c
  30. 539
      clients/gpspipe.c
  31. 329
      clients/gpsplot.py.in
  32. 525
      clients/gpsprof.py.in
  33. 643
      clients/gpsrinex.c
  34. 1094
      clients/gpssubframe.py.in
  35. 429
      clients/gpxlogger.c
  36. 233
      clients/lcdgps.c
  37. 280
      clients/ntpshmmon.c
  38. 174
      clients/ppscheck.c
  39. 555
      clients/ubxtool.py.in
  40. 551
      clients/xgps.py.in
  41. 205
      clients/xgpsspeed.py.in
  42. 309
      clients/zerk.py.in
  43. 6
      contrib/README
  44. 2
      contrib/SConstruct
  45. 8
      contrib/apparmor/README.md
  46. 53
      contrib/apparmor/usr.sbin.gpsd
  47. 2
      contrib/ashctl.c
  48. 2
      contrib/binlog.c
  49. 2
      contrib/binreplay.c
  50. 2
      contrib/clock_test.c
  51. 1
      contrib/gps
  52. 9
      contrib/gpsData.py
  53. 102
      contrib/gpsd-dbus.c
  54. 59
      contrib/gpssim.py
  55. 16
      contrib/gpssnmp.c
  56. 2
      contrib/lla2ecef.c
  57. 4
      contrib/maxsats.pl
  58. 2
      contrib/motosend.c
  59. 4
      contrib/ntpoffset
  60. 26
      contrib/ntpshmviz.py.in
  61. 10
      contrib/skyview.php
  62. 12
      contrib/skyview2svg.py.in
  63. 397
      contrib/webgps.py
  64. 537
      contrib/webgps.py.in
  65. 1
      control.in
  66. 76
      dbusexport.c
  67. 6
      devtools/README
  68. 7
      devtools/ais.py
  69. 5
      devtools/aivdmtable
  70. 13
      devtools/cycle_analyzer
  71. 8
      devtools/dchroot-exec
  72. 2
      devtools/easyinverse.pl
  73. 2
      devtools/editcomment
  74. 3
      devtools/fakecompare
  75. 52
      devtools/flock-instructions
  76. 356
      devtools/flocktest
  77. 69
      devtools/flocktest.ini
  78. 11
      devtools/get_geoid_table.py
  79. 14
      devtools/get_mag_var_table.py
  80. 1
      devtools/gps
  81. 18
      devtools/gpsd-debian-regressions.sh
  82. 11
      devtools/gpsdfake
  83. 16
      devtools/identify_failing_build_options.py
  84. 4
      devtools/logextract
  85. 6
      devtools/regress-builder
  86. 5
      devtools/regressdiff
  87. 1
      devtools/sizes
  88. 5
      devtools/striplog
  89. 232
      devtools/tablegen.py
  90. 11
      devtools/test_json_validity.py
  91. 62
      devtools/uninstall_cleanup.py
  92. 15
      do-clean
  93. 4
      doc/explan_driver_nmea.c.xml
  94. 6
      doc/explan_geoid.c.xml
  95. 2
      doc/explan_gpsd.c.xml
  96. 2
      doc/explan_net_dgpsip.c.xml
  97. 2
      doc/explan_packet.c.xml
  98. 1133
      driver_ais.c
  99. 1323
      driver_garmin.c
  100. 631
      driver_geostar.c

89
.ci-build/build.sh

@ -1,89 +0,0 @@
#!/usr/bin/env bash
set -e
set -x
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
if uname -a | grep -qi freebsd; then
export PATH="${PATH}:/usr/local/bin:/usr/local/sbin"
fi
if [ "${USE_CCACHE}" = "true" ] && [ -n "${CCACHE_DIR}" ] && command -v ccache >/dev/null; then
if [ -d "/usr/lib64/ccache" ]; then
# fedora
export PATH="/usr/lib64/ccache:${PATH}"
elif [ -d "/usr/local/libexec/ccache/" ]; then
# freebsd
export PATH="/usr/local/libexec/ccache:${PATH}"
else
# debian, .....
export PATH="/usr/lib/ccache:${PATH}"
fi
mkdir -p "${CCACHE_DIR}"
echo 'max_size = 100M' > "${CCACHE_DIR}/ccache.conf"
else
export USE_CCACHE="false"
fi
if command -v lsb_release >/dev/null && lsb_release -d | grep -qi -e debian -e ubuntu; then
eval "$(dpkg-buildflags --export=sh)"
export DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
export PYTHONS="$(pyversions -v -r '>= 2.3'; py3versions -v -r '>= 3.4')"
SCONSOPTS="${SCONSOPTS} libdir=/usr/lib/${DEB_HOST_MULTIARCH}"
else
SCONSOPTS="${SCONSOPTS} libdir=/usr/lib"
fi
SCONSOPTS="${SCONSOPTS} $@ prefix=/usr"
SCONSOPTS="${SCONSOPTS} systemd=yes"
SCONSOPTS="${SCONSOPTS} nostrip=yes"
SCONSOPTS="${SCONSOPTS} dbus_export=yes"
SCONSOPTS="${SCONSOPTS} docdir=/usr/share/doc/gpsd"
SCONSOPTS="${SCONSOPTS} gpsd_user=gpsd"
SCONSOPTS="${SCONSOPTS} gpsd_group=dialout"
SCONSOPTS="${SCONSOPTS} debug=yes"
SCONSOPTS="${SCONSOPTS} qt_versioned=5"
export SCONS=$(command -v scons)
if command -v nproc >/dev/null; then
NPROC=$(nproc)
SCONS_PARALLEL="-j ${NPROC} "
if [ "${SLOW_CHECK}" != "yes" ]; then
CHECK_NPROC=$(( 4 * ${NPROC} ))
SCONS_CHECK_PARALLEL="-j ${CHECK_NPROC} "
else
SCONS_CHECK_PARALLEL="${SCONS_PARALLEL}"
fi
else
SCONS_PARALLEL=""
SCONS_CHECK_PARALLEL=""
fi
export SCONSOPTS
if [ -z "$PYTHONS" ]; then
export PYTHONS="3"
fi
if [ -n "${SCAN_BUILD}" ]; then
export PYTHONS="3"
fi
for py in $PYTHONS; do
_SCONS="${SCONS} target_python=python${py}"
python${py} ${_SCONS} ${SCONSOPTS} --clean
rm -f .sconsign.*.dblite
${SCAN_BUILD} python${py} ${_SCONS} ${SCONS_PARALLEL}${SCONSOPTS} build-all
if [ -z "${NOCHECK}" ]; then
python${py} ${_SCONS} ${SCONS_CHECK_PARALLEL}${SCONSOPTS} check
fi
done
if [ "${USE_CCACHE}" = "true" ]; then
ccache -s
fi

24
.ci-build/test_options.sh

@ -1,24 +0,0 @@
#!/bin/bash
set -e
set -x
apt -y install ccache
PATH=/usr/sbin:/usr/bin:/sbin:/bin
export PATH="/usr/lib/ccache:$PATH"
if which nproc >/dev/null; then
SCONS_PARALLEL="-j $(nproc) "
else
SCONS_PARALLEL=""
fi
(
scons --help | grep -B1 'default: True' | grep 'yes|no' | sed 's,:.*,=no,' | grep -v '^gpsd$'
scons --help | grep -B1 'default: False' | grep 'yes|no' | sed 's,:.*,=yes,'
) | while read option; do
scons --clean
rm -f .sconsign.*.dblite
scons ${SCONS_PARALLEL}${option} build
done

166
.gitlab-ci.yml

@ -1,166 +0,0 @@
cache:
key: "${CI_JOB_NAME}"
paths:
- .ccache/
variables:
USE_CCACHE: "true"
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
CCACHE_DIR: "${CI_PROJECT_DIR}/.ccache"
CCACHE_COMPILERCHECK: "content"
DEBIAN_FRONTEND: 'noninteractive'
stages:
- build
- advanced_build
- test
.debian_build: &debian_build
script:
- apt update && apt -y install --no-install-recommends eatmydata
- eatmydata -- apt -y install --no-install-recommends ${PACKAGES}
- eatmydata -- .ci-build/build.sh
debian-stable:
image: debian:latest
stage: build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
PACKAGES: 'build-essential ccache debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
<<: *debian_build
debian-unstable:gcc:
image: debian:unstable
stage: advanced_build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
PACKAGES: 'build-essential ccache debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
<<: *debian_build
debian-unstable:clang:
image: debian:unstable
stage: advanced_build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
CC: 'clang'
CXX: 'clang++'
PACKAGES: 'clang build-essential ccache debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
<<: *debian_build
debian-unstable:minimal:
image: debian:unstable
stage: advanced_build
variables:
SCONSOPTS: 'aivdm=no ashtech=no bluez=no control_socket=no controlsend=no coveraging=no dbus_export=no debug=no earthmate=no evermore=no force_global=no fury=no fv18=no garmin=no garmintxt=no geostar=no gpsclock=no gpsdclients=no greis=no implicit_link=no isync=no itrax=no leapfetch=no libgpsmm=no magic_hat=no manbuild=no minimal=no mtk3301=no navcom=no ncurses=no netfeed=no nmea0183=no nmea2000=no nostrip=no ntrip=no oceanserver=no oncore=no oscillator=no passthrough=no profiling=no python=no qt=no reconfigure=no rtcm104v2=no rtcm104v3=no shared=no shm_export=no sirf=no skytraq=no slow=no socket_export=yes squelch=no superstar2=no systemd=no timeservice=no tnt=no tripmate=no tsip=no ublox=no usb=no xgps=no'
NOCHECK: 'true'
PACKAGES: 'build-essential ccache scons chrpath lsb-release python3-all-dev'
<<: *debian_build
# the latest tag should match the last Ubuntu LTS release.
ubuntu-latest:gcc:
image: ubuntu:latest
stage: advanced_build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
PACKAGES: 'build-essential ccache debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
before_script:
- apt update && apt -y install scons
- sed -i "s/os.environ.has_key('DH_INTERNAL_OPTIONS')/'DH_INTERNAL_OPTIONS' in os.environ/" /usr/lib/scons/SCons/Script/Main.py
<<: *debian_build
# the "rolling" release
ubuntu-rolling:gcc:
image: ubuntu:rolling
stage: advanced_build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
PACKAGES: 'build-essential ccache debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
<<: *debian_build
# the devel tag should point to the docker image of the next, upcoming Ubuntu release
ubuntu-devel:gcc:
image: ubuntu:devel
stage: advanced_build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
PACKAGES: 'build-essential ccache debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
<<: *debian_build
fedora-latest:
image: fedora:latest
stage: advanced_build
variables:
SCONSOPTS: 'qt=yes xgps=yes'
script:
- dnf install -y ccache diffutils bluez-libs-devel chrpath dbus-devel desktop-file-utils gcc-c++ libXaw-devel ncurses-devel python-devel qt-devel scons xmlto pps-tools-devel
- .ci-build/build.sh
freebsd:
stage: advanced_build
variables:
WRITE_PAD: '0.01250'
tags:
- freebsd
script:
- .ci-build/build.sh
scan-build:
allow_failure: true
image: debian:unstable
stage: test
needs: ["debian-unstable:gcc"]
variables:
SCONSOPTS: 'qt=yes xgps=yes'
SCAN_BUILD: 'scan-build -o scan_build'
PACKAGES: 'clang clang-tools build-essential debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial'
artifacts:
paths:
- scan_build
expire_in: 1 week
<<: *debian_build
# as long as sconstruct has so many options, this does not make sense
# needs a better / faster way to test
#
#test-options:
# image: debian:unstable
# stage: test
# needs: ["debian-unstable:gcc"]
# variables:
# DEBIAN_FRONTEND: 'noninteractive'
# when: manual
# script:
# - apt update && apt -y install build-essential debhelper po-debconf python3-all-dev python3-all-dbg python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial
# - .ci-build/test_options.sh
#
.changes_pages: &changes_pages
changes:
- 'www/*'
- 'www/*/*'
- '*.adoc'
.should_build_pages: &should_build_pages
only:
refs:
- master
<<: *changes_pages
pages:
image: alpine:latest
stage: build
script:
- apk update && apk add python xmlto asciidoc scons rsync musl-dev gcc
- mkdir .pages; WEBSITE=.public scons website=.pages website; mv .public public
- find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
- ls -lR public
artifacts:
paths:
- public
<<: *should_build_pages

21
.travis.yml

@ -1,21 +0,0 @@
sudo: required
language: generic
## The used .ci-build/build.sh is maintained for the gitlab CI.
## Please upadte the travis yaml file if necessary
# Some versions of clang++ don't work with some C++ headers, due to an
# issue with __float128. Until this is reproducible in a more debuggable
# context, we disable the C++ builds in the clang case.
env:
- TRAVIS_DEBIAN_DISTRIBUTION=unstable TRAVIS_DEBIAN_BUILD_COMMAND="/bin/bash .ci-build/build.sh" TRAVIS_DEBIAN_BUILD_DEPENDENCIES="build-essential debhelper po-debconf python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev qtbase5-dev qt5-default lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial"
- TRAVIS_DEBIAN_DISTRIBUTION=unstable TRAVIS_DEBIAN_BUILD_COMMAND="/bin/bash .ci-build/build.sh" TRAVIS_DEBIAN_BUILD_DEPENDENCIES="build-essential debhelper po-debconf python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial"
- TRAVIS_DEBIAN_DISTRIBUTION=unstable TRAVIS_DEBIAN_BUILD_COMMAND="/bin/bash .ci-build/build.sh libgpsmm=no qt=no" TRAVIS_DEBIAN_BUILD_DEPENDENCIES="build-essential debhelper po-debconf python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd clang python-serial" TRAVIS_DEBIAN_BUILD_ENVIRONMENT="CC=clang CXX=clang++"
- TRAVIS_DEBIAN_DISTRIBUTION=stable TRAVIS_DEBIAN_BUILD_COMMAND="/bin/bash .ci-build/build.sh" TRAVIS_DEBIAN_BUILD_DEPENDENCIES="build-essential debhelper po-debconf python-all-dev python-all-dbg xsltproc docbook-xsl docbook-xml asciidoc libncurses-dev libusb-1.0-0-dev libdbus-1-dev libglib2.0-dev makedev libbluetooth-dev libqt4-dev lsb-release bc dpkg-dev scons chrpath dh-buildinfo pps-tools dh-systemd python-serial"
services:
- docker
script:
- wget -O- https://build-in-debian.bzed.at/script.sh | sh -

15
Android.bp

@ -24,7 +24,6 @@ cc_binary {
vendor: true,
required: ["gpsd_wrapper"],
generated_headers: [
"gpsd_revision_h",
"gpsd_config_h",
"gpsd_packet_names_h"
],
@ -61,7 +60,6 @@ cc_library_shared {
vendor: true,
export_include_dirs: ["."],
generated_headers: [
"gpsd_revision_h",
"gpsd_config_h",
"gpsd_packet_names_h"
],
@ -95,7 +93,6 @@ cc_library_static {
vendor: true,
export_include_dirs: ["."],
generated_headers: [
"gpsd_revision_h",
"gpsd_config_h",
"gpsd_packet_names_h"
],
@ -137,19 +134,14 @@ genrule {
cmd: "cat $(in)/android/gpsd_config.in > $(out);" +
"grep \"^gpsd_version\" $(in)/SConstruct | " +
"cut -d\\= -f2 | sed -e 's/^/#define VERSION/'" +
">> $(out); " +
"grep \"^gpsd_version\" $(in)/SConstruct | " +
"cut -d\\= -f2 | sed -e 's/^/#define RELEASE/'" +
">> $(out)",
srcs: [""],
out: ["gpsd_config.h"]
}
genrule {
name: "gpsd_revision_h",
cmd: "grep \"^gpsd_version\" $(in) | cut -d\\= -f2 " +
"| sed -e 's/^/#define REVISION/' > $(out)",
srcs: ["SConstruct"],
out: ["revision.h"]
}
python_binary_host {
name: "maskaudit",
main: "maskaudit.py",
@ -169,7 +161,6 @@ cc_library_static {
vendor: true,
export_include_dirs: ["."],
generated_headers: [
"gpsd_revision_h",
"gpsd_config_h",
"gpsd_packet_names_h"
],

4
COPYING

@ -3,9 +3,9 @@
Compilation copyright is held by the GPSD project. All rights reserved.
GPSD project copyrights are assigned to the project lead, currently
Eric S. Raymond. Other portions of the GPSD code are Copyright (c)
Eric S. Raymond. Other portions of the GPSD code are Copyright
1997, 1998, 1999, 2000, 2001, 2002 by Remco Treffkorn, and others
Copyright (c) 2005 by Eric S. Raymond. For other copyrights, see
Copyright 2005 by Eric S. Raymond. For other copyrights, see
individual files.
LICENSE

322
INSTALL.adoc

@ -1,4 +1,4 @@
= GPSD Installation Instructions =
= GPSD Installation Instructions
:title: GPSD Installation Instructions
:description: Steps for installing GPSD and verifying its performance.
:keywords: GPSD, GPS, installation
@ -11,14 +11,14 @@ They assume you have GPSD available as an installable binary package,
Instructions for building GPSD from source (including cross-building)
are in the file "build.adoc" in the source distribution.
Most of these installation instructions are generic to Linux (inc
There are some special notes on installation for OS X and the Raspberry Pi
near the end of this file.
Most of these installation instructions are generic to Linux. There are
some special notes on installation on *BSD, WSL, OS X, macOS, and the
Raspberry Pi near the end of this file.
== Check that your GPS is live and you can get data from it ==
== Check that your GPS is live and you can get data from it
Start by making sure you can get data from your GPS, otherwise the later
steps will be very frustrating. In this command
steps will be very frustrating. In this command:
stty -F /dev/ttyXXX ispeed 4800 && cat </dev/ttyXXX
@ -46,7 +46,7 @@ Under a stock Linux kernel these will all be loaded on demand when
the USB system sees the appropriate vendor/product ID combinations.
See build.adoc for instructions relating to custom kernels.
== Check that your system configuration will allow GPSD to work ==
== Check that your system configuration will allow GPSD to work
Ensure that device permissions will enable gpsd to read from and write
to GPS devices even after it drops root privileges. If you are
@ -81,25 +81,26 @@ the permission-setting part; the hotplug scripts will force the
permissions for you. You still have to make sure all the tty devices
are in the same group.
== Check your installation prerequisites ==
== Check your installation prerequisites
A minimum build of GPSD can run pretty close to the metal; all it
absolutely needs is the C runtime support. The test clients and
various additional features have additional prerequisites:
|===============================================================================
|pps-tools | for PPS time keeping
|asciidoctor | to build the documentation and www
|dbus | gpsd will issue DBUS notifications
|ncurses | for cgps and gpsmon clients
|gnuplot | to plot gpsprof output.
|GTK | for python-GI
|libtinfo5 | low-level terminfo library (see below)
|libusb-1.0.x or later | for older Garmin USB devices
|Qt | libQgpsmm depends on this
|python2.x(x>=6) or 3.y(y>=2) | required for various clients and utilities
|ncurses | for cgps and gpsmon clients
|pps-tools | for PPS time keeping
|PyGObject | for xps and xgpsspeed clients (see below)
|python-cairo | for python-GI
|GTK | for python-GI
|pyserial | for ubxtool and zerk in direct-serial mode
|gnuplot | to plot gpsprof output.
|python2.x(x>=6) or 3.y(y>=2) | required for various clients and utilities
|python-cairo | for python-GI
|Qt | libQgpsmm depends on this
|===============================================================================
Some ncurses packages contain the terminfo library; some break it out
@ -116,9 +117,9 @@ The asynchronous python module (gps/aiogps.py) and its example client
See below for more specific module requirements in the individual
distribution instructions.
== Installing gpsd ==
== Installing gpsd
=== Install your distributions package(s) ===
=== Install your distributions package(s)
Up-to-date gpsd packages are generally available for Linux distributions
including Debian and derivatives (including Ubuntu and Mint), Fedora and
@ -134,12 +135,12 @@ However, many distributions break up GPSD into separate installable
packages for the core daemon and clients; you should search your
repository index for anything with gpsd as a prefix.
=== Install from source code ===
=== Install from source code
Directions for installing from source are in the file build.adoc found
in the source distribution.
== How to test the software ==
== How to test the software
1. Start gpsd. You'll need to give it as an argument a path to
a serial or USB port with a GPS attached to it. Your test command
@ -169,11 +170,11 @@ and begin delivering fixes.
6. A FAQ and troubleshooting instructions can be found at the GPSD
project site.
== Once you have verified correct operation ==
== Once you have verified correct operation
1. If you installed from a .deb under Debian or a Debian-derived
system, you may need to `dpkg-reconfigure -plow gpsd' to enable the
hotplug magic ("Start gpsd automatically").
1. If you installed from a '.deb' package under Debian or a
Debian-derived system, you may need to `dpkg-reconfigure -plow gpsd' to
enable the hotplug magic ("Start gpsd automatically").
2. Check out the list of supported hardware at the Hardware page on
the GPSD project's website. If your GPS isn't on the list, please send
@ -195,7 +196,36 @@ in the packages available from distributions.
For special instructions related to using GPSD for time service, see the
GPSD Time Service HOWTO in the distribution or on the web.
== Special Notes for OS X Installation ==
== Apple Desktop
=== Special Notes for macOS X Installation
gpsd will build, install and run on macOs. Install the Xcode application
from the Apple store. Then install Homebrew (https://brew.sh/) to get
all the stuff you need, like git, scons, python, etc.
As a normal user, install homebrew, then install scons and asciidoctor.
Installing scons pulls in python3. Brew will become root as needed, so
starting asd a normal user is just security theater.
--------------------------------------------------------------
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
$ brew install scons asciidoctor
--------------------------------------------------------------
Now you need to become root. Make a place for the gpsd source to live,
use git to install it there, then go there. Build gpsd with "scons",
then install it with "scons install"
--------------------------------------------------------------
# mkdir -p /usr/local/src/GPS
# cd /usr/local/src/GPS
# git clone https://gitlab.com/gpsd/gpsd.git
# cd gpsd
# scons && scons install
--------------------------------------------------------------
=== Special Notes for OS X Installation
gpsd will build, install and run on OS X (osX). The easiest way to
do so is to first install the MacPorts package. Follow their install
@ -253,7 +283,7 @@ If you are using a USB based GPS you will likely need the Prolific
PL2303 driver. You can find it here:
http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41
== Special Notes for Raspberry Pi Installation ==
== Special Notes for Raspberry Pi Installation
gpsd will build, install and run on the Raspberry Pi (RasPi) and Pi 2
using Debian jessie. Other distributions based on
@ -261,10 +291,11 @@ Debian (raspbian, etc) will work fine as well. The gpsd
package in Debian Wheezy is known to be flaky, be sure to update to a
new version of gpsd from source.
=== Raspbian ===
=== Raspbian
Before compiling gpsd from source, you will need to update your system
as root. Switching to the latest raspbian distribution (jessie)
is strongly recommended.
as root. Switching to the latest Raspbian distribution (Buster) is
strongly recommended.
--------------------------------------------------------------
# apt-get update
@ -273,6 +304,15 @@ is strongly recommended.
# reboot
--------------------------------------------------------------
Multiple versions of gpsd can not co-exist on the same system. You need
to ensure gpsd from a package is not on the system:
--------------------------------------------------------------
# apt purge gpsd
--------------------------------------------------------------
Then install the required packages:
--------------------------------------------------------------
# apt-get install scons libncurses5-dev python-dev pps-tools
# apt-get install git-core
@ -282,10 +322,23 @@ Git-core is required to build from a git repository. pps-tools is for
PPS timing.
The rest of the installation is just as for any other source based
install, as noted in the file *build.adoc* .
install, as noted in the file *build.adoc*.
=== Other Debian derivatives (including stock)
==== Buster (10) with python2
These Buster instructions seem to also work for Devuan and Maemo Leste.
Multiple versions of gpsd can not co-exist on the same system. You need
to ensure gpsd from a package is not on the system:
--------------------------------------------------------------
# apt purge gpsd
--------------------------------------------------------------
Then update your system, and install the packages required by gpsd:
=== Other Debian derivatives (including stock) ===
==== Buster (10) with python2 ====
--------------------------------------------------------------
# apt-get update
# apt-get dist-upgrade
@ -308,7 +361,7 @@ X11 server installed, but it still pulls in a lot of packages.
--------------------------------------------------------------
# apt-get install python-gi-dev python-cairo-dev
# apt-get install python-gobject-dev libgtk-3-dev
# apt-get install python-gobject-2-dev libgtk-3-dev
--------------------------------------------------------------
Ubxtool and zerk may optionally use the pyserial module for
@ -330,15 +383,18 @@ Some very old Garmin USB devices need libusb:
# apt-get install libusb-1.0-0-dev
--------------------------------------------------------------
If you wish to build the documentation, be warned it pull in a
lot of packages. To build the doc install:
If you wish to build the documentation, be warned it pulls in a
lot of packages. Build the documentation is a prerequisite to
building the HTML files for the website (www/), and also to make
a source tarball (scons dist). To install the tools to build the
documentation:
--------------------------------------------------------------
apt-get install xsltproc docbook-xsl xmlto asciidoc
apt-get install xsltproc docbook-xsl xmlto asciidoctor
--------------------------------------------------------------
The rest of the installation is just as for any other source based
install, as noted in the file *build.adoc* .
install, as noted in the file *build.adoc*.
--------------------------------------------------------------
# git clone https://gitlab.com/gpsd/gpsd.git
@ -346,7 +402,17 @@ install, as noted in the file *build.adoc* .
# scons --config=force && scons install
--------------------------------------------------------------
==== Jessie (8) ====
==== Jessie (8)
Multiple versions of gpsd can not co-exist on the same system. You need
to ensure gpsd from a package is not on the system:
--------------------------------------------------------------
# apt purge gpsd
--------------------------------------------------------------
Then install the required packages:
--------------------------------------------------------------
# apt-get install scons libncurses5-dev python-dev pps-tools
# apt-get install git-core
@ -356,10 +422,18 @@ Git-core is required to build from a git repository. pps-tools is for
PPS timing.
The rest of the installation is just as for any other source based
install, as noted in the file *build.adoc* .
install, as noted in the file *build.adoc*.
==== Wheezy
Multiple versions of gpsd can not co-exist on the same system. You need
to ensure gpsd from a package is not on the system:
--------------------------------------------------------------
# apt purge gpsd
--------------------------------------------------------------
==== Wheezy ====
Wheezy, being older, requires updating the tools for compiling
and testing gpsd:
@ -421,29 +495,78 @@ Git-core is required to build from a git repository. pps-tools is for
PPS timing.
The rest of the installation is just as for any other source based
install, as noted in the file *build.adoc* .
install, as noted in the file *build.adoc*.
==== Ubuntu Buster 20
==== Ubuntu 18.04 LTS ====
If you have Raspbian Buster, that is not this.
Preliminary install notes.
Multiple versions of gpsd can not co-exist on the same system. You need
to ensure gpsd from a package is not on the system:
--------------------------------------------------------------
# apt purge gpsd
--------------------------------------------------------------
Then install the required packages:
--------------------------------------------------------------
apt install gcc scons python-gi python-gi-cairo g++
apt install libncurses5-dev pps-tools
apt install python-gobject libgtk-3-dev
apt install libncurses5-dev libtinfo-dev pps-tools
apt install gir1.2-gtk-3.0
--------------------------------------------------------------
If you wish to build the documentation, be warned it pull in a
lot of packages. To build the doc install:
If you wish to build the documentation, be warned it pulls in a
lot of packages. Build the documentation is a prerequisite to
building the HTML files for the website (www/), and also to make
a source tarball (scons dist). To install the tools to build the
documentation:
--------------------------------------------------------------
apt install xsltproc docbook-xsl xmlto asciidoc
apt install xsltproc docbook-xsl xmlto asciidoctor
--------------------------------------------------------------
The rest of the installation is just as for any other source based
install, as noted in the file *build.adoc* .
=== Other Raspberry Pi tips ===
==== Ubuntu 18.04 LTS
Preliminary install notes.
If you have Raspbian Buster, that is not this.
Multiple versions of gpsd can not co-exist on the same system. You need
to ensure gpsd from a package is not on the system:
--------------------------------------------------------------
# apt purge gpsd
--------------------------------------------------------------
Then install the required packages:
--------------------------------------------------------------
apt install gcc scons python-gi python-gi-cairo g++
apt install libncurses5-dev libtinfo-dev pps-tools
apt install gir1.2-gtk-3.0
--------------------------------------------------------------
If you wish to build the documentation, be warned it pulls in a
lot of packages. Build the documentation is a prerequisite to
building the HTML files for the website (www/), and also to make
a source tarball (scons dist). To install the tools to build the
documentation:
--------------------------------------------------------------
apt install xsltproc docbook-xsl xmlto asciidoctor
--------------------------------------------------------------
The rest of the installation is just as for any other source based
install, as noted in the file *build.adoc*.
=== Other Raspberry Pi tips
Any USB connected GPS that is known to work with gpsd will work fine on
the RasPi. No special instructions apply.
@ -455,7 +578,7 @@ serial console: /dev/ttyAMA0. The PPS signal will be on GPIO Pin #4.
Only three specific changes need to be made to make the HAT work. First
in the file /boot/cmdline.txt, remove this part "console=ttyAMA0,115200
kgdboc=ttyAMA0,115200)". That frees the serial port from console use so
kgdboc=ttyAMA0,115200". That frees the serial port from console use so
the GPS can use it.
Second you need to tell the boot process to load the pps_gpio module
@ -471,7 +594,7 @@ Run gpsd like this:
--------------------------------------------------------------
If you are on the RasPi with gpsd version 3.17, or above, /dev/pps0 can
be autodetected. and used for PPS if available.
be autodetected, and used for PPS if available.
gpsd 3.17 and up only:
@ -515,18 +638,18 @@ Now proceed as for any other operating system to use gpsd.
Be sure to validate that your PPS signal is not offset by the pulse
width. That would mean gpsd is using the wrong edge.
Detailed instructions are available from their web site:
Detailed instructions are available from their website:
https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/
You will need to dig deeper to make the PPS work, here is a good reference:
http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html
== BSD derivatives ==
=== Special Notes for FreeBSD Installation ==+
=== Special Notes for FreeBSD Installation ===
gpsd will build, install and run on FreeBSD.
Due to the missing CAN bus support (linux/can.h), NMEA2000/CAN
is not supporten on FreeBSD.
is not supported on FreeBSD.
Use their pkg command to install scons, and optionally git if you
want to access the development source.
@ -548,11 +671,11 @@ qt5-network and pkgconf packages.
FreeBSD fails to create the python links as required by PEP394.
So you need to add them yourself, as above.
=== Special Notes for NetBSD 8.1 Installation ===
=== Special Notes for NetBSD 8.1 Installation
gpsd will build, install and run on NetBSD.
Use their pkg_add command to install pkgin. Then use pkgin to
Use their 'pkg_add' command to install pkgin. Then use pkgin to
install the required tools.
--------------------------------------------------------------
@ -575,7 +698,7 @@ install the required tools.
# scons --config=force && scons install
--------------------------------------------------------------
=== Special Notes for OpenBSD 6.6 Installation ===
=== Special Notes for OpenBSD 6.6 Installation
gpsd will build, install and run on NetBSD.
@ -596,8 +719,36 @@ Then install the normal way.
# scons --config=force && scons install
--------------------------------------------------------------
== Special Notes for Fedora derivatives ==
=== Special Notes for CentOS 7 Installation ===
== Special Notes for Fedora derivatives
=== Special Notes for Fedora 32, 33 Installation
gpsd currently will build, install and run on Fedora 32, 33.
Install the gcc compiler and tools. Clone the gpsd source, and then
build it.
--------------------------------------------------------------
# dnf install -y gcc-c++ python3-devel scons xmlto asciidoctor bzip2
# dnf install -y xz git dnf-plugins-core
# git clone https://gitlab.com/gpsd/gpsd.git
# cd gpsd
# scons
# dnf builddep -y gpsd-*/packaging/rpm/gpsd.spec
# scons
--------------------------------------------------------------
If you wish to make an rpm of your build:
--------------------------------------------------------------
# scons dist
# dnf install -y chrpath fedora-packager rpmdevtools
# rpmdev-setuptree
# cp gpsd-3*.tar.* ~/rpmbuild/SOURCES/
# rpmbuild -ba gpsd-3*/packaging/rpm/gpsd.spec
--------------------------------------------------------------
=== Special Notes for CentOS 7 Installation
gpsd currently will build, install and run on CentOS 7.
@ -609,7 +760,7 @@ Use the yum command to install git if you
want to access the development source.
--------------------------------------------------------------
# yum group install "Development Tools"
# yum group install "Development Tools"
# yum install git
# yum install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
@ -622,4 +773,61 @@ want to access the development source.
# scons
--------------------------------------------------------------
== Special Notes for Windows
Only Windows Subsystem for Linux 1 provides a reasonable means
of running gpsd at this time. WSL2 lacks a GUI, USB and serial
support making it unsuitable at this time.
=== About WSL 1
WSL 1 is a component of Microsoft
Windows that implements an alternate kernel. Linux
distributions, notably Alpine, Debian, Kali, OpenSUSE, and
Ubuntu may run on top of it.
There are some issues known which affect gpsd.
* /dev/ttyS* nodes have a 1 indexed number, like in MS Windows.
* Windows 10 may attempt to use your GPS itself.
* Older pl2303 (knockoff) serial chipsets are no longer supported \
in Windows 10
=== Installing a Linux distribution on WSL 1 or WSL 2
1. Install a Linux distribution by clicking on the `Microsoft Store` \
Icon in the taskbar.
2. Click on the search icon (it is a magnifying glass).
3. Type in 'Linux' or the name of a supported distribution. (see list)
4. Click on the icon of your chosen Linux Distribution
5. Click 'Get' then click 'Install' and busy-wait.
6. Click on the start menu and scroll to your Linux distribution and \
click it.
7. Follow the distribution-specific on-screen instructions to finish \
installing your Linux distribution.
=== Recommended packages
Due to current WSL limitations, it is recommended at this time that you
only install the equivalent of the following packages on your distribution.
----
Python
SCons (preferably 3.0+)
ncurses-dev (to build/run cgps and gpsmon)
asciidoctor (to build the documentation)
xmlto (to build the man pages)
----
Optionally, the following packages might also be installed
----
pyserial (for direct control of UBlox GPS and GREIS devices)
gnuplot (to generate graphs of gpsprof data)
libusb-dev (to possibly use crusty old Garmin GPS receivers)
git (if building from the development sources)
----
=== Building on WSL 1 or WSL 2
1. Get the list of packages from the appropriate section above.
2. Follow instructions in the distro-specific section above.

43
NEWS

@ -1,4 +1,41 @@
GPSD project news
GPSD project news
3.21.1~dev: in progress
Added client/gpscsv to convert gpsd JSON to csv.
Added client/gpsplot to dynamically plot gpsd JSON.
Added client/gpssubframe to decode gpsd SUBFRAME JSON.
Added nSat and uSat to SKY JSON. Old clients can not read new SKY.
Move stuff from source root into clients/, include/, gpsmon/ and libgps/.
Move stuff from source root into gpsd/.
Move class ubx out of ubxtool and into gps/ubx.py.
Build all targets in gpsd-$VERSION/, not in tree.
NMEA 4.11 support for $GI (IRNSS) and $GZ (QZSS).
3.21: 2020-08-04
Create python programs from .in files to allow macro substitution.
Finally clean .sconsign*.dblite with "scons -c"
Remove revision.h. Move REVISION into gpsd_config.h
Change asciidoc to asciidoctor, and revise documents to match.
library version bumped to 27
Add leap_seconds to gps_data_t
Add/change many rtcm2 structs in gps.h
Add/change many rtcm3 structs in gps.h
Maindenhead now 8 chars.
Add icondir and sharedir install options
Install basic doc in sharedir
Move gps_data_t->status to gps_fix_t.status for better fix merging
The gps python module is now Pure Python + FFI. FFI only for packet.py
User should manually delete any old packet*so.
Add wspeedt, wspeedr, wanglem, wanglet, wangler to gps_fix_t
Add "-p CONFIG", "-p STATUS", "-t" and "-tt" options to ubxtool.
Add python_shebang option to scons config.
gpsrinex has long options and many new options.
Added long options to gpsd.
Remove unused FORCE_GLOBAL_ENABLE
Remove config option reconfigure, replace with -p, --passive runtime option.
Remove config option controlsend (RECONFIGURE_ENABLE)
Add config option rundir=XX. Default set to /run, or /var/run as required.
Fixes for Python 2.6 up to 3.9.
3.20: 2019-12-31
Change README into an asciidoc file and publish HTML from it
@ -107,7 +144,7 @@
in the Python clients so the graphics don't look like SBAS.
3.14: 2015-03-14 (Eric S. Raymond <esr@snark.thyrsus.com>)
The Pi Day release, 3.14 on 3/14 2015 at 9:26. Longer timeouts on test clients.
Pi Day release, 3.14 on 3/14 2015 at 9:26. Longer timeouts on test clients.
Skyview support for the Beidou and QZSS constellations in the NMEA0183 driver.
ntpmon rename to ntpshmmon - it doesn't actually monitor NTP itself.
New HOWTO on the website: "Introduction to Time Service".
@ -221,7 +258,7 @@
skyviews. The -G option now works under IPv6. Cross-build is now
officially supported and instructions included. gpsprof works again
and does whole-cycle profiling. gpsd.php has Open Street Map
support. The pp-on-cts option is replaced by a pps_pin option that
support. The pps-on-cts option is replaced by a pps_pin option that
lets you specify the pin; the default is still DCD. New supported
device; the Jackson Labs Fury. The chrpath utility has become a
build prerequisite.

7
Qgpsmm.pc.in

@ -1,7 +1,8 @@
prefix=@prefix@
# @GENERATED@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=@libdir@
includedir=@includedir@
libdir=@LIBDIR@
includedir=@INCLUDEDIR@
qt_config=lex yacc warn_on uic resources qt release incremental link_prl def_files_disabled exceptions no_mocdepend stl qt_no_framework create_pc create_prl moc thread dll
Name: Qgpsmm

3338
SConscript

File diff suppressed because it is too large

2928
SConstruct

File diff suppressed because it is too large

131
SUPPORT.adoc

@ -0,0 +1,131 @@
gpsd SUPPORT information
------------------------
GENERAL
~~~~~~~
gpsd is developed and maintained by the open source community, and the
project does not formally offer support. Many people are usually
extremely helpful, particularly towards those people who have taken
the time to try to understand things and appear likely to contribute
to the community. This file explains how to ask for help.
(For those used to interacting with and contributing to open source
projects, note that this file is not attempting to say anything
radical or unusual.)
There is much documentation online at
https://gpsd.io/
and that documentation should be consulted before asking for help.
Details of gpsd support is described at
https://gpsd.io/faq.html#bug-reporting
The following link is very useful to give a sense of how to ask
questions:
http://www.catb.org/esr/faqs/smart-questions.html
gpsd has not adopted the policy implicit in the following link, but it
is an interesting discussion which may provide some insight into the
response to requests for help:
https://berthub.eu/articles/posts/anonymous-help/
ISSUE TRACKER
~~~~~~~~~~~~~
The gpsd source control website is at
https://gitlab.com/gpsd/gpsd/
and contains an issue tracker.
Issues may be created when you believe that something is wrong in the
gpsd code, documentation, or website and can articulate why you
believe that. This is not meant to be a particularly high bar, but
asking questions in issues is not acceptable and "gpsd doesn't work"
is not acceptable. Feature requests are sometimes acceptable,
particularly when the feature is well thought out, appears
implementable, is likely to be of broad interest, and the request is
filed by someone with a history of participation in the community.
Issues may be created for the most recent formal release of gpsd, or
the current version of gpsd, the website or other project content.
(Quality bug reports with specific references to problem code still
present in the latest release are OK too.)
Issues that are not valid issues (not a bug, or lack of a reasonable
attempt to provide enough information) may be summarily closed.
USER MAILINGLIST
~~~~~~~~~~~~~~~~
The user mailinglist at
https://lists.gnu.org/mailman/listinfo/gpsd-users
is appropriate for questions about gpsd, after a reasonable attempt
has been made to answer the question by reading the documentation.
When posting to the user list, make sure to describe your question and
situation well (see the links above). Please realize that you are
asking for free help from strangers, rather than addressing your paid
consultant.
Generally, please update to at least the latest formal release before
asking for help, particularly if you are trying to do anything that is
not already known to work for everyone else. Almost no one on the
mailinglist has shown an interest in addressing issues in old
versions.
DEVELOPMENT MAILINGLIST
~~~~~~~~~~~~~~~~~~~~~~~
The development mailinglist at
https://lists.gnu.org/mailman/listinfo/gpsd-dev
is appropriate for technical discussion about what changes should be
made to gpsd. Questions about how to do things with gpsd are
inappropriate on this list. (If you aren't reading the code, this
list is likely not for you.)
PRIVATE MAIL TO MAINTAINERS
~~~~~~~~~~~~~~~~~~~~~~~~~~~
A quick perusal of the lists will make it clear who is maintaining
gpsd and contributing changes. Do not send private mail to these
individuals asking for help. Ask your questions in public, and expect
the conversation will remain public, so that others can help you, and
that the conversation will be of benefit to the whole community.
If you need technical help in private, then you need a consultant, not
free help from the project.
It is acceptable to send private email when disclosing a security
issue.
LONG TERM STABLE PACKAGING
~~~~~~~~~~~~~~~~~~~~~~~~~~
Note that there are a variety of distributions and packaging systems
that contain gpsd. Some of these are kept relatively up to date, and
some intentionally snapshot software at some point in time and then
only apply security patches, sometimes for five years. These are
typically called "long term stable" or "LTS", and are aimed at users
who wish to avoid ABI or feature changes and only get bug reports.
Occasionally, a user has appeared on the mailinglist expecting support
for an old version because it is contained in some LTS operating
system they have chosen to run. The gpsd project lacks the resources
to provide help about old versions, and support requests for old gpsd
versions in LTS operating systems should be directed at the LTS OS
supplier (or your paid consultant or support service).
A related issue is obtaining a modified version of gpsd from a GPS
chip vendor, leading to using old gpsd versions. The project
encourages improvements to gpsd to be contributed back for the benefit
of the greater gpsd community, and also to remove reasons for people
to use old versions. People using an old version from a vendor should
seek support from their vendor.

9
TODO

@ -36,7 +36,7 @@ Make the Python JSON client as smart as the C JSON client. Gonna be
a big job. The C client checks all the JSON classes for completeness
and correctness. For example, a missing JSON field will be replaced
with a default value. Also out of bounds values are fixed. The Python
client does no checks. it just mushes a JSON sentance into a big Python
client does no checks. it just mushes a JSON sentence into a big Python
variable. No validity checking, no missing fields fixed, etc. The C
client uses a generic validator function, fed with templates for each
JSON message. Initially harder than a simple procedural parser, Once
@ -211,11 +211,6 @@ for possibilities.
Jon Schlueter has one of these on a flock machine, so testing
shouldn't be difficult.
*** Enable flocktest on the Debian server farm
Debian server farm boxes have a screwy chrooted environment setup.
flocktest needs to be modified to deal with it.
*** Finish gpssim
It's blocked on skyview computation.
@ -297,5 +292,5 @@ are not $50 USB mice...
Local variables:
mode: outline
paragraph-separate: "[ ]*$"
paragraph-separate: "[ ]*$"
end:

564
Tachometer.c

@ -1,564 +0,0 @@
/*
* Tachometer Widget Implementation
*
* Author: Kazuhiko Shutoh, 1989.
* Revised by Shinji Sumimoto, 1989/9 (xtachos)
* Modifications : ilham@mit.edu (July 10 '90)
* Cleaned up and simplified by Eric S. Raymond, December 2004.
*
* This file is Copyright (c) 2004-2018 by the GPSD project
* SPDX-License-Identifier: BSD-2-clause
*/
#include "gpsd_config.h" /* must be before all includes */
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <TachometerP.h>
#include <math.h>
#include "gps.h"
#define D2R 0.0174532925199432957692369076848861271 /* radians = pi/180 */
/****************************************************************
*
* Full class record constant
*
****************************************************************/
typedef struct
{
unsigned char digit[7];
} DigitRec;
typedef struct
{
int nofline;
XPoint point_list[5];
} StringRec;
/* Number character database - like an LED */
static DigitRec num_segment[] = {
{{1, 1, 1, 1, 1, 1, 0}},
{{0, 1, 1, 0, 0, 0, 0}},
{{1, 1, 0, 1, 1, 0, 1}},
{{1, 1, 1, 1, 0, 0, 1}},
{{0, 1, 1, 0, 0, 1, 1}},
{{1, 0, 1, 1, 0, 1, 1}},
{{1, 0, 1, 1, 1, 1, 1}},
{{1, 1, 1, 0, 0, 0, 0}},
{{1, 1, 1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 0, 1, 1}}
};
static XSegment offset[] = {
{-10, -10, 10, -10},
{10, -10, 10, 0},
{10, 0, 10, 10},
{10, 10, -10, 10},
{-10, 10, -10, 0},
{-10, 0, -10, -10},
{-10, 0, 10, 0}
};
/* " X 10 %" character database */
static StringRec char_data[] = {
{2, /* "X" */
{{-17, -5},
{-7, 5}}},
{2,
{{-7, -5},
{-17, 5}}},
{2, /* "1" */
{{-2, -5},
{-2, 5}}},
{5, /* "0" */
{{2, -5},
{12, -5},
{12, 5},
{2, 5},
{2, -5}}}
};
#define offst(field) XtOffset(TachometerWidget, field)
static XtResource resources[] = {
{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
offst(tachometer.scale), XtRString, "XtDefaultForeground"}
,
{XtNtachometerCircleColor, XtCBorderColor, XtRPixel, sizeof(Pixel),
offst(tachometer.circle), XtRString, "XtDefaultForeground"}
,
{XtNtachometerNeedleColor, XtCBorderColor, XtRPixel, sizeof(Pixel),
offst(tachometer.needle), XtRString, "XtDefaultForeground"}
,
{XtNtachometerNeedleSpeed, XtCtachometerNeedleSpeed, XtRInt,
sizeof(int), offst(tachometer.speed), XtRImmediate, (caddr_t) 1},
{XtNvalue, XtCValue, XtRInt, sizeof(int),
offst(tachometer.value), XtRImmediate, (caddr_t) 0},
{XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
offst(core.height), XtRImmediate, (caddr_t) 100}
,
{XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
offst(core.width), XtRImmediate, (caddr_t) 100}
,
{XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
offst(core.border_width), XtRImmediate, (caddr_t) 0}
,
{XtNinternalBorderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
offst(tachometer.internal_border), XtRImmediate, (caddr_t) 0}
,
};
static void Initialize(Widget request, Widget new),
Realize(Widget w, Mask * valueMask, XSetWindowAttributes * attributes),
Resize(Widget w), Redisplay(Widget w, XEvent * event, Region region),
Destroy(Widget w);
static Boolean SetValues(Widget current, Widget request UNUSED, Widget new);
TachometerClassRec tachometerClassRec = {
{
/* core_class fields */
#define superclass (&simpleClassRec)
/* superclass */ (WidgetClass) superclass,
/* class_name */ "Tachometer",
/* widget_size */ sizeof(TachometerRec),
/* class_initialize */ NULL,
/* class_part_initialize */ NULL,
/* class_inited */ FALSE,
/* initialize */ (XtInitProc) Initialize,
/* initialize_hook */ NULL,
/* realize */ Realize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* num_resources */ XtNumber(resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ Destroy,
/* resize */ Resize,
/* expose */ Redisplay,
/* set_values */ (XtSetValuesFunc) SetValues,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ NULL,
/* query_geometry */ NULL,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
}
,
/* Simple class fields initialization */
{
/* change_sensitive */ XtInheritChangeSensitive
}
};
WidgetClass tachometerWidgetClass = (WidgetClass) & tachometerClassRec;
/* Private procedures */
static void FastFillCircle(Display * d, Drawable w, GC gc,
Cardinal center_x, Cardinal center_y,
Cardinal radius_x, Cardinal radius_y)
{
XPoint points[360];
Cardinal angle;
for (angle = 0; angle < 360; angle++) {
points[angle].x = (short)(sin((double)angle * D2R) *
(double)radius_x + (double)center_x);
points[angle].y = (short)(cos((double)angle * D2R) *
(double)radius_y + (double)center_y);
}
(void)XFillPolygon(d, w, gc, points, 360, Complex, CoordModeOrigin);
}
static void DrawSingleNumber(TachometerWidget w, int which, Cardinal x,
Cardinal y)
{
XSegment segments[7];
Cardinal nsegments, width, height, count;
width = (Cardinal) ((w->core.width / 2) - w->tachometer.internal_border);
height =
(Cardinal) ((w->core.height / 2) - w->tachometer.internal_border);
if ((width == 0) || (height == 0))
return;
for (count = 0, nsegments = 0; count < 7; count++)
if (num_segment[which].digit[count] == 1) {
segments[nsegments].x1 = (short)
(x + ((double)offset[count].x1 * ((double)width / 200.0)));
segments[nsegments].y1 = (short)
(y + ((double)offset[count].y1 * ((double)height / 200.0)));
segments[nsegments].x2 = (short)
(x + ((double)offset[count].x2 * ((double)width / 200.0)));
segments[nsegments].y2 = (short)
(y + ((double)offset[count].y2 * ((double)height / 200.0)));
nsegments++;
}
(void)XDrawSegments(XtDisplay(w), XtWindow(w),
w->tachometer.scale_GC, segments, (int)nsegments);
}
static void DrawNumbers(TachometerWidget w, int which, Cardinal x, Cardinal y)
{
if (which == 10) {
DrawSingleNumber(w, 1, (Cardinal) ((double)x * 0.9), y);
DrawSingleNumber(w, 0, x, y);
} else
DrawSingleNumber(w, which, x, y);
}
static void DrawLabelString(TachometerWidget w)
{
XPoint points[5];
int char_count, data_count;
Cardinal ry, center_x, center_y, radius_x, radius_y;
GC gc;
center_x = (Cardinal) (w->core.width / 2);
center_y = (Cardinal) (w->core.height / 2);
radius_x = center_x - w->tachometer.internal_border;
radius_y = center_y - w->tachometer.internal_border;
if (!(center_x != 0 && center_y != 0 && (radius_x > 0) && (radius_y > 0)))
return;
ry = (Cardinal) (radius_y * 0.35 + center_y);
gc = w->tachometer.scale_GC;
for (char_count = 0; char_count < 4; char_count++) {
for (data_count = 0; data_count < char_data[char_count].nofline;
data_count++) {
points[data_count].x = (short)
((char_data[char_count].point_list[data_count].x) *
(double)radius_x * 0.01 + center_x);
points[data_count].y = (short)
((char_data[char_count].point_list[data_count].y) *
(double)radius_y * 0.01 + ry);
}
(void)XDrawLines(XtDisplay(w), XtWindow(w), gc, points,
char_data[char_count].nofline, CoordModeOrigin);
}
}
static void DrawGauge(TachometerWidget w)
{
XPoint points[4];
Cardinal in_gauge_x, in_gauge_y, out_gauge_x, out_gauge_y;
Cardinal number_x, number_y, center_x, center_y, radius_x, radius_y;
GC gc;
double step, jump = 1.0;
center_x = w->core.width / 2;
center_y = w->core.height / 2;
radius_x = center_x - w->tachometer.internal_border;
radius_y = center_y - w->tachometer.internal_border;
if ((center_x == 0) || (center_y == 0) || (radius_x <= 0)
|| (radius_y <= 0))
return; /* Can't draw anything */
gc = w->tachometer.scale_GC;
for (step = 330.0; step >= 30.0; step -= jump) {
if ((Cardinal) (step) % 30 == 0) {
points[0].x =
sin((step + 1.0) * D2R) * radius_x * 0.75 + center_x;
points[0].y =
cos((step + 1.0) * D2R) * radius_y * 0.75 + center_y;
points[1].x =
sin((step - 1.0) * D2R) * radius_x * 0.75 + center_x;
points[1].y =
cos((step - 1.0) * D2R) * radius_y * 0.75 + center_y;
points[2].x =
sin((step - 1.0) * D2R) * radius_x * 0.85 + center_x;
points[2].y =
cos((step - 1.0) * D2R) * radius_y * 0.85 + center_y;
points[3].x =
sin((step + 1.0) * D2R) * radius_x * 0.85 + center_x;
points[3].y =
cos((step + 1.0) * D2R) * radius_y * 0.85 + center_y;
(void)XFillPolygon(XtDisplay(w), XtWindow(w), gc, points, 4,
Complex, CoordModeOrigin);
number_x = sin((step + 1.0) * D2R) * radius_x * 0.65 + center_x;
number_y = cos((step + 1.0) * D2R) * radius_y * 0.65 + center_y;
if ((int)((330.0 - step) / 30.0) == 1)
jump = 3.0;
DrawNumbers(w, (unsigned char)((330.0 - step) / 30.0),
number_x, number_y);
} else {
in_gauge_x = sin(step * D2R) * radius_x * 0.8 + center_x;
in_gauge_y = cos(step * D2R) * radius_y * 0.8 + center_y;
out_gauge_x = sin(step * D2R) * radius_x * 0.85 + center_x;
out_gauge_y = cos(step * D2R) * radius_y * 0.85 + center_y;
(void)XDrawLine(XtDisplay(w), XtWindow(w), gc, in_gauge_x,
in_gauge_y, out_gauge_x, out_gauge_y);
}
}
DrawLabelString(w);
}
static void DrawNeedle(TachometerWidget w, int load)
{
XPoint points[6];
double cur_theta1, cur_theta2, cur_theta3, cur_theta4, cur_theta5;
Cardinal center_x, center_y, radius_x, radius_y;
center_x = w->core.width / 2;
center_y = w->core.height / 2;
radius_x = center_x - w->tachometer.internal_border;
radius_y = center_y - w->tachometer.internal_border;
if ((center_x == 0) || (center_y == 0) || (radius_x <= 0)
|| (radius_y <= 0))
return; /* can't draw anything */
cur_theta1 = (double)(330 - (load * 3)) * D2R;
cur_theta2 = (double)(330 - (load * 3) + 1) * D2R;
cur_theta3 = (double)(330 - (load * 3) - 1) * D2R;
cur_theta4 = (330.0 - ((double)load * 3.0) + 7.0) * D2R;
cur_theta5 = (330.0 - ((double)load * 3.0) - 7.0) * D2R;
points[0].x = (short)(sin(cur_theta1) * radius_x * 0.75 + center_x);
points[0].y = (short)(cos(cur_theta1) * radius_y * 0.75 + center_y);
points[1].x = (short)(sin(cur_theta2) * radius_x * 0.7 + center_x);
points[1].y = (short)(cos(cur_theta2) * radius_y * 0.7 + center_y);
points[2].x = (short)(sin(cur_theta4) * radius_x * 0.1 + center_x);
points[2].y = (short)(cos(cur_theta4) * radius_y * 0.1 + center_y);
points[3].x = (short)(sin(cur_theta5) * radius_x * 0.1 + center_x);
points[3].y = (short)(cos(cur_theta5) * radius_y * 0.1 + center_y);
points[4].x = (short)(sin(cur_theta3) * radius_x * 0.7 + center_x);
points[4].y = (short)(cos(cur_theta3) * radius_y * 0.7 + center_y);
points[5].x = points[0].x;
points[5].y = points[0].y;
(void)XDrawLines(XtDisplay(w), XtWindow(w),
w->tachometer.needle_GC, points, 6, CoordModeOrigin);
}
static void DrawTachometer(TachometerWidget w)
{
Cardinal center_x, center_y, radius_x, radius_y;
center_x = w->core.width / 2;
center_y = w->core.height / 2;
radius_x = center_x - w->tachometer.internal_border;
radius_y = center_y - w->tachometer.internal_border;
if ((center_x == 0) || (center_y == 0) || (radius_x <= 0)
|| (radius_y <= 0))
return; /* Can't draw anything -- no room */
/* Big circle */
FastFillCircle(XtDisplay(w), XtWindow(w), w->tachometer.circle_GC,
center_x, center_y, radius_x, radius_y);
/* Inner circle same color as the background */
FastFillCircle(XtDisplay(w), XtWindow(w), w->tachometer.background_GC,
center_x, center_y, (Cardinal) (radius_x * 0.95),
(Cardinal) (radius_y * 0.95));
/* Small circle */
FastFillCircle(XtDisplay(w), XtWindow(w), w->tachometer.circle_GC,
center_x, center_y, (Cardinal) (radius_x * 0.1),
(Cardinal) (radius_y * 0.1));
/* Draw the details */