summaryrefslogtreecommitdiff
path: root/serial.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up most spint errors. All regression tests pass.Eric S. Raymond2015-03-281-4/+2
|
* splint cleanup. Fixes for minor but real issues...Eric S. Raymond2015-03-281-0/+2
| | | | | ...no attempt to address the weird cross-platfprm variability we've seen lately. All regression tests pass.
* splint can't play the BLUEZGary E. Miller2015-03-251-0/+3
|
* Float elimination. All regression tests pass.Eric S. Raymond2015-03-201-1/+1
|
* Include path in faInclude path in file open failure messages.Eric S. Raymond2015-03-101-3/+6
|
* OS X, fix warning of missing cast speed_t -> unsigned longGary E. Miller2015-03-091-2/+2
|
* gpsd-report() -> gpsd_log()Eric S. Raymond2015-03-071-43/+43
| | | | | | | | | | | | | | | | 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.
* HAVE_BLUEZ -> ENABLE_BLUEZ. It's a feature flag, not a platform quirk.Eric S. Raymond2015-03-011-3/+3
| | | | | All regression tests pass.
* splint cleanup. All regressiion tests pass.Eric S. Raymond2015-02-091-1/+1
|
* Reinstate blocking I/O; it no longer breaks test rebuilds.Eric S. Raymond2015-02-091-22/+17
| | | | All regression tests pass.
* Revert to non-blocking I/O. Blocking I/O broke gps-makeregress.Eric S. Raymond2015-02-061-17/+22
| | | | | | | | | 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.
* Now we open with nonblock, set CLOCAL, and then turn off nonblock.Eric S. Raymond2015-02-021-2/+15
| | | | All regression tests pass.
* O_NONBLOCK was causing more grief than we knew. We don't need VTIME!Eric S. Raymond2015-02-021-1/+1
| | | | All regression tests pass.
* Revert mistaken use of CLOCAL in open(2).Eric S. Raymond2015-02-021-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Open ttys with CLOCAL, following a suggestion by Hal Murray.Eric S. Raymond2015-02-021-2/+2
| | | | | | Also, zero in on shorter delays in the regression tests. All regression tests pass.
* Change to using blocking I/O and VTIME.Eric S. Raymond2015-02-021-20/+4
| | | | | | | 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.
* Back out the attempt to use VTIME.Eric S. Raymond2015-01-311-56/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add workaround for VMIN/VTIME situation.Greg Troxel2015-01-301-1/+15
| | | | | On NetBSD, there's something wrong between gpsd code, select and termios's VMIN/VTIME. Until debugged, avoid it.
* Alas, we can't use ICANON.Eric S. Raymond2015-01-291-1/+5
| | | | | | | | 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.
* Rare I/O with timeout seems to work. This replaces the adaptive-delay code.Eric S. Raymond2015-01-291-4/+31
|
* Create a logic path for each driver to set tty controls.Eric S. Raymond2015-01-291-0/+10
|
* Cleaned up, improved sourcetype() code. All regression tests pass.Eric S. Raymond2015-01-231-0/+46
|
* Handle lack of TIOCEXCL and TIOCNXCL on cygwinMatt2014-09-061-0/+4
| | | | | The cygwin headers don't seem to define these. We can still attempt to work without them.
* Now that the transition is done we can restore the gpsd_report name.Eric S. Raymond2014-08-271-14/+14
| | | | All regression tests pass.
* The big leap. Most instances of gpsd_report are replaced...Eric S. Raymond2014-08-271-14/+14
| | | | | | | | | | | | | | | | ...with calls to gps_notify(), which indirects to its output method through a slot in an errout structure. Usually the errout structure lives inside the session context, but because struct errout_t is its own thing this does not have to be the case. One large clique of gpsd_notify() calls, in packet.c and isgps.c, looks at a struct errout_t copy in a lexer control block This change is not complete. Remnant gpsd_report calls need to be changed, and gpsmon needs to be tweaked so that the struct_error_t in its context is a non-defaukt hook updating the cuses display rather than simply dumping to stderr. Also the report label functionality needs to be added. All regression tests pass.
* Introduce struct errout_t to encapsulate error-reporting hooks.Eric S. Raymond2014-08-271-15/+15
| | | | | | A major step towards eliminating reverse linkage. All regression tests pass.
* Structure member name change: packet -> lexer. No logic changes.Eric S. Raymond2014-08-271-4/+4
| | | | All regression tests pass.
* Move and improve a comment.Eric S. Raymond2013-11-271-1/+4
|
* Fix a minor layerring violation. All regression tests pass.Eric S. Raymond2013-10-301-7/+0
|
* Make all hex-dumping truly thread-safe.Eric S. Raymond2013-10-131-2/+5
|
* splint cleanup.Eric S. Raymond2013-10-091-4/+4
|
* Give drivers a way to query the currewntly set stopbits and parity.Eric S. Raymond2013-10-081-0/+20
|
* We can now monitor low-level string sends through gpsmon.Eric S. Raymond2013-10-041-1/+2
| | | | Now we'll know exactly what's being sent on a UBX mode change.
* Change gpsd_report to no longer use a global. All regression tests pass.Eric S. Raymond2013-09-291-15/+24
| | | | | | | | This is a large, ugly change. But without it we can't troubleshoot the ICP/IP-source initialization bug properly - colliding definitions of gpsd_report() were interfering with error reporting early in gpsd runs. More cleanup work remains to be done, but at least this is working.
* cppcheck ckeanup. All regression tests pass.Eric S. Raymond2013-09-171-1/+1
|
* Some GPSes use the USB ACM driver (/dev/ttyACM*, major number 166) on Linux.Michael Tatarinov2013-09-041-3/+3
| | | | | This patch makes them classify as USB source and fixes typos for bluetooth device.
* Move an assignment to pacify splint.Eric S. Raymond2013-05-011-1/+1
|
* Clean up more static-analysis warnings.Eric S. Raymond2013-04-301-6/+4
|
* Don't check exclusion for bluetooth devices.Michael Tatarinov2012-10-101-1/+3
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Lose the assumption that socket_t is an integer.Eric S. Raymond2012-09-221-1/+1
|
* gpsd_get_speed_old usage was lost on exitJon Schlueter2012-09-091-1/+1
| | | | | | | in the gpsd_get_speed conversion where we lost resetting the speed to the old speed on exit in serial.c Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-9/+9
|
* Change the API so the yermios strucytture is not publicly exposed.Eric S. Raymond2012-09-071-3/+13
| | | | | | | | Becauser this changed the libgpsd API but not the libgps one, libgpsd now has its own version number. (Doing otherwise would have inflicted a gratuitous binary-compatibility break on application developers). All regression tests pass. Audit check runs clean.
* Minor cleanup for bluez code suggested by ukyg9e5r6k7gubiekd6,Eric S. Raymond2012-09-071-2/+2
|
* Clean up initial rate-setting when port speeits are fixed.Eric S. Raymond2012-09-051-2/+14
|
* Accept Freescale UARTS as RS232 devices.Stephen Cavilia2012-06-221-1/+2
| | | | | | | The on-chip UARTs on Freescale i.MX processors use device names /dev/ttymxc[012] and major number 207 on linux. These will get classified as an unknown source type by gpsd. Attached patch makes them classify as standard RS232 devices.
* Make sure an invariant is preserved.Eric S. Raymond2012-06-201-1/+1
|
* Split gpsd_hexdump() so AIS dumping will be invertible.Eric S. Raymond2012-06-201-1/+1
|
* splint gets confused by declarations after statements.Eric S. Raymond2012-06-191-1/+3
|
* More cppcheck warning fixups. All regression tests pass.Eric S. Raymond2012-05-181-0/+1
|