v1.11.0 #243

Merged
muellerr merged 159 commits from develop into main 2022-05-04 17:19:57 +02:00
4 changed files with 37 additions and 33 deletions
Showing only changes of commit c1d754d8ff - Show all commits

2
fsfw

@ -1 +1 @@
Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 Subproject commit 7f6c8b8b123a63546de0d73f0de35900d6c806bf

View File

@ -107,6 +107,7 @@ ReturnValue_t GPSHyperionLinuxController::handleCommandMessage(CommandMessage *m
} }
#ifdef FSFW_OSAL_LINUX #ifdef FSFW_OSAL_LINUX
void GPSHyperionLinuxController::readGpsDataFromGpsd() { void GPSHyperionLinuxController::readGpsDataFromGpsd() {
gpsmm gpsmm("localhost", DEFAULT_GPSD_PORT); gpsmm gpsmm("localhost", DEFAULT_GPSD_PORT);
// The data from the device will generally be read all at once. Therefore, we // The data from the device will generally be read all at once. Therefore, we
@ -125,13 +126,10 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
} }
// Stopwatch watch; // Stopwatch watch;
gps_data_t *gps = nullptr; gps_data_t *gps = nullptr;
gps = gpsmm.stream(WATCH_ENABLE | WATCH_JSON); gpsmm.stream(WATCH_ENABLE | WATCH_JSON);
if (gps == nullptr) { if(not gpsmm.waiting(50000000)) {
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd:: Setting GPSD watch " return;
"policy failed"
<< std::endl;
} }
while (gpsmm.waiting(2000)) {
gps = gpsmm.read(); gps = gpsmm.read();
if (gps == nullptr) { if (gps == nullptr) {
if (gpsReadFailedSwitch) { if (gpsReadFailedSwitch) {
@ -156,14 +154,17 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
} else { } else {
noModeSetCntr = 0; noModeSetCntr = 0;
} }
handleGpsRead(gps);
} }
gps = gpsmm.stream(WATCH_DISABLE);
ReturnValue_t GPSHyperionLinuxController::handleGpsRead(gps_data_t* gps) {
PoolReadGuard pg(&gpsSet); PoolReadGuard pg(&gpsSet);
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_VERBOSE_LEVEL >= 1 #if FSFW_VERBOSE_LEVEL >= 1
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading dataset failed" << std::endl; sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading dataset failed" << std::endl;
#endif #endif
return; return RETURN_FAILED;
} }
bool validFix = false; bool validFix = false;
@ -292,5 +293,7 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
std::tm tm = *std::gmtime(&t); std::tm tm = *std::gmtime(&t);
std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl; std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl;
} }
return RETURN_OK;
} }
#endif #endif

View File

@ -47,6 +47,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override; LocalDataPoolManager& poolManager) override;
ReturnValue_t handleGpsRead(gps_data_t* gps);
private: private:
GpsPrimaryDataset gpsSet; GpsPrimaryDataset gpsSet;
Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000);

2
tmtc

@ -1 +1 @@
Subproject commit 168b662288175f9db77a5796a02f38cb66911092 Subproject commit 0a47c17fa699dc571d2d3e63ec08c9f4cf513f65