diff options
author | Gary E. Miller <gem@rellim.com> | 2019-01-15 15:06:38 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-01-15 15:06:38 -0800 |
commit | 6341b325d628886bb6e84f3ac330aa761807aac7 (patch) | |
tree | c7398639555859d68514f0c1fd84906ba4e740c2 /driver_sirf.c | |
parent | 6d6fb45908d4b95bc8de92d2b2f392627f32b9ff (diff) | |
download | gpsd-6341b325d628886bb6e84f3ac330aa761807aac7.tar.gz |
driver_sirf: tweak the debug message for Visible List MID 13.
And some comments.
Diffstat (limited to 'driver_sirf.c')
-rw-r--r-- | driver_sirf.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/driver_sirf.c b/driver_sirf.c index a3cbe2cd..a4ffb459 100644 --- a/driver_sirf.c +++ b/driver_sirf.c @@ -420,10 +420,14 @@ static gps_mask_t sirf_msg_debug(struct gps_device_t *device, memset(msgbuf, 0, (int)sizeof(msgbuf)); if (0xe1 == buf[0]) { /* Development statistics messages */ + if (2 > len) { + /* too short */ + return 0; + } for (i = 2; i < (int)len; i++) str_appendf(msgbuf, sizeof(msgbuf), "%c", buf[i] ^ 0xff); gpsd_log(&device->context->errout, LOG_PROG, - "SiRF: DEV 0xe1: %s\n", msgbuf); + "SiRF: MID 0xe1 (255) SID %#0x %s\n", buf[1], msgbuf); } else if (0xff == (unsigned char)buf[0]) { /* Debug messages */ for (i = 1; i < (int)len; i++) if (isprint(buf[i])) @@ -1906,7 +1910,9 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf, return 0; case 0x0d: /* Visible List MID 13 */ - gpsd_log(&session->context->errout, LOG_PROG,"SiRF: unused VIS 0x0d\n"); + /* no data her not already in MID 67,16 */ + gpsd_log(&session->context->errout, LOG_PROG, + "SiRF: unused MID 0x0d (Visible List) len %zd\n", len); return 0; case 0x0e: /* Almanac Data MID 14 */ @@ -1993,6 +1999,7 @@ gps_mask_t sirf_parse(struct gps_device_t * session, unsigned char *buf, return sirf_msg_67(session, buf, len); case 0x47: /* Hardware Config MID 71 */ + /* MID_HW_CONFIG_REQ */ gpsd_log(&session->context->errout, LOG_PROG, "SiRF IV: unused Hardware Config 0x47, len %zd\n", len); |