diff --git a/src/Services/TargetControllerService.cpp b/src/Services/TargetControllerService.cpp index 6b613ce5..abd75505 100644 --- a/src/Services/TargetControllerService.cpp +++ b/src/Services/TargetControllerService.cpp @@ -115,7 +115,7 @@ namespace Services )->targetDescriptor; } - TargetState TargetControllerService::getTargetState() const { + const TargetState& TargetControllerService::getTargetState() const { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout, diff --git a/src/Services/TargetControllerService.hpp b/src/Services/TargetControllerService.hpp index ac11272b..b3996047 100644 --- a/src/Services/TargetControllerService.hpp +++ b/src/Services/TargetControllerService.hpp @@ -68,7 +68,7 @@ namespace Services * * @return */ - Targets::TargetState getTargetState() const; + const Targets::TargetState& getTargetState() const; /** * Requests the TargetController to halt execution on the target.