| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function vwprintw, declared in curses.h is called out by gcc
because of its use of varargs.h . The actaul implementation uses
stdarg.h , however GCC does not know this. Switch to the newer
calling form to make gcc happy.
gcc -o gpsmon.o -c -pthread -Wall -Wcast-align -Wextra -Wimplicit-fallthrough -Wmissing-declarations -Wmissing-prototypes -Wno-missing-field-initializers -Wno-uninitialized -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wvla -O2 -pthread -DHAVE_SYS_TIMEPPS_H=1 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include -I/usr/include/libusb-1.0 gpsmon.c
gpsmon.c: In function 'monitor_vcomplain':
gpsmon.c:392:5: warning: 'vwprintw' is deprecated [-Wdeprecated-declarations]
(void)vwprintw(cmdwin, (char *)fmt, ap);
^
In file included from gpsmon.h:11,
from gpsmon.c:31:
/usr/include/curses.h:816:28: note: declared here
extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list) GCC_DEPRECATED(use vw_printw); /* implemented */
^~~~~~~~
gpsmon.c: In function 'monitor_log':
gpsmon.c:419:2: warning: 'vwprintw' is deprecated [-Wdeprecated-declarations]
(void)vwprintw(packetwin, (char *)fmt, ap);
^
In file included from gpsmon.h:11,
from gpsmon.c:31:
/usr/include/curses.h:816:28: note: declared here
extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list) GCC_DEPRECATED(use vw_printw); /* implemented */
^~~~~~~~
Signed-off-by: Gary E. Miller <gem@rellim.com>
|
|
|
|
|
| |
Also, remove sime header inclusions discovered to be unnecessary during
the change.
|
|
|
|
|
| |
Outide of one Mac portability shim, anyway. Associated select(2) calls
become pselect(2) calls.
|
| |
|
| |
|
|
|
|
| |
Bug found by gcc 7.3.0.
|
|
|
|
| |
Thanks to Virgin Orbit for their support on this patch.
|
|
|
|
| |
Thanks to a report from <alexc@sbrella.com>
|
| |
|
|
|
|
| |
135 > 128.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until recently, PPS_ENABLE was always true by default, even on
platforms where it was intended to be forced off. Fixing this exposed
some issues in gpsmon. This generally related to confusion between
*displaying* PPS info versus *capturing* it. Since gpsmon can be run
against a remote target, it should be able to report PPS info even
when running on a host that doesn't support PPS, but the code was
conflating the two issues.
The changes here are:
1) There is now a PPS_DISPLAY_ENABLE, which is always true, and should
be used in place of PPS_ENABLE in code related to displaying PPS info,
to the extent possible.
2) The code related to processing remote TOFF and PPS events now uses
this new conditional. Aside from restoring the presence of the "PPS
offset" lines in the scrolling data, this also fixes a problem where
the display malfunctioned when this code was absent. The exact nature
of this dependency hasn't yet been determined, but there's a FIXME to
document the issue.
3) The reporting of PPS offsets in the windowed area still doesn't
work without PPS_ENABLE, due to the entanglement between that code and
the pps_thread code. There are now a couple of FIXMEs related to that
issue, which is being left for future work.
4) A couple of unnecessary PPS_ENABLE conditionals were eliminated by
making use of the existing conditionally-defined lock/unlock
functions.
TESTED:
Ran gpsmon on OSX 10.9 (where PPS_ENABLE is off) against three
receivers (one local and two remote), with the expected results. Also
ran it on Ubuntu 14 (where PPS_ENABLE is on) against the same three
receivers (again one local and two remote), again with the expected
results.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the Linux kernel is built with CONFIG_PPS_CLIENT_KTIMER=y, then a
synthetic PPS source is added to allow testing without a real PPS
source. However, this source doesn't even run at exactly 1Hz, so any
attempt to use it for real time synchronization is disastrous.
To make matters worse, this is usually the first PPS driver
configured, causing it to appear as /dev/pps0, which is the implied
PPS device used by the "Magic HAT" kludge.
This change adds detection for the fake source (based on its name),
both to provide a warning if it is configured explicitly, and to skip
over it when applying the "Magic HAT" kludge.
TESTED:
Tested both gpsmon and gpsd on a Beaglebone Black with added symlinks
for testing "Magic HAT". Did this with kernels with and without the
KTIMER enabled. Verified that the proper PPS device is selected by
"Magic HAT", and that a warning is generated when expected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a build option called 'magic_hat', and makes the code for
MAGIC_HAT_GPS and MAGIC_LINK_GPS conditional on it. It currently
defaults to True on Linux and False otherwise. It's meaningless on
non-Linux platforms, though at present there are no
conditionally-present options, so this one is also present on all
platforms.
TESTED:
Tested on a Beaglebone Black with suitable symlinks added (and running
a kernel with PPS_CLIENT_KTIMER turned off. Verified that the kludge
behaves as intended when enabled, and is inoperative when disabled.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In gpsmon, the PPS offsets reported in the display pane and in the
scrolling packet data has opposite signs. Since the display version
is consistent with the value reported by the ppswatch utility
(from the pps-tools package), this is assumed to be the correct
version, and the "text" version is corrected to match.
TESTED:
Ran gpsmon on both OSX and Linux, verifying that the two forms
of PPS offset reported by gpsmon and the ppswatch version are all
consistent.
Signed-off-by: Gary E. Miller <gem@rellim.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were two bugs in the alternate input code used in -a mode:
1) It was using strlen() instead of sizeof() to determine the
available space in the input buffer. This is uninitialized data,
making the result nondeterministic, though it would return zero
in the case observed.
2) It was failing to handle the NULL return from fgets() correctly,
resulting in a call to do_command() with a garbage argument. This
caused a segfault.
Also, casting the strlen/sizeof value to int was superfluous.
TESTED:
Typing a "q" in -a mode now outputs a prompt (an incorrect one,
but that's another story) and can then quits without crashing.
Signed-off-by: Gary E. Miller <gem@rellim.com>
|
|
|
|
|
| |
Sad, C99 did not actually standardize the defines to invoke
the standard.
|
|
|
|
| |
I sure hope I did not drop a zero anywhere...
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
When a serial device to be opened is /dev/ttyAMA0, and /dev/pps0 exists,
and we have read-write access to it (which implies running as root),
substitute /dev/pps0 for the device name in the thread context so we
use KPPS.
Should be safe because /dev/ttyAMA0 is so specific to the Raspberry Pi.
|
|
|
|
| |
Signed-off-by: Gary E. Miller <gem@rellim.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
CTRL('L') is a BSD-ism. CTRL() is defined in sys/ttydefaults.h
which does not always exist. Instead of adding scons tests for
needing CTRL() and its include files just replace with a simple
constant.
Needed for musl and found by Baruch Siach <baruch@tkos.co.il>
|
| |
|
|
|
|
| |
Also fix debug output gsmon: -> gpsmon:
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Promote scan-build to be onere of the stock pre-release checks.
Fix one minor cppcheck nit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The proximate cause was that we've been seing emission of error
messages that were randomly and disturbingly variable across different
environments - notably Raspbian and Gentoo splint gave nontrivially
different results than Ubuntu 14.10 splint. And this was *not* due to
Ubuntu patches! A pristine splint built from the 3.1.2 tarball on
Ubuntu didn't match the Raspbian and Gentoo results either.
But this has been coming for a while. Easy access to more modern
static analyzers such as coverity, scan-build and cppcheck has been
decreasing the utility of splint, which is unmaintained and somewhat
buggy and not easy to use.
Only file not cleaned is ppsthread.c, because Gary has been working
on it during this cleanup.
All regression tests pass. PPS observed live on GR601-W.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
With -Werror -DNDEBUG, these two cases end up failing with unused variables
(gcc 4.9 with lots of patches on Linux). The attached patch solves the issue
for me, but it's possible that it might be better with the UNUSEDs wrapped in
|
|
|
|
| |
PPS observed live on GR601W.
|
| |
|
|
|
|
| |
...but on the same line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The files
ntpshm.h
ntpshmread.c
ntpshmwrite.c
ppsthread.[ch]
timespec_str.[ch]
now form a standalone group which can be used for NTP communication
and PPS thread monitoring. Separation is not yet perfect, as ppsthread.c
requires gpsd_config.h for HAVE_SYS_TIMEPPS_H and npshmread.c/ntpshmwrite.c
both require compiler.h.
All regression tests pass. PPS is live on a GR-601W.
|
|
|
|
| |
PPS observed live on GR-601W. All regression yests pass.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the big step towards ntplib. A couple of minor issues remain to be
ironed out, the most significant of which is what to do about the timestamp_t
type.
This changes some field offsets of private fields in struct gps_device_t.
Probably does not require a version bump as access to them is all through
the libgpsd API.
All regression tests pass. PPS observed live in gpsmon direct mode.
|
|
|
|
|
|
|
|
|
|
|
| |
No logic changes, though it looks like there are two because two guards
that would always have failed when the code was compiled with pps=off
are now conditioned out. Also, this code is offset-preserving
so as not to break link-time compatibility of libgpsd.
(This is the subtler approach...)
All regression tests pass.
|
|
|
|
|
|
| |
fom sessions."
Previous approch was a bit too frontal.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
| |
All regression tests pass.
|
| |
|
|
|
|
| |
visiblize only used under PPS_ENABLE guard
|