diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins')
36 files changed, 471 insertions, 260 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h index 7ee56c4437..433e7add53 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h @@ -11,9 +11,11 @@ namespace commands { class RCButtonPressRequest : public application_manager::commands::RequestToHMI { public: - RCButtonPressRequest( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + RCButtonPressRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); /** * @brief Execute command */ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h index 6972762515..a8e8feb6f6 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h @@ -11,9 +11,11 @@ namespace commands { class RCButtonPressResponse : public application_manager::commands::ResponseFromHMI { public: - RCButtonPressResponse( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + RCButtonPressResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); void Run() OVERRIDE; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h index ccc3859d8b..cdd618a0e8 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h @@ -12,8 +12,11 @@ class RCGetInteriorVehicleDataRequest : public application_manager::commands::RequestToHMI { public: RCGetInteriorVehicleDataRequest( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); /** * @brief Execute command */ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h index fcf1e04d18..2d76790d03 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h @@ -12,8 +12,11 @@ class RCGetInteriorVehicleDataResponse : public application_manager::commands::ResponseFromHMI { public: RCGetInteriorVehicleDataResponse( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); void Run() OVERRIDE; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h index d282660d7c..d17dfeb11b 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h @@ -12,8 +12,11 @@ class RCOnInteriorVehicleDataNotification : public application_manager::commands::NotificationFromHMI { public: RCOnInteriorVehicleDataNotification( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h index 4becbd1d3d..535c02e59b 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h @@ -12,8 +12,11 @@ class RCOnRemoteControlSettingsNotification : public application_manager::commands::NotificationFromHMI { public: RCOnRemoteControlSettingsNotification( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h index e48d726678..d558926b7c 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h @@ -12,8 +12,11 @@ class RCSetInteriorVehicleDataRequest : public application_manager::commands::RequestToHMI { public: RCSetInteriorVehicleDataRequest( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h index 308ae71b68..339d040bd3 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h @@ -1,7 +1,7 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H -#include "application_manager/commands/response_to_hmi.h" +#include "application_manager/commands/response_from_hmi.h" #include "utils/macro.h" namespace rc_rpc_plugin { @@ -9,11 +9,14 @@ namespace app_mngr = application_manager; namespace commands { class RCSetInteriorVehicleDataResponse - : public application_manager::commands::ResponseToHMI { + : public application_manager::commands::ResponseFromHMI { public: RCSetInteriorVehicleDataResponse( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h index 746eb152b7..c6f6611e37 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h @@ -9,10 +9,12 @@ namespace app_mngr = application_manager; namespace commands { class ButtonPressRequest : public RCCommandRequest { public: - ButtonPressRequest( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager); + ButtonPressRequest(ResourceAllocationManager& resource_allocation_manager, + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); /** * @brief Execute command diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h index fa113df91e..d605a978f2 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h @@ -12,7 +12,10 @@ class ButtonPressResponse : public application_manager::commands::CommandResponseImpl { public: ButtonPressResponse(const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); void Run() OVERRIDE; /** * @brief ButtonPressResponse class destructor diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h index 078d3b2ff1..748da8eb57 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h @@ -10,10 +10,12 @@ namespace commands { class GetInteriorVehicleDataRequest : public RCCommandRequest { public: GetInteriorVehicleDataRequest( + ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, - rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager); - + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); /** * @brief Execute command */ @@ -46,13 +48,13 @@ class GetInteriorVehicleDataRequest : public RCCommandRequest { * @param hmi_response json message with response from HMI */ void ProccessSubscription( - const NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_response); + const NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_response); /** * @brief Cuts off subscribe parameter * @param request_params request parameters to handle */ - void RemoveExcessiveSubscription(); + void RemoveExcessiveSubscription(); }; } // namespace commands } // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h index b967cea71b..2b116648f7 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h @@ -13,7 +13,10 @@ class GetInteriorVehicleDataResponse public: GetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); void Run() OVERRIDE; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h index 957287e7dc..5e5e670e0b 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h @@ -2,6 +2,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H #include "application_manager/commands/command_notification_impl.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { @@ -12,8 +13,12 @@ class OnInteriorVehicleDataNotification : public application_manager::commands::CommandNotificationImpl { public: OnInteriorVehicleDataNotification( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + ResourceAllocationManager& resource_allocation_manager, + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h index 539451614b..180220cb15 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h @@ -1,19 +1,22 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H -#include "application_manager/commands/command_request_impl.h" +#include "rc_rpc_plugin/commands/rc_command_request.h" #include "utils/macro.h" namespace rc_rpc_plugin { namespace app_mngr = application_manager; namespace commands { -class SetInteriorVehicleDataRequest - : public application_manager::commands::CommandRequestImpl { +class SetInteriorVehicleDataRequest : public RCCommandRequest { public: SetInteriorVehicleDataRequest( + rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event) OVERRIDE; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h index d3b9c00280..ffc6dc23bb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h @@ -13,7 +13,10 @@ class SetInteriorVehicleDataResponse public: SetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); bool Init() OVERRIDE; void Run() OVERRIDE; void on_event(const application_manager::event_engine::Event& event); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h index f1d1f57704..dd1514feb8 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h @@ -53,7 +53,10 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl { RCCommandRequest( rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager); + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); virtual ~RCCommandRequest(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc index 77f5bb6246..c90f2aedb2 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc @@ -6,14 +6,21 @@ namespace commands { RCButtonPressRequest::RCButtonPressRequest( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::RequestToHMI(message, application_manager) {} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} -RCButtonPressRequest::~RCButtonPressRequest(){} +RCButtonPressRequest::~RCButtonPressRequest() {} void RCButtonPressRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); - SendRequest(); + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc index e0e8e74c82..f3ebaece1e 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc @@ -6,18 +6,26 @@ namespace commands { RCButtonPressResponse::RCButtonPressResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::ResponseFromHMI(message, application_manager) {} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} void RCButtonPressResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_AUTO_TRACE(logger_); - app_mngr::event_engine::Event event(hmi_apis::FunctionID::Buttons_ButtonPress); - event.set_smart_object(*message_); - event.raise(application_manager_.event_dispatcher()); + app_mngr::event_engine::Event event( + hmi_apis::FunctionID::Buttons_ButtonPress); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); } -RCButtonPressResponse::~RCButtonPressResponse(){} +RCButtonPressResponse::~RCButtonPressResponse() {} } // namespace commands } // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc index c9bb54cafb..9468191142 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc @@ -6,14 +6,21 @@ namespace commands { RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::RequestToHMI(message, application_manager) {} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} -RCGetInteriorVehicleDataRequest::~RCGetInteriorVehicleDataRequest(){} +RCGetInteriorVehicleDataRequest::~RCGetInteriorVehicleDataRequest() {} void RCGetInteriorVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); - SendRequest(); + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc index 3d77d0d28c..b52d235f04 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc @@ -6,18 +6,25 @@ namespace commands { RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::ResponseFromHMI(message, application_manager) {} - + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} void RCGetInteriorVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_AUTO_TRACE(logger_); - app_mngr::event_engine::Event event(hmi_apis::FunctionID::Buttons_ButtonPress); - event.set_smart_object(*message_); - event.raise(application_manager_.event_dispatcher()); + app_mngr::event_engine::Event event( + hmi_apis::FunctionID::Buttons_ButtonPress); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); } -RCGetInteriorVehicleDataResponse::~RCGetInteriorVehicleDataResponse(){} +RCGetInteriorVehicleDataResponse::~RCGetInteriorVehicleDataResponse() {} } // namespace commands } // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc index f267cc2f09..e45a875aa5 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc @@ -6,9 +6,15 @@ namespace commands { RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::NotificationFromHMI(message, application_manager) {} - + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::NotificationFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool RCOnInteriorVehicleDataNotification::Init() { return true; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc index 14f8bddce8..b246ee6f73 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc @@ -6,8 +6,15 @@ namespace commands { RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::NotificationFromHMI(message, application_manager) {} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::NotificationFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool RCOnRemoteControlSettingsNotification::Init() { return true; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc index 7adab79e20..3bd8723efb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc @@ -6,9 +6,15 @@ namespace commands { RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::RequestToHMI(message, application_manager) {} - + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool RCSetInteriorVehicleDataRequest::Init() { return true; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc index 948a546ff0..4c4df1248f 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc @@ -6,8 +6,15 @@ namespace commands { RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - :app_mngr::commands::ResponseToHMI(message, application_manager) {} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool RCSetInteriorVehicleDataResponse::Init() { return true; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc index 0329df5be4..8c9158c78b 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc @@ -16,11 +16,18 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap; ButtonPressRequest::ButtonPressRequest( + ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, - rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager) - : RCCommandRequest( - resource_allocation_manager, message, application_manager) {} + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : RCCommandRequest(resource_allocation_manager, + message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} ButtonPressRequest::~ButtonPressRequest() {} @@ -142,9 +149,11 @@ void ButtonPressRequest::Execute() { LOG4CXX_AUTO_TRACE(logger_); const std::string button_name = - (*message_)[app_mngr::strings::msg_params][message_params::kButtonName].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kButtonName] + .asString(); const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); static ButtonsMap btn_map = buttons_map(); mobile_apis::ButtonName::eType button_id = @@ -184,9 +193,10 @@ AcquireResult::eType ButtonPressRequest::AcquireResource( const std::string module_type = (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] .asString(); - app_mngr::ApplicationSharedPtr app = + app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); - return resource_allocation_manager_.AcquireResource(module_type, app->app_id()); + return resource_allocation_manager_.AcquireResource(module_type, + app->app_id()); } bool ButtonPressRequest::IsResourceFree(const std::string& module_type) const { @@ -199,15 +209,16 @@ void ButtonPressRequest::SetResourceState(const std::string& module_type, LOG4CXX_AUTO_TRACE(logger_); app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); - resource_allocation_manager_.SetResourceState(module_type, app->app_id(), state); + resource_allocation_manager_.SetResourceState( + module_type, app->app_id(), state); } void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); RCCommandRequest::on_event(event); - if (hmi_apis::FunctionID::Buttons_ButtonPress != event.id()){ - return; + if (hmi_apis::FunctionID::Buttons_ButtonPress != event.id()) { + return; } const smart_objects::SmartObject& message = event.smart_object(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc index fda70dcd9f..a6ac5ca0c1 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc @@ -6,14 +6,20 @@ namespace commands { ButtonPressResponse::ButtonPressResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::CommandResponseImpl(message, application_manager) {} - -ButtonPressResponse::~ButtonPressResponse(){} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} +ButtonPressResponse::~ButtonPressResponse() {} void ButtonPressResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); - application_manager_.GetRPCService().SendMessageToMobile(message_); + LOG4CXX_AUTO_TRACE(logger_); + application_manager_.GetRPCService().SendMessageToMobile(message_); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc index 8d3190b0e9..606f460394 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc @@ -12,12 +12,18 @@ using namespace message_params; CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager) - : RCCommandRequest( - resource_allocation_manager, message, application_manager) {} - + ResourceAllocationManager& resource_allocation_manager, + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : RCCommandRequest(resource_allocation_manager, + message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool CheckIfModuleTypeExistInCapabilities( const smart_objects::SmartObject& rc_capabilities, const std::string& module_type) { @@ -42,10 +48,10 @@ void GetInteriorVehicleDataRequest::Execute() { const smart_objects::SmartObject* rc_capabilities = application_manager_.hmi_capabilities().rc_capability(); const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); if (rc_capabilities && - !CheckIfModuleTypeExistInCapabilities(*rc_capabilities, - module_type)) { + !CheckIfModuleTypeExistInCapabilities(*rc_capabilities, module_type)) { LOG4CXX_WARN(logger_, "Accessing not supported module data"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE, @@ -57,32 +63,34 @@ void GetInteriorVehicleDataRequest::Execute() { } SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleData, - &(*message_)[app_mngr::strings::msg_params], true); + &(*message_)[app_mngr::strings::msg_params], + true); } -void GetInteriorVehicleDataRequest::on_event(const app_mngr::event_engine::Event& event) { +void GetInteriorVehicleDataRequest::on_event( + const app_mngr::event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); - if (hmi_apis::FunctionID::RC_GetInteriorVehicleData != event.id()){ - return; + if (hmi_apis::FunctionID::RC_GetInteriorVehicleData != event.id()) { + return; } - const smart_objects::SmartObject& hmi_response = event.smart_object(); + const smart_objects::SmartObject& hmi_response = event.smart_object(); - mobile_apis::Result::eType result_code = - GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( - hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code] - .asUInt())); + mobile_apis::Result::eType result_code = + GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( + hmi_response[app_mngr::strings::params][app_mngr::hmi_response::code] + .asUInt())); - bool result = - helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>( - result_code, - mobile_apis::Result::SUCCESS, - mobile_apis::Result::WARNINGS); + bool result = + helpers::Compare<mobile_apis::Result::eType, helpers::EQ, helpers::ONE>( + result_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::WARNINGS); - if (mobile_apis::Result::READ_ONLY == result_code) { - result = false; - result_code = mobile_apis::Result::GENERIC_ERROR; - } + if (mobile_apis::Result::READ_ONLY == result_code) { + result = false; + result_code = mobile_apis::Result::GENERIC_ERROR; + } if (result) { ProccessSubscription(hmi_response); @@ -97,20 +105,23 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( LOG4CXX_AUTO_TRACE(logger_); const bool is_subscribe_present_in_request = - (*message_)[app_mngr::strings::msg_params].keyExists(message_params::kSubscribe); + (*message_)[app_mngr::strings::msg_params].keyExists( + message_params::kSubscribe); const bool isSubscribed_present_in_response = - hmi_response[json_keys::kResult].keyExists(message_params::kIsSubscribed); + hmi_response[json_keys::kResult].keyExists(message_params::kIsSubscribed); if (!is_subscribe_present_in_request && !isSubscribed_present_in_response) { return; } app_mngr::ApplicationSharedPtr app = - application_manager_.application(CommandRequestImpl::connection_key()); - RCAppExtensionPtr extension = resource_allocation_manager_.GetApplicationExtention(app); + application_manager_.application(CommandRequestImpl::connection_key()); + RCAppExtensionPtr extension = + resource_allocation_manager_.GetApplicationExtention(app); if (is_subscribe_present_in_request && !isSubscribed_present_in_response) { LOG4CXX_WARN(logger_, "conditional mandatory parameter " - << message_params::kIsSubscribed << " missed in hmi response"); + << message_params::kIsSubscribed + << " missed in hmi response"); return; } @@ -124,25 +135,25 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( } const bool request_subscribe = - (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe].asBool(); + (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe] + .asBool(); const bool response_subscribe = hmi_response[json_keys::kResult][message_params::kIsSubscribed].asBool(); LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe); LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe); if (request_subscribe == response_subscribe) { - const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + const std::string module_type = + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); if (response_subscribe) { LOG4CXX_DEBUG(logger_, - "SubscribeToInteriorVehicleData " - << app->app_id() << " " - << module_type); + "SubscribeToInteriorVehicleData " << app->app_id() << " " + << module_type); extension->SubscribeToInteriorVehicleData(module_type); } else { LOG4CXX_DEBUG(logger_, "UnsubscribeFromInteriorVehicleData " - << app->app_id() << " " - << module_type); + << app->app_id() << " " << module_type); extension->UnsubscribeFromInteriorVehicleData(module_type); } } @@ -151,18 +162,22 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() { LOG4CXX_AUTO_TRACE(logger_); const bool is_subscribe_present_in_request = - (*message_)[app_mngr::strings::msg_params].keyExists(message_params::kSubscribe); + (*message_)[app_mngr::strings::msg_params].keyExists( + message_params::kSubscribe); if (is_subscribe_present_in_request) { - app_mngr::ApplicationSharedPtr app = + app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); - RCAppExtensionPtr extension = resource_allocation_manager_.GetApplicationExtention(app); + RCAppExtensionPtr extension = + resource_allocation_manager_.GetApplicationExtention(app); const bool is_app_already_subscribed = extension->IsSubscibedToInteriorVehicleData( - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString()); + (*message_)[app_mngr::strings::msg_params] + [message_params::kModuleType].asString()); const bool app_wants_to_subscribe = - (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe].asBool(); + (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe] + .asBool(); if (!app_wants_to_subscribe && !is_app_already_subscribed) { return true; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc index 795c9a8178..7a57e93fe6 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc @@ -6,14 +6,20 @@ namespace commands { GetInteriorVehicleDataResponse::GetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::CommandResponseImpl(message, application_manager) {} - -GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse(){} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} +GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {} void GetInteriorVehicleDataResponse::Run() { - LOG4CXX_AUTO_TRACE(logger_); - application_manager_.GetRPCService().SendMessageToMobile(message_); + LOG4CXX_AUTO_TRACE(logger_); + application_manager_.GetRPCService().SendMessageToMobile(message_); } } // namespace commands diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc index ddc2d9f0f1..1a1b7703fb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc @@ -5,11 +5,18 @@ namespace rc_rpc_plugin { namespace commands { OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification( + ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::CommandNotificationImpl(message, - application_manager) {} - + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::CommandNotificationImpl( + message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool OnInteriorVehicleDataNotification::Init() { return true; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc index 32a5294f42..5c01588ce1 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc @@ -5,9 +5,18 @@ namespace rc_rpc_plugin { namespace commands { SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest( + ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::CommandRequestImpl(message, application_manager) {} + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : RCCommandRequest(resource_allocation_manager, + message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool SetInteriorVehicleDataRequest::Init() { return true; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc index 8bd6bfd523..8f45d55908 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc @@ -6,9 +6,15 @@ namespace commands { SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse( const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::CommandResponseImpl(message, application_manager) {} - + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} bool SetInteriorVehicleDataResponse::Init() { return true; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc index 3fb8e45739..1cfcf07a64 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc @@ -43,11 +43,18 @@ namespace commands { RCCommandRequest::RCCommandRequest( rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager, const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager) - : app_mngr::commands::CommandRequestImpl(message, application_manager) + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : application_manager::commands::CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) , resource_allocation_manager_(resource_allocation_manager) {} -RCCommandRequest::~RCCommandRequest(){} +RCCommandRequest::~RCCommandRequest() {} bool RCCommandRequest::IsInterfaceAvailable( const app_mngr::HmiInterfaces::InterfaceID interface) const { @@ -61,7 +68,8 @@ bool RCCommandRequest::IsInterfaceAvailable( void RCCommandRequest::onTimeOut() { LOG4CXX_AUTO_TRACE(logger_); SetResourceState( - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(), + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(), ResourceState::FREE); SendResponse( false, mobile_apis::Result::GENERIC_ERROR, "Request timeout expired"); @@ -70,14 +78,16 @@ void RCCommandRequest::onTimeOut() { bool RCCommandRequest::CheckDriverConsent() { LOG4CXX_AUTO_TRACE(logger_); app_mngr::ApplicationSharedPtr app = - application_manager_.application(CommandRequestImpl::connection_key()); - RCAppExtensionPtr extension = resource_allocation_manager_.GetApplicationExtention(app); + application_manager_.application(CommandRequestImpl::connection_key()); + RCAppExtensionPtr extension = + resource_allocation_manager_.GetApplicationExtention(app); if (!extension) { LOG4CXX_ERROR(logger_, "NULL pointer."); return false; } const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); rc_rpc_plugin::TypeAccess access = CheckModule(module_type, app); if (rc_rpc_plugin::kAllowed == access) { @@ -102,9 +112,9 @@ void RCCommandRequest::SendDisallowed(rc_rpc_plugin::TypeAccess access) { LOG4CXX_AUTO_TRACE(logger_); std::string info; if (rc_rpc_plugin::kDisallowed == access) { - info = disallowed_info_.empty() - ? "The RPC is disallowed by vehicle settings" - : disallowed_info_; + info = disallowed_info_.empty() + ? "The RPC is disallowed by vehicle settings" + : disallowed_info_; } else { return; } @@ -135,7 +145,8 @@ void RCCommandRequest::Run() { bool RCCommandRequest::AcquireResources() { LOG4CXX_AUTO_TRACE(logger_); const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); if (!IsResourceFree(module_type)) { LOG4CXX_WARN(logger_, "Resource is busy."); @@ -169,7 +180,8 @@ bool RCCommandRequest::AcquireResources() { void RCCommandRequest::on_event(const app_mngr::event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); SetResourceState(module_type, ResourceState::FREE); @@ -184,7 +196,8 @@ void RCCommandRequest::ProcessAccessResponse( app_mngr::ApplicationSharedPtr app = application_manager_.application(CommandRequestImpl::connection_key()); const std::string module_type = - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType].asString(); + (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] + .asString(); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED, ""); @@ -238,7 +251,8 @@ void RCCommandRequest::SendGetUserConsent(const std::string& module_type) { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[json_keys::kAppId] = app->hmi_app_id(); - msg_params[app_mngr::strings::msg_params][message_params::kModuleType] = module_type; + msg_params[app_mngr::strings::msg_params][message_params::kModuleType] = + module_type; SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent, &msg_params, true); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc index a7018987c4..c67c7f6129 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc @@ -83,107 +83,116 @@ CommandSharedPtr RCCommandFactory::CreateCommand( CommandSharedPtr RCCommandFactory::CreateMobileCommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { - CommandSharedPtr command; - const int function_id = - (*message)[strings::params][strings::function_id].asInt(); - LOG4CXX_DEBUG(logger_, "CreateMobileCommand function_id: " << function_id); - switch (function_id) { - case mobile_apis::FunctionID::ButtonPressID: { - if ((*message)[strings::params][strings::message_type] == - static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset(new commands::ButtonPressRequest( - message, app_manager_, allocation_manager_)); - } else { - command.reset(new commands::ButtonPressResponse(message, app_manager_)); - } - break; - } - case mobile_apis::FunctionID::GetInteriorVehicleDataID: { - if ((*message)[strings::params][strings::message_type] == - static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset( - new commands::GetInteriorVehicleDataRequest(message, app_manager_, allocation_manager_)); - } else { - command.reset(new commands::GetInteriorVehicleDataResponse( - message, app_manager_)); - } - break; - } - case mobile_apis::FunctionID::SetInteriorVehicleDataID: { - if ((*message)[strings::params][strings::message_type] == - static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset( - new commands::SetInteriorVehicleDataRequest(message, app_manager_)); - } else { - command.reset(new commands::SetInteriorVehicleDataResponse( - message, app_manager_)); - } - break; - } - case mobile_apis::FunctionID::OnInteriorVehicleDataID: { - command.reset(new commands::OnInteriorVehicleDataNotification( - message, app_manager_)); - break; - } - default: { break; } - } - return command; + // TODO : rework factory same as in SDL commanf dactory + return CommandSharedPtr(); + + // CommandSharedPtr command; + // const int function_id = + // (*message)[strings::params][strings::function_id].asInt(); + // LOG4CXX_DEBUG(logger_, "CreateMobileCommand function_id: " << + // function_id); + // switch (function_id) { + // case mobile_apis::FunctionID::ButtonPressID: { + // if ((*message)[strings::params][strings::message_type] == + // static_cast<int>(application_manager::MessageType::kRequest)) { + // command.reset(new commands::ButtonPressRequest( + // message, app_manager_, allocation_manager_)); + // } else { + // command.reset(new commands::ButtonPressResponse(message, + // app_manager_)); + // } + // break; + // } + // case mobile_apis::FunctionID::GetInteriorVehicleDataID: { + // if ((*message)[strings::params][strings::message_type] == + // static_cast<int>(application_manager::MessageType::kRequest)) { + // command.reset( + // new commands::GetInteriorVehicleDataRequest(message, + // app_manager_, allocation_manager_)); + // } else { + // command.reset(new commands::GetInteriorVehicleDataResponse( + // message, app_manager_)); + // } + // break; + // } + // case mobile_apis::FunctionID::SetInteriorVehicleDataID: { + // if ((*message)[strings::params][strings::message_type] == + // static_cast<int>(application_manager::MessageType::kRequest)) { + // command.reset( + // new commands::SetInteriorVehicleDataRequest(message, + // app_manager_)); + // } else { + // command.reset(new commands::SetInteriorVehicleDataResponse( + // message, app_manager_)); + // } + // break; + // } + // case mobile_apis::FunctionID::OnInteriorVehicleDataID: { + // command.reset(new commands::OnInteriorVehicleDataNotification( + // message, app_manager_)); + // break; + // } + // default: { break; } + // } + // return command; } CommandSharedPtr RCCommandFactory::CreateHMICommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { CommandSharedPtr command; - const int function_id = - (*message)[strings::params][strings::function_id].asInt(); - LOG4CXX_DEBUG(logger_, "CreateHMICommand function_id: " << function_id); - switch (function_id) { - case hmi_apis::FunctionID::Buttons_ButtonPress: { - if ((*message)[strings::params][strings::message_type] == - static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset( - new commands::RCButtonPressRequest(message, app_manager_)); - } else { - command.reset( - new commands::RCButtonPressResponse(message, app_manager_)); - } - break; - } - case hmi_apis::FunctionID::RC_GetInteriorVehicleData: { - if ((*message)[strings::params][strings::message_type] == - static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset(new commands::RCGetInteriorVehicleDataRequest( - message, app_manager_)); - } else { - command.reset(new commands::RCGetInteriorVehicleDataResponse( - message, app_manager_)); - } - break; - } - case hmi_apis::FunctionID::RC_SetInteriorVehicleData: { - if ((*message)[strings::params][strings::message_type] == - static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset(new commands::RCSetInteriorVehicleDataRequest( - message, app_manager_)); - } else { - command.reset(new commands::RCSetInteriorVehicleDataResponse( - message, app_manager_)); - } - break; - } - case hmi_apis::FunctionID::RC_OnInteriorVehicleData: { - command.reset(new commands::RCOnInteriorVehicleDataNotification( - message, app_manager_)); - break; - } - case hmi_apis::FunctionID::RC_OnRemoteControlSettings: { - command.reset(new commands::RCOnRemoteControlSettingsNotification( - message, app_manager_)); - break; - } - default: { break; } - } + // TODO : rework factory same as in SDL commanf dactory return command; + // const int function_id = + // (*message)[strings::params][strings::function_id].asInt(); + // LOG4CXX_DEBUG(logger_, "CreateHMICommand function_id: " << function_id); + // switch (function_id) { + // case hmi_apis::FunctionID::Buttons_ButtonPress: { + // if ((*message)[strings::params][strings::message_type] == + // static_cast<int>(application_manager::MessageType::kRequest)) { + // command.reset( + // new commands::RCButtonPressRequest(message, app_manager_)); + // } else { + // command.reset( + // new commands::RCButtonPressResponse(message, app_manager_)); + // } + // break; + // } + // case hmi_apis::FunctionID::RC_GetInteriorVehicleData: { + // if ((*message)[strings::params][strings::message_type] == + // static_cast<int>(application_manager::MessageType::kRequest)) { + // command.reset(new commands::RCGetInteriorVehicleDataRequest( + // message, app_manager_)); + // } else { + // command.reset(new commands::RCGetInteriorVehicleDataResponse( + // message, app_manager_)); + // } + // break; + // } + // case hmi_apis::FunctionID::RC_SetInteriorVehicleData: { + // if ((*message)[strings::params][strings::message_type] == + // static_cast<int>(application_manager::MessageType::kRequest)) { + // command.reset(new commands::RCSetInteriorVehicleDataRequest( + // message, app_manager_)); + // } else { + // command.reset(new commands::RCSetInteriorVehicleDataResponse( + // message, app_manager_)); + // } + // break; + // } + // case hmi_apis::FunctionID::RC_OnInteriorVehicleData: { + // command.reset(new commands::RCOnInteriorVehicleDataNotification( + // message, app_manager_)); + // break; + // } + // case hmi_apis::FunctionID::RC_OnRemoteControlSettings: { + // command.reset(new commands::RCOnRemoteControlSettingsNotification( + // message, app_manager_)); + // break; + // } + // default: { break; } + // } + // return command; } } // namespace application_manager diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc index a5d2e9b73d..de10dc843a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc @@ -2,6 +2,7 @@ #include "rc_rpc_plugin/rc_command_factory.h" #include "rc_rpc_plugin/rc_app_extension.h" #include "rc_rpc_plugin/resource_allocation_manager_impl.h" +#include "utils/helpers.h" namespace rc_rpc_plugin { namespace plugins = application_manager::plugin_manager; @@ -26,7 +27,34 @@ bool RCRPCPlugin::IsAbleToProcess( const int32_t function_id, const application_manager::commands::Command::CommandSource message_source) { - return true; + namespace MobileFunctions = mobile_apis::FunctionID; + namespace HMIFunctions = hmi_apis::FunctionID; + namespace commands = application_manager::commands; + using helpers::in_range; + std::vector<MobileFunctions::eType> mobile_functions; + mobile_functions.push_back(MobileFunctions::GetInteriorVehicleDataID); + mobile_functions.push_back(MobileFunctions::SetInteriorVehicleDataID); + mobile_functions.push_back(MobileFunctions::OnInteriorVehicleDataID); + mobile_functions.push_back(MobileFunctions::ButtonPressID); + // mobile_functions.push_back(MobileFunctions::OnRCStatusID); + + std::vector<HMIFunctions::eType> hmi_functions; + hmi_functions.push_back(HMIFunctions::RC_GetInteriorVehicleData); + hmi_functions.push_back(HMIFunctions::RC_SetInteriorVehicleData); + hmi_functions.push_back(HMIFunctions::RC_OnInteriorVehicleData); + hmi_functions.push_back(HMIFunctions::RC_OnRemoteControlSettings); + hmi_functions.push_back(HMIFunctions::Buttons_OnButtonPress); + // hmi_functions.push_back(HMIFunctions::RC_OnRCStatus); + + if (commands::Command::SOURCE_MOBILE == message_source) { + return in_range(mobile_functions, + static_cast<MobileFunctions::eType>(function_id)); + } + if (commands::Command::SOURCE_HMI == message_source) { + return in_range(hmi_functions, + static_cast<HMIFunctions::eType>(function_id)); + } + return false; } std::string RCRPCPlugin::PluginName() { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt index 12ca5c6b75..077ce73607 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt @@ -9,7 +9,6 @@ set (RC_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/resource_allocation_manager_impl_test.cc ) - set(LIBRARIES RCRpcPluginStaticLib ApplicationManager diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc index 3ec1b18f72..ea597602bc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc @@ -45,7 +45,7 @@ #include "interfaces/MOBILE_API.h" #include "application_manager/mock_application.h" #include "application_manager/mock_hmi_capabilities.h" -#include "hmi/mixing_audio_supported_response.h" +#include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h" namespace test { namespace components { |