oncore_log(instance, LOG_NOTICE, "ONCORE DRIVER -- CONFIGURING");
instance->o_state = ONCORE_NO_IDEA;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_NO_IDEA");
/* Now open files.
* This is a bit complicated, a we dont want to open the same file twice
char *cp, Msg[160];
if (time_pps_getcap(instance->pps_h, &cap) < 0) {
- oncore_log(instance, LOG_ERR, "time_pps_getcap failed: %m");
+ snprintf(Msg, sizeof(Msg), "time_pps_getcap failed: %m");
+ oncore_log(instance, LOG_ERR, Msg);
return (0);
}
if (time_pps_getparams(instance->pps_h, &instance->pps_p) < 0) {
- oncore_log(instance, LOG_ERR, "time_pps_getparams failed: %m");
+ snprintf(Msg, sizeof(Msg), "time_pps_getparams failed: %m");
+ oncore_log(instance, LOG_ERR, Msg);
return (0);
}
if (time_pps_kcbind(instance->pps_h, PPS_KC_HARDPPS, i,
PPS_TSFMT_TSPEC) < 0) {
- oncore_log(instance, LOG_ERR, "time_pps_kcbind failed: %m");
+ snprintf(Msg, sizeof(Msg), "time_pps_kcbind failed: %m");
+ oncore_log(instance, LOG_ERR, Msg);
oncore_log(instance, LOG_ERR, "HARDPPS failed, abort...");
return (0);
}
+
pps_enable = 1;
}
return(1);
int current_mode;
pps_params_t current_params;
struct timespec timeout;
+ struct peer *peer;
pps_info_t pps_i;
char Msg[140];
+ peer = instance->peer;
+
#if 1
/* If we are in SiteSurvey mode, then we are in 3D mode, and we fall thru.
* If we have Finished the SiteSurvey, then we fall thru for the 14/15
* This gives good time, which gets better when the SS is done.
*/
- if ((instance->site_survey == ONCORE_SS_DONE) && (instance->mode != MODE_0D))
+ if ((instance->site_survey == ONCORE_SS_DONE) && (instance->mode != MODE_0D)) {
#else
/* old check, only fall thru for SS_DONE and 0D mode, 2h45m wait for ticks */
- if ((instance->site_survey != ONCORE_SS_DONE) || (instance->mode != MODE_0D))
+ if ((instance->site_survey != ONCORE_SS_DONE) || (instance->mode != MODE_0D)) {
#endif
+ peer->flags &= ~FLAG_PPS;
return;
+ }
/* Don't do anything without an almanac to define the GPS->UTC delta */
- if (instance->rsm.bad_almanac)
+ if (instance->rsm.bad_almanac) {
+ peer->flags &= ~FLAG_PPS;
return;
+ }
/* Once the Almanac is valid, the M12+T does not produce valid UTC
* immediately.
if (instance->count5) {
instance->count5--;
+ peer->flags &= ~FLAG_PPS;
return;
}
if (time_pps_fetch(instance->pps_h, PPS_TSFMT_TSPEC, &pps_i,
&timeout) < 0) {
oncore_log(instance, LOG_ERR, "time_pps_fetch failed");
+ peer->flags &= ~FLAG_PPS;
return;
}
if (pps_i.assert_sequence == j) {
oncore_log(instance, LOG_NOTICE, "ONCORE: oncore_get_timestamp, error serial pps");
+ peer->flags &= ~FLAG_PPS;
return;
}
if (pps_i.clear_sequence == j) {
oncore_log(instance, LOG_ERR, "oncore_get_timestamp, error serial pps");
+ peer->flags &= ~FLAG_PPS;
return;
}
instance->ev_serial = pps_i.clear_sequence;
*/
if (time_pps_getcap(instance->pps_h, ¤t_mode) < 0) {
- oncore_log(instance, LOG_ERR, "time_pps_getcap failed: %m");
+ snprintf(Msg, sizeof(Msg), "time_pps_getcap failed: %m");
+ oncore_log(instance, LOG_ERR, Msg);
+ peer->flags &= ~FLAG_PPS;
return;
}
if (time_pps_getparams(instance->pps_h, ¤t_params) < 0) {
- oncore_log(instance, LOG_ERR, "time_pps_getparams failed: %m");
+ snprintf(Msg, sizeof(Msg), "time_pps_getparams failed: %m");
+ oncore_log(instance, LOG_ERR, Msg);
+ peer->flags &= ~FLAG_PPS;
return;
}
if (!refclock_process(instance->pp)) {
refclock_report(instance->peer, CEVNT_BADTIME);
+ peer->flags &= ~FLAG_PPS;
return;
}
instance->pp->lastref = instance->pp->lastrec;
refclock_receive(instance->peer);
}
+ peer->flags |= FLAG_PPS;
}
} warn;
day_now = day_lsf = 0;
+ cp = NULL; /* keep gcc happy */
chan = buf[4] & 0377;
id = buf[5] & 0377;