/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include "GetSimulationStateServiceHandler.h" #include #include #include namespace ROS2SimulationInterfaces { AZStd::unordered_set GetSimulationStateServiceHandler::GetProvidedFeatures() { return AZStd::unordered_set{ SimulationFeatures::SIMULATION_STATE_GETTING }; } AZStd::optional GetSimulationStateServiceHandler::HandleServiceRequest( const std::shared_ptr header, const Request& request) { Response response; SimulationInterfaces::SimulationState currentState; SimulationInterfaces::SimulationManagerRequestBus::BroadcastResult( currentState, &SimulationInterfaces::SimulationManagerRequests::GetSimulationState); response.result.result = simulation_interfaces::msg::Result::RESULT_OK; response.state.state = currentState; return response; } } // namespace ROS2SimulationInterfaces