New TC shutdown command

This commit is contained in:
Nav
2023-05-26 01:02:51 +01:00
parent 039df146a7
commit 142f844f83
7 changed files with 49 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ namespace Bloom::TargetController
using Commands::CommandIdType;
using Commands::Command;
using Commands::Shutdown;
using Commands::GetTargetDescriptor;
using Commands::GetTargetState;
using Commands::StopTargetExecution;
@@ -139,6 +140,10 @@ namespace Bloom::TargetController
EventManager::registerListener(this->eventListener);
// Register command handlers
this->registerCommandHandler<Shutdown>(
std::bind(&TargetControllerComponent::handleShutdown, this, std::placeholders::_1)
);
this->registerCommandHandler<GetTargetDescriptor>(
std::bind(&TargetControllerComponent::handleGetTargetDescriptor, this, std::placeholders::_1)
);
@@ -640,6 +645,11 @@ namespace Bloom::TargetController
}
}
std::unique_ptr<Response> TargetControllerComponent::handleShutdown(Shutdown& command) {
this->shutdown();
return std::make_unique<Response>();
}
std::unique_ptr<Responses::TargetDescriptor> TargetControllerComponent::handleGetTargetDescriptor(
GetTargetDescriptor& command
) {