summaryrefslogtreecommitdiff
path: root/gpsutils.c
Commit message (Collapse)AuthorAgeFilesLines
* gpsutils.c: Fix strlcpy() missing prototype warning.HEADmasterGary E. Miller2019-06-121-1/+2
|
* gpsutils: DST is not part of UTC!Gary E. Miller2019-04-231-2/+4
|
* gps.h: Add qErr to gps_fix_t.Gary E. Miller2019-04-051-0/+3
| | | | qErr, aka "sawtooth" correction, is the error in the PPS time.
* gpsutils: Fixes build on OSX.Fred Wright2019-03-271-0/+3
| | | | | | | | | | | OSX needs _DARWIN_C_SOURCE defined to get strlcpy() (copied from driver_ais.c). There's some inconsistency in the config test, perhaps related to its being a builtin. TESTED: Ran "build-all check" on most of the usual set of machines and VMs, with no issues. Only skipped macOS 10.14, due to the large cost of rebooting into it at this time.
* gpsd_error_model(): be more consistent with HERR_SET.Gary E. Miller2019-03-261-1/+2
|
* gpsutils: Add 999 as user defined datum.Gary E. Miller2019-03-251-0/+3
|
* gpsutils: Add datum_code_string().Gary E. Miller2019-03-251-0/+43
| | | | These datum codes seem standard, other drivers will use them.
* gps_data_t: Add datum field. Add decode for $PGRMM.Gary E. Miller2019-03-251-0/+3
| | | | | Sadly, $PGRMM is after a cycle ender and the data is never reported, so no regression changes. Cycle ender needs to get fixed...
* daemon side: stop using VERR_SET. Exposed a bug in sirf driver.Gary E. Miller2019-03-251-1/+2
| | | | It seems the gpsd epc is more pessimistic than from the GPS.
* Split epe into eph and sep.Gary E. Miller2019-03-221-18/+22
| | | | | | | | Try to do it with forward and backward compatibility, which is challenging with current miscojson. Sometimes epe was used to 2D estimated erro. Sometimes for 3D error. So make it explicit eph is 2D, and sep is 3D.
* gpsutils: Fix unix_to_iso8601 NaN case.Fred Wright2019-03-201-1/+1
| | | | | | | | | | | | | Since the return type of unix_to_iso8601 is non-const, it's illegal to return a pointer to a string constant. Some compilers report a warning for this. The fix is to copy the string to the provided buffer. It would be nice to add a test case for this, but there doesn't seem to be any portable way to get NaN as a constant in C. TESTED: The warning is gone, and the tests still pass.
* Move epe from gps_data_t to be near its friends in gps_fix_t.Gary E. Miller2019-03-151-0/+4
| | | | No functional changes. Looks like epe never went anywhere...
* driver_nmea0183 and more: Decode $PSRFEPE add eps.Gary E. Miller2019-03-131-0/+3
| | | | | Turns out eps also came from other GPS, but never made it to TPV. Regressions changed to show new eps data.
* driver_nmea0183 and more: Decode $PSRFEPE, and epd.Gary E. Miller2019-03-131-0/+3
| | | | | Turns out epd also came from SiRF, but never made it to TPV. Regressions changed to show new epd data.
* gpsutils: unix_to_iso8601() if fixtime is NaN, return NaN.Gary E. Miller2019-02-071-0/+3
|
* gpsutils: need to include <sys/select.h> for POSIXGary E. Miller2018-12-271-6/+7
| | | | | SuS and POSIX have different idea on where pselect() prototype lives.
* Factor most uses of pselect(2) into a new utility function named 'nanowait'.Eric S. Raymond2018-12-271-0/+19
| | | | | Also, remove sime header inclusions discovered to be unnecessary during the change.
* LICENSE: Update licenses for consistency. No functional changes.Gary E. Miller2018-11-191-1/+1
|
* test_mktime: Add test for mkgmtime()Gary E. Miller2018-11-081-1/+5
| | | | Better comments in gpsutils.c
* gpsutils: fix rounding error in unix_to_iso8601(), add/fix tests.Gary E. Miller2018-11-081-4/+8
| | | | | | | | | | 1541766896.999512 became "2018-11-09T12:34:56.000Z". Which sould be :57. The fractional seconds got rounded up, but the seconds did not get incremented to match. Added regression tests for unix_to_iso8601(). Reported by Peter Liu <greendice@me.com>.
* ATT: centralize clearing of the attitude data.Gary E. Miller2018-09-111-0/+22
| | | | | This showed up a bug where rtcm3_unpack() was not clearing its rtcm3 data, which is a union with the attitude data.
* Remove some remnant splint annotations.Eric S. Raymond2018-08-081-1/+1
|
* gpsutils.c: isnan() -> isfinite()Gary E. Miller2018-07-141-2/+3
| | | | Thanks to Virgin Orbit for their support on this patch.
* $GPVTG Added parsing, storage, output of magnetic courseDaniel_M_Williams2018-06-121-1/+4
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* ECEF: remove unused and unneeded ecef.valid.Gary E. Miller2018-02-121-2/+0
| | | | Gotta check each value for isfinite() anyway.
* Add ECEF support to u-blocx driver, data comes out in json.Gary E. Miller2018-02-081-0/+24
| | | | More work to do so cgps, xgps, etc. see the new data.
* Initial creation of os_compat.h.Fred Wright2017-01-221-0/+1
| | | | | | | | | | | | | | | | | This creates a header for os_compat.c, and moves the related prototypes into it from gpsd_config.h (as created by SConstruct), after adding references to it to gpsd.h (via gpsd.h-tail) and a few other sources that need it but don't include gpsd.h. It also removes includes of <time.h> in the places where they were only needed for the code now removed from gpsd_config.h. TESTED: Ran "scons build-all check" on OSX 10.9 (with strlcat/strlcpy but no clock_gettime), OSX 10.12 (with strlcat/strlcpy and clock_gettime), and Ubuntu 14 (with clock_gettime but no strlcat/strlcpy). Also verified that fallback versions were not being included where unnecessary.
* Add Windows versions of time related functions.Rob Norris2016-03-221-3/+92
|
* Write scan-build suppressions to it runs clean.Eric S. Raymond2015-03-301-0/+2
| | | | | | Promote scan-build to be onere of the stock pre-release checks. Fix one minor cppcheck nit.
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-26/+11
| | | | | | | | | | | | | | | | | | | 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-4/+13
|
* Yet more: Line expects to suppress X error, found 0 errorsGary E. Miller2015-03-251-4/+4
|
* Break timespec_str out of gpsutils.c.Eric S. Raymond2015-03-081-29/+1
| | | | | | It's not used on the client side, and it's needed separately for ntplib. All regression tesrs pass. PPS is live.
* 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.
* Remove unused and incorrect retval from timespec_strZbigniew Chyla2015-02-151-6/+2
| | | | | | | All callers ignore value returned by timespec_str. Additionally, the function returns simply the result of snprintf(), which is not necessarily the number of chars written to the buffer (if the buffer provided by the caller was too small).
* timespec_str: add "const" to input argumentZbigniew Chyla2015-02-151-1/+1
|
* Document the output of timespec_str() betterGary E. Miller2015-02-121-0/+12
| | | | | It can be as short as 12 chars: "-0.123456789" Or as long as 21 chars: "-2147483647.123456789"
* splint cleanup. All regressiion tests pass.Eric S. Raymond2015-02-091-1/+3
|
* Add function timespec_str(), and use it.Gary E. Miller2015-02-051-0/+19
| | | | | Converting a timespec to a printable string is odd, so placed in a new function for ease of use.
* Comment on loss of precision in timestamp().Gary E. Miller2015-02-021-0/+2
| | | | timestamp() should not be used where nanoSec count.
* Revert to using internal mkgmtime() as in 3.11.Eric S. Raymond2015-01-231-8/+7
| | | | | | The experiments since then have failed. All regression tests pass.
* Easy splint cleanups. All regression tests pass.Eric S. Raymond2015-01-211-1/+1
|
* Revert to using timegm() following Hal Murray's report of Fedora flakiness.Eric S. Raymond2015-01-141-3/+6
| | | | All regression tests pass.
* Fix the build in some unusual cases. All regression tests pass.Eric S. Raymond2015-01-131-0/+5
|
* Fixup iso8601_to_unix uninitialized memory bugJon Schlueter2015-01-071-0/+1
| | | | | | | | Initialize struct tm before passing it to strptime The issue is that mktime uses tm_isdst but some versions of strptime don't actually set tm_isdst so you get an uninitialized memory behavior at that point
* Better way to avoid glibc dependency.Eric S. Raymond2014-09-291-0/+30
| | | | | | | Returns us to something amost identical to the original code. Sigh. Timezones are a swamp. All regression tests pass.
* GNU libc timegm() turns out to be buggy when DST is on (glibc-2.19).Eric S. Raymond2014-09-281-1/+1
| | | | | | Fortunately, there's a much simpler way to do the computation correctly. All regression tests pass,
* Remove some custom code, at the cost of introducing a glibc depenency.Eric S. Raymond2014-09-251-29/+1
| | | | Dependency soon to be fixed. All regression tests pass.
* Silence compiler warnings about array subscripts of type 'char'Matt2014-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | 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)) { ^