Merge remote-tracking branch 'origin/develop' into mueller/host-fixes-fsfw-update
This commit is contained in:
commit
e836ed8a2d
@ -304,18 +304,11 @@ target_include_directories(${WATCHDOG_NAME} PUBLIC
|
|||||||
#unittests
|
#unittests
|
||||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(EIVE_ADD_ETL_LIB)
|
|
||||||
# add_subdirectory(${LIB_ETL_PATH})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(EIVE_ADD_JSON_LIB)
|
if(EIVE_ADD_JSON_LIB)
|
||||||
add_subdirectory(${LIB_JSON_PATH})
|
add_subdirectory(${LIB_JSON_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(EIVE_ADD_LINUX_FILES)
|
if(EIVE_ADD_LINUX_FILES)
|
||||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||||
add_subdirectory(${LINUX_PATH})
|
add_subdirectory(${LINUX_PATH})
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 3d047f9629c3a6fe25514f92dd008bd34d0784dd
|
Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11
|
@ -1,5 +1,7 @@
|
|||||||
#include "GPSHyperionLinuxController.h"
|
#include "GPSHyperionLinuxController.h"
|
||||||
|
|
||||||
|
#include <fsfw/timemanager/Stopwatch.h>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "fsfw/FSFW.h"
|
#include "fsfw/FSFW.h"
|
||||||
#include "fsfw/datapool/PoolReadGuard.h"
|
#include "fsfw/datapool/PoolReadGuard.h"
|
||||||
@ -106,10 +108,10 @@ ReturnValue_t GPSHyperionLinuxController::handleCommandMessage(CommandMessage *m
|
|||||||
|
|
||||||
#ifdef FSFW_OSAL_LINUX
|
#ifdef FSFW_OSAL_LINUX
|
||||||
void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
||||||
gpsmm myGpsmm(GPSD_SHARED_MEMORY, nullptr);
|
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
|
||||||
// can set all field here
|
// can set all field here
|
||||||
if (not myGpsmm.is_open()) {
|
if (not gpsmm.is_open()) {
|
||||||
if (gpsNotOpenSwitch) {
|
if (gpsNotOpenSwitch) {
|
||||||
// Opening failed
|
// Opening failed
|
||||||
#if FSFW_VERBOSE_LEVEL >= 1
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
@ -121,8 +123,16 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Stopwatch watch;
|
||||||
gps_data_t *gps = nullptr;
|
gps_data_t *gps = nullptr;
|
||||||
gps = myGpsmm.read();
|
gps = gpsmm.stream(WATCH_ENABLE | WATCH_JSON);
|
||||||
|
if (gps == nullptr) {
|
||||||
|
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd:: Setting GPSD watch "
|
||||||
|
"policy failed"
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
|
while (gpsmm.waiting(2000)) {
|
||||||
|
gps = gpsmm.read();
|
||||||
if (gps == nullptr) {
|
if (gps == nullptr) {
|
||||||
if (gpsReadFailedSwitch) {
|
if (gpsReadFailedSwitch) {
|
||||||
gpsReadFailedSwitch = false;
|
gpsReadFailedSwitch = false;
|
||||||
@ -131,6 +141,23 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (MODE_SET != (MODE_SET & gps->set)) {
|
||||||
|
if (noModeSetCntr >= 0) {
|
||||||
|
noModeSetCntr++;
|
||||||
|
}
|
||||||
|
if (noModeSetCntr == 10) {
|
||||||
|
// TODO: Trigger event here
|
||||||
|
sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be "
|
||||||
|
"read for 10 consecutive reads"
|
||||||
|
<< std::endl;
|
||||||
|
noModeSetCntr = -1;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
noModeSetCntr = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gps = gpsmm.stream(WATCH_DISABLE);
|
||||||
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
|
||||||
|
@ -55,6 +55,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
|
|||||||
bool gpsNotOpenSwitch = true;
|
bool gpsNotOpenSwitch = true;
|
||||||
bool gpsReadFailedSwitch = true;
|
bool gpsReadFailedSwitch = true;
|
||||||
bool debugHyperionGps = false;
|
bool debugHyperionGps = false;
|
||||||
|
int32_t noModeSetCntr = 0;
|
||||||
uint32_t timeIsConstantCounter = 0;
|
uint32_t timeIsConstantCounter = 0;
|
||||||
Countdown timeUpdateCd = Countdown(60);
|
Countdown timeUpdateCd = Countdown(60);
|
||||||
|
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf
|
Subproject commit 76da8042a4601087e99fa856af241afe9e43695d
|
Loading…
Reference in New Issue
Block a user