Replaced WriteMemoryToTarget event with TC command

This commit is contained in:
Nav
2022-04-30 01:30:57 +01:00
parent 63dc84aba0
commit ffc27a567b
8 changed files with 102 additions and 115 deletions

View File

@@ -0,0 +1,38 @@
#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;
explicit 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;
}
};
}