eive-obsw/mission/cfdp/CfdpFaultHandler.h

39 lines
1.7 KiB
C
Raw Normal View History

2023-08-16 11:38:00 +02:00
#ifndef MISSION_CFDP_CFDPFAULTHANDLER_H_
#define MISSION_CFDP_CFDPFAULTHANDLER_H_
2023-10-19 11:27:21 +02:00
#include "defs.h"
2023-08-16 11:38:00 +02:00
#include "fsfw/cfdp.h"
namespace cfdp {
2023-10-19 11:27:21 +02:00
class EiveFaultHandler : public cfdp::FaultHandlerBase, public SystemObject {
2023-08-16 11:38:00 +02:00
public:
2023-10-19 11:27:21 +02:00
EiveFaultHandler(object_id_t objectId) : SystemObject(objectId) {}
2023-08-16 11:38:00 +02:00
void noticeOfSuspensionCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override {
sif::warning << "Notice of suspension detected for transaction " << id
<< " with condition code: " << cfdp::getConditionCodeString(code) << std::endl;
2023-10-19 11:27:21 +02:00
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::NOTICE_OF_SUSPENSION, code);
2023-08-16 11:38:00 +02:00
}
void noticeOfCancellationCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override {
sif::warning << "Notice of suspension detected for transaction " << id
<< " with condition code: " << cfdp::getConditionCodeString(code) << std::endl;
2023-10-19 11:27:21 +02:00
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::NOTICE_OF_CANCELLATION, code);
2023-08-16 11:38:00 +02:00
}
void abandonCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override {
sif::warning << "Transaction " << id
<< " was abandoned, condition code : " << cfdp::getConditionCodeString(code)
<< std::endl;
2023-10-19 11:27:21 +02:00
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::ABANDON_TRANSACTION, code);
2023-08-16 11:38:00 +02:00
}
void ignoreCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override {
sif::warning << "Fault ignored for transaction " << id
<< ", condition code: " << cfdp::getConditionCodeString(code) << std::endl;
2023-10-19 11:27:21 +02:00
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::IGNORE_ERROR, code);
2023-08-16 11:38:00 +02:00
}
};
} // namespace cfdp
#endif /* MISSION_CFDP_CFDPFAULTHANDLER_H_ */