bugfixes and improvements
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

- Tests finished
This commit is contained in:
2022-04-08 11:22:16 +02:00
parent 45007d726d
commit 4a6840f098
12 changed files with 144 additions and 118 deletions

View File

@ -1,3 +1,4 @@
#include "utility.h"
#include <cstring>
@ -5,6 +6,7 @@
#include "FSFWConfig.h"
#include "OBSWConfig.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/timemanager/Clock.h"
void utility::handleSystemError(int retcode, std::string function) {
#if OBSW_VERBOSE_LEVEL >= 1
@ -12,3 +14,14 @@ void utility::handleSystemError(int retcode, std::string function) {
<< strerror(retcode) << std::endl;
#endif
}
bool utility::timeSanityCheck() {
timeval currentTime = {};
Clock::getUptime(&currentTime);
Clock::TimeOfDay_t currTimeOfDay = {};
Clock::convertTimevalToTimeOfDay(&currentTime, &currTimeOfDay);
if (currTimeOfDay.year == 2000) {
return false;
}
return true;
}

View File

@ -9,6 +9,8 @@ namespace utility {
void handleSystemError(int retcode, std::string function);
}
bool timeSanityCheck();
} // namespace utility
#endif /* LINUX_UTILITY_UTILITY_H_ */