summaryrefslogtreecommitdiff
path: root/driver_navcom.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-13 03:30:05 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-13 03:30:05 +0000
commit00cd07ffcaa670709bc492e01d5c97be0262580b (patch)
tree4f21deae21586a533b279d272d74af3a0899b5e1 /driver_navcom.c
parentbff151b7897e75612f871d44087c6f90cf412b52 (diff)
downloadgpsd-00cd07ffcaa670709bc492e01d5c97be0262580b.tar.gz
Merge the configurator and probe_subtype methods.
They're now distinguished by an event argument passed to the common hook function. This is a refactoring step - later, we'll define more and different events for finer-grained control. All regression tests pass.
Diffstat (limited to 'driver_navcom.c')
-rw-r--r--driver_navcom.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/driver_navcom.c b/driver_navcom.c
index 7bb9a432..51f0aa61 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -186,10 +186,11 @@ static void navcom_cmd_0x11(struct gps_device_t *session, u_int8_t port_selectio
}
#endif /* ALLOW_RECONFIGURE */
-static void navcom_probe_subtype(struct gps_device_t *session, unsigned int seq)
+static void navcom_configurator(struct gps_device_t *session,
+ event_t event, unsigned int seq)
{
/* Request the following messages: */
- if (seq==0) {
+ if (event == event_probe_subtype && seq==0) {
/*@ +charint @*/
navcom_cmd_0x1c(session, 0x01, 5); /* Blink LEDs on receiver */
navcom_cmd_0x20(session, 0xae, 0x1770); /* Identification Block - send every 10 min*/
@@ -1269,7 +1270,6 @@ const struct gps_type_t navcom_binary =
.channels = NAVCOM_CHANNELS, /* 12 L1 + 12 L2 + 2 Inmarsat L-Band */
.probe_wakeup = navcom_ping, /* wakeup to be done before hunt */
.probe_detect = NULL, /* no probe */
- .probe_subtype = navcom_probe_subtype, /* subtype probing */
.get_packet = generic_get, /* use generic one */
.parse_packet = navcom_parse_input, /* parse message packets */
.rtcm_writer = pass_rtcm, /* send RTCM data straight */
@@ -1277,7 +1277,7 @@ const struct gps_type_t navcom_binary =
.control_send = navcom_control_send, /* how to send a control string */
#endif /* ALLOW_CONTROLSEND */
#ifdef ALLOW_RECONFIGURE
- .configurator = NULL, /* no reconfigure */
+ .configurator = navcom_configurator, /* configuration logic */
.speed_switcher = navcom_speed, /* we do change baud rates */
.mode_switcher = NULL, /* there is not a mode switcher */
.rate_switcher = NULL, /* no sample-rate switcher */