Activate target before calling Target::targetDescriptor()

This commit is contained in:
Nav
2024-09-07 13:07:40 +01:00
parent 9daa53ed45
commit df06757124
2 changed files with 6 additions and 2 deletions

View File

@@ -513,11 +513,12 @@ namespace TargetController
} }
this->target->setDebugTool(this->debugTool.get()); this->target->setDebugTool(this->debugTool.get());
this->targetDescriptor = std::make_unique<const TargetDescriptor>(this->target->targetDescriptor());
Logger::info("Activating target"); Logger::info("Activating target");
this->target->activate(); this->target->activate();
Logger::info("Target activated"); Logger::info("Target activated");
this->targetDescriptor = std::make_unique<const TargetDescriptor>(this->target->targetDescriptor());
Logger::info("Target name: " + this->targetDescriptor->name); Logger::info("Target name: " + this->targetDescriptor->name);
this->target->postActivate(); this->target->postActivate();

View File

@@ -85,7 +85,10 @@ namespace Targets
virtual void postActivate() = 0; virtual void postActivate() = 0;
/** /**
* Should generate a TargetDescriptor for the current target. * Should generate a TargetDescriptor for the target.
*
* This function is called shortly after target activation, allowing for information that was obtained via
* probing/discovery to be used in the target descriptor.
* *
* @return * @return
*/ */