summaryrefslogtreecommitdiff
path: root/driver_proto.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 /driver_proto.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 'driver_proto.c')
-rw-r--r--driver_proto.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/driver_proto.c b/driver_proto.c
index bbbd7c0d..1b44990a 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -72,8 +72,8 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
if (data_len != _PROTO__NAVSOL_MSG_LEN)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ NAVSOL - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ NAVSOL - navigation data\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__SOLUTION_VALID) == 0)
@@ -121,14 +121,14 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
* the fields it potentially set and the transfer mask. Doing this
* makes it relatively easy to track down data-management problems.
*/
- gpsd_report(&session->context->errout, LOG_DATA,
- "NAVSOL: time=%.2f, lat=%.2f lon=%.2f alt=%.2f mode=%d status=%d\n",
- session->newdata.time,
- session->newdata.latitude,
- session->newdata.longitude,
- session->newdata.altitude,
- session->newdata.mode,
- session->gpsdata.status);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "NAVSOL: time=%.2f, lat=%.2f lon=%.2f alt=%.2f mode=%d status=%d\n",
+ session->newdata.time,
+ session->newdata.latitude,
+ session->newdata.longitude,
+ session->newdata.altitude,
+ session->newdata.mode,
+ session->gpsdata.status);
return mask;
}
@@ -144,8 +144,8 @@ _proto__msg_utctime(struct gps_device_t *session, unsigned char *buf, size_t dat
if (data_len != UTCTIME_MSG_LEN)
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ UTCTIME - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ UTCTIME - navigation data\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__TIME_VALID) == 0)
@@ -171,8 +171,8 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
if (data_len != SVINFO_MSG_LEN )
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ SVINFO - navigation data\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ SVINFO - navigation data\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__SVINFO_VALID) == 0)
@@ -187,8 +187,8 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
*/
nchan = GET_NUMBER_OF_CHANNELS();
if ((nchan < 1) || (nchan > MAXCHANNELS)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "too many channels reported\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "too many channels reported\n");
return 0;
}
gpsd_zero_satellites(&session->gpsdata);
@@ -212,10 +212,10 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
session->gpsdata.skyview_time = NaN;
session->gpsdata.satellites_used = nsv;
session->gpsdata.satellites_visible = st;
- gpsd_report(&session->context->errout, LOG_DATA,
- "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
- session->gpsdata.satellites_visible,
- session->gpsdata.satellites_used);
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "SVINFO: visible=%d used=%d mask={SATELLITE|USED}\n",
+ session->gpsdata.satellites_visible,
+ session->gpsdata.satellites_used);
return SATELLITE_SET | USED_IS;
}
@@ -231,8 +231,8 @@ _proto__msg_raw(struct gps_device_t *session, unsigned char *buf, size_t data_le
if (data_len != RAW_MSG_LEN )
return 0;
- gpsd_report(&session->context->errout, LOG_DATA,
- "_proto_ RAW - raw measurements\n");
+ gpsd_log(&session->context->errout, LOG_DATA,
+ "_proto_ RAW - raw measurements\n");
/* if this protocol has a way to test message validity, use it */
flags = GET_FLAGS();
if ((flags & _PROTO__SVINFO_VALID) == 0)
@@ -247,8 +247,8 @@ _proto__msg_raw(struct gps_device_t *session, unsigned char *buf, size_t data_le
*/
nchan = GET_NUMBER_OF_CHANNELS();
if ((nchan < 1) || (nchan > MAXCHANNELS)) {
- gpsd_report(&session->context->errout, LOG_INF,
- "too many channels reported\n");
+ gpsd_log(&session->context->errout, LOG_INF,
+ "too many channels reported\n");
return 0;
}
@@ -292,16 +292,16 @@ gps_mask_t _proto__dispatch(struct gps_device_t *session, unsigned char *buf, si
type = GET_MESSAGE_TYPE();
/* we may need to dump the raw packet */
- gpsd_report(&session->context->errout, LOG_RAW,
- "raw _proto_ packet type 0x%02x\n", type);
+ gpsd_log(&session->context->errout, LOG_RAW,
+ "raw _proto_ packet type 0x%02x\n", type);
switch (type)
{
/* Deliver message to specific decoder based on message type */
default:
- gpsd_report(&session->context->errout, LOG_WARN,
- "unknown packet id %d length %d\n", type, len);
+ gpsd_log(&session->context->errout, LOG_WARN,
+ "unknown packet id %d length %d\n", type, len);
return 0;
}
}
@@ -351,7 +351,7 @@ static ssize_t _proto__control_send(struct gps_device_t *session,
/* we may need to dump the message */
return gpsd_write(session, session->msgbuf, session->msgbuflen);
- gpsd_report(&session->context->errout, LOG_PROG,
+ gpsd_log(&session->context->errout, LOG_PROG,
"writing _proto_ control type %02x\n");
return gpsd_write(session, session->msgbuf, session->msgbuflen);
}