watchdog handling finished

This commit is contained in:
2021-07-29 16:31:04 +02:00
parent 983ce045a9
commit ff86c8af73
8 changed files with 179 additions and 45 deletions

View File

@ -15,9 +15,11 @@ public:
enum class LoopResult {
OK,
SUSPEND_RQ,
CANCEL_RQ,
RESTART_RQ,
TIMEOUT
TIMEOUT,
FAULT
};
WatchdogTask();
@ -28,10 +30,17 @@ public:
private:
int fd = 0;
bool obswRunning = false;
bool watchdogRunning = false;
std::array<uint8_t, 64> buf;
States state = States::NOT_STARTED;
LoopResult watchdogLoop();
LoopResult pollEvent(struct pollfd& waiter);
LoopResult parseCommandByte(ssize_t readLen);
int performRunningOperation();
int performTimeoutOperation();
};
#endif /* WATCHDOG_WATCHDOG_H_ */