fsfw/action/CommandsActionsIF.h

38 lines
1.3 KiB
C
Raw Normal View History

2020-11-02 15:51:52 +01:00
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
2020-08-13 20:53:35 +02:00
#include "CommandActionHelper.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueIF.h"
/**
* Interface to separate commanding actions of other objects.
* In next iteration, IF should be shortened to three calls:
* - dataReceived(data)
* - successReceived(id, step)
* - failureReceived(id, step, cause)
* or even
* - replyReceived(id, step, cause) (if cause == OK, it's a success).
*/
class CommandsActionsIF {
friend class CommandActionHelper;
public:
static const uint8_t INTERFACE_ID = CLASS_ID::COMMANDS_ACTIONS_IF;
static const ReturnValue_t OBJECT_HAS_NO_FUNCTIONS = MAKE_RETURN_CODE(1);
static const ReturnValue_t ALREADY_COMMANDING = MAKE_RETURN_CODE(2);
virtual ~CommandsActionsIF() {}
virtual MessageQueueIF* getCommandQueuePtr() = 0;
protected:
virtual void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) = 0;
2020-11-02 15:51:52 +01:00
virtual void stepFailedReceived(ActionId_t actionId, uint8_t step,
ReturnValue_t returnCode) = 0;
virtual void dataReceived(ActionId_t actionId, const uint8_t* data,
uint32_t size) = 0;
virtual void completionSuccessfulReceived(ActionId_t actionId) = 0;
2020-11-02 15:51:52 +01:00
virtual void completionFailedReceived(ActionId_t actionId,
ReturnValue_t returnCode) = 0;
};
2020-11-02 15:51:52 +01:00
#endif /* FSFW_ACTION_COMMANDSACTIONSIF_H_ */