summaryrefslogtreecommitdiff
path: root/driver_proto.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-30 11:02:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-30 11:02:16 +0000
commitf6519ca132b92c29874b40079ca1f5d07ecd0676 (patch)
tree011cc2685be175c35f7664bacb35e2d44f9faaaa /driver_proto.c
parenta94d50c111df0d6ac9947e12980eddd9a116fde4 (diff)
downloadgpsd-f6519ca132b92c29874b40079ca1f5d07ecd0676.tar.gz
Split the "initializer" driver method in two.
There is now a new method, "configurator". The initializer method probes the driver for subtype information (such as a firmware rev) without changing any device settings. The configurator method does things like selecting which packets should send. At the moment, these two methods are always called in tandem, so there has been effectively no change in behavior. Soon, though, gpsctrl will call the initializer method but *not* the configurator.
Diffstat (limited to 'driver_proto.c')
-rw-r--r--driver_proto.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/driver_proto.c b/driver_proto.c
index fdb14a6a..d90673d3 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -106,7 +106,11 @@ static void proto_mode(struct gps_device_t *session, int mode)
}
static void proto_initializer(struct gps_device_t *session)
-/* poll for software version in order to check for old firmware */
+{
+ /* probe for subtypes here */
+}
+
+static void proto_configurator(struct gps_device_t *session)
{
if (session->packet_type == NMEA_PACKET)
(void)proto_set_mode(session, session->gpsdata.baudrate, true);
@@ -121,6 +125,7 @@ struct gps_type_t proto_binary =
.probe = NULL, /* no probe */
.wakeup = NULL, /* no wakeup to be done before hunt */
.initializer = proto_initializer,/* initialize the device */
+ .configurator = proto_configurator,/* configure the proper sentences */
.get_packet = packet_get, /* use generic packet getter */
.parse_packet = proto_parse_input,/* parse message packets */
.rtcm_writer = pass_rtcm, /* send RTCM data straight */