squashed EIVE software
This commit is contained in:
1 parent
eced94f335
commit
996aa72fb4
823 files changed
+115952
-2
No files matched your search
@@ -0,0 +1,34 @@
|
||||
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "Watchdog.h"
|
||||
#include "definitions.h"
|
||||
|
||||
/**
|
||||
* @brief This watchdog application uses a FIFO to check whether the OBSW is still running.
|
||||
* It checks whether the OBSW writes to the the FIFO regularly.
|
||||
*/
|
||||
int main() {
|
||||
std::cout << "Starting OBSW watchdog" << std::endl;
|
||||
std::error_code e;
|
||||
if (std::filesystem::exists(watchdog::RUNNING_FILE_NAME, e)) {
|
||||
std::cout << "Removing " << watchdog::RUNNING_FILE_NAME << std::endl;
|
||||
int result = std::remove(watchdog::RUNNING_FILE_NAME.c_str());
|
||||
if (result != 0) {
|
||||
std::cerr << "file removal failure" << std::endl;
|
||||
}
|
||||
}
|
||||
try {
|
||||
WatchdogTask watchdogTask;
|
||||
int result = watchdogTask.performOperation();
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
} catch (const std::runtime_error& e) {
|
||||
std::cerr << "Run time exception " << e.what() << std::endl;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user