fsfw/src/fsfw/datapool/HkSwitchHelper.h

45 lines
1.6 KiB
C
Raw Normal View History

#ifndef FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_
#define FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_
2021-07-13 20:22:54 +02:00
#include "fsfw/action/CommandsActionsIF.h"
#include "fsfw/events/EventReportingProxyIF.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/tasks/ExecutableObjectIF.h"
2022-02-02 10:29:30 +01:00
// TODO this class violations separation between mission and framework
// but it is only a transitional solution until the Datapool is
// implemented decentrally
2022-02-02 10:29:30 +01:00
class HkSwitchHelper : public ExecutableObjectIF, public CommandsActionsIF {
public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HK;
static const Event SWITCHING_TM_FAILED =
MAKE_EVENT(1, severity::LOW); //!< Commanding the HK Service failed, p1: error code, p2
//!< action: 0 disable / 1 enable
2022-02-02 10:29:30 +01:00
HkSwitchHelper(EventReportingProxyIF* eventProxy);
virtual ~HkSwitchHelper();
2022-02-02 10:29:30 +01:00
ReturnValue_t initialize();
2022-02-02 10:29:30 +01:00
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
2022-02-02 10:29:30 +01:00
ReturnValue_t switchHK(SerializeIF* sids, bool enable);
2022-02-02 10:29:30 +01:00
virtual void setTaskIF(PeriodicTaskIF* task_){};
2018-07-13 18:28:26 +02:00
2022-02-02 10:29:30 +01:00
protected:
virtual void stepSuccessfulReceived(ActionId_t actionId, uint8_t step);
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode);
virtual void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size);
virtual void completionSuccessfulReceived(ActionId_t actionId);
virtual void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode);
virtual MessageQueueIF* getCommandQueuePtr();
2022-02-02 10:29:30 +01:00
private:
CommandActionHelper commandActionHelper;
MessageQueueIF* actionQueue;
EventReportingProxyIF* eventProxy;
};
#endif /* FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_ */