fsfw/src/fsfw/action/CommandActionHelper.h

37 lines
1.2 KiB
C
Raw Normal View History

#ifndef COMMANDACTIONHELPER_H_
#define COMMANDACTIONHELPER_H_
2020-08-13 20:53:35 +02:00
#include "ActionMessage.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/ipc/MessageQueueIF.h"
2021-07-13 20:22:54 +02:00
#include "fsfw/objectmanager/ObjectManagerIF.h"
2022-08-16 12:48:22 +02:00
#include "fsfw/returnvalues/returnvalue.h"
2021-07-13 20:22:54 +02:00
#include "fsfw/serialize/SerializeIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
class CommandsActionsIF;
class CommandActionHelper {
2022-02-02 10:29:30 +01:00
friend class CommandsActionsIF;
public:
2022-07-04 11:44:26 +02:00
explicit CommandActionHelper(CommandsActionsIF* owner);
2022-02-02 10:29:30 +01:00
virtual ~CommandActionHelper();
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, const uint8_t* data,
uint32_t size);
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data);
ReturnValue_t initialize();
ReturnValue_t handleReply(CommandMessage* reply);
2022-07-04 11:44:26 +02:00
[[nodiscard]] uint8_t getCommandCount() const;
2022-02-02 10:29:30 +01:00
private:
CommandsActionsIF* owner;
MessageQueueIF* queueToUse;
StorageManagerIF* ipcStore;
uint8_t commandCount;
MessageQueueId_t lastTarget;
void extractDataForOwner(ActionId_t actionId, store_address_t storeId);
ReturnValue_t sendCommand(MessageQueueId_t queueId, ActionId_t actionId, store_address_t storeId);
};
#endif /* COMMANDACTIONHELPER_H_ */