Some GPS updates #369

Merged
muellerr merged 12 commits from some_more_gps_updates into develop 2023-02-08 13:04:46 +01:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit b2de4ee08c - Show all commits

View File

@ -45,7 +45,10 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_
if (mode == MODE_OFF) {
PoolReadGuard pg(&gpsSet);
gpsSet.setValidity(false, true);
// There can't be a fix with a device that is off.
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, 0);
oneShotSwitches.reset();
modeCommanded = false;
}
return returnvalue::OK;
}
@ -102,6 +105,7 @@ ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) {
if (not callAgainImmediately) {
handleQueue();
poolManager.performHkOperation();
TaskFactory::delayTask(250);
}
}
// Should never be reached.
@ -152,9 +156,13 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() {
<< errno << " | " << gps_errstr(errno) << std::endl;
}
};
// GPS is off, no point in reading data from GPSD.
if(mode == MODE_OFF) {
return false;
}
if (readMode == ReadModes::SOCKET) {
// Perform other necessary handling if not data seen for 0.2 seconds.
if (gps_waiting(&gps, 200000)) {
if (gps_waiting(&gps, 0)) {
if (-1 == gps_read(&gps)) {
readError();
return false;
@ -212,7 +220,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
modeCommanded = false;
}
gpsSet.setValidity(false, true);
} else if (gps.satellites_used > 0 && validFix) {
} else if (gps.satellites_used > 0 && validFix && mode != MODE_OFF) {
gpsSet.setValidity(true, true);
}

2
tmtc

@ -1 +1 @@
Subproject commit d6445d38a8eb644a5e1bd27f0fc56d29e93c030d
Subproject commit 8a96e21d1a1ca790cd1053594495dd74beb12133