summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2009-11-17 19:59:37 +0000
committerGary E. Miller <gem@rellim.com>2009-11-17 19:59:37 +0000
commitadf6a6c2f107e95e9691ebd47925f2a8f0733630 (patch)
tree6c5103537b2376665cd0c86eca439d85e7f8390e /drivers.c
parent9c9497981cc554c218d55ed15aae9217b9a159b9 (diff)
downloadgpsd-adf6a6c2f107e95e9691ebd47925f2a8f0733630.tar.gz
Make 'gpsctl -b' work for SiRF binary.
Very ugly, proof of concept. Gimmme another patch or two before cleaning it up.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers.c b/drivers.c
index c64b139d..7755489c 100644
--- a/drivers.c
+++ b/drivers.c
@@ -214,6 +214,20 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
}
}
+#ifdef ALLOW_RECONFIGURE
+#if defined(SIRF_ENABLE) && defined(BINARY_ENABLE)
+extern void sirfbin_mode(struct gps_device_t *, int);
+#endif
+static void nmea_mode_switch(struct gps_device_t *session, int mode)
+{
+ if (mode == MODE_BINARY) {
+#if defined(SIRF_ENABLE) && defined(BINARY_ENABLE)
+ sirfbin_mode(session, mode);
+#endif
+ }
+}
+#endif ALLOW_RECONFIGURE
+
const struct gps_type_t nmea = {
.type_name = "Generic NMEA", /* full name of type */
.packet_type = NMEA_PACKET, /* associated lexer packet type */
@@ -226,7 +240,7 @@ const struct gps_type_t nmea = {
.event_hook = nmea_event_hook, /* lifetime event handler */
#ifdef ALLOW_RECONFIGURE
.speed_switcher = NULL, /* no speed switcher */
- .mode_switcher = NULL, /* no mode switcher */
+ .mode_switcher = nmea_mode_switch, /* no mode switcher */
.rate_switcher = NULL, /* no sample-rate switcher */
.min_cycle = 1, /* not relevant, no rate switch */
#endif /* ALLOW_RECONFIGURE */
@@ -235,6 +249,7 @@ const struct gps_type_t nmea = {
#endif /* ALLOW_CONTROLSEND */
};
+
#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
/**************************************************************************
*