2020-11-02 15:51:52 +01:00
|
|
|
#ifndef FSFW_ACTION_COMMANDSACTIONSIF_H_
|
|
|
|
#define FSFW_ACTION_COMMANDSACTIONSIF_H_
|
2016-06-15 23:48:41 +02:00
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "CommandActionHelper.h"
|
|
|
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
|
|
|
#include "../ipc/MessageQueueIF.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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:
|
2018-07-12 16:29:32 +02:00
|
|
|
static const uint8_t INTERFACE_ID = CLASS_ID::COMMANDS_ACTIONS_IF;
|
2016-06-15 23:48:41 +02:00
|
|
|
static const ReturnValue_t OBJECT_HAS_NO_FUNCTIONS = MAKE_RETURN_CODE(1);
|
|
|
|
static const ReturnValue_t ALREADY_COMMANDING = MAKE_RETURN_CODE(2);
|
|
|
|
virtual ~CommandsActionsIF() {}
|
2018-07-12 16:29:32 +02:00
|
|
|
virtual MessageQueueIF* getCommandQueuePtr() = 0;
|
2016-06-15 23:48:41 +02:00
|
|
|
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;
|
2016-06-15 23:48:41 +02:00
|
|
|
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;
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-11-02 15:51:52 +01:00
|
|
|
#endif /* FSFW_ACTION_COMMANDSACTIONSIF_H_ */
|