eive-obsw/linux/utility/utility.cpp
Robin Mueller 8161d1cd88
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
finished update cmd impl
2022-09-26 12:26:08 +02:00

28 lines
696 B
C++

#include "utility.h"
#include <cstring>
#include "FSFWConfig.h"
#include "OBSWConfig.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/timemanager/Clock.h"
void utility::handleSystemError(int retcode, std::string context) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::warning << context << ": System call failed with code " << retcode << ": "
<< 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;
}