summaryrefslogtreecommitdiff
path: root/gpspipe.c
Commit message (Collapse)AuthorAgeFilesLines
* HAVE_SYS_SELECT_H: Remove test for this. No longer needed.Gary E. Miller2018-12-271-2/+0
| | | | | Many places in the code include sys/select.h with no guard for a long time and no problem reports. So kill it off.
* Factor most uses of pselect(2) into a new utility function named 'nanowait'.Eric S. Raymond2018-12-271-1/+1
| | | | | Also, remove sime header inclusions discovered to be unnecessary during the change.
* gpspipe: POSIX_C_SOURCE breaks on osX.Gary E. Miller2018-12-261-1/+3
| | | | Very odd. Not obvious why.
* POSIX_C_SOURCE: Not just a linux define. 200112L is a minimum.Gary E. Miller2018-12-261-1/+1
| | | | Don't force _POSIX_C_SOURCE 200112L, just make it a minimum.
* Eliminate effectively all uses of struct timeval.Eric S. Raymond2018-12-261-3/+7
| | | | | Outide of one Mac portability shim, anyway. Associated select(2) calls become pselect(2) calls.
* gpspipe: Small cleanup of getopt() and usage()Gary E. Miller2018-12-141-2/+2
|
* gpspipe: Change gmtime() to gmtime_r().Gary E. Miller2018-12-141-3/+3
| | | | | Some code checkers complain that gmtime() is not thread safe. Like we care in gpspipe.
* gpspipe: Order the options in the code alphabetically.Gary E. Miller2018-12-141-33/+33
|
* gpspipe: Add -Z option to add Z to timestamp.Daniel_M_Williams2018-12-141-3/+23
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* gpspipe: now outputs its timestamps as UTC, not localtimeDaniel_M_Williams2018-12-141-1/+1
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* LICENSE: Update licenses for consistency. No functional changes.Gary E. Miller2018-11-191-1/+1
|
* gpspipe: git seems confused. Empty commit...Gary E. Miller2018-11-081-1/+1
|
* gpspipe: Alphabetize options.Gary E. Miller2018-06-171-10/+10
|
* gpspipe improvement: add option to exit after delayJean Pierre TOSONI2018-06-171-1/+8
| | | | | | | | | | | | | | | | If the GPS receiver cease to supply data to gpsd, gpspipe hangs indefinitely waiting for gpsd. This can happen if the GPS is turned off by external means, e.g. by an AT command on the command port of a cellular card. In order to use gpspipe to get a fix within bounded time, this patch adds an option to specify a timout, so that I can do things like: $x=$(gpspipe -x 5 -w|sed -n '/TPV/{p;q}') And get either the first TPV or an empty string if no fix is available. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Improved Windows build of gpspipeRobert Norris2018-06-171-0/+2
| | | | | | Add missing ifdef for HAVE_TERMIOS_H. Signed-off-by: Gary E. Miller <gem@rellim.com>
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* gpspipe: buffer to small. 40 > 20Gary E. Miller2018-02-081-1/+1
|
* Enable Windows version of gpspipeRobert Norris2017-03-051-1/+13
| | | | | | | | | | | | | | | | Use recv() rather than read() for Windows compatibility. Disable serial port code not available on Windows. Add open flag that's not available on Windows. TESTED: Built gpspipe for Windows under cross compiler. Run gpspipe on a Windows system and successfully connects to an instance of gpsd and dumps NMEA output to the terminal or a specified output file. Still builds and runs on a Linux system including the daemon option. Signed-off-by: Fred Wright <fw@fwright.net>
* Fixes spelling of "daemonization".Fred Wright2017-03-041-1/+1
| | | | | | | | Error messages related to daemonization failures had incorrect spelling. TESTED: Ran "scons build-all" on OSX.
* Whitespace cleanups related to recent changes.Fred Wright2017-02-201-1/+2
|
* Explicit marking of ignoring fprintf() resultRobert Norris2017-02-201-7/+7
| | | | | | | | | Ensure consistent marking of '(void)' for most normal usage of fprintf() TESTED: 'scons build-all check' passes Signed-off-by: Fred Wright <fw@fwright.net>
* Centralizes daemon() calls.Fred Wright2017-01-221-3/+1
| | | | | | | | | | | | | | | | This defines a new function os_daemon() (in os_compat.c), which is either the old replacement daemon() renamed, or a wrapper around the actual daemon() call. This allows any issues related to daemon() (which exist on some platforms) to be dealt with in one place. No such changes are present yet, so platforms giving warnings for the use of daemon() continue to do so, but now only in the compilation of os_compat.c. Unfortunately, the current build procedure typically compiles os_compat.c multiple times, so the warnings still appear multiple times. TESTED: Ran "scons build-all check" on OSX 10.9, OSX 10.12, Ubuntu 14, and FreeBSD 10.3.
* bzero() is gone in POSIX 2008. Use memset()Gary E. Miller2016-08-151-1/+7
| | | | Also two #defines for gpspipe.c
* A gaggle of whitespace gaffs.Gary E. Miller2015-04-301-3/+3
|
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-17/+3
| | | | | | | | | | | | | | | | | | | 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.
* Clean up most spint errors. All regression tests pass.Eric S. Raymond2015-03-281-2/+4
|
* The last of: Line expects to suppress X errors, found 0 errorsGary E. Miller2015-03-251-1/+1
| | | | gpsd is now splint clean again.
* OS X needs a lot of time.hGary E. Miller2015-03-081-1/+1
| | | | | | gpsd_config.h needs time_t which is in time.h OS X builds now. Untested.
* splint cleanup. All regression tests pass.Eric S. Raymond2015-03-021-1/+2
|
* In gpspipe.c, polish some error messages.Eric S. Raymond2015-03-021-4/+4
|
* More splint cleanup.Eric S. Raymond2015-03-021-0/+2
|
* Complete port of clock_gettime(3) and teach gpsipe to use it.Eric S. Raymond2015-03-021-5/+6
| | | | | | | This eliminates the last gettimeofday(3) from the code. POSIX.1-2008 marked it obsolete. All regression tests pass.
* Assume POSIX-conformant termios.h.Eric S. Raymond2015-03-011-2/+0
| | | | | | | HAVE_TERMIOS_H was some sort of relic, apparently always on. I don't think the code would have compiled without it. All regression tests pass.
* BSD compiler waening and splint cleanup.Eric S. Raymond2015-02-111-2/+4
|
* Guard includes of termios.h with #ifdef HAVE_TERMIOS_HMatt2015-01-231-0/+4
| | | | | | | | | | | | Guard includes of termios.h with #ifdef HAVE_TERMIOS_H. Test for termios.h in scons, and define/undefine HAVE_TERMIOS_H accordingly. Fixes the below error seen on cygwin, which lacks termios.h: In file included from gpsutils.c:22:0: gpsd.h:349:21: fatal error: termios.h: No such file or directory #include <termios.h> ^
* Include <sys/select.h> everywhere fd_set us used.Eric S. Raymond2014-08-181-2/+3
| | | | | | | | This came up in connection with Android. According to SuS this shouln't be necessary if sys/time.h was included, but oh well. While we;re at it, rearrange some includes for more consistent order. All regression tests pass.
* Use the gps_errstr() to handle gps_open() errors.Michael Tatarinov2013-11-281-1/+1
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Add -P option to gpspipe for including PPS drift JSON in NMEA or raw dumps.Eric S. Raymond2013-11-131-1/+5
|
* Add -2 flag to set split24 flag.Reinhard Arlt2013-11-081-1/+5
|
* Fix static-checker warnings. All regression tests pass.Eric S. Raymond2013-04-301-8/+11
| | | | | cppchecker now finds variables that could have reduced scope; that's most of these.
* gpspipe -u time-stamps with sub-second resolutionAndreas Merz2013-04-301-5/+26
| | | | | | | | | | | | | | | | | | | | | For simple logging of NMEA data or system performance analysis it is often desirable to have high resolution time-stamps. This implementation affects only the client-side, namely gpspipe. Option -u was added to enable usec-resolution time output. Furthermore, the default time format has been changed because it is more desirable to have a standardized and sortable time-tag default format instead of a locale-dependent one. Also, the new option -u appends decimal digits to the seconds which does not make sense for the some %c formats. A future desirable feature might be to have usec resolution timestamps on the gpsd protocol messages. modified: gpspipe.c modified: gpspipe.xml Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Add -S (for scaled flag) option to gpspipe.Reinhard Arlt2012-09-261-1/+5
|
* Fix a misleading error message.Eric S. Raymond2012-09-181-1/+1
|
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-4/+4
|
* Replace exit({0,1}) with exit(EXIT_{SUCCESS,FAILURE})Eric S. Raymond2012-09-071-20/+20
| | | | Note there are some exit(2) instances we bneed to decide what to do with.
* Cleanup motivated by new cppcheck with more tests. All regression tests pass.Eric S. Raymond2012-05-161-2/+2
|
* Asdd a gpspipe option to enable profiling.Eric S. Raymond2011-09-221-1/+8
|
* Fix a help string.Eric S. Raymond2011-06-081-2/+4
|
* More deheader testing. All regression tests pass.Eric S. Raymond2011-01-131-1/+1
|
* deheader cleanup.Eric S. Raymond2011-01-121-1/+0
|