fsfw/src/fsfw/action/ActionMessage.h

47 lines
1.8 KiB
C
Raw Normal View History

2020-11-02 15:51:52 +01:00
#ifndef FSFW_ACTION_ACTIONMESSAGE_H_
#define FSFW_ACTION_ACTIONMESSAGE_H_
2021-07-13 20:22:54 +02:00
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/objectmanager/ObjectManagerIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
2021-01-18 19:49:15 +01:00
using ActionId_t = uint32_t;
/**
* @brief These messages are part of the action module of the FSFW.
* @details
2021-01-18 19:49:59 +01:00
* These messages are sent amongst objects implementing the HasActionsIF. Classes like the
* ActionHelper are able to process these messages.
2021-01-18 19:49:15 +01:00
*/
class ActionMessage {
2022-02-02 10:29:30 +01:00
private:
ActionMessage();
public:
static const uint8_t MESSAGE_ID = messagetypes::ACTION;
static const Command_t EXECUTE_ACTION = MAKE_COMMAND_ID(1);
static const Command_t STEP_SUCCESS = MAKE_COMMAND_ID(2);
static const Command_t STEP_FAILED = MAKE_COMMAND_ID(3);
static const Command_t DATA_REPLY = MAKE_COMMAND_ID(4);
static const Command_t COMPLETION_SUCCESS = MAKE_COMMAND_ID(5);
static const Command_t COMPLETION_FAILED = MAKE_COMMAND_ID(6);
virtual ~ActionMessage();
static void setCommand(CommandMessage* message, ActionId_t fid, store_address_t parameters);
static ActionId_t getActionId(const CommandMessage* message);
static store_address_t getStoreId(const CommandMessage* message);
static void setStepReply(CommandMessage* message, ActionId_t fid, uint8_t step,
2022-08-16 01:08:26 +02:00
ReturnValue_t result = returnvalue::OK);
2022-02-02 10:29:30 +01:00
static uint8_t getStep(const CommandMessage* message);
static ReturnValue_t getReturnCode(const CommandMessage* message);
static void setDataReply(CommandMessage* message, ActionId_t actionId, store_address_t data);
static void setCompletionReply(CommandMessage* message, ActionId_t fid, bool success,
2022-08-16 01:08:26 +02:00
ReturnValue_t result = returnvalue::OK);
2022-02-02 10:29:30 +01:00
static void clear(CommandMessage* message);
};
2020-11-02 15:51:52 +01:00
#endif /* FSFW_ACTION_ACTIONMESSAGE_H_ */