2016-06-15 23:48:41 +02:00
|
|
|
#ifndef DATAPOOLADMIN_H_
|
|
|
|
#define DATAPOOLADMIN_H_
|
|
|
|
|
|
|
|
#include <framework/memory/MemoryHelper.h>
|
2018-07-12 16:29:32 +02:00
|
|
|
#include <framework/action/HasActionsIF.h>
|
|
|
|
#include <framework/action/SimpleActionHelper.h>
|
2016-06-15 23:48:41 +02:00
|
|
|
#include <framework/objectmanager/SystemObject.h>
|
|
|
|
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
|
|
|
#include <framework/tasks/ExecutableObjectIF.h>
|
2018-07-12 16:29:32 +02:00
|
|
|
#include <framework/parameters/ReceivesParameterMessagesIF.h>
|
|
|
|
#include <framework/datapool/DataPoolParameterWrapper.h>
|
|
|
|
#include <framework/ipc/MessageQueueIF.h>
|
|
|
|
|
|
|
|
class DataPoolAdmin: public HasActionsIF,
|
|
|
|
public ExecutableObjectIF,
|
|
|
|
public AcceptsMemoryMessagesIF,
|
|
|
|
public HasReturnvaluesIF,
|
|
|
|
public ReceivesParameterMessagesIF,
|
|
|
|
public SystemObject {
|
2016-06-15 23:48:41 +02:00
|
|
|
public:
|
2018-07-12 16:29:32 +02:00
|
|
|
static const ActionId_t SET_VALIDITY = 1;
|
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
DataPoolAdmin(object_id_t objectId);
|
|
|
|
|
2018-07-12 16:29:32 +02:00
|
|
|
~DataPoolAdmin();
|
|
|
|
|
|
|
|
ReturnValue_t performOperation(uint8_t opCode);
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
MessageQueueId_t getCommandQueue() const;
|
|
|
|
|
2018-07-12 16:29:32 +02:00
|
|
|
ReturnValue_t handleMemoryLoad(uint32_t address, const uint8_t* data,
|
|
|
|
uint32_t size, uint8_t** dataPointer);
|
|
|
|
ReturnValue_t handleMemoryDump(uint32_t address, uint32_t size,
|
|
|
|
uint8_t** dataPointer, uint8_t* copyHere);
|
|
|
|
|
2020-03-24 14:21:57 +01:00
|
|
|
virtual ReturnValue_t executeAction(ActionId_t actionId,
|
|
|
|
MessageQueueId_t commandedBy, const uint8_t* data, size_t size);
|
2018-07-12 16:29:32 +02:00
|
|
|
|
|
|
|
//not implemented as ParameterHelper is no used
|
|
|
|
ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId,
|
|
|
|
ParameterWrapper *parameterWrapper,
|
|
|
|
const ParameterWrapper *newValues, uint16_t startAtIndex);
|
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
ReturnValue_t initialize();
|
2018-07-12 16:29:32 +02:00
|
|
|
private:
|
|
|
|
StorageManagerIF *storage;
|
|
|
|
MessageQueueIF* commandQueue;
|
|
|
|
MemoryHelper memoryHelper;
|
|
|
|
SimpleActionHelper actionHelper;
|
|
|
|
void handleCommand();
|
|
|
|
ReturnValue_t handleParameterCommand(CommandMessage *command);
|
|
|
|
ReturnValue_t sendParameter(MessageQueueId_t to, uint32_t id,
|
|
|
|
const DataPoolParameterWrapper* wrapper);
|
|
|
|
void rejectCommand(MessageQueueId_t to, ReturnValue_t reason,
|
|
|
|
Command_t initialCommand);
|
2016-06-15 23:48:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DATAPOOLADMIN_H_ */
|