2022-08-16 18:31:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fsfw/action/MinMaxParameter.h>
|
|
|
|
#include <fsfw/action/TemplateAction.h>
|
|
|
|
#include <fsfw/introspection/Enum.h>
|
|
|
|
|
|
|
|
class CoreController;
|
|
|
|
|
|
|
|
namespace core {
|
|
|
|
|
|
|
|
FSFW_ENUM(ActionId, ActionId_t,
|
|
|
|
((LIST_DIRECTORY_INTO_FILE, 0, "List Directory into file"))(
|
|
|
|
(SWITCH_REBOOT_FILE_HANDLING, 5,
|
|
|
|
"Switch Reboot File Handling"))((RESET_REBOOT_COUNTERS, 6, "Reset Boot Counters"))(
|
|
|
|
(SWITCH_IMG_LOCK, 7, "Switch Image Lock"))((SET_MAX_REBOOT_CNT, 8,
|
|
|
|
"Set maximum reboot Count"))(
|
|
|
|
(XSC_REBOOT_OBC, 32, "Reboot using the xsc_boot_copy command"))(
|
|
|
|
(MOUNT_OTHER_COPY, 33, "Mount Other Copy"))((REBOOT_OBC, 34,
|
|
|
|
"Reboot using the reboot command")))
|
|
|
|
|
|
|
|
FSFW_ENUM(Boolenum, uint8_t, ((NO, 0, "NO"))((YES, 1, "Yes")))
|
|
|
|
|
|
|
|
class ListDirectoryIntoFileAction
|
|
|
|
: public TemplateAction<CoreController, ListDirectoryIntoFileAction, ActionId> {
|
|
|
|
public:
|
|
|
|
ListDirectoryIntoFileAction(CoreController *owner)
|
|
|
|
: TemplateAction(owner, ActionId::LIST_DIRECTORY_INTO_FILE){};
|
|
|
|
};
|
|
|
|
|
|
|
|
class SwitchRebootFileHandlingAction
|
|
|
|
: public TemplateAction<CoreController, SwitchRebootFileHandlingAction, ActionId> {
|
|
|
|
public:
|
|
|
|
SwitchRebootFileHandlingAction(CoreController *owner)
|
|
|
|
: TemplateAction(owner, ActionId::SWITCH_REBOOT_FILE_HANDLING){};
|
|
|
|
|
|
|
|
Parameter<Boolenum> enableRebootFile =
|
|
|
|
Parameter<Boolenum>::createParameter(this, "Enable Reboot File");
|
|
|
|
};
|
|
|
|
|
|
|
|
class ResetRebootCountersAction
|
|
|
|
: public TemplateAction<CoreController, ResetRebootCountersAction, ActionId> {
|
|
|
|
public:
|
|
|
|
FSFW_ENUM(Selection, uint8_t, ((ZERO, "0"))((ONE, "1"))((ALL, "All")))
|
|
|
|
|
|
|
|
ResetRebootCountersAction(CoreController *owner)
|
|
|
|
: TemplateAction(owner, ActionId::RESET_REBOOT_COUNTERS){};
|
|
|
|
|
|
|
|
Parameter<Selection> chip = Parameter<Selection>::createParameter(this, "Chip");
|
|
|
|
Parameter<Selection> copy = Parameter<Selection>::createParameter(this, "Copy");
|
|
|
|
};
|
|
|
|
|
|
|
|
class SwitchImageLockAction
|
|
|
|
: public TemplateAction<CoreController, SwitchImageLockAction, ActionId> {
|
|
|
|
public:
|
2022-08-17 11:21:35 +02:00
|
|
|
FSFW_ENUM(Selection, uint8_t, ((ZERO, "0"))((ONE, "1")))
|
|
|
|
|
2022-08-16 18:31:58 +02:00
|
|
|
SwitchImageLockAction(CoreController *owner) : TemplateAction(owner, ActionId::SWITCH_IMG_LOCK){};
|
2022-08-17 11:21:35 +02:00
|
|
|
|
|
|
|
Parameter<Boolenum> lock = Parameter<Boolenum>::createParameter(this, "Lock Image");
|
|
|
|
Parameter<Selection> chip = Parameter<Selection>::createParameter(this, "Chip");
|
|
|
|
Parameter<Selection> copy = Parameter<Selection>::createParameter(this, "Copy");
|
2022-08-16 18:31:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SetMaxRebootCntAction
|
|
|
|
: public TemplateAction<CoreController, SetMaxRebootCntAction, ActionId> {
|
|
|
|
public:
|
|
|
|
SetMaxRebootCntAction(CoreController *owner)
|
|
|
|
: TemplateAction(owner, ActionId::SET_MAX_REBOOT_CNT){};
|
2022-08-17 11:21:35 +02:00
|
|
|
|
|
|
|
Parameter<uint8_t> maxCount = Parameter<uint8_t>::createParameter(this, "Count");
|
2022-08-16 18:31:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class XscRebootObcAction : public TemplateAction<CoreController, XscRebootObcAction, ActionId> {
|
|
|
|
public:
|
2022-08-17 11:21:35 +02:00
|
|
|
FSFW_ENUM(Selection, uint8_t, ((ZERO, "0"))((ONE, "1"))((SAME, "Same")))
|
2022-08-16 18:31:58 +02:00
|
|
|
XscRebootObcAction(CoreController *owner) : TemplateAction(owner, ActionId::XSC_REBOOT_OBC){};
|
|
|
|
|
|
|
|
Parameter<Selection> chip = Parameter<Selection>::createParameter(this, "Chip");
|
|
|
|
Parameter<Selection> copy = Parameter<Selection>::createParameter(this, "Copy");
|
|
|
|
};
|
|
|
|
|
|
|
|
class RebootObcAction : public TemplateAction<CoreController, RebootObcAction, ActionId> {
|
|
|
|
public:
|
|
|
|
RebootObcAction(CoreController *owner) : TemplateAction(owner, ActionId::REBOOT_OBC){};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace core
|