diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-01-08 16:27:49 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-01-08 16:29:11 -0500 |
commit | a315dc1ca6a803fcb5c87f66984f4e900c974809 (patch) | |
tree | d14f737838776d178b5d6fd571221cb564085a46 /drivers.c | |
parent | 8f398f0e567770f1fb26f3e4a52aa60d8184224b (diff) | |
download | gpsd-a315dc1ca6a803fcb5c87f66984f4e900c974809.tar.gz |
Rename a function before some substantial changes. All regression tests pass.
Diffstat (limited to 'drivers.c')
-rw-r--r-- | drivers.c | 52 |
1 files changed, 26 insertions, 26 deletions
@@ -23,22 +23,7 @@ ssize_t generic_get(struct gps_device_t *session) return packet_get(session->gpsdata.gps_fd, &session->packet); } -#if defined(NMEA_ENABLE) || defined(SIRF_ENABLE) || defined(EVERMORE_ENABLE) || defined(ITRAX_ENABLE) || defined(NAVCOM_ENABLE) -ssize_t pass_rtcm(struct gps_device_t * session, char *buf, size_t rtcmbytes) -/* most GPSes take their RTCM corrections straight up */ -{ - return gpsd_write(session, buf, rtcmbytes); -} -#endif - -#ifdef NMEA_ENABLE -/************************************************************************** - * - * Generic driver -- straight NMEA 0183 - * - **************************************************************************/ - -gps_mask_t nmea_parse_input(struct gps_device_t * session) +gps_mask_t generic_parse_input(struct gps_device_t *session) { const struct gps_type_t **dp; @@ -89,6 +74,21 @@ gps_mask_t nmea_parse_input(struct gps_device_t * session) } } +#if defined(NMEA_ENABLE) || defined(SIRF_ENABLE) || defined(EVERMORE_ENABLE) || defined(ITRAX_ENABLE) || defined(NAVCOM_ENABLE) +ssize_t pass_rtcm(struct gps_device_t * session, char *buf, size_t rtcmbytes) +/* most GPSes take their RTCM corrections straight up */ +{ + return gpsd_write(session, buf, rtcmbytes); +} +#endif + +#ifdef NMEA_ENABLE +/************************************************************************** + * + * Generic driver -- straight NMEA 0183 + * + **************************************************************************/ + static void nmea_event_hook(struct gps_device_t *session, event_t event) { /* @@ -223,7 +223,7 @@ const struct gps_type_t nmea = { .channels = 12, /* consumer-grade GPS */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* use generic packet getter */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = pass_rtcm, /* write RTCM data straight */ .event_hook = nmea_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -321,7 +321,7 @@ const struct gps_type_t garmin = { .channels = 12, /* not used by this driver */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* use generic packet getter */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* some do, some don't, skip for now */ .event_hook = garmin_nmea_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -379,7 +379,7 @@ const struct gps_type_t ashtech = { .channels = 24, /* not used, GG24 has 24 channels */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = pass_rtcm, /* write RTCM data straight */ .event_hook = ashtech_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -426,7 +426,7 @@ const struct gps_type_t fv18 = { .channels = 12, /* not used by this driver */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = pass_rtcm, /* write RTCM data straight */ .event_hook = fv18_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -476,7 +476,7 @@ const struct gps_type_t gpsclock = { .channels = 12, /* not used by this driver */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = pass_rtcm, /* write RTCM data straight */ .event_hook = gpsclock_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -528,7 +528,7 @@ static const struct gps_type_t tripmate = { .channels = 12, /* consumer-grade GPS */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = pass_rtcm, /* send RTCM data straight */ .event_hook = tripmate_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -576,7 +576,7 @@ static const struct gps_type_t earthmate = { .channels = 12, /* not used by NMEA parser */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* don't send RTCM data */ .event_hook = earthmate_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -700,7 +700,7 @@ const struct gps_type_t trueNorth = { .channels = 0, /* not an actual GPS at all */ .probe_detect = NULL, /* no probe in run mode */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* Don't send */ .event_hook = tnt_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE @@ -773,7 +773,7 @@ static const struct gps_type_t oceanServer = { .channels = 0, /* not an actual GPS at all */ .probe_detect = NULL, .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* Don't send */ .event_hook = oceanserver_event_hook, #ifdef ALLOW_RECONFIGURE @@ -1035,7 +1035,7 @@ const struct gps_type_t mtk3301 = { .channels = 12, /* not used by this driver */ .probe_detect = NULL, /* no probe */ .get_packet = generic_get, /* how to get a packet */ - .parse_packet = nmea_parse_input, /* how to interpret a packet */ + .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = pass_rtcm, /* write RTCM data straight */ .event_hook = mtk3301_event_hook, /* lifetime event handler */ #ifdef ALLOW_RECONFIGURE |