big gps victory
This commit is contained in:
parent
ff6cb2a2e3
commit
8441c49fe6
@ -166,29 +166,32 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() {
|
|||||||
if (mode == MODE_OFF) {
|
if (mode == MODE_OFF) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
unsigned int readIdx = 0;
|
||||||
if (readMode == ReadModes::SOCKET) {
|
if (readMode == ReadModes::SOCKET) {
|
||||||
// Poll the GPS.
|
// Poll the GPS.
|
||||||
if (gps_waiting(&gps, 0)) {
|
while (gps_waiting(&gps, 0)) {
|
||||||
int retval = gps_read(&gps);
|
int retval = gps_read(&gps);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
readError();
|
readError();
|
||||||
return false;
|
return false;
|
||||||
} else if (retval == 0) {
|
}
|
||||||
|
readIdx++;
|
||||||
|
if (readIdx >= 40) {
|
||||||
|
sif::warning << "GpsHyperionLinuxController: Received " << readIdx
|
||||||
|
<< " GPSD message consecutively" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (readIdx > 0) {
|
||||||
oneShotSwitches.gpsReadFailedSwitch = true;
|
oneShotSwitches.gpsReadFailedSwitch = true;
|
||||||
ReturnValue_t result = handleGpsReadData();
|
handleGpsReadData();
|
||||||
if (result != returnvalue::OK) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else if (readMode == ReadModes::SHM) {
|
} else if (readMode == ReadModes::SHM) {
|
||||||
sif::error << "GpsHyperionLinuxController::readGpsDataFromGpsdPermanentLoop: "
|
sif::error << "GpsHyperionLinuxController::readGpsDataFromGpsdPermanentLoop: "
|
||||||
"SHM read not implemented"
|
"SHM read not implemented"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
||||||
|
Loading…
Reference in New Issue
Block a user