2021-07-29 11:35:20 +02:00
|
|
|
#include "Watchdog.h"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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() {
|
2021-07-29 11:59:32 +02:00
|
|
|
std::cout << "eive-watchdog: Starting OBSW watchdog.." << std::endl;
|
|
|
|
try {
|
|
|
|
WatchdogTask watchdogTask;
|
2021-07-29 18:33:15 +02:00
|
|
|
int result = watchdogTask.performOperation();
|
|
|
|
if(result != 0) {
|
|
|
|
return result;
|
|
|
|
}
|
2021-07-29 11:59:32 +02:00
|
|
|
}
|
|
|
|
catch(const std::runtime_error& e) {
|
|
|
|
std::cerr << "eive-watchdog: Run time exception " << e.what() << std::endl;
|
2021-07-29 18:32:02 +02:00
|
|
|
return -1;
|
2021-07-29 11:59:32 +02:00
|
|
|
}
|
2021-07-29 11:35:20 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|