Target driver passthrough commands
Added `pm` commands to manage the program mode of WCH targets
This commit is contained in:
@@ -54,6 +54,7 @@ namespace Services
|
||||
using TargetController::Commands::EnableProgrammingMode;
|
||||
using TargetController::Commands::DisableProgrammingMode;
|
||||
using TargetController::Commands::Shutdown;
|
||||
using TargetController::Commands::InvokeTargetPassthroughCommand;
|
||||
|
||||
using Targets::TargetDescriptor;
|
||||
using Targets::TargetState;
|
||||
@@ -345,6 +346,16 @@ namespace Services
|
||||
);
|
||||
}
|
||||
|
||||
std::optional<Targets::PassthroughResponse> TargetControllerService::invokeTargetPassthroughCommand(
|
||||
Targets::PassthroughCommand&& command
|
||||
) const {
|
||||
return this->commandManager.sendCommandAndWaitForResponse(
|
||||
std::make_unique<InvokeTargetPassthroughCommand>(std::move(command)),
|
||||
this->defaultTimeout,
|
||||
this->activeAtomicSessionId
|
||||
)->response;
|
||||
}
|
||||
|
||||
TargetControllerService::AtomicSession TargetControllerService::makeAtomicSession() {
|
||||
return AtomicSession{*this};
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "src/Targets/TargetGpioPadState.hpp"
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
#include "src/Targets/TargetBreakpoint.hpp"
|
||||
#include "src/Targets/PassthroughCommand.hpp"
|
||||
#include "src/Targets/PassthroughResponse.hpp"
|
||||
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
@@ -266,6 +268,10 @@ namespace Services
|
||||
*/
|
||||
void shutdown() const;
|
||||
|
||||
std::optional<Targets::PassthroughResponse> invokeTargetPassthroughCommand(
|
||||
Targets::PassthroughCommand&& command
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Starts a new atomic session with the TC, via an TargetControllerService::AtomicSession RAII object.
|
||||
* The session will end when the object is destroyed.
|
||||
|
||||
Reference in New Issue
Block a user