81 lines
3.1 KiB
C++
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, GomspaceCommands> {
|
|
public:
|
|
PingAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GomspaceCommands::PING) {}
|
|
|
|
// TODO array
|
|
Parameter<uint8_t> pingData = Parameter<uint8_t>::createParameter(this, "Ping Data");
|
|
};
|
|
|
|
class RebootAction : public TemplateAction<GomspaceDeviceHandler, RebootAction, GomspaceCommands> {
|
|
public:
|
|
RebootAction(GomspaceDeviceHandler* owner) : TemplateAction(owner, GomspaceCommands::REBOOT) {}
|
|
};
|
|
|
|
class GndwdtResetAction
|
|
: public TemplateAction<GomspaceDeviceHandler, GndwdtResetAction, GomspaceCommands> {
|
|
public:
|
|
GndwdtResetAction(GomspaceDeviceHandler* owner)
|
|
: TemplateAction(owner, GomspaceCommands::GNDWDT_RESET) {}
|
|
};
|
|
|
|
class ParamGetAction
|
|
: public TemplateAction<GomspaceDeviceHandler, ParamGetAction, 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, GomspaceCommands::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, 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, GomspaceCommands::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, GomspaceCommands> {
|
|
public:
|
|
RequestHkTableAction(GomspaceDeviceHandler* owner)
|
|
: TemplateAction(owner, GomspaceCommands::REQUEST_HK_TABLE) {}
|
|
};
|
|
|
|
class PrintSwitchVIAction
|
|
: public TemplateAction<GomspaceDeviceHandler, PrintSwitchVIAction, GomspaceCommands> {
|
|
public:
|
|
PrintSwitchVIAction(GomspaceDeviceHandler* owner)
|
|
: TemplateAction(owner, GomspaceCommands::PRINT_SWITCH_V_I) {}
|
|
};
|
|
|
|
class PrintLatchupsAction
|
|
: public TemplateAction<GomspaceDeviceHandler, PrintLatchupsAction, GomspaceCommands> {
|
|
public:
|
|
PrintLatchupsAction(GomspaceDeviceHandler* owner)
|
|
: TemplateAction(owner, GomspaceCommands::PRINT_LATCHUPS) {}
|
|
}; |