summaryrefslogtreecommitdiff
path: root/driver_navcom.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-12 17:52:41 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-12 17:52:41 -0500
commit4b1c6ecccb0a1dc155f6fe8c40d3c353b79c09a4 (patch)
treefb2f432b1892ef40c14b562708982e57ab937ffe /driver_navcom.c
parent25c55a4c7a4ed769ac10073fb65466f31305d305 (diff)
downloadgpsd-4b1c6ecccb0a1dc155f6fe8c40d3c353b79c09a4.tar.gz
Reduce gpsd log verbosity a lot.
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.
Diffstat (limited to 'driver_navcom.c')
-rw-r--r--driver_navcom.c68
1 files changed, 35 insertions, 33 deletions
diff --git a/driver_navcom.c b/driver_navcom.c
index d013c05f..3cecbe86 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -148,8 +148,9 @@ static void navcom_cmd_0x1c(struct gps_device_t *session, uint8_t mode,
putbyte(msg, 10, checksum(msg + 3, 7));
putbyte(msg, 11, 0x03);
(void)navcom_send_cmd(session, msg, 12);
- gpsd_report(session->context->debug, LOG_PROG, "Navcom: sent command 0x1c (Test Support Block)\n");
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_PROG,
+ "Navcom: sent command 0x1c (Test Support Block)\n");
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: command 0x1c mode = %02x, length = %u\n",
mode, length);
}
@@ -176,7 +177,7 @@ static void navcom_cmd_0x11(struct gps_device_t *session,
(void)navcom_send_cmd(session, msg, 12);
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: sent command 0x11 (Serial Port Configuration)\n");
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: serial port selection: 0x%02x\n", port_selection);
}
#endif /* RECONFIGURE_ENABLE */
@@ -220,7 +221,7 @@ static gps_mask_t handle_0x83(struct gps_device_t *session)
* for determining the GPS-UTC time difference,
* for which the iono data is not needed as far
* as we are concerned. However, I am still
- * reporting it (if debuglevel >= LOG_IO) as a
+ * reporting it (if debuglevel >= LOG_DATA) as a
* matter of interest */
/* 2^-30 */
#define SF_A0 (0.000000000931322574615478515625)
@@ -277,24 +278,25 @@ static gps_mask_t handle_0x83(struct gps_device_t *session)
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: received packet type 0x83 (Ionosphere and UTC Data)\n");
- gpsd_report(session->context->debug, LOG_IO, "Navcom: Scaled parameters follow:\n");
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
+ "Navcom: Scaled parameters follow:\n");
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: GPS Week: %u, GPS Time of Week: %u (GPS Time: %f)\n",
week, tow, week * 604800 + tow / 1000.0);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: a0: %12.4E, a1: %12.4E, a2: %12.4E, a3: %12.4E, "
"b0: %12.4E, b1: %12.4E, b2: %12.4E, b3: %12.4E\n",
(double)alpha0 * SF_ALPHA0, (double)alpha1 * SF_ALPHA1,
(double)alpha2 * SF_ALPHA2, (double)alpha3 * SF_ALPHA3,
(double)beta0 * SF_BETA0, (double)beta1 * SF_BETA1,
(double)beta2 * SF_BETA2, (double)beta3 * SF_BETA3);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: A0: %19.12E, A1: %19.12E\n", (double)a0 * SF_A0,
(double)a1 * SF_A1);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: UTC Ref. Time: %lu, UTC Ref. Week: %u, dTls: %d\n",
(unsigned long)tot * SF_TOT, wnt, dtls);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: Week of leap seconds: %u, Day number of leap seconds: %u, dTlsf: %d\n",
wnlsf, dn, dtlsf);
@@ -323,7 +325,7 @@ static gps_mask_t handle_0x06(struct gps_device_t *session)
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: received packet type 0x06 (Acknowledgement (without error))\n");
/*@ -type @*/
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: acknowledged command id 0x%02x on port %c\n",
cmd_id, (port == 0 ? 'A' : (port == 1 ? 'B' : '?')));
/*@ +type @*/
@@ -343,12 +345,12 @@ static gps_mask_t handle_0x15(struct gps_device_t *session)
for (n = 4; n < (msg_len - 2); n += 2) {
uint8_t err_id = getub(buf, n);
uint8_t err_desc = getub(buf, n + 1);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: error id = 0x%02x, error description = 0x%02x\n",
err_id, err_desc);
}
port = getub(buf, n);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: negative acknowledge was for command id 0x%02x on port %c\n",
cmd_id, (port == 0 ? 'A' : (port == 1 ? 'B' : '?')));
/*@ -type @*/
@@ -494,17 +496,17 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: received packet type 0xb1 (PVT Report)\n");
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: navigation mode %s (0x%02x) - %s - %s\n",
((-nav_mode & 0x80)!='\0' ? "invalid" : "valid"), nav_mode,
((nav_mode & 0x40)!='\0' ? "3D" : "2D"),
((nav_mode & 0x03)!='\0' ? "DGPS" : "GPS"));
/*@ +type @*/
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: latitude = %f, longitude = %f, altitude = %f, geoid = %f\n",
session->newdata.latitude, session->newdata.longitude,
session->newdata.altitude, session->gpsdata.separation);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: velocities: north = %f, east = %f, up = %f (track = %f, speed = %f)\n",
vel_north * VEL_RES, vel_east * VEL_RES, vel_up * VEL_RES,
session->newdata.track, session->newdata.speed);
@@ -647,39 +649,39 @@ static gps_mask_t handle_0x81(struct gps_device_t *session)
/* leap second? */
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: received packet type 0x81 (Packed Ephemeris Data)\n");
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: PRN: %u, Week: %u, TOW: %.3f SV clock bias/drift/drift rate: %#19.12E/%#19.12E/%#19.12E\n",
prn,
session->context->gps_week,
session->context->gps_tow,
((double)af0) * SF_AF0,
((double)af1) * SF_AF1, ((double)af2) * SF_AF2);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: IODE (!AODE): %u Crs: %19.12e, Delta n: %19.12e, M0: %19.12e\n",
iode, (double)crs * SF_CRS,
(double)delta_n * SF_DELTA_N * GPS_PI,
(double)m0 * SF_M0 * GPS_PI);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: Cuc: %19.12e, Eccentricity: %19.12e, Cus: %19.12e, A^1/2: %19.12e\n",
(double)cuc * SF_CUC, (double)e * SF_E, (double)cus * SF_CUS,
(double)sqrt_a * SF_SQRT_A);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: TOE: %u, Cic: %19.12e, Omega %19.12e, Cis: %19.12e\n",
toe * SF_TOE, (double)cic * SF_CIC,
(double)Omega0 * SF_OMEGA0 * GPS_PI, (double)cis * SF_CIS);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: i0: %19.12e, Crc: %19.12e, omega: %19.12e, Omega dot: %19.12e\n",
(double)i0 * SF_I0 * GPS_PI, (double)crc * SF_CRC,
(double)omega * SF_OMEGA * GPS_PI,
(double)Omegadot * SF_OMEGADOT * GPS_PI);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: IDOT: %19.12e, Codes on L2: 0x%x, GPS Week: %u, L2 P data flag: %x\n",
(double)idot * SF_IDOT * GPS_PI, cl2,
week - (week % 1024) + wn, l2pd);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: SV accuracy: 0x%x, SV health: 0x%x, TGD: %f, IODC (!AODC): %u\n",
ura, svh, (double)tgd * SF_TGD, iodc);
- gpsd_report(session->context->debug, LOG_IO, "Navcom: Transmission time: %u\n", tow);
+ gpsd_report(session->context->debug, LOG_DATA, "Navcom: Transmission time: %u\n", tow);
#undef SF_TGD
#undef SF_TOC
@@ -748,7 +750,7 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
}
/*@ -predboolothers @*/
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: engine status = 0x%x, almanac = %s, time = 0x%x, pos = 0x%x\n",
eng_status & 0x07, (eng_status & 0x08 ? "valid" : "invalid"),
eng_status & 0x30 >> 4, eng_status & 0xc0 >> 6);
@@ -787,12 +789,12 @@ static gps_mask_t handle_0x86(struct gps_device_t *session)
s = session->gpsdata.ss[i++] = (p2_snr ? p2_snr : ca_snr) / 4.0;
/*@ end @*/
}
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: prn = %3u, ele = %02u, azm = %03u, snr = %d (%s), "
"dgps age = %.1fs, log ch = %d, hw ch = 0x%02x\n",
prn, ele, azm, s, (p2_snr ? "P2" : "C/A"),
(double)dgps_age * 0.1, log_channel & 0x3f, hw_channel);
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: sol. valid = %c, clock = %s, pos. = %s, "
"height = %s, err. code = 0x%x\n",
(sol_status & 0x01 ? 'Y' : 'N'),
@@ -829,7 +831,7 @@ static gps_mask_t handle_0xb0(struct gps_device_t *session)
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: received packet type 0xb0 (Raw Meas. Data Block)\n");
/*@ -predboolothers @*/
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: week = %u, tow = %.3f, time slew accumulator = %u (1/1023mS), status = 0x%02x "
"(%sclock %s - %u blocks follow)\n",
session->context->gps_week,
@@ -867,17 +869,17 @@ static gps_mask_t handle_0xb0(struct gps_device_t *session)
double p2 =
(sv_status & 0x20 ? c1 +
(double)p2_ca_pseudorange / 16.0 * LAMBDA_L1 : NAN);
- gpsd_report(session->context->debug, LOG_IO + 1,
+ gpsd_report(session->context->debug, LOG_DATA + 1,
"Navcom: >> sv status = 0x%02x (PRN %u - C/A & L1 %s - P1 %s - P2 & L2 %s)\n",
sv_status, (sv_status & 0x1f),
(sv_status & 0x80 ? "valid" : "invalid"),
(sv_status & 0x40 ? "valid" : "invalid"),
(sv_status & 0x20 ? "valid" : "invalid"));
- gpsd_report(session->context->debug, LOG_IO + 1,
+ gpsd_report(session->context->debug, LOG_DATA + 1,
"Navcom: >>> ch status = 0x%02x (Logical channel: %u - CA C/No: %u dBHz) "
"sL1: %u, sL2: %u\n", ch_status, ch_status & 0x0f,
((ch_status & 0xf0) >> 4) + 35, l1_slips, l2_slips);
- gpsd_report(session->context->debug, LOG_IO + 1,
+ gpsd_report(session->context->debug, LOG_DATA + 1,
"Navcom: >>> C1: %14.3f, L1: %14.3f, L2: %14.3f, P1: %14.3f, P2: %14.3f\n",
c1, l1, l2, p1, p2);
/*@ +predboolothers -charint @*/
@@ -920,7 +922,7 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
(double)tow / 1000.0f);
gpsd_report(session->context->debug, LOG_PROG,
"Navcom: received packet type 0xb5 (Pseudorange Noise Statistics)\n");
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: epe = %f\n", session->gpsdata.epe);
return mask;
} else {
@@ -1102,7 +1104,7 @@ static gps_mask_t handle_0xef(struct gps_device_t *session)
osc_filter_drift_est = NAN;
}
- gpsd_report(session->context->debug, LOG_IO,
+ gpsd_report(session->context->debug, LOG_DATA,
"Navcom: oscillator temp. = %d, nav. status = 0x%02x, "
"nav. clock offset = %f, nav. clock drift = %f, "
"osc. filter drift est. = %f, acc.time slew value = %d\n",