diff options
author | Ira Lytvynenko <ILytvynenko@luxoft.com> | 2018-02-09 17:14:21 +0200 |
---|---|---|
committer | Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> | 2018-06-26 12:01:45 +0300 |
commit | b024aff385cd29f9dbd070e4dccf69f6131d2afd (patch) | |
tree | 48329cd564fc1bf5b08d6e7ab717199cef7a7aee /src | |
parent | 87abaf17c2f8a7e5b5153b0db3f7c1d03c6d5b5a (diff) | |
download | sdl_core-b024aff385cd29f9dbd070e4dccf69f6131d2afd.tar.gz |
RC Command Factory implementation
Diffstat (limited to 'src')
25 files changed, 203 insertions, 43 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 5cda0c83b1..fb77bc6169 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCButtonPressRequest : public application_manager::commands::RequestFromHMI { public: + RCButtonPressRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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/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 ccd41e1911..01093d3548 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCButtonPressResponse : public application_manager::commands::ResponseToHMI { public: + RCButtonPressResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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_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 7e388acafa..0266305d50 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCGetInteriorVehicleDataRequest : public application_manager::commands::RequestToHMI { public: + RCGetInteriorVehicleDataRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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_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 cc75878d42..a746306dcf 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCGetInteriorVehicleDataResponse : public application_manager::commands::ResponseToHMI { public: + RCGetInteriorVehicleDataResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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_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 db248725c2..d282660d7c 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCOnInteriorVehicleDataNotification : public application_manager::commands::NotificationFromHMI { public: + RCOnInteriorVehicleDataNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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 89a961368e..4becbd1d3d 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCOnRemoteControlSettingsNotification : public application_manager::commands::NotificationFromHMI { public: + RCOnRemoteControlSettingsNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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 75053313b5..e48d726678 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCSetInteriorVehicleDataRequest : public application_manager::commands::RequestToHMI { public: + RCSetInteriorVehicleDataRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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 9a70e74f94..308ae71b68 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class RCSetInteriorVehicleDataResponse : public application_manager::commands::ResponseToHMI { public: + RCSetInteriorVehicleDataResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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/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 0072613518..957287e7dc 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class OnInteriorVehicleDataNotification : public application_manager::commands::CommandNotificationImpl { public: + OnInteriorVehicleDataNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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/on_remote_control_settings_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_remote_control_settings_notification.h deleted file mode 100644 index 7511346863..0000000000 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_remote_control_settings_notification.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H -#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H - -#include "application_manager/commands/command_notification_impl.h" -#include "utils/macro.h" - -namespace rc_rpc_plugin { -namespace commands { -class OnRemoveControlSettingsNotification - : public application_manager::commands::CommandNotificationImpl { - public: - bool Init() OVERRIDE; - void Run() OVERRIDE; - void on_event(const application_manager::event_engine::Event& event); -}; -} // namespace commands -} // namespace rc_rpc_plugin - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H 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 dce4cf0c17..539451614b 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class SetInteriorVehicleDataRequest : public application_manager::commands::CommandRequestImpl { public: + SetInteriorVehicleDataRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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 09bd2086b7..d3b9c00280 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 @@ -5,10 +5,15 @@ #include "utils/macro.h" namespace rc_rpc_plugin { +namespace app_mngr = application_manager; + namespace commands { class SetInteriorVehicleDataResponse : public application_manager::commands::CommandResponseImpl { public: + SetInteriorVehicleDataResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager); 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/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 d59f12a6df..c903791e7a 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCButtonPressRequest::RCButtonPressRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::RequestFromHMI(message, application_manager) {} + bool RCButtonPressRequest::Init() { return true; } 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 7765de7534..14cc81b849 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCButtonPressResponse::RCButtonPressResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::ResponseToHMI(message, application_manager) {} + bool RCButtonPressResponse::Init() { return true; } 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 11c3569a1e..ae8a314aac 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + : app_mngr::commands::RequestToHMI(message, application_manager) {} + bool RCGetInteriorVehicleDataRequest::Init() { return true; } 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 53c19dcad7..3a988d3469 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::ResponseToHMI(message, application_manager) {} + bool RCGetInteriorVehicleDataResponse::Init() { return true; } 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 8109a4cdb3..f267cc2f09 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::NotificationFromHMI(message, application_manager) {} + 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 cb1d066e0f..14f8bddce8 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::NotificationFromHMI(message, application_manager) {} + 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 25645308d2..7adab79e20 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::RequestToHMI(message, application_manager) {} + 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 0f54cc2c81..948a546ff0 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 @@ -4,10 +4,16 @@ namespace rc_rpc_plugin { namespace commands { +RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + :app_mngr::commands::ResponseToHMI(message, application_manager) {} + bool RCSetInteriorVehicleDataResponse::Init() { return true; } void RCSetInteriorVehicleDataResponse::Run() {} + void RCSetInteriorVehicleDataResponse::on_event( const application_manager::event_engine::Event& event) {} 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 88e73fa83d..ddc2d9f0f1 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 @@ -4,6 +4,12 @@ namespace rc_rpc_plugin { namespace commands { +OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + : app_mngr::commands::CommandNotificationImpl(message, + application_manager) {} + bool OnInteriorVehicleDataNotification::Init() { return true; } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_remote_control_settings_notification.cc deleted file mode 100644 index 5229e9e172..0000000000 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_remote_control_settings_notification.cc +++ /dev/null @@ -1,15 +0,0 @@ -#include "rc_rpc_plugin/commands/mobile/on_remote_control_settings_notification.h" -#include "utils/macro.h" - -namespace rc_rpc_plugin { -namespace commands { - -bool OnRemoveControlSettingsNotification::Init() { - return true; -} -void OnRemoveControlSettingsNotification::Run() {} -void OnRemoveControlSettingsNotification::on_event( - const application_manager::event_engine::Event& event) {} - -} // namespace commands -} // namespace rc_rpc_plugin 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 10bfcbd104..32a5294f42 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + : app_mngr::commands::CommandRequestImpl(message, application_manager) {} + 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 802866e334..8bd6bfd523 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 @@ -4,6 +4,11 @@ namespace rc_rpc_plugin { namespace commands { +SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager) + : app_mngr::commands::CommandResponseImpl(message, application_manager) {} + bool SetInteriorVehicleDataResponse::Init() { return 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 4e9e81bf45..e15edc8e42 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 @@ -41,9 +41,17 @@ #include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h" #include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h" #include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h" -#include "rc_rpc_plugin/commands/mobile/on_remote_control_settings_notification.h" +#include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h" +#include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h" +#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h" +#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h" +#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h" +#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h" +#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h" +#include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h" #include "interfaces/MOBILE_API.h" +#include "interfaces/HMI_API.h" CREATE_LOGGERPTR_GLOBAL(logger_, "RCCommandFactory") @@ -78,20 +86,45 @@ CommandSharedPtr RCCommandFactory::CreateMobileCommand( (*message)[strings::params][strings::function_id].asInt(); LOG4CXX_DEBUG( logger_, - "MobileCommandFactory::CreateCommand function_id: " << function_id); + "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_)); } else { - command.reset(new commands::ButtonPressRequest(message, app_manager_)); + command.reset(new commands::ButtonPressResponse(message, app_manager_)); } + break; } - - break; - default: + 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_)); + } 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; } @@ -99,8 +132,57 @@ CommandSharedPtr RCCommandFactory::CreateMobileCommand( CommandSharedPtr RCCommandFactory::CreateHMICommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { - CommandSharedPtr command; - return command; -} + 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; } + } + return command; + } } // namespace application_manager |