summaryrefslogtreecommitdiff
path: root/gpsd.c
Commit message (Collapse)AuthorAgeFilesLines
* gpsd-report() -> gpsd_log()Eric S. Raymond2015-03-071-264/+272
| | | | | | | | | | | | | | | | 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-1/+3
| | | | | | | | | | | 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.
* Revert "ntplib extraction requires libgpsd object format bump to 23."Eric S. Raymond2015-03-071-1/+1
| | | | 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-1/+1
| | | | | | 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.
* Generqte -V messages in a uniform way.Eric S. Raymond2015-03-021-1/+1
| | | | All regression tests pass.
* Warning hunting cleanup unused variable af in gpsdJon Schlueter2015-02-271-4/+6
| | | | | | | for scons minimal=on clang identified af as assigned but never used. on closer inspection af is a file static and a parameter to one of the functions renamed file static and guarded it with SOCKET_EXPORT_ENABLED
* fix broken build scons minimal=on ntp=on in gpsd.cJon Schlueter2015-02-241-0/+3
| | | | Missing ifdef guard for SOCKET_EXPORT around usage of notify_watchers
* In gpsd.c, restire some trailingsplint markup.Eric S. Raymond2015-02-231-0/+1
| | | | No code changes.
* TOFF JSON message implemented and documented.Eric S. Raymond2015-02-231-7/+18
| | | | | | 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-5/+5
| | | | No logic changes. All regression tesrs pass. Live PPS observed.
* Warning hunting cleanup in gpsd.c around ship_pps_drift_messageJon Schlueter2015-02-231-1/+1
| | | | declaration was missing a stacked guard for CONTROL_SOCKET_ENABLE
* Fix for scons minimal=on broken build in gpsd.c missing ifdef guardJon Schlueter2015-02-181-0/+2
|
* Tweak instrumentation to find out why alternate export segment isn't being set.Eric S. Raymond2015-02-161-6/+1
| | | | All regression tests pass. No logic changes.
* BSD compiler waening and splint cleanup.Eric S. Raymond2015-02-111-1/+1
|
* Comment typo fix.Eric S. Raymond2015-02-101-1/+1
|
* Graceful shutdown qwhen hotplug-driven and out of devices and subscribers.Eric S. Raymond2015-02-061-1/+29
|
* Revert the change abolishing the "pps" policy flag, it broke gpsmon client mode.Eric S. Raymond2015-02-021-5/+6
| | | | All regression tests pass.
* Add missing pthread_mutex_init(&ppslast_mutex)Gary E. Miller2015-01-301-0/+4
| | | | | No error checking was previously done on uses of ppslast_mutex. So likely the mutex has never worked, just created the odd segfault.
* Assertions cleanup and new policy. All regression tests pass.Eric S. Raymond2015-01-301-1/+5
|
* Remove the failed adaptive-delay experiment.Eric S. Raymond2015-01-291-82/+0
| | | | | | | | Instead, we're going to try telling the tty layer to deliver input in chunks larger than chracters, with a timeout. That way the select call in the main loop will return data ready less often. All regression tests pass.
* Using SIOCOUTQ to flush output on client socket close caused a hard hang.Eric S. Raymond2015-01-281-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To replicate the problem: (1) Check out the parent of this revision. (2) Run "gpsd -n -N -D 3 /dev/ttyUSB0" substituting the device as needed. (3) Run the following script in another window: while true do date ./gpspipe -n 3 -R -o /dev/null # hang if gpsd is sick ./gpspipe -d -R -o /dev/null sleep 2 DELAY=$RANDOM # 0-32K #usleep ${DELAY}00 # 0-3 seconds sleep `echo "scale=6; $DELAY / 1000000" | bc` killall gpspipe #ps ax | grep gpspipe done (4) Run gpsmon in a third window. gpsd will hang in 3-5 minutes, requiring kill -9, in the kernal hrtime function.
* Remove a guard that is duplicated in the called function.Eric S. Raymond2015-01-281-11/+9
| | | | All regression tests pass.
* Reduce log verbosity.Eric S. Raymond2015-01-271-2/+2
|
* Try a simpler adaptive-delay formula that produces shorter delays.Eric S. Raymond2015-01-271-4/+13
| | | | All regression tests pass.
* Documentation improvements.Eric S. Raymond2015-01-271-1/+2
|
* Apply de Morgan's law properly.Eric S. Raymond2015-01-271-1/+1
| | | | All regression tests pass.
* Improved adaptive-delay logic. Don't insert them if CAN devices are in play.Eric S. Raymond2015-01-271-12/+18
| | | | All regression tests pass.
* Implement and document the buzzkill option.Eric S. Raymond2015-01-261-5/+13
| | | | All regression tests pass.
* Prevent TIOCMIWAIT from beinf sent to non-serial devices.Eric S. Raymond2015-01-261-9/+11
| | | | All regression tests pass.
* Skip writespace *before* looking for word length.Eric S. Raymond2015-01-251-2/+2
| | | | All regression tests pass.
* SIOCOUTQ build fix required for older Ubuntu versions.Eric S. Raymond2015-01-251-1/+2
|
* Under Linux, delay client socket close until pending data has shipped.Eric S. Raymond2015-01-241-0/+16
| | | | | | This is not, alas, sufficient to allow us to zero out CLOSE_DELAY; I tried. But it can't hurt, and might help in combination wuth some black magic we have yet to discover.
* Coverity cleanup. All regression tests pass.Eric S. Raymond2015-01-241-3/+1
|
* Fix bug reported on the dev list resulting from NTPSHMSEGS > MAX_DEVICES * 2.Eric S. Raymond2015-01-241-60/+33
| | | | | | As a side effect, simplify configuration slightly. All regression tests pass.
* Fixing broken build for scons control_socket=on pps=onJon Schlueter2015-01-231-2/+2
| | | | guard for using ship_pps_drift_message didn't match it's declaration
* cppcheck cleanup.Eric S. Raymond2015-01-221-2/+4
|
* spelling cleanup in commentsJon Schlueter2015-01-221-2/+2
|
* Introduce an adaptive delay into the main loop to prevent select buzzing.Eric S. Raymond2015-01-221-0/+59
| | | | | | | | | | | 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.
* More splint cleanup. All regression tests pass.Eric S. Raymond2015-01-211-1/+1
|
* Comment typo fix.Eric S. Raymond2015-01-211-1/+1
|
* Add str_rstrip_char, use it everywhere.Zbigniew Chyla2015-01-211-8/+4
| | | | This change doesn't affect generated binary code.
* Add str_{,v}appendf, use it everywhere.Zbigniew Chyla2015-01-211-9/+5
| | | | This change doesn't affect generated binary code.
* Add str_starts_with macro, use it instead of strncmp.Zbigniew Chyla2015-01-211-5/+6
| | | | This change doesn't affect generated binary code.
* Refactor the way NTP shared memory segments are addressed.Eric S. Raymond2015-01-131-2/+2
| | | | | | | | | | This is a first step towards removing the NTPSHMSEGS limit. Instead of devices holding two indices into the segment array in the context structure, give them copies of the actual segment pointers and allow ntpshm_put() to take a pointer limit. All regression tests pass.
* Always use sizeof to get array sizeZbigniew Chyla2015-01-131-1/+1
| | | | | | Don't use constant/expression from an array's definition when referring to its size. Eliminates redundancy and avoids problems when array size changes. The change doesn't affect generated code.
* Fix the build in some unusual cases. All regression tests pass.Eric S. Raymond2015-01-131-7/+5
|
* Sanity check for too many devices on the command line.Eric S. Raymond2014-12-091-1/+11
| | | | All regression tests pass.
* Remove a redundant check. All regression tests pass.Eric S. Raymond2014-09-271-1/+1
|
* Silence compiler warnings about array subscripts of type 'char'Matt2014-09-101-7/+7
| | | | | | | | | | | | | | | | | | | | Cygwin GCC complains about code like isprint(c), where c is of type char. The isX() and toX() functions/macros (ISO C allows either) all accept an int, whose value should be either that of an unsigned char, or the special value EOF (== -1). So cast to unsigned char each argument to isprint, tolower, etc. Silences several warnings of the form: gpsutils.c: In function 'safe_atof': gpsutils.c:90:5: warning: array subscript has type 'char' [-Wchar-subscripts] while (isspace(*p)) { ^ gpsutils.c:188:2: warning: array subscript has type 'char' [-Wchar-subscripts] while (isdigit(*p)) { ^
* Minimal option requires conditionalization of some code.Eric S. Raymond2014-09-061-4/+11
| | | | | All regression tests pass with default options (GPS tests are disabled with minimal on, because socket_export is off).