summaryrefslogtreecommitdiff
path: root/truenorth.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-26 17:31:15 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-26 17:31:15 +0000
commit8c4c1b38e7db2adc24528912d20486d386764327 (patch)
tree2b7e4d0a8acd1617eacaabab0fd15283857f3fcd /truenorth.c
parent0ad0dbab0d5a5b0d52bdcd1998a71b7eb924a5e3 (diff)
downloadgpsd-8c4c1b38e7db2adc24528912d20486d386764327.tar.gz
OK, I'm slow today.
If we don't already know the type of a device, we have to send it *every* driver's wakeups on a baud-rate change. This does, basically, the same thing the old probe function in the TrueNorth driver did since at the moment only that driver has a wakeup. Also, move the send so it gets done when we change baud rates without closing the device.
Diffstat (limited to 'truenorth.c')
-rw-r--r--truenorth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/truenorth.c b/truenorth.c
index 3af9f31f..167920d4 100644
--- a/truenorth.c
+++ b/truenorth.c
@@ -16,11 +16,16 @@
/*
* The True North compass won't start talking unless you ask it to. To
* wake it up, we query for its ID string just after each speed change
- * in the autobaud hunt. Then we send codes to start the flow of data.
+ * in the autobaud hunt. The initializer will send it codes to start
+ * the flow of data.
*/
static void tnt_wakeup(struct gps_device_t *session)
{
(void)nmea_send(session->gpsdata.gps_fd, "@X?");
+}
+
+static void tnt_initializer(struct gps_device_t *session)
+{
//nmea_send(session->gpsdata.gps_fd, "@BA?"); // Query current rate
//nmea_send(session->gpsdata.gps_fd, "@BA=8"); // Start HTM packet at 1Hz
/*
@@ -38,7 +43,7 @@ struct gps_type_t trueNorth = {
.channels = 0, /* not an actual GPS at all */
.wakeup = tnt_wakeup, /* wakeup by sending ID query */
.probe = NULL, /* no probe */
- .initializer = NULL, /* no initializer */
+ .initializer = tnt_initializer, /* no initializer */
.get_packet = packet_get, /* how to get a packet */
.parse_packet = nmea_parse_input, /* how to interpret a packet */
.rtcm_writer = NULL, /* Don't send */