2016-06-15 23:48:41 +02:00
|
|
|
#ifndef COMMANDACTIONHELPER_H_
|
|
|
|
#define COMMANDACTIONHELPER_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "ActionMessage.h"
|
|
|
|
#include "../objectmanager/ObjectManagerIF.h"
|
|
|
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
|
|
|
#include "../serialize/SerializeIF.h"
|
|
|
|
#include "../storagemanager/StorageManagerIF.h"
|
|
|
|
#include "../ipc/MessageQueueIF.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
class CommandsActionsIF;
|
|
|
|
|
|
|
|
class CommandActionHelper {
|
2021-01-28 11:38:45 +01:00
|
|
|
friend class CommandsActionsIF;
|
2016-06-15 23:48:41 +02:00
|
|
|
public:
|
2021-01-28 11:38:45 +01:00
|
|
|
CommandActionHelper(CommandsActionsIF* owner);
|
|
|
|
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);
|
|
|
|
uint8_t getCommandCount() const;
|
2016-06-15 23:48:41 +02:00
|
|
|
private:
|
2021-01-28 11:38:45 +01:00
|
|
|
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);
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* COMMANDACTIONHELPER_H_ */
|