Init Commit
This commit is contained in:
commit
7852b88e6a
821 files changed
+115954
No files matched your search
@@ -0,0 +1 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC utility.cpp)
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
#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(¤tTime);
|
||||
Clock::TimeOfDay_t currTimeOfDay = {};
|
||||
Clock::convertTimevalToTimeOfDay(¤tTime, &currTimeOfDay);
|
||||
if (currTimeOfDay.year == 2000) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef LINUX_UTILITY_UTILITY_H_
|
||||
#define LINUX_UTILITY_UTILITY_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
|
||||
namespace utility {
|
||||
|
||||
void handleSystemError(int retcode, std::string function);
|
||||
|
||||
bool timeSanityCheck();
|
||||
|
||||
} // namespace utility
|
||||
|
||||
#endif /* LINUX_UTILITY_UTILITY_H_ */
|
||||
Reference in new issue
Block a user