summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2018-06-18 13:18:16 +0300
committerIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2018-06-26 12:01:49 +0300
commite5974c2fea9efdb447ddbfc9560d00d1d7882897 (patch)
tree845b052f5715747c0ce2348a56e11ce110ddc491
parente8d91bde77671b2448d041a05ef6ebbec13d8668 (diff)
downloadsdl_core-e5974c2fea9efdb447ddbfc9560d00d1d7882897.tar.gz
Move vi_get_vehicle_type to vehicle_info_plugin
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_request.h)2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_response.h)2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc)4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc)4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc6
10 files changed, 14 insertions, 41 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
index 3545d3243d..11acd8a733 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
@@ -188,8 +188,6 @@
#include "sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h"
#endif // #ifdef HMI_DBUS_API
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_request.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_response.h"
#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
@@ -828,11 +826,6 @@ CommandCreator& HMICommandFactory::get_creator_factory(
hmi_apis::FunctionID::VehicleInfo_GetMyKey> >();
}
#endif // #ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetVehicleType: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleTypeRequest>()
- : factory.GetCreator<commands::VIGetVehicleTypeResponse>();
- }
case hmi_apis::FunctionID::Navigation_IsReady: {
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::NaviIsReadyRequest>()
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
index b5a33784b8..2374609774 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -158,8 +158,6 @@
#include "hmi/sdl_activate_app_response.h"
#include "hmi/on_app_permission_changed_notification.h"
#include "hmi/on_event_changed_notification.h"
-#include "hmi/vi_get_vehicle_type_request.h"
-#include "hmi/vi_get_vehicle_type_response.h"
#include "hmi/navi_is_ready_request.h"
#include "hmi/navi_show_constant_tbt_request.h"
#include "hmi/navi_show_constant_tbt_response.h"
@@ -433,9 +431,7 @@ typedef Types<commands::UIChangeRegistrationRequest,
commands::UIIsReadyResponse,
commands::UIIsReadyRequest> HMICommandsListSecond;
-typedef Types<commands::VIGetVehicleTypeResponse,
- commands::VIGetVehicleTypeRequest,
- commands::NaviIsReadyResponse,
+typedef Types<commands::NaviIsReadyResponse,
commands::NaviIsReadyRequest,
commands::NaviAlertManeuverResponse,
commands::NaviAlertManeuverRequest,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
index b313fc2363..c24cfc48db 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -59,7 +59,6 @@
#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h"
#include "application_manager/commands/request_to_hmi.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_request.h"
#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h"
@@ -164,8 +163,7 @@ class RequestToHMICommandsTest3
typedef Command CommandType;
};
-typedef Types<sdl_rpc_plugin::commands::VIGetVehicleTypeRequest,
- sdl_rpc_plugin::commands::hmi::DialNumberRequest,
+typedef Types<sdl_rpc_plugin::commands::hmi::DialNumberRequest,
sdl_rpc_plugin::commands::ClosePopupRequest,
sdl_rpc_plugin::commands::TTSSetGlobalPropertiesRequest,
sdl_rpc_plugin::commands::TTSSpeakRequest,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
index cfe1032ea2..229f48b5e1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -59,7 +59,6 @@
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "hmi/vi_get_vehicle_type_response.h"
#include "hmi/dial_number_response.h"
#include "hmi/close_popup_response.h"
#include "hmi/tts_set_global_properties_response.h"
@@ -268,23 +267,6 @@ MATCHER_P(VehicleTypeIsEqualTo, vehicle_type, "") {
return (*vehicle_type) == arg.asString();
}
-TEST_F(OtherResponseFromHMICommandsTest, VIGetVehicleTypeResponse_Run_SUCCESS) {
- const std::string kVehicleType = "Test";
-
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::msg_params][am::hmi_response::vehicle_type] =
- kVehicleType;
-
- SharedPtr<sdl_rpc_plugin::commands::VIGetVehicleTypeResponse> command(
- CreateCommand<sdl_rpc_plugin::commands::VIGetVehicleTypeResponse>(
- command_msg));
-
- EXPECT_CALL(mock_hmi_capabilities_,
- set_vehicle_type(VehicleTypeIsEqualTo(&kVehicleType)));
-
- command->Run();
-}
-
MATCHER_P(CheckMsgType, msg_type, "") {
return msg_type ==
static_cast<int32_t>(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
index 68d89a47a8..79a5270f8d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h
@@ -35,7 +35,7 @@
#include "application_manager/commands/request_to_hmi.h"
-namespace sdl_rpc_plugin {
+namespace vehicle_info_plugin {
namespace app_mngr = application_manager;
namespace commands {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
index 8073546be6..baa4a936ae 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_response.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h
@@ -35,7 +35,7 @@
#include "application_manager/commands/response_from_hmi.h"
-namespace sdl_rpc_plugin {
+namespace vehicle_info_plugin {
namespace app_mngr = application_manager;
namespace commands {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
index 63b2261340..a1a221220a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc
@@ -30,9 +30,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
-namespace sdl_rpc_plugin {
+namespace vehicle_info_plugin {
using namespace application_manager;
namespace commands {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
index f3d21adc7c..9f14b4e7ea 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc
@@ -29,9 +29,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_type_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
-namespace sdl_rpc_plugin {
+namespace vehicle_info_plugin {
using namespace application_manager;
namespace commands {
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
index 143a727455..5f79785784 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc
@@ -63,8 +63,6 @@ void UnsubscribeVehicleDataResponse::Run() {
return;
}
}
-
- // TODO(DK): Some logic
SendResponse(true);
}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
index 11edee303f..3855d6733b 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc
@@ -49,6 +49,8 @@
#include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h"
#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
#include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h"
+#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin")
@@ -108,6 +110,10 @@ app_mngr::CommandCreator& VehicleInfoHmiCommandFactory::buildCommandCreator(
application_manager_, rpc_service_, hmi_capabilities_, policy_handler_);
switch (function_id) {
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleType:
+ return hmi_apis::messageType::request == message_type
+ ? factory.GetCreator<commands::VIGetVehicleTypeRequest>()
+ : factory.GetCreator<commands::VIGetVehicleTypeResponse>();
case hmi_apis::FunctionID::VehicleInfo_IsReady:
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::VIIsReadyRequest>()