From b97604d7d25849c3ecbb2e5eb799454830476995 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 15:36:56 +0200 Subject: [PATCH] override event confirmed as well --- mission/system/fdir/SyrlinksFdir.cpp | 20 ++++++++++++++++++++ mission/system/fdir/SyrlinksFdir.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mission/system/fdir/SyrlinksFdir.cpp b/mission/system/fdir/SyrlinksFdir.cpp index 27e17293..c35427db 100644 --- a/mission/system/fdir/SyrlinksFdir.cpp +++ b/mission/system/fdir/SyrlinksFdir.cpp @@ -106,3 +106,23 @@ ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { } return RETURN_OK; } + +void SyrlinksFdir::eventConfirmed(EventMessage* event) { + switch (event->getEvent()) { + case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED: + case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED: + case DeviceHandlerIF::DEVICE_MISSED_REPLY: + if (missedReplyCount.incrementAndCheck()) { + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + } + break; + case PowerSwitchIF::SWITCH_WENT_OFF: + // This means the switch went off only for one device. + // handleRecovery(event->getEvent()); + triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + break; + default: + break; + } +} diff --git a/mission/system/fdir/SyrlinksFdir.h b/mission/system/fdir/SyrlinksFdir.h index 79480924..e56714e9 100644 --- a/mission/system/fdir/SyrlinksFdir.h +++ b/mission/system/fdir/SyrlinksFdir.h @@ -8,7 +8,8 @@ class SyrlinksFdir : public DeviceHandlerFailureIsolation { SyrlinksFdir(object_id_t syrlinksId); private: - ReturnValue_t eventReceived(EventMessage* event); + ReturnValue_t eventReceived(EventMessage* event) override; + void eventConfirmed(EventMessage* event) override; }; #endif /* MISSION_DEVICES_SYRLINKSFDIR_H_ */