summaryrefslogtreecommitdiff
path: root/libgps_json.c
Commit message (Collapse)AuthorAgeFilesLines
* cppcheck: style - remove unused variable.Robert Norris2017-02-091-2/+2
| | | | | TESTED: 'scons build-all check' passes.
* Add "status" to TPV for DGPS notificationGary E. Miller2016-04-061-1/+2
| | | | | Also update the affected regression files. gpsd had been throwing away the DGPS status.
* Add concept of a GPS-disciplined oscillatorMichael Brown2016-02-091-0/+41
| | | | Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
* Address Savannah bug #46804: JSON satellite view parsing is somewhat broken.Fred Wright2016-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fred Wright <fhgwright> writes: While trying the regression tests on a MacBook (PowerPC), I ran across some failures in the JSON unit test. Although this is ostensibly an endian issue, it turns out that the code for parsing satellite view data is actually incorrect for all processors, albeit more so for big-endian processors. The problem is that the three "integer" fields in struct satellite_t are defined as shorts, but parsed as ints by the JSON parser. On a big-endian processor, this causes the values to be misaddressed and hence have incorrect values, but even on a little-endian processor this is incorrect since it's storing four-byte values into two-byte fields. The unit tests don't catch this aspect, since the fields are favorably ordered such that the clobbered fields are clobbered before being written pseudo-correctly. I was able to demonstrate the "buffer overflow" misbehavior by modifying the test data for the last satellite to provide the fields in the reverse order from their order in the structure. The simple fix for this would be just to change the shorts to ints in the definition of struct satellite_t. On most processors, this doesn't even cost any memory, since the presence of the double forces eight-bye alignment, so the padded structure is 24 bytes regardless of whether the three fields in question are shorts or ints. However, there might be some processors with less strict alignment requirements where using shorts would actually be helpful. With the existing layout, the only possible fix is to add support for shorts to the JSON parser, and adjust the satellite-view parsing accordingly. The attached patch does that, as well as adding u_short support for completeness (though it's not currently used). It also provides the aforementioned change in the test data, in keeping with the philosophy of "create a test for what just failed, so it doesn't happen again". Note that using shorts for these fields would be more effective if the "used" field were also reduced to a short, instead of inheriting "int" from "bool". That would shrink the structure to 16 bytes. It could be further reduced to 12 bytes by using a float instead of a double for the "ss" field (and even a float is gross overkill for this purpose). This could all be more significant when MAXCHANNELS needs to be increased (again) to accommodate the deployment of the newer GNSSes.
* Fix a dodgy comment.Gary E. Miller2015-04-061-4/+2
|
* Add client-library parsing of PPS precision.Eric S. Raymond2015-04-041-2/+2
| | | | Data is currently discarded, pending the next gps_data_t structure break.
* Add a JSON test for the PPS message.Gary E. Miller2015-04-021-0/+1
| | | | Still need a place for PPS precision.
* Add precision to the JSON decoder. Throw away the result.Gary E. Miller2015-04-011-0/+3
| | | | Next rev of gps_data_t->pps needs to add a field for precision.
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-47/+9
| | | | | | | | | | | | | | | | | | | 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.
* TOFF JSON message implemented and documented.Eric S. Raymond2015-02-231-0/+47
| | | | | | 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-6/+6
| | | | No logic changes. All regression tesrs pass. Live PPS observed.
* Avoid overexposure of an internal mask. EOF_SET -> EOF_ISEric S. Raymond2015-02-201-1/+1
| | | | | | | | 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.
* Fix improper timespec type casting.Gary E. Miller2015-02-021-4/+4
|
* In client library, "dip" member was missing from ATT parsing.Eric S. Raymond2015-01-241-0/+2
| | | | | | Should fix Savannah bug #43789: Dip and mag_x are not available in gps_data_t All regression test pass.
* Complete splint cleanup.Eric S. Raymond2015-01-211-0/+1
|
* Use str_starts_with instead of local macro.Zbigniew Chyla2015-01-211-15/+14
| | | | This change doesn't affect generated binary code.
* Last change to STARTSWITH was buggy. All regression tests pass.Eric S. Raymond2015-01-131-1/+1
|
* The STARTSWITH macro in libgps_json.c uses sizeof when it means strlen.Matt2015-01-081-1/+1
|
* Refactor representation of satellite data into an array of structs...Eric S. Raymond2014-09-221-17/+14
| | | | | | | | | | | | | | | | | | ...from a set of parallel arrays. This change flushed out a longstanding bug in the computation of DOPs for estimated error bars. Some test-load rebuilds were required: geostar-geos1m-binary.log.chk: With this change error estimates are computed and reported. trimble-lassen_iq-3dfix.log, trimble-lassen_iq-3dfix.log: the change revealed a bug in the computation of satellite-seen bits. Error estimates did not change. navcom.log: Error estimates changed. With these rebuilds, all regression tests pass.
* Drop the obsolete tag field from JSON output. Bump the minor protocol number.Eric S. Raymond2014-08-241-8/+0
| | | | | | | Required a regression-test rebuild, of course. The field is still set by the TSIP and SiRF drivers; the SiRF driver actually uses it. It may be possible to eliminate the TSIP uses, but so far attempting this has produced odd regression-test failures.
* Fix up the pps=no build. All regression tests pass.Eric S. Raymond2013-11-171-1/+3
|
* In libgps, incorrect defaults resulted in garbage values for empty fields.Eric S. Raymond2013-11-131-5/+5
|
* Full splint cleanup. Partial cppcheck cleanup.Eric S. Raymond2013-11-051-1/+1
|
* Partial splint cleanup. All regression tests pass. PPS is live.Eric S. Raymond2013-11-051-0/+4
|
* Support reading PPS messages in libgps.Eric S. Raymond2013-11-031-0/+45
| | | | | | Finally defines a message validity nask that won't fit in 32 bits, alas. Defines a timedrift structure that we will use internally as well.
* Start on support for unpacking RTCM3 JSON.Eric S. Raymond2013-05-011-0/+11
| | | | | Only the 1001 sentence so far, with two fields missing. Not usable for production yet, but gets infrastructure in place.
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-1/+1
|
* Mark VERSION and WATCH with a remote attribute when passed from slaves.Eric S. Raymond2011-06-221-0/+2
|
* splint cleanup.Eric S. Raymond2011-04-161-2/+2
|
* Use t_time consistently for timestamps.Eric S. Raymond2011-04-161-48/+8
| | | | All regression tests pass. Livetesting with cgps looks good.
* Cosmetic tweak: t_timestamp -> t_time.Eric S. Raymond2011-04-161-1/+1
|
* Add a 'timestamp' type to the JSON parser to solve a compatibility problem.Eric S. Raymond2011-04-151-1/+2
| | | | | | | Sigh, no other way to get DEVICELIST to recignize both new and old timestamps. All regression tests pass.
* Centralize the C client library's flag setting.Eric S. Raymond2011-04-151-56/+72
| | | | This squeezes out a couple of minor errors due to unset flag fields.
* Force some flag clears to ensure the library-side set member is correct.Eric S. Raymond2011-04-151-0/+4
|
* Add a switch to configure out control-socket switch.Eric S. Raymond2011-03-281-0/+3
|
* Fix scan-build glitches. All regression tests pass.Eric S. Raymond2011-03-281-0/+3
|
* Fix bonehead error in the code for backward compatibility with Unix timestamps.Eric S. Raymond2011-03-231-1/+1
|
* Library time parsing is now backward-compatible with 2.95.Eric S. Raymond2011-03-101-10/+22
|
* Fix a problem noted by Charles Curley.Eric S. Raymond2011-02-251-0/+1
| | | | His second library glitch. An array was not getting properly zeroed.
* Fix a bug in computation of satellites_visible.Eric S. Raymond2011-02-251-1/+3
| | | | | Charles Curley pointed this one out on Mon Feb 7 00:40:04 CET 2011 and enclosed a patch. All regression tests pass.
* Compute satellites_visible in the client-side JSON parser.Eric S. Raymond2011-02-031-0/+3
|
* More name changes related to GST.Eric S. Raymond2011-02-011-11/+11
| | | | All regression tests pass.
* Change Noise sentence to use ISO8601 timestamp.Eric S. Raymond2011-02-011-5/+13
|
* Process GPGST into noise statistics. All regression tests pass.Thomas Sprinkmeier2011-02-011-0/+43
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Timestamps in TPV and SKY go from float seconds since Unix epoch to ISO8601.Eric S. Raymond2011-01-291-4/+18
| | | | | | | | Protocol version number is bumped. Python and C test clients are known to work; interfaces of the C and Python client bindings are unchanged. Third-party client-side bindings which rely on naively copying JSON members will break (implementers have been repeatedly warned not to do this).
* More deheader testing.Eric S. Raymond2011-01-121-0/+1
|
* Unused-header removals by deheader. All regression tests pass.Eric S. Raymond2010-12-011-2/+0
|
* Reindent the JSON stuff. All regression tests pass.Eric S. Raymond2010-04-141-44/+38
|
* Guard some displayed structures from reindenting.Eric S. Raymond2010-04-131-0/+14
|
* Shorten some names for concision, and make C names match JSON names.Eric S. Raymond2010-04-111-9/+9
| | | | All regression tests pass.