diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-13 14:46:15 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-13 14:46:15 -0400 |
commit | 5ae819b8e4b9df0da24953355d6d05b9001a82a9 (patch) | |
tree | 785cbf67a50ffdfe7ca5ce3ee31ba19ab0c2bb62 /driver_sirf.c | |
parent | 60b874d966ce88bea269879b1ac86cc7b6ae39cc (diff) | |
download | gpsd-5ae819b8e4b9df0da24953355d6d05b9001a82a9.tar.gz |
Second step in the visualization code.
Diffstat (limited to 'driver_sirf.c')
-rw-r--r-- | driver_sirf.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/driver_sirf.c b/driver_sirf.c index 9b457129..96d60fba 100644 --- a/driver_sirf.c +++ b/driver_sirf.c @@ -264,6 +264,16 @@ static ssize_t sirf_control_send(struct gps_device_t *session, char *msg, } #endif /* CONTROLSEND_ENABLE */ +#ifdef VISUALIZE_ENABLE +static ssize_t sirfbin_visualize(struct gps_device_t *session, + char *buf, + size_t len) +{ + (void)snprintf(buf, len, "MID%d:", (int)buf[4]); + gpsd_packetdump(buf + strlen(buf), len - strlen(buf)); +} +#endif /* VISUALIZE_ENABLE */ + #ifdef RECONFIGURE_ENABLE static bool sirfbin_speed(struct gps_device_t *session, speed_t speed, char parity, int stopbits) /* change speed in binary mode */ @@ -1360,6 +1370,8 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event) } } + + /* this is everything we export */ /* *INDENT-OFF* */ const struct gps_type_t sirf_binary = @@ -1384,7 +1396,7 @@ const struct gps_type_t sirf_binary = .control_send = sirf_control_send,/* how to send a control string */ #endif /* CONTROLSEND_ENABLE */ #ifdef VISUALIZE_ENABLE - .visualize = NULL, /* no visualization method */ + .visualize = sirfbin_visualize, /* no visualization method */ #endif /* VISUALIZE_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = sirf_ntp_offset, |