Skip to content

Commit

Permalink
Add conditionnals to detect gpsd API version (indilib#188)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc-Olivier Barre <marc-olivier.barre@intercloud.com>
  • Loading branch information
2 people authored and lboclboc committed Sep 13, 2020
1 parent 98e1d4b commit 72f7e4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion indi-gpsd/gps_driver.cpp
Expand Up @@ -214,6 +214,9 @@ IPState GPSD::updateGPS()
IDSetSwitch(&RefreshSP, nullptr);
}

#if GPSD_API_MAJOR_VERSION >= 10
struct gps_fix_t *gpsFix;
#endif
struct gps_data_t *gpsData;
time_t raw_time;

Expand Down Expand Up @@ -279,8 +282,11 @@ IPState GPSD::updateGPS()
break;
}


#if GPSD_API_MAJOR_VERSION >= 10
if (gpsFix->status == STATUS_NO_FIX)
#else
if (gpsData->status == STATUS_NO_FIX)
#endif
{
// We have no fix and there is no point in further processing.
IUSaveText(&GPSstatusT[0], "NO FIX");
Expand Down

0 comments on commit 72f7e4c

Please sign in to comment.