summaryrefslogtreecommitdiff
path: root/isgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 11:51:15 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 11:51:15 -0500
commitdf34a3add8df382eb852a67635c6859ee8cc657f (patch)
treec52183ba41403d093ad1ac971fa45c4ba1289f0c /isgps.c
parent9c49083f2afe799343a610912b0ed404b2ffad05 (diff)
downloadgpsd-df34a3add8df382eb852a67635c6859ee8cc657f.tar.gz
gpsd-report() -> gpsd_log()
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.
Diffstat (limited to 'isgps.c')
-rw-r--r--isgps.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/isgps.c b/isgps.c
index dcec5d0c..2d9438b7 100644
--- a/isgps.c
+++ b/isgps.c
@@ -141,7 +141,7 @@ unsigned int isgps_parity(isgps30bits_t th)
/*@ -charint @*/
#ifdef __UNUSED__
- gpsd_report(errout, ISGPS_ERRLEVEL_BASE + 2, "ISGPS parity %u\n", p);
+ gpsd_log(errout, ISGPS_ERRLEVEL_BASE + 2, "ISGPS parity %u\n", p);
#endif /* __UNUSED__ */
return (p);
}
@@ -186,8 +186,8 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
{
/* ASCII characters 64-127, @ through DEL */
if ((c & MAG_TAG_MASK) != MAG_TAG_DATA) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS word tag not correct, skipping byte\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS word tag not correct, skipping byte\n");
return ISGPS_SKIP;
}
@@ -206,19 +206,19 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
lexer->isgps.curr_word |=
c >> -(lexer->isgps.curr_offset);
}
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS syncing at byte %lu: 0x%08x\n",
- lexer->char_counter, lexer->isgps.curr_word);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS syncing at byte %lu: 0x%08x\n",
+ lexer->char_counter, lexer->isgps.curr_word);
if (preamble_match(&lexer->isgps.curr_word)) {
if (isgps_parityok(lexer->isgps.curr_word)) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS preamble ok, parity ok -- locked\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS preamble ok, parity ok -- locked\n");
lexer->isgps.locked = true;
break;
}
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS preamble ok, parity fail\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS preamble ok, parity fail\n");
}
lexer->isgps.curr_offset++;
} /* end while */
@@ -246,16 +246,16 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
* another preamble pattern in the data stream. -wsr
*/
if (preamble_match(&lexer->isgps.curr_word)) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS preamble spotted (index: %u)\n",
- lexer->isgps.bufindex);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS preamble spotted (index: %u)\n",
+ lexer->isgps.bufindex);
lexer->isgps.bufindex = 0;
}
#endif
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS processing word %u (offset %d)\n",
- lexer->isgps.bufindex,
- lexer->isgps.curr_offset);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS processing word %u (offset %d)\n",
+ lexer->isgps.bufindex,
+ lexer->isgps.curr_offset);
{
/*
* Guard against a buffer overflow attack. Just wait for
@@ -263,8 +263,8 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
*/
if (lexer->isgps.bufindex >= (unsigned)maxlen) {
lexer->isgps.bufindex = 0;
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS buffer overflowing -- resetting\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS buffer overflowing -- resetting\n");
return ISGPS_NO_SYNC;
}
@@ -274,8 +274,8 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
/* *INDENT-OFF* */
if ((lexer->isgps.bufindex == 0) &&
!preamble_match((isgps30bits_t *) lexer->isgps.buf)) {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS word 0 not a preamble- punting\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS word 0 not a preamble- punting\n");
return ISGPS_NO_SYNC;
}
/* *INDENT-ON* */
@@ -298,22 +298,22 @@ enum isgpsstat_t isgps_decode(struct gps_lexer_t *lexer,
c >> -(lexer->isgps.curr_offset);
}
} else {
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 0,
- "ISGPS parity failure, lost lock\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 0,
+ "ISGPS parity failure, lost lock\n");
lexer->isgps.locked = false;
}
}
lexer->isgps.curr_offset -= 6;
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
- "ISGPS residual %d\n",
- lexer->isgps.curr_offset);
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 2,
+ "ISGPS residual %d\n",
+ lexer->isgps.curr_offset);
return res;
}
/*@ +shiftnegative @*/
/* never achieved lock */
- gpsd_report(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
- "ISGPS lock never achieved\n");
+ gpsd_log(&lexer->errout, ISGPS_ERRLEVEL_BASE + 1,
+ "ISGPS lock never achieved\n");
return ISGPS_NO_SYNC;
}