Files
BloomPatched/src/TargetController/Commands/WriteTargetMemory.hpp

43 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include "Command.hpp"
#include "src/TargetController/Responses/TargetMemoryRead.hpp"
#include "src/Targets/TargetMemory.hpp"
namespace Bloom::TargetController::Commands
{
class WriteTargetMemory: public Command
{
public:
static constexpr CommandType type = CommandType::WRITE_TARGET_MEMORY;
static inline const std::string name = "WriteTargetMemory";
Targets::TargetMemoryType memoryType;
std::uint32_t startAddress;
Targets::TargetMemoryBuffer buffer;
2022-04-30 01:45:49 +01:00
WriteTargetMemory(
Targets::TargetMemoryType memoryType,
std::uint32_t startAddress,
const Targets::TargetMemoryBuffer& buffer
)
: memoryType(memoryType)
, startAddress(startAddress)
, buffer(buffer)
{};
[[nodiscard]] CommandType getType() const override {
return WriteTargetMemory::type;
}
[[nodiscard]] bool requiresStoppedTargetState() const override {
return true;
}
2022-06-05 16:13:43 +01:00
[[nodiscard]] bool requiresDebugMode() const override {
return this->memoryType == Targets::TargetMemoryType::RAM;
}
};
}