New resume & suspend TargetController commands
This commit is contained in:
@@ -24,6 +24,8 @@ namespace Bloom::TargetController
|
||||
|
||||
using Commands::Command;
|
||||
using Commands::GetState;
|
||||
using Commands::Resume;
|
||||
using Commands::Suspend;
|
||||
using Commands::GetTargetDescriptor;
|
||||
using Commands::GetTargetState;
|
||||
using Commands::StopTargetExecution;
|
||||
@@ -172,6 +174,14 @@ namespace Bloom::TargetController
|
||||
std::bind(&TargetControllerComponent::handleGetState, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->registerCommandHandler<Resume>(
|
||||
std::bind(&TargetControllerComponent::handleResume, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->registerCommandHandler<Suspend>(
|
||||
std::bind(&TargetControllerComponent::handleSuspend, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->registerCommandHandler<GetTargetDescriptor>(
|
||||
std::bind(&TargetControllerComponent::handleGetTargetDescriptor, this, std::placeholders::_1)
|
||||
);
|
||||
@@ -765,6 +775,22 @@ namespace Bloom::TargetController
|
||||
return std::make_unique<Responses::State>(this->state);
|
||||
}
|
||||
|
||||
std::unique_ptr<Responses::Response> TargetControllerComponent::handleResume(Resume& command) {
|
||||
if (this->state != TargetControllerState::ACTIVE) {
|
||||
this->resume();
|
||||
}
|
||||
|
||||
return std::make_unique<Response>();
|
||||
}
|
||||
|
||||
std::unique_ptr<Responses::Response> TargetControllerComponent::handleSuspend(Suspend& command) {
|
||||
if (this->state != TargetControllerState::SUSPENDED) {
|
||||
this->suspend();
|
||||
}
|
||||
|
||||
return std::make_unique<Response>();
|
||||
}
|
||||
|
||||
std::unique_ptr<Responses::TargetDescriptor> TargetControllerComponent::handleGetTargetDescriptor(
|
||||
GetTargetDescriptor& command
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user