2022-05-01 17:33:09 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Command.hpp"
|
|
|
|
|
|
|
|
|
|
#include "src/Targets/TargetPinDescriptor.hpp"
|
2024-07-23 21:14:22 +01:00
|
|
|
#include "src/Targets/TargetGpioPinState.hpp"
|
2022-05-01 17:33:09 +01:00
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace TargetController::Commands
|
2022-05-01 17:33:09 +01:00
|
|
|
{
|
2024-07-23 21:14:22 +01:00
|
|
|
class SetTargetGpioPinState: public Command
|
2022-05-01 17:33:09 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2024-07-23 21:14:22 +01:00
|
|
|
static constexpr CommandType type = CommandType::SET_TARGET_GPIO_PIN_STATE;
|
|
|
|
|
static const inline std::string name = "SetTargetGpioPinState";
|
2022-05-01 17:33:09 +01:00
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
const Targets::TargetPinDescriptor& pinDescriptor;
|
|
|
|
|
Targets::TargetGpioPinState state;
|
2022-05-01 17:33:09 +01:00
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
SetTargetGpioPinState(
|
2022-05-01 17:33:09 +01:00
|
|
|
const Targets::TargetPinDescriptor& pinDescriptor,
|
2024-07-23 21:14:22 +01:00
|
|
|
const Targets::TargetGpioPinState& state
|
2022-05-01 17:33:09 +01:00
|
|
|
)
|
|
|
|
|
: pinDescriptor(pinDescriptor)
|
2024-07-23 21:14:22 +01:00
|
|
|
, state(state)
|
2022-05-01 17:33:09 +01:00
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] CommandType getType() const override {
|
2024-07-23 21:14:22 +01:00
|
|
|
return SetTargetGpioPinState::type;
|
2022-05-01 17:33:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] bool requiresStoppedTargetState() const override {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|