diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-09 23:50:33 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-09 23:50:33 -0400 |
commit | f46a379b6c3e70b13f9c34eb5b182ad41370cbdc (patch) | |
tree | b16dece5024164506d3a5ea7c8e174c03e9dc58d /gpsctl.c | |
parent | b997850f8a5e0b8abdfa873272c9ab72b0fb274e (diff) | |
download | gpsd-f46a379b6c3e70b13f9c34eb5b182ad41370cbdc.tar.gz |
Add some new mechanism.
Diffstat (limited to 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -62,6 +62,13 @@ static void settle(struct gps_device_t *session) (void)tcdrain(session->gpsdata.gps_fd); } +/* + * Allows any response other than ERROR. Use it for queries where a + * failure return (due to, for example, a missing driver method) is + * immediate, but successful responses have unpredictable lag. + */ +#define NON_ERROR 0 /* must be distinct from any gps_mask_t value */ + static bool gps_query(/*@out@*/struct gps_data_t *gpsdata, gps_mask_t expect, const int timeout, @@ -131,7 +138,7 @@ static bool gps_query(/*@out@*/struct gps_data_t *gpsdata, } /*@ +ignorequals @*/ - if ((expect & gpsdata->set) != 0) + if ((expect == NON_ERROR) || (expect & gpsdata->set) != 0) return true; else if (time(NULL) - starttime > timeout) { gpsd_report(context.debug, LOG_ERROR, |