eive-obsw/mission/cfdp/CfdpFaultHandler.h
Robin Mueller 0854ec878b
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
added CFDP fault handler events
2023-10-19 11:27:21 +02:00

39 lines
1.7 KiB
C++

#ifndef MISSION_CFDP_CFDPFAULTHANDLER_H_
#define MISSION_CFDP_CFDPFAULTHANDLER_H_
#include "defs.h"
#include "fsfw/cfdp.h"
namespace cfdp {
class EiveFaultHandler : public cfdp::FaultHandlerBase, public SystemObject {
public:
EiveFaultHandler(object_id_t objectId) : SystemObject(objectId) {}
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;
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::NOTICE_OF_SUSPENSION, code);
}
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;
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::NOTICE_OF_CANCELLATION, code);
}
void abandonCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override {
sif::warning << "Transaction " << id
<< " was abandoned, condition code : " << cfdp::getConditionCodeString(code)
<< std::endl;
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::ABANDON_TRANSACTION, code);
}
void ignoreCb(cfdp::TransactionId& id, cfdp::ConditionCode code) override {
sif::warning << "Fault ignored for transaction " << id
<< ", condition code: " << cfdp::getConditionCodeString(code) << std::endl;
triggerEvent(cfdp::FAULT_HANDLER_TRIGGERED, FaultHandlerCode::IGNORE_ERROR, code);
}
};
} // namespace cfdp
#endif /* MISSION_CFDP_CFDPFAULTHANDLER_H_ */