2018-07-12 16:29:32 +02:00
|
|
|
#ifndef FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_
|
|
|
|
#define FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "../tasks/ExecutableObjectIF.h"
|
|
|
|
#include "../action/CommandsActionsIF.h"
|
|
|
|
#include "../events/EventReportingProxyIF.h"
|
2018-07-12 16:29:32 +02:00
|
|
|
|
|
|
|
//TODO this class violations separation between mission and framework
|
|
|
|
//but it is only a transitional solution until the Datapool is
|
|
|
|
//implemented decentrally
|
|
|
|
|
|
|
|
class HkSwitchHelper: public ExecutableObjectIF, public CommandsActionsIF {
|
|
|
|
public:
|
|
|
|
|
|
|
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HK;
|
2020-12-08 14:43:44 +01:00
|
|
|
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
|
2018-07-12 16:29:32 +02:00
|
|
|
|
|
|
|
HkSwitchHelper(EventReportingProxyIF *eventProxy);
|
|
|
|
virtual ~HkSwitchHelper();
|
|
|
|
|
|
|
|
ReturnValue_t initialize();
|
|
|
|
|
|
|
|
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
|
|
|
|
|
|
|
|
ReturnValue_t switchHK(SerializeIF *sids, bool enable);
|
|
|
|
|
2018-07-13 18:28:26 +02:00
|
|
|
virtual void setTaskIF(PeriodicTaskIF* task_){};
|
|
|
|
|
2018-07-12 16:29:32 +02: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();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CommandActionHelper commandActionHelper;
|
|
|
|
MessageQueueIF* actionQueue;
|
|
|
|
EventReportingProxyIF *eventProxy;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FRAMEWORK_DATAPOOL_HKSWITCHHELPER_H_ */
|