summaryrefslogtreecommitdiff
path: root/driver_tsip.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoids troublesome dependency on M_LN2 from math.h.Fred Wright2019-03-181-8/+1
| | | | | | | | | | | | | | | | | The M_LN2 definition isn't always provided by math.h, depending on the settings of the pesky configure flags. Since ln(2) is a mathematical constant, there's no loss of generality in defining our own version, and that decouples us from the variability. Since the stated purpose of defining _XOPEN_SOURCE in driver_tsip.c and driver_zodiac.c is just to make M_LN2 available, this is no longer necessary. TESTED: (With subsequent fixes included) Ran "build-all check" on Mac Pro 10.9, Mac Pro 10.14, MacBook Pro 10.9, PowerBook 10.5, VMs for OSX 10.5-10.13, Ubuntu 14.04, CentOS 7, Fedora 25, FreeBSD 10.3, OpenBSD 5.6, OpenBSD 5.6 32-bit, NetBSD 6.1.5, and Beaglebone (arm) Debian 7.
* Factor most uses of pselect(2) into a new utility function named 'nanowait'.Eric S. Raymond2018-12-271-10/+2
| | | | | Also, remove sime header inclusions discovered to be unnecessary during the change.
* POSIX_C_SOURCE: Not just a linux define. 200112L is a minimum.Gary E. Miller2018-12-261-1/+4
| | | | Don't force _POSIX_C_SOURCE 200112L, just make it a minimum.
* Eliminate effectively all uses of struct timeval.Eric S. Raymond2018-12-261-4/+4
| | | | | Outide of one Mac portability shim, anyway. Associated select(2) calls become pselect(2) calls.
* LICENSE: Update licenses for consistency. No functional changes.Gary E. Miller2018-11-191-1/+1
|
* driver_tsip: Fix 16e2664bd6e6d9f56dac11e32022db5ced2e41f3Gary E. Miller2018-10-081-1/+1
| | | | | | Forgot to change all references to s2. Broke detection of Acutime Gold. Found by 'scons scan-build'
* driver_tsip: cppcheck found reused variable. No check caught it.Gary E. Miller2018-09-251-4/+4
|
* driver_tsip: fix cppcheck nits.Gary E. Miller2018-09-251-5/+5
|
* driver_tsip: Fix potential overrun of subtype buffer.Gary E. Miller2018-09-111-2/+2
| | | | Fixes another compiler warning.
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* Prevent unused-variable warning.Eric S. Raymond2017-09-061-1/+1
|
* Fix reported time from Trimble devicesJoshua Roys2017-09-051-1/+1
| | | | | | The sign of an exponent was reversed in commit 0e7ff3d causing reported times to rapidly alternate between the correct time and the far future.
* TSIP: mark unused variable clearly.Gary E. Miller2017-07-261-1/+1
|
* Shield FreeBSD from standards compliance.Gary E. Miller2016-09-071-0/+4
| | | | | gpsd now compiles, and runs scons check, with no warnings on FreeBSD.
* If you specify XOPEN version, you must specify POSIX version.Gary E. Miller2016-08-161-0/+2
| | | | | | This fixes 32-bit Gentoo on RasPi. All regression tests pass.
* C99 requires _XOPEN_SOURCE 500 for M_LN2Gary E. Miller2016-08-151-0/+5
|
* uint was rmoved in C99. If gpsd enforce C99, then uint must go.Gary E. Miller2016-08-151-1/+1
| | | | uint is now unsigned int.
* TSIP: Add support for messages 0x5d and 0x6cNuno Goncalves2016-07-181-5/+120
| | | | | | | | | | 0x5d: GNSS Satellite Tracking Status (multi-GNSS operation) 0x6c: Satellite Selection List Still needs a regressions test. Signed-off-by: Gary E. Miller <gem@rellim.com>
* TSIP: fix time offsetNuno Goncalves2016-07-181-2/+12
| | | | | | | The Trimble serial time offset is all over the map. Give up on taking a best guess. Signed-off-by: Gary E. Miller <gem@rellim.com>
* TSIP: improve commentsNuno Goncalves2016-07-181-0/+2
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* PPSTIME -> NTPTIMEGary E. Miller2016-04-241-6/+6
| | | | | NTPTIME is from the serial stream, it never had anything to do with PPS and it just confused everyone.
* Add Coverity suppressions for new invariant checks.Eric S. Raymond2016-01-291-0/+1
|
* A drowning deluge of whitespace hacks.Gary E. Miller2015-04-301-13/+13
|
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-40/+1
| | | | | | | | | | | | | | | | | | | 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.
* splint cleanup. Fixes for minor but real issues...Eric S. Raymond2015-03-281-1/+1
| | | | | ...no attempt to address the weird cross-platfprm variability we've seen lately. All regression tests pass.
* Fix more splint: Line expects to suppress X errors, found 0 errorsGary E. Miller2015-03-251-1/+1
|
* One of the float-elimination steps busted something. Revert.Eric S. Raymond2015-03-081-8/+6
|
* A step toards float elimination. No code changes.Eric S. Raymond2015-03-081-6/+8
|
* gpsd-report() -> gpsd_log()Eric S. Raymond2015-03-071-139/+142
| | | | | | | | | | | | | | | | 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.
* Back out the attempt to use VTIME.Eric S. Raymond2015-01-311-1/+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.
* Add a minimum packet length to every driver.Eric S. Raymond2015-01-291-0/+1
| | | | Length 0 means the minimum is unknown and the driver should use character I/O.
* cppcheck cleanup.Eric S. Raymond2015-01-221-1/+2
|
* Easy splint cleanups. All regression tests pass.Eric S. Raymond2015-01-211-7/+7
|
* Add str_{,v}appendf, use it everywhere.Zbigniew Chyla2015-01-211-5/+4
| | | | This change doesn't affect generated binary code.
* Almost entirely eliminate use of sats_used array.Eric S. Raymond2015-01-101-3/+3
| | | | | | | Instead, set the used member in the satellites array directly where possible. The NMEA0183 and TSIP drivers still need a local equivalent. This changes pseudo-NMEA GSA output in several binary-protocol tests.
* Refactor representation of satellite data into an array of structs...Eric S. Raymond2014-09-221-11/+17
| | | | | | | | | | | | | | | | | | ...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.
* Now that the transition is done we can restore the gpsd_report name.Eric S. Raymond2014-08-271-45/+45
| | | | All regression tests pass.
* The big leap. Most instances of gpsd_report are replaced...Eric S. Raymond2014-08-271-45/+45
| | | | | | | | | | | | | | | | ...with calls to gps_notify(), which indirects to its output method through a slot in an errout structure. Usually the errout structure lives inside the session context, but because struct errout_t is its own thing this does not have to be the case. One large clique of gpsd_notify() calls, in packet.c and isgps.c, looks at a struct errout_t copy in a lexer control block This change is not complete. Remnant gpsd_report calls need to be changed, and gpsmon needs to be tweaked so that the struct_error_t in its context is a non-defaukt hook updating the cuses display rather than simply dumping to stderr. Also the report label functionality needs to be added. All regression tests pass.
* Introduce struct errout_t to encapsulate error-reporting hooks.Eric S. Raymond2014-08-271-45/+45
| | | | | | A major step towards eliminating reverse linkage. All regression tests pass.
* Structure member name change: packet -> lexer. No logic changes.Eric S. Raymond2014-08-271-10/+10
| | | | All regression tests pass.
* Split firmwqre version query out of the init method.Eric S. Raymond2014-08-251-9/+15
| | | | | | This enables us to force readonly off while it's being called. The practical effect is that gpsmon can get a firmware version (if this is possible) without reconfiguring the device.
* Clean up some FIXMEs. All regression tests pass.Eric S. Raymond2014-08-241-1/+1
|
* A lesson in why not to write code with easy-to-miss side effects.Eric S. Raymond2014-08-241-12/+1
| | | | | | | In the Trimble driver, the id field of the sentence was extracted inside a sprint we needed to remove to get rid of tag field uses. All regressuin tests pass.
* Drop the obsolete tag field from JSON output. Bump the minor protocol number.Eric S. Raymond2014-08-241-10/+10
| | | | | | | 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.
* Include <sys/select.h> everywhere fd_set us used.Eric S. Raymond2014-08-181-0/+2
| | | | | | | | 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.
* Address Savannah sr #108406: Trimble Thunderbolt reporting wrong time.Eric S. Raymond2013-11-221-1/+1
|
* More consistent ise of LOG_PROG.Eric S. Raymond2013-11-121-1/+1
| | | | This logging level is intended to directly explain accompanying I/O messages.
* Reduce gpsd log verbosity a lot.Eric S. Raymond2013-11-121-2/+3
| | | | | | | | | | Way too much logging was happening at LOG_IO level, which is intended for watching data traffic in and out of the daemon rather than all the minutiae of data analysis - that's LOG_DATA. Also, LOG_DATA gets pushed down two levels. The effect is that -D 5 means exactly what it did, but for purposes other than driver debugging -D 4 now suffices.
* Rename and rationalize driver table instances. No logic changes.Eric S. Raymond2013-11-121-2/+2
|
* Contain the assumption that time hinting is done to NTPD.Eric S. Raymond2013-10-311-6/+6
| | | | | | | Because it might be going to chrony. Or something else. No logic changes, just name changes and one new derived #define, TIMEHINT_ENABLE.