64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <fsfw/introspection/HasTmTcParametersIF.h>
|
|
#include <fsfw/serialize/SerializeIF.h>
|
|
#include <stdint.h>
|
|
|
|
#include <vector>
|
|
|
|
#include "ActionMessage.h"
|
|
|
|
#ifdef FSFW_INTROSPECTION
|
|
#include "../introspection/Enum.h"
|
|
#endif
|
|
|
|
// TODO ActionId_t
|
|
|
|
class Action : public SerializeIF, public HasTmTcParametersIF {
|
|
public:
|
|
#ifdef FSFW_INTROSPECTION
|
|
Action();
|
|
void setEnum(EnumIF *id);
|
|
const char *getName();
|
|
#else
|
|
Action(ActionId_t id);
|
|
#endif
|
|
|
|
store_address_t getTc();
|
|
size_t getTcOffset();
|
|
|
|
// if an action is triggered by a TC, this should be set to be able to handle replies
|
|
// TODO make deleting it safe
|
|
// TODO integrate with internal commands
|
|
store_address_t tc;
|
|
size_t tcOffset;
|
|
MessageQueueId_t commandedBy;
|
|
|
|
ActionId_t getId();
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
[[nodiscard]] virtual ReturnValue_t handle() = 0;
|
|
|
|
void registerParameter(ParameterIF *parameter) override;
|
|
|
|
std::vector<ParameterIF *> const *getParameters() const override;
|
|
|
|
ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
|
Endianness streamEndianness) const override;
|
|
|
|
size_t getSerializedSize() const override;
|
|
|
|
ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size,
|
|
Endianness streamEndianness) override;
|
|
|
|
private:
|
|
ActionId_t id;
|
|
|
|
#ifdef FSFW_INTROSPECTION
|
|
const char *name;
|
|
#endif
|
|
std::vector<ParameterIF *> parameterList;
|
|
}; |