~foxtrotgps-team/foxtrotgps/trunk

« back to all changes in this revision

Viewing changes to src/gps_functions.c

  • Committer: Paul Wise
  • Author(s): Charles Curley
  • Date: 2019-02-27 01:45:28 UTC
  • Revision ID: pabs3@bonedaddy.net-20190227014528-44mjwq25ls853nrx
Update the interface to gps_read() for gpsd API version 7

This change is available in gpsd version 3.18 and later.

Kept deprecated code for users of older versions by using a version check.

See-also: http://catb.org/gpsd/libgps.html

Show diffs side-by-side

added added

removed removed

Lines of Context:
738
738
        if (!libgps_initialized)
739
739
                return FALSE;
740
740
 
 
741
#if GPSD_API_MAJOR_VERSION >= 7 /* API change. gpsd version 3.18 and subsequent. */
 
742
        ret = gps_read(&libgps_gpsdata, NULL, 0);
 
743
#else
741
744
        ret = gps_read(&libgps_gpsdata);
 
745
#endif
742
746
        /* Note that gps_read() will never actually return 0
743
747
           (zero-length reads are converted internally to a -1 return,
744
748
            since they mean that the connection to the daemon has closed),