diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc index 7afc04c8e9..b2b5ec7974 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc @@ -42,6 +42,10 @@ #include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h" #include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h" #include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h" CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") @@ -78,6 +82,8 @@ app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand( message_type_str = "response"; } else if (hmi_apis::messageType::error_response == message_type) { message_type_str = "error response"; + } else if (hmi_apis::messageType::notification == message_type) { + message_type_str = "notification"; } UNUSED(message_type_str); @@ -91,6 +97,8 @@ app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand( bool AppServiceHmiCommandFactory::IsAbleToProcess( const int32_t function_id, const app_mngr::commands::Command::CommandSource source) const { + LOG4CXX_DEBUG(logger_, + "HMI App Service Plugin IsAbleToProcess: " << function_id); UNUSED(source); return buildCommandCreator(function_id, hmi_apis::messageType::INVALID_ENUM, @@ -104,6 +112,9 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator( auto factory = app_mngr::CommandCreatorFactory( application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + LOG4CXX_DEBUG(logger_, + "buildCommandCreator: " << function_id << " " << source); + switch (function_id) { case hmi_apis::FunctionID::AppService_PublishAppService: return hmi_apis::messageType::request == message_type @@ -115,6 +126,22 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator( commands::OnASAppServiceDataNotificationFromHMI>() : factory .GetCreator<commands::OnASAppServiceDataNotification>(); + case hmi_apis::FunctionID::AppService_GetAppServiceData: + if (app_mngr::commands::Command::CommandSource::SOURCE_HMI == source) { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands::ASGetAppServiceDataRequestFromHMI>() + : factory.GetCreator< + commands::ASGetAppServiceDataResponseFromHMI>(); + } else if (app_mngr::commands::Command::CommandSource:: + SOURCE_SDL_TO_HMI == source) { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands::ASGetAppServiceDataRequestToHMI>() + : factory.GetCreator< + commands::ASGetAppServiceDataResponseToHMI>(); + } + case hmi_apis::FunctionID::AppService_GetAppServiceRecords: return hmi_apis::messageType::request == message_type ? factory.GetCreator<commands::ASGetAppServiceRecordsRequest>() @@ -126,7 +153,7 @@ app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator( : factory .GetCreator<commands::ASAppServiceActivationResponse>(); default: - LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id); + LOG4CXX_WARN(logger_, "Unsupported HMI function_id: " << function_id); return factory.GetCreator<app_mngr::InvalidCommand>(); } } |