diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2004-09-27 17:27:58 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2004-09-27 17:27:58 +0000 |
commit | 520091529604f54d5301e5f4e844abeacdaf71cf (patch) | |
tree | 20d36eb0d0d3a21d181f6001ca5fab1cb5326d56 | |
parent | 2aafc68349d0ff5660bd05ed41555e1be46e6894 (diff) | |
download | gpsd-520091529604f54d5301e5f4e844abeacdaf71cf.tar.gz |
Cindition out more code if non-NMEA devices aren't supported.
-rw-r--r-- | libgpsd_core.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index c16bc3c1..2a4c6acf 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -13,6 +13,7 @@ #include "gps.h" #include "gpsd.h" +#ifdef NON_NMEA_ENABLE static struct gps_type_t *set_device_type(char what) /* select a device driver by key letter */ { @@ -26,6 +27,7 @@ static struct gps_type_t *set_device_type(char what) foundit:; return *dp; } +#endif /* NON_NMEA_ENABLE */ struct gps_session_t *gpsd_init(char devicetype, char *dgpsserver) /* initialize GPS polling */ @@ -40,15 +42,15 @@ struct gps_session_t *gpsd_init(char devicetype, char *dgpsserver) session->gpsd_device = "/dev/gps"; session->device_type = gpsd_drivers[0]; +#ifdef NON_NMEA_ENABLE devtype = set_device_type(devicetype); if (!devtype) gpsd_report(1, "invalid GPS type \"%s\", using NMEA instead\n", devicetype); else - { session->device_type = devtype; - session->baudrate = devtype->baudrate; - } +#endif /* NON_NMEA_ENABLE */ + session->baudrate = session->device_type->baudrate; session->dsock = -1; if (dgpsserver) { char hn[256], buf[BUFSIZE]; |