summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-26 15:55:43 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-26 15:55:43 +0000
commitd74df4d29521580f858e81f62a805798ca009d95 (patch)
tree8e49b87a1843f2a6b3ddcbca99480efffa1fa5ea /serial.c
parente8662124d6e16f064968a6223a1be1c41e79a0ba (diff)
downloadgpsd-d74df4d29521580f858e81f62a805798ca009d95.tar.gz
Add a new capability to the generic driver structure: wakeup...
...a function to be called just after the autobaud hunt sets the line speed each time. Use this to get rid of the internal baud hunt loop in the True North driver; instead, the ID query and rate-setting strings will be sent by the wakeup hook. Note: this patch is untested. I'm pretty certain it will work, but somebody needs to try it on live hardware.
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/serial.c b/serial.c
index fae63d0c..c041d23f 100644
--- a/serial.c
+++ b/serial.c
@@ -223,6 +223,8 @@ int gpsd_open(struct gps_device_t *session)
session->baudindex = 0;
gpsd_set_speed(session,
gpsd_get_speed(&session->ttyset_old), 'N', 1);
+ if (session->device_type->wakeup != NULL)
+ session->device_type->wakeup(session);
}
return session->gpsdata.gps_fd;
}
@@ -269,6 +271,8 @@ bool gpsd_next_hunt_setting(struct gps_device_t *session)
gpsd_set_speed(session,
rates[session->baudindex],
'N', session->gpsdata.stopbits);
+ if (session->device_type->wakeup != NULL)
+ session->device_type->wakeup(session);
}
return true; /* keep hunting */