39 lines
1.7 KiB
C++
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_ */
|