summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
Commit message (Collapse)AuthorAgeFilesLines
...
* splint cleanup of new code.Eric S. Raymond2015-03-081-4/+4
|
* Eliminate timestamp-T use from PPS thread code.Eric S. Raymond2015-03-081-2/+1
| | | | PPS observed live on GR-601W. All regression yests pass.
* Decouple (mostly) the PPS thread-monitor from the session structure.Eric S. Raymond2015-03-081-3/+42
| | | | | | | | | | | | 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.
* Remove a bit of ancient driver-specific cruft.Eric S. Raymond2015-03-071-3/+0
|
* Remove a confusing duplication of a memset() call. All regression tests pass.Eric S. Raymond2015-03-071-6/+2
|
* Expose gpsd_vlog(), so ppsthread.c will be able to see it.Eric S. Raymond2015-03-071-1/+1
|
* gpsd-report() -> gpsd_log()Eric S. Raymond2015-03-071-187/+190
| | | | | | | | | | | | | | | | 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.
* Factor PPS-related members of struct gps_device_t into a pps_thread_t structure.Eric S. Raymond2015-03-071-12/+4
| | | | | | | | | | | 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.
* BUG FIX: Potential buffer overrun in visibilize().Eric S. Raymond2015-03-071-17/+31
| | | | | | | Not exploitable, but could gave been trouble if the funcition was fed more data than exprected through a coding error. All regression tests pass.
* Revert "Another step in prying ntplib loose. Partly decouple ppsthread.c ↵Eric S. Raymond2015-03-071-16/+5
| | | | | | fom sessions." Previous approch was a bit too frontal.
* Revert "ntplib extraction requires libgpsd object format bump to 23."Eric S. Raymond2015-03-071-4/+10
| | | | We need to sneak up on this in a more subtle way.
* ntplib extraction requires libgpsd object format bump to 23.Eric S. Raymond2015-03-071-10/+4
| | | | | | The new struct ppsthread_t isolates the interface to the PPS monitor loop. It will need more members before we're done, including some reporting hooks.
* Another step in prying ntplib loose. Partly decouple ppsthread.c fom sessions.Eric S. Raymond2015-03-071-5/+16
| | | | All regression tests pass.
* Simplify context initialization so we don't have to know structure shapes.Eric S. Raymond2015-03-061-27/+4
|
* Use pselect unconditionally. We're assuming POSIX-2001.1 conformance.Eric S. Raymond2015-03-021-10/+1
| | | | All regression tests pass.
* Remove redundant code.Eric S. Raymond2015-03-021-3/+0
|
* Implement POSIX clock_gettime(3) for systems that lack it (like Mac OS X).Eric S. Raymond2015-03-011-6/+0
| | | | | | | On Mac OS X it will get proper nanosecond precision; elsewhere, only microseconds. Hides the conformance failure from the rest of the code. All regression tests pass.
* fix broken build scons minimal=on ntp=on in libgpsd_coreJon Schlueter2015-02-241-0/+3
| | | | | Missing ifdef guard TIMEHINT around usage of time_offset in libgpsd_core.c
* Restore correct screen painting for gpsmon error messages.Eric S. Raymond2015-02-241-0/+2
| | | | There's still some minor bug here - extra newlines at level LOG_PROG and above.
* TOFF JSON message implemented and documented.Eric S. Raymond2015-02-231-3/+3
| | | | | | All regression tests pass. PPS observed live with gosmon. gpsmon presently ignores this message, but shout display its contents near PPS.
* Abolish all confusing uses of the word 'drift' for a time delta.Eric S. Raymond2015-02-231-1/+1
| | | | No logic changes. All regression tesrs pass. Live PPS observed.
* warning hunting cleanup unused variables in libgpsd_core.cJon Schlueter2015-02-231-1/+5
| | | | | added dummy usage of parameters if function is conditionally compiled out
* Avoid overexposure of an internal mask. EOF_SET -> EOF_ISEric S. Raymond2015-02-201-2/+2
| | | | | | | | Also, use PPSDRIFT_SET as a client-side status flag for JSON PPS rather than the (not yet shipped) TIMEDRIFT_SET. Next release we're probably going to add a drift object for in-line time. No logic changes. All regression tests pass.
* Fixing broken build scons minimal=on ntpshm=onJon Schlueter2015-02-181-0/+2
| | | | missing ifdef guards around pps_thread_stash_fixtime()
* Simplify NTP SHM segment creation.Eric S. Raymond2015-02-151-1/+0
| | | | | | This will avoid an object file compatibility break later. All regression tetrs pass. SHM segments allocate successfully in live testing.
* splint cleanup. All regression tests pass.Eric S. Raymond2015-02-121-0/+2
|
* Namespace cleanup.Eric S. Raymond2015-02-121-1/+1
|
* Mutex-lock the update of last-fix time.Eric S. Raymond2015-02-121-3/+3
|
* BSD compiler waening and splint cleanup.Eric S. Raymond2015-02-111-4/+4
|
* Fix the gpsmon display-trashing problem; add some documentation and asserts.Eric S. Raymond2015-02-101-4/+3
| | | | All regression tests pass.
* splint cleanup. All regressiion tests pass.Eric S. Raymond2015-02-091-5/+4
|
* Remove some remnants of the adaptive-delay experiment.Eric S. Raymond2015-02-091-21/+0
| | | | All regression tests pass.
* Build fix for when pps=no.Eric S. Raymond2015-02-031-1/+1
| | | | All regression tests pass.
* Add note where gpsmon is failing in PPS.Gary E. Miller2015-02-021-2/+2
|
* Mask a NAN in ntpshm_latch(). Cause of NAN in ppsthread.cGary E. Miller2015-02-021-0/+4
| | | | The root cause still to be found.
* Tweak init of session.Gary E. Miller2015-02-021-2/+6
|
* More session initializationGary E. Miller2015-02-021-5/+8
|
* Initialize a few time variables in session.Gary E. Miller2015-02-021-0/+13
|
* Fix insufficient precision in last_fixtime.clockGary E. Miller2015-02-011-3/+2
| | | | | | | | | | last_fixtime.clock and last_fixtime_clock were storing 63 bits of time in 53 bits of timestamp_t (double). Change timestamp_t to timespec to restore nSec precision. Along the way save some floating point that is slow in embedded systems that have no FPU.
* Note loss of precision in ntpshm_latch()Gary E. Miller2015-01-311-0/+4
| | | | | Until we see a high precision GPS timestamp this can be ignored.
* Back out the attempt to use VTIME.Eric S. Raymond2015-01-311-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Document why gpsd needs to die on certain mutex failures.Gary E. Miller2015-01-301-0/+9
|
* Restore hastily removed checks on pthread usage.Gary E. Miller2015-01-301-2/+14
| | | | Any failure of pthread_mutex_lock() is a fatal error.
* Assertions cleanup and new policy. All regression tests pass.Eric S. Raymond2015-01-301-6/+2
|
* Correct assertions in libgpsd_core to assert 0 == errJon Schlueter2015-01-301-2/+2
|
* Add assert()s to the mutex lock/unlock.Gary E. Miller2015-01-291-2/+6
| | | | When in doubt, always test return codes.
* Create a logic path for each driver to set tty controls.Eric S. Raymond2015-01-291-0/+3
|
* Introduce an adaptive delay into the main loop to prevent select buzzing.Eric S. Raymond2015-01-221-0/+22
| | | | | | | | | | | When select(2) returns too fast with only small amounts of data, the main loop will buzz and eat power - a significant issue on, e.g. battery-powered RasPi devices, where it was first spotted. This code watches read volume and delays when it sees lots of small bursts. All regressiion tests pass. But note: the adaptive-delay logic has to suppress delays to arrange this, otherwise we get an all too familiar class of spurious test failure.
* Simplify by using str_rstrip_char.Zbigniew Chyla2015-01-211-2/+1
| | | | | By using str_rstrip_char we explicitly show that we're removing trailing comma/space.
* Add str_{,v}appendf, use it everywhere.Zbigniew Chyla2015-01-211-5/+3
| | | | This change doesn't affect generated binary code.