summaryrefslogtreecommitdiff
path: root/timehint.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-04-01 11:03:19 -0700
committerGary E. Miller <gem@rellim.com>2015-04-01 11:04:36 -0700
commitc505988baec87349337b61ccf4c2dfe31457a34f (patch)
tree0968b550c9ba0759794c1b92b06f4716a7a33e3e /timehint.c
parent89e84cb61eebfd104e59ba937b03944ce27ed782 (diff)
downloadgpsd-c505988baec87349337b61ccf4c2dfe31457a34f.tar.gz
Remove validations on /dev/pps0 time that can never work.
/dev/pps0 now ships time to NTP SHM. Very wrong time... last_fixtime is all wacky...
Diffstat (limited to 'timehint.c')
-rw-r--r--timehint.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/timehint.c b/timehint.c
index 6ea7bc9b..5ef60c55 100644
--- a/timehint.c
+++ b/timehint.c
@@ -351,20 +351,26 @@ static char *report_hook(volatile struct pps_thread_t *pps_thread,
char *log1;
struct gps_device_t *session = (struct gps_device_t *)pps_thread->context;
- if (!session->ship_to_ntpd)
- return "skipped ship_to_ntp=0";
-
- /*
- * Only listen to PPS after several consecutive fixes,
- * otherwise time may be inaccurate. (We know this is
- * required on all Garmin and u-blox; safest to do it
- * for all cases as we have no other general way to know
- * if PPS is good.
- *
- * Not sure yet how to handle u-blox UBX_MODE_TMONLY
- */
- if (session->fixcnt <= PPS_MIN_FIXES)
- return "no fix";
+ /* PPS only source never get any serial info
+ * so no PPSTIME_IS or fixcnt */
+ if ( source_pps != session->sourcetype) {
+ /* FIXME! these two validations need to move back into ppsthread.c */
+
+ if ( !session->ship_to_ntpd)
+ return "skipped ship_to_ntp=0";
+
+ /*
+ * Only listen to PPS after several consecutive fixes,
+ * otherwise time may be inaccurate. (We know this is
+ * required on all Garmin and u-blox; safest to do it
+ * for all cases as we have no other general way to know
+ * if PPS is good.
+ *
+ * Not sure yet how to handle u-blox UBX_MODE_TMONLY
+ */
+ if (session->fixcnt <= PPS_MIN_FIXES)
+ return "no fix";
+ }
log1 = "accepted";
if ( 0 <= session->chronyfd ) {