diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 900de0aa..afa73f77 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -169,18 +169,17 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { if (readMode == ReadModes::SOCKET) { // Poll the GPS. if (gps_waiting(&gps, 0)) { - if (-1 == gps_read(&gps)) { + int retval = gps_read(&gps); + if (retval < 0) { readError(); return false; + } else if (retval == 0) { + oneShotSwitches.gpsReadFailedSwitch = true; + ReturnValue_t result = handleGpsReadData(); + if (result != returnvalue::OK) { + return false; + } } - oneShotSwitches.gpsReadFailedSwitch = true; - ReturnValue_t result = handleGpsReadData(); - if (result == returnvalue::OK) { - return true; - } else { - return false; - } - noModeSetCntr = 0; } else { return false; } diff --git a/linux/acs/GpsHyperionLinuxController.h b/linux/acs/GpsHyperionLinuxController.h index d5b1f637..5a8494dd 100644 --- a/linux/acs/GpsHyperionLinuxController.h +++ b/linux/acs/GpsHyperionLinuxController.h @@ -81,7 +81,6 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { } oneShotSwitches; bool debugHyperionGps = false; - int32_t noModeSetCntr = 0; // Returns true if the function should be called again or false if other // controller handling can be done.