eive-obsw/mission/devices/devicedefinitions/GomspaceActions.h

81 lines
3.1 KiB
C++

#pragma once
#include <fsfw/action/MinMaxParameter.h>
#include <fsfw/action/TemplateAction.h>
#include "GomspaceDefinitions.h"
class GomspaceDeviceHandler;
class PingAction : public TemplateAction<GomspaceDeviceHandler, PingAction, GOMSPACE::GomspaceCommands> {
public:
PingAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GOMSPACE::PING) {}
// TODO array
Parameter<uint8_t> pingData = Parameter<uint8_t>::createParameter(this, "Ping Data");
};
class RebootAction : public TemplateAction<GomspaceDeviceHandler, RebootAction, GOMSPACE::GomspaceCommands> {
public:
RebootAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GOMSPACE::REBOOT) {}
};
class GndwdtResetAction
: public TemplateAction<GomspaceDeviceHandler, GndwdtResetAction, GOMSPACE::GomspaceCommands> {
public:
GndwdtResetAction(GomspaceDeviceHandler* owner)
: TemplateAction(owner, GOMSPACE::GNDWDT_RESET) {}
};
class ParamGetAction
: public TemplateAction<GomspaceDeviceHandler, ParamGetAction, GOMSPACE::GomspaceCommands> {
public:
FSFW_ENUM(ParameterByteSize, uint8_t,
((ONE_BYTE, 1, "One Byte"))((TWO_BYTES, 2, "Two Bytes"))((FOUR_BYTES, 4, "Four Bytes")))
FSFW_ENUM(TableId, uint8_t,
((CONFIG_TABLE_ID, 1, "Config Table"))((HK_TABLE_ID, 4, "Housekeeping Table")))
ParamGetAction(GomspaceDeviceHandler* owner)
: TemplateAction(owner, GOMSPACE::PARAM_GET) {}
Parameter<TableId> tableId =
Parameter<TableId>::createParameter(this, "Table");
Parameter<uint16_t> address = Parameter<uint16_t>::createParameter(this, "Address");
Parameter<ParameterByteSize> parameterSize =
Parameter<ParameterByteSize>::createParameter(this, "Parameter Size");
};
class ParamSetAction
: public TemplateAction<GomspaceDeviceHandler, ParamSetAction, GOMSPACE::GomspaceCommands> {
public:
FSFW_ENUM(ParameterByteSize, uint8_t,
((ONE_BYTE, 1, "One Byte"))((TWO_BYTES, 2, "Two Bytes"))((FOUR_BYTES, 4, "Four Bytes")))
ParamSetAction(GomspaceDeviceHandler* owner)
: TemplateAction(owner, GOMSPACE::PARAM_SET) {}
Parameter<uint16_t> address = Parameter<uint16_t>::createParameter(this, "Address");
Parameter<uint32_t> parameter = Parameter<uint32_t>::createParameter(this, "Parameter Value");
Parameter<ParameterByteSize> parameterSize =
Parameter<ParameterByteSize>::createParameter(this, "Parameter Size");
};
class RequestHkTableAction
: public TemplateAction<GomspaceDeviceHandler, RequestHkTableAction, GOMSPACE::GomspaceCommands> {
public:
RequestHkTableAction(GomspaceDeviceHandler* owner)
: TemplateAction(owner, GOMSPACE::REQUEST_HK_TABLE) {}
};
class PrintSwitchVIAction
: public TemplateAction<GomspaceDeviceHandler, PrintSwitchVIAction, GOMSPACE::GomspaceCommands> {
public:
PrintSwitchVIAction(GomspaceDeviceHandler* owner)
: TemplateAction(owner, GOMSPACE::PRINT_SWITCH_V_I) {}
};
class PrintLatchupsAction
: public TemplateAction<GomspaceDeviceHandler, PrintLatchupsAction, GOMSPACE::GomspaceCommands> {
public:
PrintLatchupsAction(GomspaceDeviceHandler* owner)
: TemplateAction(owner, GOMSPACE::PRINT_LATCHUPS) {}
};