| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
makes gpsd hang when it closes the serial port after receiving a SIGTERM.
Hanging is caused by the call to tcdrain(), which happens even when
gpsd is in read-only mode (-b argument).
In this mode, since nothing is ever written to the serial port, the
tcdrain call is not needed. Skip it.
Signed-off-by: Gary E. Miller <gem@rellim.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
I sure hope I did not drop a zero anywhere...
|
|
|
|
|
|
|
|
|
| |
As the comment now says:
strangely this fails on non-serial ports, but if
we do not try, we get other failures.
so ignore for now, as we always have, until it can
be nailed down.
|
|
|
|
|
|
|
|
|
| |
This was the wrong place to stop calls to gpsd_set_speed().
Other places call gpsd_set_speed() so the check for devices that
should not have their speed set with tcsetattr() should be in in
gpsd_set_speed.
More on this soon.
|
|
|
|
| |
Possibly temporary revert of close simplification, which looks like the culprit.
|
| |
|
|
|
|
|
|
| |
The old log, on some hosts, was:
gpsd:ERROR: SER: error setting port attributes: Invalid argument
|
|
|
|
|
| |
isatty() says a /dev/pts is a tty, but /dev/pts will not accept
ttyset speed changes.
|
|
|
|
|
| |
But, as the man page says, a return of success does not mean 100%
success
|
|
|
|
|
|
| |
This makes it easy to trace the serial.c code:
gpsd -nND 8 /dev/ttyS0 |& fgrep SER:
|
|
|
|
|
|
|
|
| |
Gary thinks it was fighting the autobaud loop. He's probably right, and
the way we were trying to force HUPCL on old systems (forcing baud rate to 0)
seems to cause misbehavior on the Raspberry Pi under Jessie.
Solution: shoot the whole mess through the head. See if anyone complains.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simon Artott wrote:
When using a pipe with the serial driver (e.g. stdin from another
process) to provide NMEA data, the fd is set to blocking mode and
gpsd_poll() gets stuck in a loop calling get_packet() because read()
always waits for more data.
I have to remove the "Switch back to blocking I/O now that CLOCAL is
set" code from serial.c to get it to work. The driver should detect if
the fd is a pipe and keep it set to non-blocking.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d1965788249d7e22cdde4021d452cf0dc6c6b9bd.
This breaks my build on Gentoo running gcc 4.9.2
libgps_shm.c: In function 'int gps_shm_read(gps_data_t*)':
libgps_shm.c:122:12: error: no match for 'operator=' (operand types are
'gps_data_t' and 'volatile gps_data_t')
noclobber = shared->gpsdata;
^
libgps_shm.c:122:12: note: candidate is:
In file included from gpsd.h:350:0,
from libgps_shm.c:30:
gps.h:1918:8: note: gps_data_t& gps_data_t::operator=(const gps_data_t&)
struct gps_data_t {
^
gps.h:1918:8: note: no known conversion for argument 1 from 'volatile
gps_data_t' to 'const gps_data_t&'
|
| |
|
|
|
|
|
| |
Now gpsctl, and friends, can return a pretty device name. And avoids
a segfault on empty *device.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason the ppsthread no longer tries to open /dev/pps0, Either
before or after this patch.
Here is the current status:
root@raspberrypi:/usr/local/src/GPS/gpsd/gpsd# gpsd -nND 6 /dev/pps0 /dev/ttyAMA0 |& fgrep pps0
gpsd:INFO: stashing device /dev/pps0 at slot 0
gpsd:ERROR: initial GPS device /dev/pps0 open failed
gpsd:INFO: KPPS:/dev/ttyAMA0 checking /sys/devices/virtual/pps/pps0/path,
[... no more output]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For these devices:
1. The hunt loop is disabled.
2. When emitting a PPS report, all other (non-/dev/pps) devices are
checked for in-band time. If no time is found the report is not
emitted. If time is ound its seconds field is incremented by 1 and it
is used
Every PPS from a device resets its online time, which should prevent
/dev/pps devices from timing out too often.
Not yet tested with a /dev/pps device. All regression tests oass.
|
| |
|
|
|
|
|
| |
...no attempt to address the weird cross-platfprm variability we've seen lately.
All regression tests pass.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is done so we can add a "log" hook to the pps_thread_t
structure (this is not done yet) and harmonize with the name of the
outer logging function. If that name had been left as gpsd_report()
there would have been scope for bad confusion with the report_hook
member.
Also, remove two stray duplicative printf calls from the NMEA2000 driver
(drivers shouldn't have printfs!) and fix one typo.
This is a step towards factoring out ntplib. For that to happen, the
PPS thread code needs to be decoupled from the core session structure.
No logic changes. Object compatibility preserved. All regression tests pass.
|
|
|
|
|
| |
All regression tests pass.
|
| |
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
|
|
|
|
| |
Regression tests pass with nonblocking I/O, but a regression test *rebuild*
fails with timing errors. Much as we want a solution to the select-buzz
problem, this change must go on hold until the root cause of the timing
problems is found and fixed.
Regression tests still pass.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All regression tests pass.
Hal Murray thinks we should be opening the device, setting CLOCAL with
tcsetattr() , closing it, and reopening. This is a good idea in
principle but doing it right will require serious preparatory surgery
on the serial.c code.
According to StackOverflow, the specific thing CLOCAL does is disable signaling
the process on CD drop.
The Modem HOWTO says this:
Normally a CD (Carrier Detect) signal (on the CD wire for an external
modem) is [not] required before a serial port can be opened. But if stty has
negated clocal (-clocal), then the port requires CD raised for the
port to open and remain open. Actually, a skilled programmer can write
the program in such a way as to force the port to open even when CD
and clocal say not to. So if stty shows -clocal then there might be a
problem with opening the port. But for dial-in, in some cases you may
want -clocal so that when the remote modem stops sending a carrier and
CD drops, the port will close and terminate all processes running on
it.
The above is internally inconsistent without the inserted "not".
The Gnu C library documentation says:
Macro: tcflag_t CLOCAL
If this bit is set, it indicates that the terminal is connected
"locally" and that the modem status lines (such as carrier detect)
should be ignored.
On many systems if this bit is not set and you call open without
the O_NONBLOCK flag set, open blocks until a modem connection is
established.
If this bit is not set and a modem disconnect is detected, a
SIGHUP signal is sent to the controlling process group for the
terminal (if it has one). Normally, this causes the process to
exit; see 24. Signal Handling. Reading from the terminal after a
disconnect causes an end-of-file condition, and writing causes an
EIO error to be returned. The terminal device must be closed and
reopened to clear the condition.
|
|
|
|
|
|
| |
Also, zero in on shorter delays in the regression tests.
All regression tests pass.
|
|
|
|
|
|
|
| |
This addresses the buzzing-select problem, but the cost is that the GPS
regression tests require longer delays and may hang if the delays are too short.
All regression tests pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to Matthias Drochner at
http://lists.lysator.liu.se/pipermail/lsh-bugs/2003q4/000151.html:
I thought I'd give lsh a try, just to see how it compares to openssh...
The client didn't work well on NetBSD, got a message like "unexpected
EWOULDBLOCK" on each keystroke.
Looked a bit deeper and found that stdin is set to O_NONBLOCK and
a raw tty mode with c_cc[VMIN] > 1 and c_cc[VTIME] > 0.
I'll append a little test program which does the same. I've tried
it on 3 operating systems (Linux, NetBSD, Digital UNIX), and it
behaves differently on each:
-on Linux, if a key is pressed, the read returns immediately with
that one character
-on NetBSD, the read returns with no data but EWOULDBLOCK
-on D'UNIX, the poll() doesn't teturn before 4 keypresses are done;
the read() returns these 4 characters
Indeed, in SUSv2's termios page is a sentence which says that if
both O_NONBLOCK and VTIME>0 are set, the behaviour is more or less
undefined.
I've solved my immediate problems by setting VMIN to 1 instead of 4
in unix_interact.c:do_make_raw(), but VTIME is still pointless,
so I wouldn't call this a clean solution.
All regression tests pass.
|
|
|
|
|
| |
On NetBSD, there's something wrong between gpsd code, select and
termios's VMIN/VTIME. Until debugged, avoid it.
|
|
|
|
|
|
|
|
| |
For the moment, we do nothing with the textual argument to
gpsd_optimize_io(). We'd like to use it to set ICANON mode and let the
kernel do all the line buffering itself. The problem with this is
that VTIME stops working in ICANON, so a binary packet coming up the
wire would result in no further input being seen.
|
| |
|
| |
|