From 25c55a4c7a4ed769ac10073fb65466f31305d305 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 12 Nov 2013 17:13:27 -0500 Subject: Rename and rationalize driver table instances. No logic changes. --- driver_evermore.c | 4 +- driver_garmin.c | 6 +-- driver_geostar.c | 4 +- driver_italk.c | 4 +- driver_navcom.c | 4 +- driver_nmea2000.c | 2 +- driver_oncore.c | 4 +- driver_proto.c | 4 +- driver_sirf.c | 4 +- driver_superstar2.c | 4 +- driver_tsip.c | 4 +- driver_ubx.c | 6 +-- driver_zodiac.c | 4 +- drivers.c | 127 +++++++++++++++++++++++++++------------------------ gpsctl.c | 2 +- gpsmon.c | 8 ++-- monitor_garmin.c | 4 +- monitor_italk.c | 4 +- monitor_nmea.c | 38 +++++++-------- monitor_oncore.c | 4 +- monitor_proto.c | 2 +- monitor_sirf.c | 13 +++--- monitor_superstar2.c | 4 +- monitor_tnt.c | 4 +- monitor_ubx.c | 4 +- 25 files changed, 139 insertions(+), 129 deletions(-) diff --git a/driver_evermore.c b/driver_evermore.c index 681d61b5..5009ae04 100644 --- a/driver_evermore.c +++ b/driver_evermore.c @@ -614,9 +614,9 @@ static bool evermore_rate_switcher(struct gps_device_t *session, double rate) /* this is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t evermore_binary = +const struct gps_type_t driver_evermore = { - .type_name = "EverMore binary", /* full name of type */ + .type_name = "EverMore", /* full name of type */ .packet_type = EVERMORE_PACKET, /* lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ .trigger = NULL, /* recognize the type */ diff --git a/driver_garmin.c b/driver_garmin.c index aa5a1609..6a310e80 100644 --- a/driver_garmin.c +++ b/driver_garmin.c @@ -1370,7 +1370,7 @@ static ssize_t garmin_get_packet(struct gps_device_t *session) } /* *INDENT-OFF* */ -const struct gps_type_t garmin_usb_binary_old = +const struct gps_type_t driver_garmin_usb_binary_old = { .type_name = "Garmin USB binary", /* full name of type */ .packet_type = GARMIN_PACKET; /* associated lexer packet type */ @@ -1399,7 +1399,7 @@ const struct gps_type_t garmin_usb_binary_old = #endif /* __UNUSED__ */ /* *INDENT-OFF* */ -const struct gps_type_t garmin_usb_binary = +const struct gps_type_t driver_garmin_usb_binary = { .type_name = "Garmin USB binary", /* full name of type */ .packet_type = GARMIN_PACKET, /* associated lexer packet type */ @@ -1427,7 +1427,7 @@ const struct gps_type_t garmin_usb_binary = /* *INDENT-ON* */ /* *INDENT-OFF* */ -const struct gps_type_t garmin_ser_binary = +const struct gps_type_t driver_garmin_ser_binary = { .type_name = "Garmin Serial binary", /* full name of type */ .packet_type = GARMIN_PACKET, /* associated lexer packet type */ diff --git a/driver_geostar.c b/driver_geostar.c index 7830eaad..a5eb1447 100644 --- a/driver_geostar.c +++ b/driver_geostar.c @@ -608,9 +608,9 @@ static double geostar_time_offset(struct gps_device_t *session UNUSED) /* this is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t geostar_binary = +const struct gps_type_t driver_geostar = { - .type_name = "GeoStar binary", /* full name of type */ + .type_name = "GeoStar", /* full name of type */ .packet_type = GEOSTAR_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ .trigger = NULL, /* no trigger */ diff --git a/driver_italk.c b/driver_italk.c index 35d5a6d2..5520817f 100644 --- a/driver_italk.c +++ b/driver_italk.c @@ -397,9 +397,9 @@ static void italk_ping(struct gps_device_t *session) #endif /* __UNUSED__ */ /* *INDENT-OFF* */ -const struct gps_type_t italk_binary = +const struct gps_type_t driver_italk = { - .type_name = "iTalk binary", /* full name of type */ + .type_name = "iTalk", /* full name of type */ .packet_type = ITALK_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* no rollover or other flags */ .trigger = NULL, /* recognize the type */ diff --git a/driver_navcom.c b/driver_navcom.c index d67acde9..d013c05f 100644 --- a/driver_navcom.c +++ b/driver_navcom.c @@ -1275,9 +1275,9 @@ static bool navcom_speed(struct gps_device_t *session, /* this is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t navcom_binary = +const struct gps_type_t driver_navcom = { - .type_name = "Navcom binary", /* full name of type */ + .type_name = "Navcom", /* full name of type */ .packet_type = NAVCOM_PACKET, /* lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ .trigger = NULL, /* none */ diff --git a/driver_nmea2000.c b/driver_nmea2000.c index 94eaa30a..884dc9b9 100644 --- a/driver_nmea2000.c +++ b/driver_nmea2000.c @@ -1680,7 +1680,7 @@ void nmea2000_close(struct gps_device_t *session) } /* *INDENT-OFF* */ -const struct gps_type_t nmea2000 = { +const struct gps_type_t driver_nmea2000 = { .type_name = "NMEA2000", /* full name of type */ .packet_type = NMEA2000_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ diff --git a/driver_oncore.c b/driver_oncore.c index 14e2f6d5..36e7a475 100644 --- a/driver_oncore.c +++ b/driver_oncore.c @@ -480,9 +480,9 @@ static gps_mask_t oncore_parse_input(struct gps_device_t *session) /* This is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t oncore_binary = { +const struct gps_type_t driver_oncore = { - .type_name = "Oncore binary", /* Full name of type */ + .type_name = "Motorola Oncore", /* Full name of type */ .packet_type = ONCORE_PACKET, /* numeric packet type */ .flags = DRIVER_STICKY, /* remember this */ .trigger = NULL, /* identifying response */ diff --git a/driver_proto.c b/driver_proto.c index 17413e80..319418fa 100644 --- a/driver_proto.c +++ b/driver_proto.c @@ -490,9 +490,9 @@ static void _proto__wrapup(struct gps_device_t *session) /* This is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t _proto__binary = { +const struct gps_type_t driver__proto__binary = { /* Full name of type */ - .type_name = "_proto_ binary", + .type_name = "_proto", /* Associated lexer packet type */ .packet_type = _PROTO__PACKET, /* Driver tyoe flags */ diff --git a/driver_sirf.c b/driver_sirf.c index bcad53cb..87705e22 100644 --- a/driver_sirf.c +++ b/driver_sirf.c @@ -1476,9 +1476,9 @@ 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 = +const struct gps_type_t driver_sirf = { - .type_name = "SiRF binary", /* full name of type */ + .type_name = "SiRF", /* full name of type */ .packet_type = SIRF_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* no flags set */ .trigger = NULL, /* no trigger */ diff --git a/driver_superstar2.c b/driver_superstar2.c index 969ad87a..667788f0 100644 --- a/driver_superstar2.c +++ b/driver_superstar2.c @@ -540,9 +540,9 @@ static void superstar2_set_mode(struct gps_device_t *session, int mode) #endif /* RECONFIGURE_ENABLE */ /* *INDENT-OFF* */ -const struct gps_type_t superstar2_binary = { +const struct gps_type_t driver_superstar2 = { /* Full name of type */ - .type_name = "SuperStarII binary", + .type_name = "SuperStarII", /* Associated lexer packet type */ .packet_type = SUPERSTAR2_PACKET, /* Driver type flags */ diff --git a/driver_tsip.c b/driver_tsip.c index 6dced174..bb878de8 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -1253,9 +1253,9 @@ void configuration_packets_accutime_gold(struct gps_device_t *session) /* this is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t tsip_binary = +const struct gps_type_t driver_tsip = { - .type_name = "Trimble TSIP binary", /* full name of type */ + .type_name = "Trimble TSIP", /* full name of type */ .packet_type = TSIP_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ .trigger = NULL, /* no trigger */ diff --git a/driver_ubx.c b/driver_ubx.c index d7c9892c..5ef314d6 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -472,7 +472,7 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf, break; case UBX_CFG_PRT: - session->driver.ubx.port_id = (int)buf[UBX_MESSAGE_DATA_OFFSET + 0]; + session->driver.ubx.port_id = (unsigned char)buf[UBX_MESSAGE_DATA_OFFSET + 0]; gpsd_report(session->context->debug, LOG_INF, "UBX_CFG_PRT: port %d\n", session->driver.ubx.port_id); break; @@ -928,8 +928,8 @@ static bool ubx_rate(struct gps_device_t *session, double cycletime) /* This is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t ubx_binary = { - .type_name = "u-blox binary", /* Full name of type */ +const struct gps_type_t driver_ubx = { + .type_name = "u-blox", /* Full name of type */ .packet_type = UBX_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ .trigger = NULL, diff --git a/driver_zodiac.c b/driver_zodiac.c index 025bab3d..66736817 100644 --- a/driver_zodiac.c +++ b/driver_zodiac.c @@ -457,9 +457,9 @@ static double zodiac_time_offset(struct gps_device_t *session UNUSED) /* this is everything we export */ /* *INDENT-OFF* */ -const struct gps_type_t zodiac_binary = +const struct gps_type_t driver_zodiac = { - .type_name = "Zodiac binary", /* full name of type */ + .type_name = "Zodiac", /* full name of type */ .packet_type = ZODIAC_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* no flags set */ .trigger = NULL, /* no trigger */ diff --git a/drivers.c b/drivers.c index 1f0235e7..3cc6ccbb 100644 --- a/drivers.c +++ b/drivers.c @@ -15,10 +15,10 @@ #include "gpsd.h" #include "bits.h" /* for getbeu16(), to extract big-endian words */ -extern const struct gps_type_t zodiac_binary; -extern const struct gps_type_t ubx_binary; -extern const struct gps_type_t sirf_binary; -extern const struct gps_type_t nmea2000; +extern const struct gps_type_t driver_zodiac_binary; +extern const struct gps_type_t driver_ubx_binary; +extern const struct gps_type_t driver_sirf_binary; +extern const struct gps_type_t driver_nmea2000; ssize_t generic_get(struct gps_device_t *session) { @@ -80,7 +80,7 @@ gps_mask_t generic_parse_input(struct gps_device_t *session) **************************************************************************/ /* *INDENT-OFF* */ -const struct gps_type_t unknown = { +const struct gps_type_t driver_unknown = { .type_name = "Unknown", /* full name of type */ .packet_type = COMMENT_PACKET, /* associated lexer packet type */ .flags = DRIVER_NOFLAGS, /* no flags set */ @@ -245,8 +245,8 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event) } /* *INDENT-OFF* */ -const struct gps_type_t nmea0183 = { - .type_name = "Generic NMEA", /* full name of type */ +const struct gps_type_t driver_nmea0183 = { + .type_name = "NMEA0183", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_NOFLAGS, /* remember this */ .trigger = NULL, /* it's the default */ @@ -350,7 +350,7 @@ static void garmin_nmea_event_hook(struct gps_device_t *session, } /* *INDENT-OFF* */ -const struct gps_type_t garmin = { +const struct gps_type_t driver_garmin = { .type_name = "Garmin NMEA", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ @@ -412,7 +412,7 @@ static void ashtech_event_hook(struct gps_device_t *session, event_t event) } /* *INDENT-OFF* */ -const struct gps_type_t ashtech = { +const struct gps_type_t driver_ashtech = { .type_name = "Ashtech", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ @@ -463,7 +463,7 @@ static void fv18_event_hook(struct gps_device_t *session, event_t event) } /* *INDENT-OFF* */ -const struct gps_type_t fv18 = { +const struct gps_type_t driver_fv18 = { .type_name = "San Jose Navigation FV18", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ @@ -517,7 +517,7 @@ static void gpsclock_event_hook(struct gps_device_t *session, event_t event) } /* *INDENT-OFF* */ -const struct gps_type_t gpsclock = { +const struct gps_type_t driver_gpsclock = { .type_name = "Furuno Electric GH-79L4", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ @@ -572,7 +572,7 @@ static void tripmate_event_hook(struct gps_device_t *session, event_t event) } /* *INDENT-OFF* */ -static const struct gps_type_t tripmate = { +static const struct gps_type_t driver_tripmate = { .type_name = "Delorme TripMate", /* full name of type */ .packet_type = NMEA_PACKET, /* lexer packet type */ .flags = DRIVER_STICKY, /* no rollover or other flags */ @@ -617,13 +617,13 @@ static void earthmate_event_hook(struct gps_device_t *session, event_t event) if (event == event_triggermatch) { (void)gpsd_write(session, "EARTHA\r\n", 8); (void)usleep(10000); - (void)gpsd_switch_driver(session, "Zodiac Binary"); + (void)gpsd_switch_driver(session, "Zodiac"); } } /*@ -redef @*/ /* *INDENT-OFF* */ -static const struct gps_type_t earthmate = { +static const struct gps_type_t driver_earthmate = { .type_name = "Pre-2003 Delorme EarthMate", .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* no rollover or other flags */ @@ -746,7 +746,7 @@ static void tnt_event_hook(struct gps_device_t *session, event_t event) } /* *INDENT-OFF* */ -const struct gps_type_t trueNorth = { +const struct gps_type_t driver_trueNorth = { .type_name = "True North", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ @@ -824,8 +824,8 @@ static void oceanserver_event_hook(struct gps_device_t *session, } /* *INDENT-OFF* */ -static const struct gps_type_t oceanServer = { - .type_name = "OceanServer Digital Compass OS5000", /* full name of type */ +static const struct gps_type_t driver_oceanServer = { + .type_name = "OceanServer OS5000", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* no rollover or other flags */ .trigger = "$OHPR,", /* detect their main sentence */ @@ -891,7 +891,7 @@ static void fury_event_hook(struct gps_device_t *session, event_t event) /* *INDENT-OFF* */ -static const struct gps_type_t fury = { +static const struct gps_type_t driver_fury = { .type_name = "Jackson Labs Fury", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* no rollover or other flags */ @@ -945,7 +945,7 @@ static gps_mask_t rtcm104v2_analyze(struct gps_device_t *session) } /* *INDENT-OFF* */ -static const struct gps_type_t rtcm104v2 = { +static const struct gps_type_t driver_rtcm104v2 = { .type_name = "RTCM104V2", /* full name of type */ .packet_type = RTCM2_PACKET, /* associated lexer packet type */ .flags = DRIVER_NOFLAGS, /* no rollover or other flags */ @@ -991,7 +991,7 @@ static gps_mask_t rtcm104v3_analyze(struct gps_device_t *session) } /* *INDENT-OFF* */ -static const struct gps_type_t rtcm104v3 = { +static const struct gps_type_t driver_rtcm104v3 = { .type_name = "RTCM104V3", /* full name of type */ .packet_type = RTCM3_PACKET, /* associated lexer packet type */ .flags = DRIVER_NOFLAGS, /* no rollover or other flags */ @@ -1026,7 +1026,7 @@ static const struct gps_type_t rtcm104v3 = { **************************************************************************/ /* *INDENT-OFF* */ -static const struct gps_type_t garmintxt = { +static const struct gps_type_t driver_garmintxt = { .type_name = "Garmin Simple Text", /* full name of type */ .packet_type = GARMINTXT_PACKET, /* associated lexer packet type */ .flags = DRIVER_NOFLAGS, /* no rollover or other flags */ @@ -1121,7 +1121,7 @@ static bool mtk3301_rate_switcher(struct gps_device_t *session, double rate) #endif /* RECONFIGURE_ENABLE */ /* *INDENT-OFF* */ -const struct gps_type_t mtk3301 = { +const struct gps_type_t driver_mtk3301 = { .type_name = "MTK-3301", /* full name of type */ .packet_type = NMEA_PACKET, /* associated lexer packet type */ .flags = DRIVER_STICKY, /* remember this */ @@ -1358,7 +1358,7 @@ static gps_mask_t aivdm_analyze(struct gps_device_t *session) } /* *INDENT-OFF* */ -const struct gps_type_t aivdm = { +const struct gps_type_t driver_aivdm = { /* Full name of type */ .type_name = "AIVDM", /* associated lexer packet type */ .packet_type = AIVDM_PACKET, /* numeric packet type */ @@ -1449,7 +1449,7 @@ static gps_mask_t json_pass_packet(struct gps_device_t *session) (void)strlcat((char *)session->packet.outbuffer, "\"}", sizeof(session->packet.outbuffer)); } - session->packet.outbuflen = (unsigned int)strlen((char *)session->packet.outbuffer); + session->packet.outbuflen = strlen((char *)session->packet.outbuffer); } gpsd_report(session->context->debug, LOG_PROG, "JSON, passing through %s\n", @@ -1459,7 +1459,7 @@ static gps_mask_t json_pass_packet(struct gps_device_t *session) } /* *INDENT-OFF* */ -const struct gps_type_t json_passthrough = { +const struct gps_type_t driver_json_passthrough = { .type_name = "JSON slave driver", /* full name of type */ .packet_type = JSON_PACKET, /* associated lexer packet type */ .flags = DRIVER_NOFLAGS, /* don't remember this */ @@ -1487,105 +1487,112 @@ const struct gps_type_t json_passthrough = { #endif /* PASSTHROUGH_ENABLE */ -extern const struct gps_type_t garmin_usb_binary, garmin_ser_binary; -extern const struct gps_type_t geostar_binary; -extern const struct gps_type_t tsip_binary, oncore_binary; -extern const struct gps_type_t evermore_binary, italk_binary; -extern const struct gps_type_t navcom_binary, superstar2_binary; +extern const struct gps_type_t driver_evermore; +extern const struct gps_type_t driver_garmin_ser_binary; +extern const struct gps_type_t driver_garmin_usb_binary; +extern const struct gps_type_t driver_geostar; +extern const struct gps_type_t driver_italk; +extern const struct gps_type_t driver_navcom; +extern const struct gps_type_t driver_oncore; +extern const struct gps_type_t driver_sirf; +extern const struct gps_type_t driver_superstar2; +extern const struct gps_type_t driver_tsip; +extern const struct gps_type_t driver_ubx; +extern const struct gps_type_t driver_zodiac; /*@ -nullassign @*/ /* the point of this rigamarole is to not have to export a table size */ static const struct gps_type_t *gpsd_driver_array[] = { - &unknown, + &driver_unknown, #ifdef NMEA_ENABLE - &nmea0183, + &driver_nmea0183, #ifdef ASHTECH_ENABLE - &ashtech, + &driver_ashtech, #endif /* ASHTECHV18_ENABLE */ #ifdef TRIPMATE_ENABLE - &tripmate, + &driver_tripmate, #endif /* TRIPMATE_ENABLE */ #ifdef EARTHMATE_ENABLE - &earthmate, + &driver_earthmate, #endif /* EARTHMATE_ENABLE */ #ifdef GPSCLOCK_ENABLE - &gpsclock, + &driver_gpsclock, #endif /* GPSCLOCK_ENABLE */ #ifdef GARMIN_ENABLE - &garmin, + &driver_garmin, #endif /* GARMIN_ENABLE */ #ifdef MTK3301_ENABLE - &mtk3301, + &driver_mtk3301, #endif /* MTK3301_ENABLE */ #ifdef OCEANSERVER_ENABLE - &oceanServer, + &driver_oceanServer, #endif /* OCEANSERVER_ENABLE */ #ifdef FV18_ENABLE - &fv18, + &driver_fv18, #endif /* FV18_ENABLE */ #ifdef TNT_ENABLE - &trueNorth, + &driver_trueNorth, #endif /* TNT_ENABLE */ #ifdef FURY_ENABLE - &fury, + &driver_fury, #endif /* FURY_ENABLE */ #ifdef AIVDM_ENABLE - &aivdm, + &driver_aivdm, #endif /* AIVDM_ENABLE */ #endif /* NMEA_ENABLE */ #ifdef EVERMORE_ENABLE - &evermore_binary, + &driver_evermore, #endif /* EVERMORE_ENABLE */ #ifdef GARMIN_ENABLE /* be sure to try Garmin Serial Binary before Garmin USB Binary */ - &garmin_ser_binary, - &garmin_usb_binary, + &driver_garmin_ser_binary, + &driver_garmin_usb_binary, #endif /* GARMIN_ENABLE */ #ifdef GEOSTAR_ENABLE - &geostar_binary, + &driver_geostar, #endif /* GEOSTAR_ENABLE */ #ifdef ITRAX_ENABLE - &italk_binary, + &driver_italk, #endif /* ITRAX_ENABLE */ #ifdef ONCORE_ENABLE - &oncore_binary, + &driver_oncore, #endif /* ONCORE_ENABLE */ #ifdef NAVCOM_ENABLE - &navcom_binary, + &driver_navcom, #endif /* NAVCOM_ENABLE */ #ifdef SIRF_ENABLE - &sirf_binary, + &driver_sirf, #endif /* SIRF_ENABLE */ #ifdef SUPERSTAR2_ENABLE - &superstar2_binary, + &driver_superstar2, #endif /* SUPERSTAR2_ENABLE */ #ifdef TSIP_ENABLE - &tsip_binary, + &driver_tsip, #endif /* TSIP_ENABLE */ #ifdef UBLOX_ENABLE - &ubx_binary, + &driver_ubx, #endif /* UBLOX_ENABLE */ #ifdef ZODIAC_ENABLE - &zodiac_binary, + &driver_zodiac, #endif /* ZODIAC_ENABLE */ #ifdef NMEA2000_ENABLE - &nmea2000, + &driver_nmea2000, #endif /* NMEA2000_ENABLE */ #ifdef RTCM104V2_ENABLE - &rtcm104v2, + &driver_rtcm104v2, #endif /* RTCM104V2_ENABLE */ #ifdef RTCM104V3_ENABLE - &rtcm104v3, + &driver_rtcm104v3, #endif /* RTCM104V3_ENABLE */ #ifdef GARMINTXT_ENABLE - &garmintxt, + &driver_garmintxt, #endif /* GARMINTXT_ENABLE */ #ifdef PASSTHROUGH_ENABLE - &json_passthrough, + &driver_json_passthrough, #endif /* PASSTHROUGH_ENABLE */ NULL, diff --git a/gpsctl.c b/gpsctl.c index 436e2f05..fceb9881 100644 --- a/gpsctl.c +++ b/gpsctl.c @@ -704,7 +704,7 @@ int main(int argc, char **argv) device, gpsd_id(&session), session.gpsdata.dev.baudrate); - if (forcetype!=NULL && strcmp("Generic NMEA", session.device_type->type_name) !=0 && strcmp(forcetype->type_name, session.device_type->type_name)!=0) { + if (forcetype!=NULL && strcmp("NMEA0183", session.device_type->type_name) !=0 && strcmp(forcetype->type_name, session.device_type->type_name)!=0) { gpsd_report(context.debug, LOG_ERROR, "'%s' doesn't match non-generic type '%s' of selected device.\n", forcetype->type_name, diff --git a/gpsmon.c b/gpsmon.c index 410e0301..ea9eecf6 100644 --- a/gpsmon.c +++ b/gpsmon.c @@ -40,7 +40,7 @@ extern struct monitor_object_t garmin_mmt, garmin_bin_ser_mmt; extern struct monitor_object_t italk_mmt, ubx_mmt, superstar2_mmt; extern struct monitor_object_t fv18_mmt, gpsclock_mmt, mtk3301_mmt; extern struct monitor_object_t oncore_mmt, tnt_mmt, aivdm_mmt; -extern const struct gps_type_t nmea0183; +extern const struct gps_type_t driver_nmea0183; /* These are public */ struct gps_device_t session; @@ -59,14 +59,14 @@ static struct fixsource_t source; #ifdef PASSTHROUGH_ENABLE /* no methods, it's all device window */ -extern const struct gps_type_t json_passthrough; +extern const struct gps_type_t driver_json_passthrough; const struct monitor_object_t json_mmt = { .initialize = NULL, .update = NULL, .command = NULL, .wrap = NULL, .min_y = 0, .min_x = 80, /* no need for a device window */ - .driver = &json_passthrough, + .driver = &driver_json_passthrough, }; #endif /* PASSTHROUGH_ENABLE */ @@ -507,7 +507,7 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED) const struct gps_type_t *active_type = device->device_type; if (device->packet.type == NMEA_PACKET && ((device->device_type->flags & DRIVER_STICKY) != 0)) - active_type = &nmea0183; + active_type = &driver_nmea0183; if (!switch_type(active_type)) longjmp(terminate, TERM_DRIVER_SWITCH); else { diff --git a/monitor_garmin.c b/monitor_garmin.c index 5f0fbf61..edc52b51 100644 --- a/monitor_garmin.c +++ b/monitor_garmin.c @@ -13,7 +13,7 @@ #include "gpsmon.h" #if defined(GARMIN_ENABLE) && defined(BINARY_ENABLE) -extern const struct gps_type_t garmin_ser_binary; +extern const struct gps_type_t driver_garmin_ser_binary; static WINDOW *miscwin, *mid51win, *mid114win; @@ -294,7 +294,7 @@ const struct monitor_object_t garmin_bin_ser_mmt = { .command = NULL, .wrap = garmin_bin_wrap, .min_y = 16,.min_x = 80, - .driver = &garmin_ser_binary, + .driver = &driver_garmin_ser_binary, }; #endif /* defined(GARMIN_ENABLE) && defined(BINARY_ENABLE) */ diff --git a/monitor_italk.c b/monitor_italk.c index 2de8073a..3157d5ee 100644 --- a/monitor_italk.c +++ b/monitor_italk.c @@ -16,7 +16,7 @@ #include #endif -extern const struct gps_type_t italk_binary; +extern const struct gps_type_t driver_italk; static WINDOW *satwin, *navfixwin; #define display (void)mvwprintw @@ -248,6 +248,6 @@ const struct monitor_object_t italk_mmt = { .command = italk_command, .wrap = italk_wrap, .min_y = 23,.min_x = 80, /* size of the device window */ - .driver = &italk_binary, + .driver = &driver_italk, }; #endif diff --git a/monitor_nmea.c b/monitor_nmea.c index d08f9522..43b9bfb2 100644 --- a/monitor_nmea.c +++ b/monitor_nmea.c @@ -20,7 +20,7 @@ #include "gpsdclient.h" #ifdef NMEA_ENABLE -extern const struct gps_type_t nmea0183; +extern const struct gps_type_t driver_nmea0183; static WINDOW *cookedwin, *nmeawin, *satwin, *gprmcwin, *gpggawin, *gpgsawin, *gpgstwin; static timestamp_t last_tick, tick_interval; @@ -28,7 +28,7 @@ static char sentences[NMEA_MAX * 2]; /***************************************************************************** * - * Generic NMEA support + * NMEA0183 support * *****************************************************************************/ @@ -318,13 +318,15 @@ static void nmea_update(void) } #ifdef PPS_ENABLE + /*@-compdef@*/ + /*@-type@*/ /* splint is confused about struct timespec */ if (pps_thread_lastpps(&session, &drift) > 0) { - /*@-type@*/ /* splint is confused about struct timespec */ double timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9; - /*@+type@*/ (void)mvwprintw(gpgsawin, 4, 13, "%.9f", timedelta); - wnoutrefresh(gpgsawin); + (void)wnoutrefresh(gpgsawin); } + /*@+type@*/ + /*@+compdef@*/ #endif /* PPS_ENABLE */ } @@ -346,7 +348,7 @@ const struct monitor_object_t nmea_mmt = { .command = NULL, .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &nmea0183, + .driver = &driver_nmea0183, }; /***************************************************************************** @@ -378,7 +380,7 @@ static void monitor_nmea_send(const char *fmt, ...) */ #if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE) -extern const struct gps_type_t garmin; +extern const struct gps_type_t driver_garmin; const struct monitor_object_t garmin_mmt = { .initialize = nmea_initialize, @@ -386,12 +388,12 @@ const struct monitor_object_t garmin_mmt = { .command = NULL, .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &garmin, + .driver = &driver_garmin, }; #endif /* GARMIN_ENABLE && NMEA_ENABLE */ #ifdef ASHTECH_ENABLE -extern const struct gps_type_t ashtech; +extern const struct gps_type_t driver_ashtech; #define ASHTECH_SPEED_9600 5 #define ASHTECH_SPEED_57600 8 @@ -456,12 +458,12 @@ const struct monitor_object_t ashtech_mmt = { #endif /* CONTROLSEND_ENABLE */ .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &ashtech, + .driver = &driver_ashtech, }; #endif /* ASHTECH_ENABLE */ #ifdef FV18_ENABLE -extern const struct gps_type_t fv18; +extern const struct gps_type_t driver_fv18; const struct monitor_object_t fv18_mmt = { .initialize = nmea_initialize, @@ -469,12 +471,12 @@ const struct monitor_object_t fv18_mmt = { .command = NULL, .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &fv18, + .driver = &driver_fv18, }; #endif /* FV18_ENABLE */ #ifdef GPSCLOCK_ENABLE -extern const struct gps_type_t gpsclock; +extern const struct gps_type_t driver_gpsclock; const struct monitor_object_t gpsclock_mmt = { .initialize = nmea_initialize, @@ -482,12 +484,12 @@ const struct monitor_object_t gpsclock_mmt = { .command = NULL, .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &gpsclock, + .driver = &driver_gpsclock, }; #endif /* GPSCLOCK_ENABLE */ #ifdef MTK3301_ENABLE -extern const struct gps_type_t mtk3301; +extern const struct gps_type_t driver_mtk3301; const struct monitor_object_t mtk3301_mmt = { .initialize = nmea_initialize, @@ -495,12 +497,12 @@ const struct monitor_object_t mtk3301_mmt = { .command = NULL, .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &mtk3301, + .driver = &driver_mtk3301, }; #endif /* MTK3301_ENABLE */ #ifdef AIVDM_ENABLE -extern const struct gps_type_t aivdm; +extern const struct gps_type_t driver_aivdm; const struct monitor_object_t aivdm_mmt = { .initialize = nmea_initialize, @@ -508,7 +510,7 @@ const struct monitor_object_t aivdm_mmt = { .command = NULL, .wrap = nmea_wrap, .min_y = 21,.min_x = 80, - .driver = &aivdm, + .driver = &driver_aivdm, }; #endif /* AIVDM_ENABLE */ #endif /* NMEA_ENABLE */ diff --git a/monitor_oncore.c b/monitor_oncore.c index 43529e82..74a243dc 100644 --- a/monitor_oncore.c +++ b/monitor_oncore.c @@ -14,7 +14,7 @@ #include "gpsmon.h" #if defined(ONCORE_ENABLE) && defined(BINARY_ENABLE) -extern const struct gps_type_t oncore_binary; +extern const struct gps_type_t driver_oncore; static WINDOW *Ea1win, *Eawin, *Bbwin, *Enwin, *Bowin, *Aywin, *Aswin, *Atwin; static unsigned char EaSVlines[8]; @@ -461,7 +461,7 @@ const struct monitor_object_t oncore_mmt = { .command = oncore_command, .wrap = oncore_wrap, .min_y = 20,.min_x = 80, /* size of the device window */ - .driver = &oncore_binary, + .driver = &driver_oncore, }; #endif /* defined(ONCORE_ENABLE) && defined(BINARY_ENABLE) */ diff --git a/monitor_proto.c b/monitor_proto.c index 05a7cc9c..149fba4f 100644 --- a/monitor_proto.c +++ b/monitor_proto.c @@ -33,7 +33,7 @@ * helper functions. */ -extern const struct gps_type_t PROTO_binary; +extern const struct gps_type_t driver__proto_; static bool PROTO_initialize(void) { diff --git a/monitor_sirf.c b/monitor_sirf.c index edf790b5..dc737300 100644 --- a/monitor_sirf.c +++ b/monitor_sirf.c @@ -18,7 +18,7 @@ #include "gpsmon.h" #if defined(SIRF_ENABLE) && defined(BINARY_ENABLE) -extern const struct gps_type_t sirf_binary; +extern const struct gps_type_t driver_sirf; static WINDOW *mid2win, *mid4win, *mid6win, *mid7win, *mid9win, *mid13win; static WINDOW *mid19win, *mid27win; @@ -584,14 +584,15 @@ static void sirf_update(void) /*@ +nullpass -nullderef @*/ #ifdef PPS_ENABLE - /* Not a CSD field, but there's no better place to put it */ + /*@-compdef@*/ + /*@-type@*/ /* splint is confused about struct timespec */ if (pps_thread_lastpps(&session, &drift) > 0) { - /*@-type@*/ /* splint is confused about struct timespec */ double timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9; - /*@+type@*/ display(mid7win, 2, 39, "%.9f", timedelta); /* PPS offset */ - wnoutrefresh(mid7win); + (void)wnoutrefresh(mid7win); } + /*@+type@*/ + /*@+compdef@*/ #endif /* PPS_ENABLE */ } @@ -687,7 +688,7 @@ const struct monitor_object_t sirf_mmt = { #endif /* CONTROLSEND_ENABLE */ .wrap = sirf_wrap, .min_y = 22,.min_x = 80, - .driver = &sirf_binary, + .driver = &driver_sirf, }; #endif /* defined(SIRF_ENABLE) && defined(BINARY_ENABLE) */ diff --git a/monitor_superstar2.c b/monitor_superstar2.c index d014d836..d5c55c52 100644 --- a/monitor_superstar2.c +++ b/monitor_superstar2.c @@ -8,7 +8,7 @@ #ifdef SUPERSTAR2_ENABLE #include "driver_superstar2.h" -extern const struct gps_type_t superstar2_binary; +extern const struct gps_type_t driver_superstar2; static WINDOW *satwin; static bool superstar2_initialize(void) @@ -99,6 +99,6 @@ const struct monitor_object_t superstar2_mmt = { .command = superstar2_command, .wrap = superstar2_wrap, .min_y = 23,.min_x = 80, /* size of the device window */ - .driver = &superstar2_binary, + .driver = &driver_superstar2, }; #endif diff --git a/monitor_tnt.c b/monitor_tnt.c index 5a6d1331..43855504 100644 --- a/monitor_tnt.c +++ b/monitor_tnt.c @@ -10,7 +10,7 @@ #include "gpsmon.h" #ifdef TNT_ENABLE -extern const struct gps_type_t trueNorth; +extern const struct gps_type_t driver_trueNorth; static WINDOW *thtmwin; @@ -101,7 +101,7 @@ const struct monitor_object_t tnt_mmt = { .command = tnt_command, .wrap = tnt_wrap, .min_y = 6,.min_x = 80, /* size of the device window */ - .driver = &trueNorth, + .driver = &driver_trueNorth, }; #endif /* TNT_ENABLE */ diff --git a/monitor_ubx.c b/monitor_ubx.c index 378339ef..cb71be20 100644 --- a/monitor_ubx.c +++ b/monitor_ubx.c @@ -11,7 +11,7 @@ #ifdef UBLOX_ENABLE #include "driver_ubx.h" -extern const struct gps_type_t ubx_binary; +extern const struct gps_type_t driver_ubx; static WINDOW *satwin, *navsolwin, *dopwin, *ppswin; #define display (void)mvwprintw @@ -280,6 +280,6 @@ const struct monitor_object_t ubx_mmt = { .command = ubx_command, .wrap = ubx_wrap, .min_y = 19,.min_x = 80, /* size of the device window */ - .driver = &ubx_binary, + .driver = &driver_ubx, }; #endif -- cgit v1.2.1