Renamed TargetControllerConsole to TargetControllerService

This commit is contained in:
Nav
2022-12-26 21:27:19 +00:00
parent de97e8d4e0
commit d353b55f9b
85 changed files with 261 additions and 257 deletions

View File

@@ -8,7 +8,7 @@
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
using ResponsePackets::ErrorResponsePacket;
using ResponsePackets::OkResponsePacket;
@@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
: CommandPacket(rawPacket)
{}
void FlashDone::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
void FlashDone::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling FlashDone packet");
try {
@@ -29,9 +29,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
"Flushing " + std::to_string(programmingSession.buffer.size()) + " bytes to target's program memory"
);
targetControllerConsole.enableProgrammingMode();
targetControllerService.enableProgrammingMode();
targetControllerConsole.writeMemory(
targetControllerService.writeMemory(
Targets::TargetMemoryType::FLASH,
programmingSession.startAddress,
std::move(programmingSession.buffer)
@@ -41,10 +41,10 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
}
Logger::warning("Program memory updated");
targetControllerConsole.disableProgrammingMode();
targetControllerService.disableProgrammingMode();
Logger::warning("Resetting target");
targetControllerConsole.resetTarget();
targetControllerService.resetTarget();
Logger::info("Target reset complete");
debugSession.connection.writePacket(OkResponsePacket());
@@ -54,7 +54,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
debugSession.programmingSession.reset();
try {
targetControllerConsole.disableProgrammingMode();
targetControllerService.disableProgrammingMode();
} catch (const Exception& exception) {
Logger::error("Failed to disable programming mode - " + exception.getMessage());

View File

@@ -20,7 +20,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -8,7 +8,7 @@
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
using ResponsePackets::ErrorResponsePacket;
using ResponsePackets::OkResponsePacket;
@@ -48,16 +48,16 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
}
}
void FlashErase::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
void FlashErase::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling FlashErase packet");
try {
targetControllerConsole.enableProgrammingMode();
targetControllerService.enableProgrammingMode();
Logger::warning("Erasing entire chip, in preparation for programming");
// We don't erase a specific address range - we just erase the entire program memory.
targetControllerConsole.eraseMemory(Targets::TargetMemoryType::FLASH);
targetControllerService.eraseMemory(Targets::TargetMemoryType::FLASH);
debugSession.connection.writePacket(OkResponsePacket());
@@ -66,7 +66,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
debugSession.programmingSession.reset();
try {
targetControllerConsole.disableProgrammingMode();
targetControllerService.disableProgrammingMode();
} catch (const Exception& exception) {
Logger::error("Failed to disable programming mode - " + exception.getMessage());

View File

@@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -10,7 +10,7 @@
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
using ResponsePackets::ErrorResponsePacket;
using ResponsePackets::OkResponsePacket;
@@ -48,7 +48,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
this->buffer = Targets::TargetMemoryBuffer(colonIt + 1, this->data.end());
}
void FlashWrite::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
void FlashWrite::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling FlashWrite packet");
try {
@@ -91,7 +91,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
debugSession.programmingSession.reset();
try {
targetControllerConsole.disableProgrammingMode();
targetControllerService.disableProgrammingMode();
} catch (const Exception& exception) {
Logger::error("Failed to disable programming mode - " + exception.getMessage());

View File

@@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -10,7 +10,7 @@
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
using ResponsePackets::ErrorResponsePacket;
using ResponsePackets::ResponsePacket;
@@ -62,7 +62,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
}
}
void ReadMemory::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
void ReadMemory::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling ReadMemory packet");
try {
@@ -136,7 +136,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
auto memoryBuffer = Targets::TargetMemoryBuffer();
if (bytesToRead > 0) {
memoryBuffer = targetControllerConsole.readMemory(
memoryBuffer = targetControllerService.readMemory(
this->memoryType,
this->startAddress,
bytesToRead

View File

@@ -36,7 +36,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -6,7 +6,7 @@
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
using ResponsePackets::ResponsePacket;
@@ -50,7 +50,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
}
}
void ReadMemoryMap::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
void ReadMemoryMap::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling ReadMemoryMap packet");
using Targets::TargetMemoryType;

View File

@@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}

View File

@@ -8,7 +8,7 @@
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
using ResponsePackets::ErrorResponsePacket;
using ResponsePackets::OkResponsePacket;
@@ -68,7 +68,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
}
}
void WriteMemory::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
void WriteMemory::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling WriteMemory packet");
try {
@@ -123,7 +123,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
);
}
targetControllerConsole.writeMemory(
targetControllerService.writeMemory(
this->memoryType,
this->startAddress,
this->buffer

View File

@@ -36,7 +36,7 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
Services::TargetControllerService& targetControllerService
) override;
};
}