summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2018-08-23 09:58:04 -0400
committerJackLivio <jack@livio.io>2018-08-23 09:58:04 -0400
commitfb890127f47c300d80c76e0464ea0f041783deb2 (patch)
tree8b7785aa9dca98776a29fbe9acee90cc6df3493d
parent997674798fbe6a6ed2dd579d0703aa8e22d8a643 (diff)
parent73e4f50de1b77e1c938f31226f180f3c63a566fc (diff)
downloadsdl_core-feature/full_app_id.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/full_app_idfeature/full_app_id
# Conflicts: # src/components/interfaces/MOBILE_API.xml
-rw-r--r--README.md2
-rw-r--r--src/appMain/CMakeLists.txt15
-rwxr-xr-xsrc/appMain/hmi_capabilities.json234
-rw-r--r--src/appMain/life_cycle.h105
-rw-r--r--src/appMain/life_cycle_impl.cc (renamed from src/appMain/life_cycle.cc)46
-rw-r--r--src/appMain/life_cycle_impl.h113
-rw-r--r--src/appMain/low_voltage_signals_handler.cc165
-rw-r--r--src/appMain/low_voltage_signals_handler.h132
-rw-r--r--src/appMain/main.cc39
-rw-r--r--src/appMain/signal_handlers.cc4
-rw-r--r--src/appMain/smartDeviceLink.ini6
-rw-r--r--src/appMain/test/CMakeLists.txt46
-rw-r--r--src/appMain/test/low_voltage_signals_handler_test.cc138
-rw-r--r--src/appMain/test/mock_life_cycle.h54
-rw-r--r--src/components/application_manager/include/application_manager/application.h18
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h14
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h129
-rw-r--r--src/components/application_manager/include/application_manager/command_factory.h9
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h14
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h35
-rw-r--r--src/components/application_manager/include/application_manager/message.h1
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h16
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h20
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h86
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h20
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_db.h13
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_json.h18
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h5
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h2
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h17
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h14
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h19
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h10
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_request.h15
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h17
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h19
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h14
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h23
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h20
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h81
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h64
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h86
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h122
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h12
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h20
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h96
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h45
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h17
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h9
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_request.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_button_press_response.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_request.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc31
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc37
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_request.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_set_interior_vehicle_data_response.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_response.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc159
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc19
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc36
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc284
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_response.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc121
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc159
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc90
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc118
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc37
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt3
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc470
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc70
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc36
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc22
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h54
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h55
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h9
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc160
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc35
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt1
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc102
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h8
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc1
-rw-r--r--src/components/application_manager/src/application_impl.cc11
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc256
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc14
-rw-r--r--src/components/application_manager/src/hmi_state.cc52
-rw-r--r--src/components/application_manager/src/message.cc13
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc34
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc226
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc93
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc49
-rw-r--r--src/components/application_manager/src/resumption/resumption_sql_queries.cc18
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc3
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc1
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc3
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc5
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt1
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h7
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h3
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h7
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h4
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc7
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc218
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc2
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc73
-rw-r--r--src/components/config_profile/include/config_profile/profile.h34
-rw-r--r--src/components/config_profile/src/profile.cc60
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h36
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc81
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc2
-rw-r--r--src/components/include/application_manager/application_manager.h69
-rw-r--r--src/components/include/application_manager/application_manager_settings.h2
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h13
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h7
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h21
-rw-r--r--src/components/include/protocol_handler/protocol_handler_settings.h6
-rw-r--r--src/components/include/protocol_handler/session_observer.h38
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h18
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h2
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h5
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler.h7
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h7
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h4
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h24
-rw-r--r--src/components/include/utils/typed_enum_print.h52
-rw-r--r--src/components/interfaces/HMI_API.xml484
-rw-r--r--src/components/interfaces/MOBILE_API.xml1805
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h22
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h9
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml3
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc38
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc21
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc36
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h9
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h2
-rw-r--r--src/components/policy/policy_regular/policy_table_interface_ext.xml3
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc24
-rw-r--r--src/components/protocol_handler/include/protocol_handler/handshake_handler.h13
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h24
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc20
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc181
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h6
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc4
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h7
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h7
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h11
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h14
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h13
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h15
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h7
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h9
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h11
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h7
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc5
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc4
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc5
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc5
-rw-r--r--src/components/smart_objects/src/schema_item.cc4
-rw-r--r--src/components/smart_objects/src/smart_object.cc5
-rw-r--r--src/components/smart_objects/src/smart_schema.cc5
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc5
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h1
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc2
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h14
-rw-r--r--src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc2
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc1
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc4
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc2
-rw-r--r--src/components/utils/CMakeLists.txt1
-rw-r--r--src/components/utils/include/utils/signals.h54
-rw-r--r--src/components/utils/src/signals_posix.cc44
-rw-r--r--src/components/utils/test/include/utils/mock_signals_posix.h59
-rw-r--r--src/components/utils/test/mock_signals_posix.cc76
-rwxr-xr-xtools/InterfaceGenerator/generator/parsers/RPCBase.py1
206 files changed, 6654 insertions, 3063 deletions
diff --git a/README.md b/README.md
index 80a6fbc88d..86d07c3d83 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)
[![codecov.io](https://codecov.io/github/smartdevicelink/sdl_core/coverage.svg?branch=develop)](https://codecov.io/github/smartdevicelink/sdl_core?branch=develop)
-[![Build Status](http://opensdl-jenkins.luxoft.com:8080/buildStatus/icon?job=OpenSDL_Nightly)](http://opensdl-jenkins.luxoft.com:8080/view/All/job/OpenSDL_Nightly/)
+[![Build Status](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/badge/icon)](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/)
# SmartDeviceLink (SDL)
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index b821c94260..fe9a6af3f7 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -70,9 +70,19 @@ include_directories(
${default_media_inc}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${BOOST_INCLUDE_DIR}
+ ${CMAKE_SOURCE_DIR}/src
)
-collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+# Create object library
+add_library("LowVoltageHandlerObjLibrary" OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/low_voltage_signals_handler.cc
+)
+
+set (SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/life_cycle_impl.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/signal_handlers.cc
+ $<TARGET_OBJECTS:LowVoltageHandlerObjLibrary>
+)
cmake_policy(PUSH)
# make link_directories() treat paths relative to the source dir
@@ -243,3 +253,6 @@ else()
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 4eedd6b17a..a3f7bcd0a1 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -438,6 +438,10 @@
"defrostZoneAvailable": true,
"desiredTemperatureAvailable": true,
"dualModeEnableAvailable": true,
+ "heatedMirrorsAvailable":true,
+ "heatedRearWindowAvailable":true,
+ "heatedSteeringWheelAvailable":true,
+ "heatedWindshieldAvailable":true,
"fanSpeedAvailable": true,
"moduleName": "primary_climate",
"ventilationMode": [
@@ -460,11 +464,24 @@
"rdsDataAvailable": true,
"signalChangeThresholdAvailable": true,
"signalStrengthAvailable": true,
+ "hdRadioEnableAvailable" : true,
+ "siriusxmRadioAvailable" : true,
+ "sisDataAvailable":true,
"stateAvailable": true
}
],
- "seatControlCapabilities": [
- {
+ "audioControlCapabilities": [
+ {
+ "moduleName": "audio",
+ "sourceAvailable": true,
+ "volumeAvailable": true,
+ "equalizerAvailable": true,
+ "keepContextAvailable" : true,
+ "equalizerMaxChannelId": 10
+ }
+ ],
+ "seatControlCapabilities": [
+ {
"moduleName": "driver_seat",
"heatingEnabledAvailable" : true,
"coolingEnabledAvailable": true,
@@ -482,7 +499,218 @@
"massageCushionFirmnessAvailable": true,
"memoryAvailable": true
}
- ]
+ ],
+ "lightControlCapabilities": {
+ "moduleName": "light",
+ "supportedLights":[
+ {
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_LEFT_BREAK_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_BREAK_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_REGISTRATION_PLATE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"HIGH_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"LOW_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"FOG_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"RUNNING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"PARKING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"BRAKE_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"REAR_REVERSING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"SIDE_MARKER_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"LEFT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"RIGHT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"HAZARD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"AMBIENT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"OVERHEAD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"READING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"TRUNK_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"EXTERIOR_FRONT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"EXTERIOR_REAR_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"EXTERIOR_LEFT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "densityAvailable":true,
+ "name":"EXTERIOR_RIGHT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ }
+ ]
+ },
+ "hmiSettingsControlCapabilities": {
+ "moduleName": "hmiSettings",
+ "distanceUnitAvailable": true,
+ "temperatureUnitAvailable": true,
+ "displayModeUnitAvailable": true
+ }
}
}
},
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index a9b18e1bd9..ff8fa2cc40 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, Ford Motor Company
+* Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,77 +32,60 @@
#ifndef SRC_APPMAIN_LIFE_CYCLE_H_
#define SRC_APPMAIN_LIFE_CYCLE_H_
-#include <thread>
-#include <unistd.h>
-#include "utils/macro.h"
-#include "config_profile/profile.h"
-#include "hmi_message_handler/hmi_message_handler_impl.h"
-#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
-#include "hmi_message_handler/messagebroker_adapter.h"
-#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
-#include "application_manager/application_manager_impl.h"
-#include "connection_handler/connection_handler_impl.h"
-#include "protocol_handler/protocol_handler_impl.h"
-#include "transport_manager/transport_manager.h"
-#include "transport_manager/transport_manager_default.h"
-#include "media_manager/media_manager_impl.h"
-#ifdef TELEMETRY_MONITOR
-#include "telemetry_monitor/telemetry_monitor.h"
-#endif
-
-#ifdef ENABLE_SECURITY
-namespace security_manager {
-class CryptoManager;
-class SecurityManagerImpl;
-} // namespace security_manager
-#endif // ENABLE_SECURITY
+namespace main_namespace {
-namespace utils {
-class SystemTimeHandler;
-} // namespace utils
+/**
+ * Class responsible for all system components creation,
+ * start, stop, suspend and restore
+ */
-namespace main_namespace {
class LifeCycle {
public:
- LifeCycle(const profile::Profile& profile);
- bool StartComponents();
+ virtual ~LifeCycle() {}
/**
- * Initialize MessageBroker component
- * @return true if success otherwise false.
- */
- bool InitMessageSystem();
+ * Creates and starts all system components
+ * @return true if all components started successfully
+ * otherwise false.
+ */
+ virtual bool StartComponents() = 0;
+
/**
- * \brief Main loop
- */
- void Run();
- void StopComponents();
+ * Initializes MessageBroker component
+ * @return true if success otherwise false.
+ */
+ virtual bool InitMessageSystem() = 0;
- private:
- transport_manager::TransportManagerImpl* transport_manager_;
- protocol_handler::ProtocolHandlerImpl* protocol_handler_;
- connection_handler::ConnectionHandlerImpl* connection_handler_;
- application_manager::ApplicationManagerImpl* app_manager_;
-#ifdef ENABLE_SECURITY
- security_manager::CryptoManager* crypto_manager_;
- security_manager::SecurityManager* security_manager_;
-#endif // ENABLE_SECURITY
- hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
- hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
- media_manager::MediaManagerImpl* media_manager_;
- resumption::LastState* last_state_;
-#ifdef TELEMETRY_MONITOR
- telemetry_monitor::TelemetryMonitor* telemetry_monitor_;
-#endif // TELEMETRY_MONITOR
+ /**
+ * @brief Main loop
+ */
+ virtual void Run() = 0;
-#ifdef MESSAGEBROKER_HMIADAPTER
- hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
- std::thread* mb_adapter_thread_;
-#endif // MESSAGEBROKER_HMIADAPTER
+ /**
+ * Stops all system components
+ */
+ virtual void StopComponents() = 0;
+
+ /**
+ * Makes appropriate actions when Low Voltage signal received:
+ * Stops all SDL activities except of waiting of UNIX signals
+ * from HMI
+ */
+ virtual void LowVoltage() = 0;
- const profile::Profile& profile_;
- DISALLOW_COPY_AND_ASSIGN(LifeCycle);
+ /**
+ * Makes appropriate actions when Wake Up signal received:
+ * Restores all SDL activities stopped due to LOW VOLTAGE
+ * from HMI
+ */
+ virtual void WakeUp() = 0;
+
+ /**
+ * Makes appropriate actions when Ignition Off signal received:
+ * Triggers all SDL components stop and deletion
+ */
+ virtual void IgnitionOff() = 0;
};
} // namespace main_namespace
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle_impl.cc
index dae70e3318..186be3c829 100644
--- a/src/appMain/life_cycle.cc
+++ b/src/appMain/life_cycle_impl.cc
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2017, Ford Motor Company
+* Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "life_cycle.h"
+#include "appMain/life_cycle_impl.h"
#include "utils/signals.h"
#include "config_profile/profile.h"
#include "application_manager/system_time/system_time_handler_impl.h"
@@ -47,13 +47,15 @@
#include "utils/log_message_loop_thread.h"
#endif // ENABLE_LOG
+#include "appMain/low_voltage_signals_handler.h"
+
using threads::Thread;
namespace main_namespace {
CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain")
-LifeCycle::LifeCycle(const profile::Profile& profile)
+LifeCycleImpl::LifeCycleImpl(const profile::Profile& profile)
: transport_manager_(NULL)
, protocol_handler_(NULL)
, connection_handler_(NULL)
@@ -76,7 +78,7 @@ LifeCycle::LifeCycle(const profile::Profile& profile)
, profile_(profile) {
}
-bool LifeCycle::StartComponents() {
+bool LifeCycleImpl::StartComponents() {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(!last_state_);
last_state_ = new resumption::LastStateImpl(profile_.app_storage_folder(),
@@ -165,11 +167,36 @@ bool LifeCycle::StartComponents() {
// start transport manager
transport_manager_->Visibility(true);
+ LowVoltageSignalsOffset signals_offset{profile_.low_voltage_signal_offset(),
+ profile_.wake_up_signal_offset(),
+ profile_.ignition_off_signal_offset()};
+
+ low_voltage_signals_handler_.reset(
+ new LowVoltageSignalsHandler(*this, signals_offset));
+
return true;
}
+void LifeCycleImpl::LowVoltage() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ transport_manager_->Visibility(false);
+ app_manager_->OnLowVoltage();
+}
+
+void LifeCycleImpl::IgnitionOff() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ kill(getpid(), SIGINT);
+}
+
+void LifeCycleImpl::WakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ app_manager_->OnWakeUp();
+ transport_manager_->Reinit();
+ transport_manager_->Visibility(true);
+}
+
#ifdef MESSAGEBROKER_HMIADAPTER
-bool LifeCycle::InitMessageSystem() {
+bool LifeCycleImpl::InitMessageSystem() {
mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
hmi_handler_, profile_.server_address(), profile_.server_port());
@@ -206,16 +233,16 @@ void sig_handler(int sig) {
}
} // namespace
-void LifeCycle::Run() {
+void LifeCycleImpl::Run() {
LOG4CXX_AUTO_TRACE(logger_);
// Register signal handlers and wait sys signals
// from OS
- if (!utils::WaitTerminationSignals(&sig_handler)) {
+ if (!utils::Signals::WaitTerminationSignals(&sig_handler)) {
LOG4CXX_FATAL(logger_, "Fail to catch system signal!");
}
}
-void LifeCycle::StopComponents() {
+void LifeCycleImpl::StopComponents() {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(hmi_handler_);
@@ -284,6 +311,9 @@ void LifeCycle::StopComponents() {
delete app_manager_;
app_manager_ = NULL;
+ LOG4CXX_INFO(logger_, "Destroying Low Voltage Signals Handler.");
+ low_voltage_signals_handler_.reset();
+
LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
#ifdef MESSAGEBROKER_HMIADAPTER
diff --git a/src/appMain/life_cycle_impl.h b/src/appMain/life_cycle_impl.h
new file mode 100644
index 0000000000..5dfc4641ab
--- /dev/null
+++ b/src/appMain/life_cycle_impl.h
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
+#define SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
+
+#include "appMain/life_cycle.h"
+
+#include <unistd.h>
+#include <thread>
+#include <memory>
+#include "utils/macro.h"
+
+#include "config_profile/profile.h"
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#if (defined(MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI))
+#include "hmi_message_handler/messagebroker_adapter.h"
+#endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) )
+#include "application_manager/application_manager_impl.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "protocol_handler/protocol_handler_impl.h"
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_default.h"
+#include "media_manager/media_manager_impl.h"
+#ifdef TELEMETRY_MONITOR
+#include "telemetry_monitor/telemetry_monitor.h"
+#endif
+
+#ifdef ENABLE_SECURITY
+namespace security_manager {
+class CryptoManager;
+class SecurityManagerImpl;
+} // namespace security_manager
+#endif // ENABLE_SECURITY
+
+namespace utils {
+class SystemTimeHandler;
+} // namespace utils
+
+namespace main_namespace {
+
+class LowVoltageSignalsHandler;
+
+class LifeCycleImpl : public LifeCycle {
+ public:
+ explicit LifeCycleImpl(const profile::Profile& profile);
+
+ bool StartComponents() OVERRIDE;
+ bool InitMessageSystem() OVERRIDE;
+ void Run() OVERRIDE;
+ void StopComponents() OVERRIDE;
+ void LowVoltage() OVERRIDE;
+ void WakeUp() OVERRIDE;
+ void IgnitionOff() OVERRIDE;
+
+ private:
+ transport_manager::TransportManagerImpl* transport_manager_;
+ protocol_handler::ProtocolHandlerImpl* protocol_handler_;
+ connection_handler::ConnectionHandlerImpl* connection_handler_;
+ application_manager::ApplicationManagerImpl* app_manager_;
+ std::unique_ptr<LowVoltageSignalsHandler> low_voltage_signals_handler_;
+#ifdef ENABLE_SECURITY
+ security_manager::CryptoManager* crypto_manager_;
+ security_manager::SecurityManager* security_manager_;
+#endif // ENABLE_SECURITY
+ hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
+ hmi_message_handler::HMIMessageAdapter* hmi_message_adapter_;
+ media_manager::MediaManagerImpl* media_manager_;
+ resumption::LastState* last_state_;
+#ifdef TELEMETRY_MONITOR
+ telemetry_monitor::TelemetryMonitor* telemetry_monitor_;
+#endif // TELEMETRY_MONITOR
+
+#ifdef MESSAGEBROKER_HMIADAPTER
+ hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
+ std::thread* mb_adapter_thread_;
+#endif // MESSAGEBROKER_HMIADAPTER
+
+ const profile::Profile& profile_;
+ DISALLOW_COPY_AND_ASSIGN(LifeCycleImpl);
+};
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_LIFE_CYCLE_IMPL_H_
diff --git a/src/appMain/low_voltage_signals_handler.cc b/src/appMain/low_voltage_signals_handler.cc
new file mode 100644
index 0000000000..936d91ba18
--- /dev/null
+++ b/src/appMain/low_voltage_signals_handler.cc
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "appMain/low_voltage_signals_handler.h"
+
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <iostream>
+#include "appMain/life_cycle.h"
+#include "utils/signals.h"
+#include "utils/logger.h"
+#include "utils/typed_enum_print.h"
+#include "config_profile/profile.h"
+
+namespace main_namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "LowVoltageSignalsHandler")
+
+LowVoltageSignalsHandler::LowVoltageSignalsHandler(
+ LifeCycle& life_cycle, const LowVoltageSignalsOffset& offset_data)
+ : notifications_delegate_(new NotificationThreadDelegate(*this))
+ , signals_handler_thread_(threads::CreateThread(
+ "LV_SIGNALS_HANDLER_THREAD", notifications_delegate_.get()))
+ , life_cycle_(life_cycle)
+ , SIGLOWVOLTAGE_(offset_data.low_voltage_signal_offset + SIGRTMIN)
+ , SIGWAKEUP_(offset_data.wake_up_signal_offset + SIGRTMIN)
+ , SIGIGNOFF_(offset_data.ignition_off_signal_offset + SIGRTMIN)
+ , cpid_(-1) {
+ sigemptyset(&lv_mask_);
+ sigaddset(&lv_mask_, SIGLOWVOLTAGE_);
+ signals_handler_thread_->start();
+}
+
+sigset_t LowVoltageSignalsHandler::LowVoltageSignalsMask() const {
+ return lv_mask_;
+}
+
+int LowVoltageSignalsHandler::low_voltage_signo() const {
+ return SIGLOWVOLTAGE_;
+}
+
+int LowVoltageSignalsHandler::wake_up_signo() const {
+ return SIGWAKEUP_;
+}
+
+int LowVoltageSignalsHandler::ignition_off_signo() const {
+ return SIGIGNOFF_;
+}
+
+void LowVoltageSignalsHandler::Destroy() {
+ if (signals_handler_thread_) {
+ signals_handler_thread_->join();
+ }
+ notifications_delegate_.reset();
+ threads::DeleteThread(signals_handler_thread_);
+}
+
+LowVoltageSignalsHandler::~LowVoltageSignalsHandler() {
+ Destroy();
+}
+
+void LowVoltageSignalsHandler::HandleSignal(const int signo) {
+ if (SIGLOWVOLTAGE_ == signo) {
+ LOG4CXX_DEBUG(logger_, "Received LOW_VOLTAGE signal");
+
+ life_cycle_.LowVoltage();
+ cpid_ = utils::Signals::Fork();
+
+ if (0 > cpid_) {
+ LOG4CXX_FATAL(logger_,
+ "Error due fork() call. Error: " << strerror(errno));
+ utils::Signals::ExitProcess(EXIT_FAILURE);
+ }
+
+ if (0 != cpid_) {
+ // In Parent process
+ LOG4CXX_DEBUG(logger_, "Child PID: " << cpid_);
+ utils::Signals::WaitPid(cpid_, nullptr, 0);
+ LOG4CXX_DEBUG(logger_, "Child process: " << cpid_ << " is stopped");
+ life_cycle_.WakeUp();
+ } else {
+ // In Child process
+ sigset_t signal_set;
+ sigfillset(&signal_set);
+ pthread_sigmask(SIG_BLOCK, &signal_set, nullptr);
+ sigemptyset(&lv_mask_);
+ sigaddset(&lv_mask_, SIGWAKEUP_);
+ sigaddset(&lv_mask_, SIGIGNOFF_);
+ std::cout << "Stopping parent process: " << getppid() << std::endl;
+ utils::Signals::SendSignal(SIGSTOP, getppid());
+ std::cout << "SIGSTOP signal sent to " << getppid() << std::endl;
+ }
+ return;
+ }
+
+ if (SIGWAKEUP_ == signo) {
+ std::cout << "Received WAKE UP signal" << std::endl;
+ std::cout << "Waking Up parent process: " << getppid() << std::endl;
+ utils::Signals::SendSignal(SIGCONT, getppid());
+ std::cout << "Stopping child process: " << getpid() << std::endl;
+ utils::Signals::ExitProcess(0);
+ }
+
+ if (SIGIGNOFF_ == signo) {
+ std::cout << "Received IGNITION_OFF signal" << std::endl;
+ std::cout << "Stopping all SDL processes..." << std::endl;
+ utils::Signals::SendSignal(SIGKILL, getppid());
+ utils::Signals::ExitProcess(0);
+ }
+}
+
+void NotificationThreadDelegate::threadMain() {
+ while (true) {
+ int signo = 0;
+ const sigset_t lv_mask =
+ low_voltage_signals_handler_.LowVoltageSignalsMask();
+ const int err = sigwait(&lv_mask, &signo);
+ if (0 != err) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Sigwait() error! Signals set contains an invalid signal number!");
+ continue;
+ }
+ low_voltage_signals_handler_.HandleSignal(signo);
+ }
+}
+
+void NotificationThreadDelegate::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ThreadDelegate::exitThreadMain();
+}
+
+} // namespace main_namespace
diff --git a/src/appMain/low_voltage_signals_handler.h b/src/appMain/low_voltage_signals_handler.h
new file mode 100644
index 0000000000..8c139c6836
--- /dev/null
+++ b/src/appMain/low_voltage_signals_handler.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
+#define SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
+
+#include <unistd.h>
+#include <memory>
+#include "utils/threads/thread_delegate.h"
+#include "utils/threads/thread.h"
+
+namespace main_namespace {
+
+typedef struct LowVoltageSignalsOffset {
+ int low_voltage_signal_offset;
+ int wake_up_signal_offset;
+ int ignition_off_signal_offset;
+} LowVoltageSignalsOffset;
+
+class LifeCycle;
+class NotificationThreadDelegate;
+
+/**
+ * @brief Class which handles real-time POSIX signals
+ * dedicated for LOW VOLTAGE functionality
+ */
+class LowVoltageSignalsHandler {
+ public:
+ /**
+ * @brief Constructor
+ * @param life_cycle - life_cycle object to interact with other system
+ * components
+ * @param offset_data offset data needed to calculate correct SIGNAL numbers
+ * used for LOW VOLTAGE functionality (as offset from SIGRTMIN)
+ */
+ LowVoltageSignalsHandler(LifeCycle& life_cycle,
+ const LowVoltageSignalsOffset& offset_data);
+ /**
+ * @brief Handles RT signals related to Low Voltage functionality
+ * @param signal number to handle
+ */
+ void HandleSignal(const int signo);
+
+ /**
+ * @brief Returns signals mask required for handling
+ * LOW VOLTAGE functionality
+ */
+ sigset_t LowVoltageSignalsMask() const;
+
+ /**
+ * @brief Returns LOW VOLTAGE signal number
+ */
+ int low_voltage_signo() const;
+
+ /**
+ * @brief Returns WAKE UP signal number
+ */
+ int wake_up_signo() const;
+
+ /**
+ * @brief Returns IGNITION OFF signal number
+ */
+ int ignition_off_signo() const;
+
+ /**
+ * @brief Destructor
+ */
+ ~LowVoltageSignalsHandler();
+
+ private:
+ /**
+ * @brief Destroys all parts of Low Voltage signals handler
+ * Invoked from destructor
+ */
+ void Destroy();
+ std::unique_ptr<NotificationThreadDelegate> notifications_delegate_;
+ threads::Thread* signals_handler_thread_;
+ LifeCycle& life_cycle_;
+ int SIGLOWVOLTAGE_;
+ int SIGWAKEUP_;
+ int SIGIGNOFF_;
+ pid_t cpid_;
+ sigset_t lv_mask_;
+};
+
+class NotificationThreadDelegate : public threads::ThreadDelegate {
+ public:
+ NotificationThreadDelegate(
+ LowVoltageSignalsHandler& low_voltage_signals_handler)
+ : low_voltage_signals_handler_(low_voltage_signals_handler) {}
+
+ ~NotificationThreadDelegate() {}
+
+ void threadMain() OVERRIDE;
+ void exitThreadMain() OVERRIDE;
+
+ private:
+ LowVoltageSignalsHandler& low_voltage_signals_handler_;
+};
+
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_LOW_VOLTAGE_SIGNALS_HANDLER_H_
diff --git a/src/appMain/main.cc b/src/appMain/main.cc
index feb5b5830e..752cfb7bb9 100644
--- a/src/appMain/main.cc
+++ b/src/appMain/main.cc
@@ -35,6 +35,7 @@
#include <signal.h>
#include <cstdio>
#include <cstdlib>
+#include <memory>
#include <vector>
#include <string>
#include <iostream> // cpplint: Streams are highly discouraged.
@@ -45,7 +46,7 @@
#include "utils/log_message_loop_thread.h"
#include "utils/logger.h"
-#include "./life_cycle.h"
+#include "appMain/life_cycle_impl.h"
#include "signal_handlers.h"
#include "utils/signals.h"
@@ -94,8 +95,8 @@ bool InitHmi(std::string hmi_link) {
* \return EXIT_SUCCESS or EXIT_FAILURE
*/
int32_t main(int32_t argc, char** argv) {
- // Unsibscribe once for all threads
- if (!utils::UnsibscribeFromTermination()) {
+ // Unsubscribe once for all threads
+ if (!utils::Signals::UnsubscribeFromTermination()) {
// Can't use internal logger here
exit(EXIT_FAILURE);
}
@@ -103,13 +104,31 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Components initialization
profile::Profile profile_instance;
- main_namespace::LifeCycle life_cycle(profile_instance);
+ std::unique_ptr<main_namespace::LifeCycle> life_cycle(
+ new main_namespace::LifeCycleImpl(profile_instance));
+
if ((argc > 1) && (0 != argv)) {
profile_instance.set_config_file_name(argv[1]);
} else {
profile_instance.set_config_file_name("smartDeviceLink.ini");
}
+ // Reading profile offsets for real-time signals dedicated
+ // for Low Voltage functionality handling
+ main_namespace::LowVoltageSignalsOffset signals_offset{
+ profile_instance.low_voltage_signal_offset(),
+ profile_instance.wake_up_signal_offset(),
+ profile_instance.ignition_off_signal_offset()};
+
+ // Unsubscribe once for all threads
+ // except specific thread dedicated for
+ // Low Voltage signals handling
+ // Thread will be created later
+ if (!utils::Signals::UnsubscribeFromLowVoltageSignals(signals_offset)) {
+ // Can't use internal logger here
+ exit(EXIT_FAILURE);
+ }
+
// --------------------------------------------------------------------------
// Logger initialization
INIT_LOGGER("log4cxx.properties", profile_instance.logs_enabled());
@@ -134,9 +153,9 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Components initialization
- if (!life_cycle.StartComponents()) {
+ if (!life_cycle->StartComponents()) {
LOG4CXX_FATAL(logger_, "Failed to start components");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
DEINIT_LOGGER();
exit(EXIT_FAILURE);
}
@@ -145,9 +164,9 @@ int32_t main(int32_t argc, char** argv) {
// --------------------------------------------------------------------------
// Third-Party components initialization.
- if (!life_cycle.InitMessageSystem()) {
+ if (!life_cycle->InitMessageSystem()) {
LOG4CXX_FATAL(logger_, "Failed to init message system");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
DEINIT_LOGGER();
_exit(EXIT_FAILURE);
}
@@ -167,10 +186,10 @@ int32_t main(int32_t argc, char** argv) {
}
// --------------------------------------------------------------------------
- life_cycle.Run();
+ life_cycle->Run();
LOG4CXX_INFO(logger_, "Stop SDL due to caught signal");
- life_cycle.StopComponents();
+ life_cycle->StopComponents();
LOG4CXX_INFO(logger_, "Application has been stopped successfuly");
DEINIT_LOGGER();
diff --git a/src/appMain/signal_handlers.cc b/src/appMain/signal_handlers.cc
index c695467ae2..649f162ec6 100644
--- a/src/appMain/signal_handlers.cc
+++ b/src/appMain/signal_handlers.cc
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "signal_handlers.h"
-#include "life_cycle.h"
+#include "appMain/signal_handlers.h"
+#include "appMain/life_cycle.h"
#include "utils/logger.h"
namespace main_namespace {
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index 2eff499bf7..b0513c076f 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -96,6 +96,12 @@ AppTransportChangeTimer = 500
; The time used as addition for AppTransportChangeTimer
AppTransportChangeTimerAddition = 0
+; Signal offsets used by SDL for setting up real time signals
+; used by LOW VOLTAGE functionality
+LowVoltageSignal = 1 ; Offset from SIGRTMIN
+WakeUpSignal = 2 ; Offset from SIGRTMIN
+IgnitionOffSignal = 3 ; Offset from SIGRTMIN
+
[MEDIA MANAGER]
; where 3 is a number of retries and 1000 is a timeout in milliseconds for request frequency
StartStreamRetry = 3, 1000
diff --git a/src/appMain/test/CMakeLists.txt b/src/appMain/test/CMakeLists.txt
new file mode 100644
index 0000000000..057e1e9869
--- /dev/null
+++ b/src/appMain/test/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Copyright (c) 2018, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include_directories (
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/utils/test/include
+)
+
+set(testSources
+ $<TARGET_OBJECTS:LowVoltageHandlerObjLibrary>
+ ${CMAKE_SOURCE_DIR}/src/appMain/test/low_voltage_signals_handler_test.cc
+ ${COMPONENTS_DIR}/utils/test/mock_signals_posix.cc
+)
+
+set(LIBRARIES
+ gmock
+)
+
+create_test(low_voltage_signals_handler_test "${testSources}" "${LIBRARIES}")
diff --git a/src/appMain/test/low_voltage_signals_handler_test.cc b/src/appMain/test/low_voltage_signals_handler_test.cc
new file mode 100644
index 0000000000..14210df71d
--- /dev/null
+++ b/src/appMain/test/low_voltage_signals_handler_test.cc
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "appMain/low_voltage_signals_handler.h"
+
+#include <memory>
+#include "gtest/gtest.h"
+#include "appMain/test/mock_life_cycle.h"
+#include "utils/mock_signals_posix.h"
+#include "config_profile/profile.h"
+#include "utils/macro.h"
+
+namespace test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+
+class LowVoltageSignalsHandlerTest : public ::testing::Test {
+ protected:
+ LowVoltageSignalsHandlerTest()
+ : mock_life_cycle_(std::make_shared<main_namespace::MockLifeCycle>())
+ , mock_signals_posix_(*utils::MockSignalsPosix::signals_posix_mock()) {}
+
+ void SetUp() OVERRIDE {
+ profile_.set_config_file_name("smartDeviceLink.ini");
+ signals_offset_ = {profile_.low_voltage_signal_offset(),
+ profile_.wake_up_signal_offset(),
+ profile_.ignition_off_signal_offset()};
+
+ low_voltage_signals_handler_ =
+ std::unique_ptr<main_namespace::LowVoltageSignalsHandler>(
+ new main_namespace::LowVoltageSignalsHandler(
+ *mock_life_cycle_.get(), signals_offset_));
+ }
+
+ profile::Profile profile_;
+ main_namespace::LowVoltageSignalsOffset signals_offset_;
+ std::unique_ptr<main_namespace::LowVoltageSignalsHandler>
+ low_voltage_signals_handler_;
+ std::shared_ptr<main_namespace::MockLifeCycle> mock_life_cycle_;
+ utils::MockSignalsPosix& mock_signals_posix_;
+};
+
+TEST_F(
+ LowVoltageSignalsHandlerTest,
+ LowVoltageSignalReceived_CheckParentProcessBehavior_ExpectChildCreationAndtLowVoltageCall) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Set expectation after LOW VOLTAGE signal
+ EXPECT_CALL(*mock_life_cycle_, LowVoltage());
+ // Expect child process creation
+ const pid_t cpid = 111;
+ EXPECT_CALL(mock_signals_posix_, Fork()).WillOnce(Return(cpid));
+ // Expect parent process sleep
+ EXPECT_CALL(mock_signals_posix_, WaitPid(_, nullptr, 0));
+ // Expect parent process wakes up
+ EXPECT_CALL(*mock_life_cycle_, WakeUp());
+ const int low_voltage_signo =
+ low_voltage_signals_handler_->low_voltage_signo();
+ // Emulate LOW VOLTAGE signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(low_voltage_signo);
+}
+
+TEST_F(
+ LowVoltageSignalsHandlerTest,
+ LowVoltageSignalReceived_CheckChildProcessBehavior_ExpectChildSendsStopToParentProcess) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Set expectation after LOW VOLTAGE signal
+ EXPECT_CALL(*mock_life_cycle_, LowVoltage());
+ // Expect child process creation
+ const pid_t cpid = 0;
+ EXPECT_CALL(mock_signals_posix_, Fork()).WillOnce(Return(cpid));
+ // Expect SIGCONT signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGSTOP, _));
+ const int low_voltage_signo =
+ low_voltage_signals_handler_->low_voltage_signo();
+ // Emulate LOW VOLTAGE signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(low_voltage_signo);
+}
+
+TEST_F(LowVoltageSignalsHandlerTest,
+ WakeUpSignalReceived_ExpectParentProcessWakeUpAndChildProcessExit) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Expect SIGCONT signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGCONT, _));
+ // Expect child process exit
+ EXPECT_CALL(mock_signals_posix_, ExitProcess(0));
+ const int wake_up_signo = low_voltage_signals_handler_->wake_up_signo();
+ // Emulate WAKE UP signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(wake_up_signo);
+}
+
+TEST_F(LowVoltageSignalsHandlerTest,
+ IgnitionOffSignalReceived_ExpectAllProcessesStopped) {
+ // To guarantee strict call orders
+ InSequence guarantees_calls_sequence;
+ // Expect SIGKILL signal to be sent to parent process
+ EXPECT_CALL(mock_signals_posix_, SendSignal(SIGKILL, _));
+ // Expect child process exit
+ EXPECT_CALL(mock_signals_posix_, ExitProcess(0));
+ const int ign_off_signo = low_voltage_signals_handler_->ignition_off_signo();
+ // Emulate IGN OFF signal receipt and handling
+ low_voltage_signals_handler_->HandleSignal(ign_off_signo);
+}
+
+} // namespace test
diff --git a/src/appMain/test/mock_life_cycle.h b/src/appMain/test/mock_life_cycle.h
new file mode 100644
index 0000000000..fc24b26080
--- /dev/null
+++ b/src/appMain/test/mock_life_cycle.h
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2018, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+#define SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+
+#include "appMain/life_cycle.h"
+#include "gmock/gmock.h"
+
+namespace main_namespace {
+
+class MockLifeCycle : public LifeCycle {
+ public:
+ MOCK_METHOD0(StartComponents, bool());
+ MOCK_METHOD0(InitMessageSystem, bool());
+ MOCK_METHOD0(Run, void());
+ MOCK_METHOD0(StopComponents, void());
+ MOCK_METHOD0(LowVoltage, void());
+ MOCK_METHOD0(WakeUp, void());
+ MOCK_METHOD0(IgnitionOff, void());
+};
+
+} // namespace main_namespace
+
+#endif // SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index da5860f06b..c3a4ecbb30 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -597,8 +597,6 @@ class Application : public virtual InitialApplicationData,
virtual void increment_list_files_in_none_count() = 0;
virtual bool set_app_icon_path(const std::string& file_name) = 0;
virtual void set_app_allowed(const bool allowed) = 0;
- DEPRECATED virtual void set_device(
- connection_handler::DeviceHandle device) = 0;
/**
* @brief Sets the handle of the device on which secondary transport of this
* app is running
@@ -738,6 +736,12 @@ class Application : public virtual InitialApplicationData,
virtual const HmiStatePtr RegularHmiState() const = 0;
/**
+ * @brief Checks if app is allowed to change audio source
+ * @return True - if allowed, otherwise - False
+ */
+ virtual bool IsAllowedToChangeAudioSource() const = 0;
+
+ /**
* @brief PostponedHmiState returns postponed hmi state of application
* if it's present
*
@@ -785,16 +789,6 @@ class Application : public virtual InitialApplicationData,
virtual bool IsVideoApplication() const = 0;
/**
- * DEPRECATED
- * @brief GetDeviceId allows to obtain device id which posseses
- * by this application.
- * @return device the device id.
- */
- std::string GetDeviceId() const {
- return device_id_;
- }
-
- /**
* @brief IsRegistered allows to distinguish if this
* application has been registered.
*
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
index 549ccc6d0d..d86203cd84 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -94,14 +94,6 @@ class ApplicationImpl : public virtual Application,
std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager);
- DEPRECATED ApplicationImpl(
- uint32_t application_id,
- const std::string& policy_app_id,
- const std::string& mac_address,
- const custom_str::CustomString& app_name,
- std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
- ApplicationManager& application_manager);
-
~ApplicationImpl();
/**
@@ -353,6 +345,12 @@ class ApplicationImpl : public virtual Application,
virtual const HmiStatePtr CurrentHmiState() const;
/**
+ * @brief Checks if app is allowed to change audio source
+ * @return True - if allowed, otherwise - False
+ */
+ virtual bool IsAllowedToChangeAudioSource() const;
+
+ /**
* @brief RegularHmiState of application without active events VR, TTS etc ...
* @return HmiState of application
*/
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index 622441bdf5..981da8e672 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -181,6 +181,10 @@ class ApplicationManagerImpl
void set_application_id(const int32_t correlation_id,
const uint32_t app_id) OVERRIDE;
+ uint32_t get_current_audio_source() const OVERRIDE;
+
+ void set_current_audio_source(const uint32_t source) OVERRIDE;
+
void OnHMILevelChanged(uint32_t app_id,
mobile_apis::HMILevel::eType from,
mobile_apis::HMILevel::eType to) OVERRIDE;
@@ -224,29 +228,6 @@ class ApplicationManagerImpl
bool IsAppTypeExistsInFullOrLimited(ApplicationConstSharedPtr app) const;
/**
- * DEPRECATED
- * @brief Checks if Application is subscribed for way points
- * @param Application AppID
- * @return true if Application is subscribed for way points
- * otherwise false
- */
- bool IsAppSubscribedForWayPoints(const uint32_t app_id) const OVERRIDE;
-
- /**
- * DEPRECATED
- * @brief Subscribe Application for way points
- * @param Application AppID
- */
- void SubscribeAppForWayPoints(const uint32_t app_id) OVERRIDE;
-
- /**
- * DEPRECATED
- * @brief Unsubscribe Application for way points
- * @param Application AppID
- */
- void UnsubscribeAppFromWayPoints(const uint32_t app_id) OVERRIDE;
-
- /**
* @brief Checks if Application is subscribed for way points
* @param Application pointer
* @return true if Application is subscribed for way points
@@ -365,10 +346,6 @@ class ApplicationManagerImpl
* @brief Closes all registered applications
*/
void UnregisterAllApplications();
-
- DEPRECATED bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
-
- DEPRECATED bool LoadAppDataToHMI(ApplicationSharedPtr app);
bool ActivateApplication(ApplicationSharedPtr app) OVERRIDE;
/**
@@ -390,13 +367,6 @@ class ApplicationManagerImpl
*/
uint32_t GetNextHMICorrelationID() OVERRIDE;
- /* @brief Starts audio passthru process
- * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is already in process
- */
- bool BeginAudioPassThrough() OVERRIDE;
-
/**
* @brief Starts AudioPassThru process by given application
* @param app_id ID of the application which starts the process
@@ -404,14 +374,6 @@ class ApplicationManagerImpl
*/
bool BeginAudioPassThru(uint32_t app_id) OVERRIDE;
- /*
- * @brief Finishes already started audio passthru process
- * @deprecated Use EndAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is not active
- */
- bool EndAudioPassThrough() OVERRIDE;
-
/**
* @brief Finishes already started AudioPassThru process by given application
* @param app_id ID of the application which started the process
@@ -437,22 +399,6 @@ class ApplicationManagerImpl
const hmi_apis::Common_DriverDistractionState::eType state) OVERRIDE;
/*
- * DEPRECATED
- * @brief Retrieves if VR session has started
- *
- * @return Current VR session state (started, stopped)
- */
- inline bool vr_session_started() const;
-
- /*
- * DEPRECATED
- * @brief Sets VR session state
- *
- * @param state Current HMI VR session state
- */
- void set_vr_session_started(const bool state);
-
- /*
* @brief Retrieves SDL access to all mobile apps
*
* @return Currently active state of the access
@@ -482,21 +428,6 @@ class ApplicationManagerImpl
mobile_apis::SystemContext::eType system_context) const OVERRIDE;
/**
- * DEPRECATED
- * @brief CreateRegularState create regular HMI state for application
- * @param app_id Application id
- * @param hmi_level of returned state
- * @param audio_state of returned state
- * @param system_context of returned state
- * @return new regular HMI state
- */
- DEPRECATED HmiStatePtr CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const OVERRIDE;
-
- /**
* @brief Checks, if given RPC is allowed at current HMI level for specific
* application in policy table
* @param app Application
@@ -660,10 +591,6 @@ class ApplicationManagerImpl
*/
void OnDeviceSwitchingFinish(const std::string& device_uid) FINAL;
- DEPRECATED bool OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) OVERRIDE;
void OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -861,20 +788,6 @@ class ApplicationManagerImpl
*/
uint32_t GenerateNewHMIAppID() OVERRIDE;
- /**
- * DERPECATED
- * @brief Parse smartObject and replace mobile app Id by HMI app ID
- * @param message Smartobject to be parsed
- */
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
-
- /**
- * DEPRECATED
- * @brief Parse smartObject and replace HMI app ID by mobile app Id
- * @param message Smartobject to be parsed
- */
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
-
/*
* @brief Save binary data to specified directory
*
@@ -926,22 +839,6 @@ class ApplicationManagerImpl
*/
void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) OVERRIDE;
- /**
- * DEPRECATED
- * @brief method adds application in FULL and LIMITED state
- * to on_phone_call_app_list_.
- * Also OnHMIStateNotification with BACKGROUND state sent for these apps
- */
- void CreatePhoneCallAppList();
-
- /**
- * DEPRECATED
- * @brief method removes application from on_phone_call_app_list_.
- *
- * Also OnHMIStateNotification with previous HMI state sent for these apps
- */
- void ResetPhoneCallAppList();
-
// TODO(AOleynik): Temporary added, to fix build. Should be reworked.
connection_handler::ConnectionHandler& connection_handler() const OVERRIDE;
protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE;
@@ -1236,10 +1133,10 @@ class ApplicationManagerImpl
*/
void SendOnSDLClose();
- /*
+ /**
* @brief returns true if low voltage state is active
*/
- bool IsLowVoltage();
+ bool IsLowVoltage() const OVERRIDE;
/**
* @brief Allows to process postponed commands for application
@@ -1313,15 +1210,6 @@ class ApplicationManagerImpl
* @brief Starts specified navi service for application
* @param app_id Application to proceed
* @param service_type Type of service to start
- * @return True on success, false on fail
- */
- DEPRECATED bool StartNaviService(uint32_t app_id,
- protocol_handler::ServiceType service_type);
-
- /**
- * @brief Starts specified navi service for application
- * @param app_id Application to proceed
- * @param service_type Type of service to start
* @param params configuration parameters specified by mobile
* @return True if service is immediately started or configuration
* parameters are sent to HMI, false on other cases
@@ -1482,6 +1370,7 @@ class ApplicationManagerImpl
bool is_vr_session_strated_;
bool hmi_cooperating_;
bool is_all_apps_allowed_;
+ uint32_t current_audio_source_;
event_engine::EventDispatcherImpl event_dispatcher_;
media_manager::MediaManager* media_manager_;
@@ -1606,10 +1495,6 @@ class ApplicationManagerImpl
DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
};
-DEPRECATED bool ApplicationManagerImpl::vr_session_started() const {
- return is_vr_session_strated_;
-}
-
inline bool ApplicationManagerImpl::all_apps_allowed() const {
return is_all_apps_allowed_;
}
diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h
index b8267ed438..f494fd64f8 100644
--- a/src/components/application_manager/include/application_manager/command_factory.h
+++ b/src/components/application_manager/include/application_manager/command_factory.h
@@ -40,7 +40,6 @@
#include "utils/macro.h"
namespace application_manager {
-using rpc_service::RPCService;
using policy::PolicyHandlerInterface;
typedef std::shared_ptr<commands::Command> CommandSharedPtr;
@@ -105,7 +104,7 @@ class DefaultCommandCreator : public CommandCreator {
* @param policy_handler PolicyHandlerInterface.
*/
DefaultCommandCreator(ApplicationManager& application_manager,
- RPCService& rpc_service,
+ rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
PolicyHandlerInterface& policy_handler)
: application_manager_(application_manager)
@@ -137,7 +136,7 @@ class DefaultCommandCreator : public CommandCreator {
}
ApplicationManager& application_manager_;
- RPCService& rpc_service_;
+ rpc_service::RPCService& rpc_service_;
HMICapabilities& hmi_capabilities_;
PolicyHandlerInterface& policy_handler_;
};
@@ -158,7 +157,7 @@ class DefaultCommandCreator<InvalidCommand> : public CommandCreator {
* @param policy_handler PolicyHandlerInterface.
*/
DefaultCommandCreator(ApplicationManager& application_manager,
- RPCService& rpc_service,
+ rpc_service::RPCService& rpc_service,
HMICapabilities& hmi_capabilities,
PolicyHandlerInterface& policy_handler) {
UNUSED(application_manager);
@@ -203,7 +202,7 @@ struct CommandCreatorFactory {
return res;
}
ApplicationManager& application_manager_;
- RPCService& rpc_service_;
+ rpc_service::RPCService& rpc_service_;
HMICapabilities& hmi_capabilities_;
PolicyHandlerInterface& policy_handler_;
};
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h
index be79d9e8d1..4859f73a55 100644
--- a/src/components/application_manager/include/application_manager/commands/command_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_impl.h
@@ -152,26 +152,12 @@ class CommandImpl : public Command {
bool ReplaceMobileWithHMIAppId(smart_objects::SmartObject& message);
/**
- * DEPRECATED
- * @brief Parses mobile message and replaces mobile app id with HMI app id
- * @param message Message to replace its ids
- */
- void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
-
- /**
* @brief Parses message from HMI and replaces HMI app id with mobile app id
* @param message Message to replace its ids
* @return True if replacement succeeded, otherwise - false
*/
bool ReplaceHMIWithMobileAppId(smart_objects::SmartObject& message);
- /**
- * DEPRECATED
- * @brief Parses message from HMI and replaces HMI app id with mobile app id
- * @param message Message to replace its ids
- */
- void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
-
MessageSharedPtr message_;
uint32_t default_timeout_;
bool allowed_to_terminate_;
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
index e790fc9af6..6fdeaea332 100644
--- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -43,8 +43,6 @@ namespace application_manager {
namespace commands {
struct ResponseInfo {
- DEPRECATED ResponseInfo(hmi_apis::Common_Result::eType result,
- HmiInterfaces::InterfaceID interface);
ResponseInfo();
ResponseInfo(const hmi_apis::Common_Result::eType result,
const HmiInterfaces::InterfaceID hmi_interface,
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index e333cb9bbc..4b7779e08c 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -94,25 +94,6 @@ class HmiState {
const ApplicationManager& app_mngr,
StateID state_id);
- /**
- * DEPRECATED
- * @brief HmiState constructor
- * @param app_id Application id
- * @param app_mngr Application manager
- */
- HmiState(uint32_t app_id, const ApplicationManager& app_mngr);
-
- /**
- * DEPRECATED
- * @brief HmiState constructor
- * @param app_id Application id
- * @param app_mngr Application manager
- * @param state_id HMI state to assign
- */
- HmiState(uint32_t app_id,
- const ApplicationManager& app_mngr,
- StateID state_id);
-
virtual ~HmiState() {}
/**
@@ -274,8 +255,6 @@ class VRHmiState : public HmiState {
const OVERRIDE;
VRHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
-
- DEPRECATED VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
};
/**
@@ -286,8 +265,6 @@ class TTSHmiState : public HmiState {
TTSHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
-
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
};
@@ -327,9 +304,6 @@ class PhoneCallHmiState : public HmiState {
PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED PhoneCallHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -346,9 +320,6 @@ class SafetyModeHmiState : public HmiState {
SafetyModeHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED SafetyModeHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr);
-
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
@@ -368,8 +339,6 @@ class DeactivateHMI : public HmiState {
DeactivateHMI(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -390,8 +359,6 @@ class AudioSource : public HmiState {
AudioSource(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED AudioSource(uint32_t app_id, const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -413,8 +380,6 @@ class EmbeddedNavi : public HmiState {
EmbeddedNavi(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
- DEPRECATED EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr);
-
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
index 7c3f0a13c9..1c319cf204 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -88,7 +88,6 @@ class Message {
void set_correlation_id(int32_t id);
void set_connection_key(int32_t key);
void set_message_type(MessageType type);
- DEPRECATED void set_binary_data(BinaryData* data);
void set_binary_data(const BinaryData* data);
void set_json_message(const std::string& json_message);
void set_protocol_version(protocol_handler::MajorProtocolVersion version);
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 127ff967b4..73f49e3477 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -50,6 +50,7 @@
#include "application_manager/policies/policy_handler_interface.h"
#include "smart_objects/smart_object.h"
#include "transport_manager/common.h"
+#include <application_manager/smart_object_keys.h>
namespace policy {
class PolicyHandlerInterface;
@@ -634,6 +635,21 @@ class MessageHelper {
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr);
+ /**
+ * @brief Stores whether each choice in a set has the vrCommands parameter
+ * MIXED means some choices have vrCommands and others don't
+ * ALL means all do, NONE means none do
+ */
+ enum ChoiceSetVRCommandsStatus { MIXED, ALL, NONE };
+
+ /**
+ * @brief Check whether each choice in the set has the vrCommands parameter
+ * @param choice set to check
+ * @return a ChoiceSetVRCommandsStatus with the state of the choice set
+ */
+ static ChoiceSetVRCommandsStatus CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set);
+
/*
* @brief Finds "Image" structure in request and verify image file presence
* in Core.
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
index 90c6c5c208..f9a60c862b 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
#include <stdint.h>
-
+#include <time.h>
#include "application_manager/resumption/resumption_data.h"
namespace application_manager {
@@ -125,6 +125,16 @@ class ResumeCtrl {
virtual void OnAwake() = 0;
/**
+ * @brief Saves Low Voltage signal timestamp
+ */
+ virtual void SaveLowVoltageTime() = 0;
+
+ /**
+ * @brief Saves Wake Up signal timestamp
+ */
+ virtual void SaveWakeUpTime() = 0;
+
+ /**
* @brief Checks if SDL has already received OnExitAllApplication notification
* with "SUSPEND" reason
*
@@ -134,13 +144,19 @@ class ResumeCtrl {
virtual bool is_suspended() const = 0;
/**
- * @brief Method stops timer "RsmCtrlPercist" when SDL
+ * @brief Method stops timer "RsmCtrlPersist" when SDL
* receives OnExitAllApplication notification
* with reason "SUSPEND"
*/
virtual void StopSavePersistentDataTimer() = 0;
/**
+ * @brief Method starts timer "RsmCtrlPersist" when
+ * SDL receives onAwakeSDL notification
+ */
+ virtual void StartSavePersistentDataTimer() = 0;
+
+ /**
* @brief Start timer for resumption applications
* Restore D1-D5 data
* @param application that is need to be restored
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
index 17aabb6d60..e749118140 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
@@ -33,6 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_IMPL_H_
+#include "application_manager/resumption/resume_ctrl.h"
+
#include <stdint.h>
#include <vector>
#include <map>
@@ -46,7 +48,6 @@
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "application_manager/resumption/resumption_data.h"
-#include "application_manager/resumption/resume_ctrl.h"
#include "utils/timer.h"
namespace resumption {
@@ -138,6 +139,10 @@ class ResumeCtrlImpl : public ResumeCtrl,
*/
void OnAwake() OVERRIDE;
+ void SaveLowVoltageTime() OVERRIDE;
+
+ void SaveWakeUpTime() OVERRIDE;
+
/**
* @brief Checks if SDL has already received OnExitAllApplication notification
* with "SUSPEND" reason
@@ -155,6 +160,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
void StopSavePersistentDataTimer() OVERRIDE;
/**
+ * @brief Check if all IGNITION OFF and IGNITION ON records
+ * saved in resumption data base
+ * @return True if all records saved, otherwise False
+ */
+ bool CheckIgnCyclesData() const;
+
+ /**
* @brief Method stops restore_hmi_level_timer_ "RsmCtrlRstore" in OnSuspend()
*/
void StopRestoreHmiLevelTimer();
@@ -300,7 +312,7 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Method starts timer "RsmCtrlPercist" when
* SDL receives onAwakeSDL notification
*/
- void StartSavePersistentDataTimer();
+ void StartSavePersistentDataTimer() OVERRIDE;
#ifdef BUILD_TESTS
void set_resumption_storage(
@@ -310,6 +322,20 @@ class ResumeCtrlImpl : public ResumeCtrl,
#endif // BUILD_TESTS
private:
/**
+ * @brief Returns Low Voltage signal timestamp
+ * @return Low Voltage event timestamp if event LOW VOLTAGE event occures
+ * otherwise 0
+ */
+ time_t LowVoltageTime() const;
+
+ /**
+ * @brief Returns Wake Up signal timestamp
+ * @return Wake Up timestamp if Wake Up signal occures
+ * otherwise 0
+ */
+ time_t WakeUpTime() const;
+
+ /**
* @brief restores saved data of application
* @param application contains application for which restores data
* @return true if success, otherwise return false
@@ -390,11 +416,27 @@ class ResumeCtrlImpl : public ResumeCtrl,
void AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is allowed for resumption
+ * by Ignition Cycle restrictions
+ * @param saved_app application specific section from backup file
+ * @return True if allowed , otherwise - False
+ */
bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app);
- bool DisconnectedJustBeforeIgnOff(
- const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is allowed for resumption
+ * by Low Voltage restrictions
+ * @param saved_app application specific section from backup file
+ * @return True if allowed , otherwise - False
+ */
+ bool CheckLowVoltageRestrictions(const smart_objects::SmartObject& saved_app);
+ /**
+ * @brief Checks if saved HMI level is applicable for resumption
+ * @param saved_app application specific section from backup file
+ * @return True fs allowed , otherwise - False
+ */
bool CheckAppRestrictions(app_mngr::ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app);
@@ -409,10 +451,38 @@ class ResumeCtrlImpl : public ResumeCtrl,
/**
* @brief CheckDelayAfterIgnOn should check if SDL was started less
- * then N seconds ago. N will be readed from profile.
+ * than N seconds ago. N will be read from profile.
* @return true if SDL started N seconds ago, otherwise return false
*/
- bool CheckDelayAfterIgnOn();
+ bool CheckDelayAfterIgnOn() const;
+
+ /**
+ * @brief CheckDelayBeforeIgnOff checks if app was unregistered less
+ * than N seconds before Ignition OFF. N will be read from profile.
+ * @return true if app was disconnected within timeframe of N seconds before
+ * Ignition Off,
+ * otherwise return false
+ */
+ bool CheckDelayBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) const;
+
+ /**
+ * @brief CheckDelayAfterWakeUp should check if app was registered
+ * during the first N seconds after WakeUp signal. N will be read from
+ * profile.
+ * @return true if app registered within N seconds after WakeUp, otherwise
+ * return false
+ */
+ bool CheckDelayAfterWakeUp() const;
+
+ /**
+ * @brief CheckDelayBeforeLowVoltage checks if app was unregistered within
+ * N seconds before Low Voltage signal. N will be read from profile.
+ * @return true if app was disconnected within timeframe of N seconds before
+ * Low Voltage , otherwise return false
+ */
+ bool CheckDelayBeforeLowVoltage(
+ const smart_objects::SmartObject& saved_app) const;
typedef std::pair<uint32_t, uint32_t> application_timestamp;
@@ -447,7 +517,7 @@ class ResumeCtrlImpl : public ResumeCtrl,
* @brief Get the last ignition off time from LastState
* @return the last ignition off time from LastState
*/
- time_t GetIgnOffTime();
+ time_t GetIgnOffTime() const;
/**
* @brief Setup IgnOff time to LastState
@@ -535,6 +605,8 @@ class ResumeCtrlImpl : public ResumeCtrl,
bool is_data_saved_;
bool is_suspended_;
time_t launch_time_;
+ time_t low_voltage_time_;
+ time_t wake_up_time_;
std::shared_ptr<ResumptionData> resumption_storage_;
application_manager::ApplicationManager& application_manager_;
};
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
index 5ecfaf3c11..c2634173a5 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
@@ -95,20 +95,26 @@ class ResumptionData {
virtual void IncrementIgnOffCount() = 0;
/**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
+ * @brief Decrements ignition counter for all registered applications
*/
- DEPRECATED virtual void OnSuspend() = 0;
+ virtual void DecrementIgnOffCount() = 0;
/**
- * @brief Decrements ignition counter for all registered applications
+ * @brief Increments global ignition on counter
+ * by 1
*/
- virtual void DecrementIgnOffCount() = 0;
+ virtual void IncrementGlobalIgnOnCounter() = 0;
/**
- * @brief Decrements ignition counter for all registered applications
+ * @brief Get the global ignition on counter
+ * @return the global ignition on counter
+ */
+ virtual uint32_t GetGlobalIgnOnCounter() const = 0;
+
+ /**
+ * @brief Resets global ignition on counter
*/
- DEPRECATED virtual void OnAwake() = 0;
+ virtual void ResetGlobalIgnOnCount() = 0;
/**
* @brief Retrieves hash ID for the given mobile app ID
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
index 780aac82c1..2b5a1fdcc9 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
@@ -110,16 +110,11 @@ class ResumptionDataDB : public ResumptionData {
virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
const std::string& device_id) const;
- /**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- DEPRECATED void OnSuspend() FINAL;
+ void IncrementGlobalIgnOnCounter() OVERRIDE;
- /**
- * @brief Decrements ignition counter for all registered applications
- */
- DEPRECATED void OnAwake() FINAL;
+ uint32_t GetGlobalIgnOnCounter() const OVERRIDE;
+
+ void ResetGlobalIgnOnCount() OVERRIDE;
/**
* @brief Increments ignition counter for all registered applications
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
index 82ec1d9e5c..e2418fd033 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
@@ -80,18 +80,6 @@ class ResumptionDataJson : public ResumptionData {
*/
virtual uint32_t GetHMIApplicationID(const std::string& policy_app_id,
const std::string& device_id) const;
-
- /**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- DEPRECATED void OnSuspend() FINAL;
-
- /**
- * @brief Decrements ignition counter for all registered applications
- */
- DEPRECATED void OnAwake() FINAL;
-
/**
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
@@ -145,6 +133,12 @@ class ResumptionDataJson : public ResumptionData {
*/
virtual uint32_t GetIgnOffTime() const;
+ void IncrementGlobalIgnOnCounter() OVERRIDE;
+
+ uint32_t GetGlobalIgnOnCounter() const OVERRIDE;
+
+ void ResetGlobalIgnOnCount() OVERRIDE;
+
/**
* @brief Checks if saved data have application
* @param policy_app_id - mobile application id
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
index 33d62740f7..eee7650697 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
@@ -57,7 +57,10 @@ extern const std::string kUpdateIgnOffCount;
extern const std::string kCountApplicationsIgnOff;
extern const std::string kSelectApplicationsIgnOffCount;
extern const std::string kUpdateSuspendData;
-extern const std::string KUpdateLastIgnOffTime;
+extern const std::string kUpdateLastIgnOffTime;
+extern const std::string kUpdateGlobalIgnOnCount;
+extern const std::string kResetGlobalIgnOnCount;
+extern const std::string kSelectGlobalIgnOnCounter;
extern const std::string kDeleteFile;
extern const std::string kDeleteApplicationFilesArray;
extern const std::string kDeleteSubMenu;
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index 50ea6094c0..1291829eb5 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -314,6 +314,8 @@ extern const char* resume_vr_grammars;
extern const char* ign_off_count;
+extern const char* global_ign_on_counter;
+
extern const char* connection_info;
extern const char* is_download_complete;
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 fc3721e763..3bc34be8d1 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
@@ -30,19 +30,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
namespace app_mngr = application_manager;
namespace commands {
-class RCButtonPressRequest
- : public application_manager::commands::RequestToHMI {
+class RCButtonPressRequest : public app_mngr::commands::RequestToHMI {
public:
/**
* @brief RCButtonPressRequest class constructor
@@ -54,11 +55,7 @@ class RCButtonPressRequest
* @param resource_allocation_manager ResourceAllocationManager
**/
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,
- ResourceAllocationManager& resource_allocation_manager);
+ const RCCommandParams& params);
/**
* @brief Execute command
*/
@@ -68,4 +65,4 @@ class RCButtonPressRequest
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_REQUEST_H_
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 c16f4de0cc..939d5fa468 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
@@ -30,11 +30,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -54,11 +56,7 @@ class RCButtonPressResponse
* @param resource_allocation_manager ResourceAllocationManager
**/
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,
- ResourceAllocationManager& resource_allocation_manager);
+ const RCCommandParams& params);
void Run() OVERRIDE;
@@ -67,4 +65,4 @@ class RCButtonPressResponse
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_BUTTON_PRESS_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
index fc2e0d6536..97df5e8390 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h
@@ -34,7 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_
#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -45,12 +47,8 @@ class RCGetInteriorVehicleDataConsentRequest
: public application_manager::commands::RequestToHMI {
public:
RCGetInteriorVehicleDataConsentRequest(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
~RCGetInteriorVehicleDataConsentRequest();
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
index a037d33d5a..46232987a5 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h
@@ -34,7 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_RESPONSE_H_
#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -54,12 +56,8 @@ class RCGetInteriorVehicleDataConsentResponse
* @param resource_allocation_manager ResourceAllocationManager
**/
RCGetInteriorVehicleDataConsentResponse(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
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 9f7b1211b7..a88a39aa7a 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
@@ -34,7 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -45,12 +47,8 @@ class RCGetInteriorVehicleDataRequest
: public application_manager::commands::RequestToHMI {
public:
RCGetInteriorVehicleDataRequest(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
~RCGetInteriorVehicleDataRequest();
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 28f9b4b9c7..c9e5d39d1d 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
@@ -34,7 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -45,12 +47,8 @@ class RCGetInteriorVehicleDataResponse
: public application_manager::commands::ResponseFromHMI {
public:
RCGetInteriorVehicleDataResponse(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
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 0afa613c7c..aeb0a06d22 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
@@ -30,11 +30,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
#include "application_manager/commands/notification_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -54,12 +56,8 @@ class RCOnInteriorVehicleDataNotification
* @param resource_allocation_manager ResourceAllocationManager
**/
RCOnInteriorVehicleDataNotification(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
~RCOnInteriorVehicleDataNotification();
@@ -71,4 +69,4 @@ class RCOnInteriorVehicleDataNotification
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
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 b9ab821176..7aa1aa3dba 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
@@ -30,15 +30,18 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
#include "application_manager/commands/notification_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
namespace app_mngr = application_manager;
+class InteriorDataManager;
namespace commands {
class RCOnRemoteControlSettingsNotification
@@ -54,12 +57,8 @@ class RCOnRemoteControlSettingsNotification
* @param resource_allocation_manager ResourceAllocationManager
**/
RCOnRemoteControlSettingsNotification(
- 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,
- rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
/**
* @brief Execute command
**/
@@ -69,7 +68,7 @@ class RCOnRemoteControlSettingsNotification
private:
ResourceAllocationManager& resource_allocation_manager_;
-
+ InteriorDataManager& interior_data_manager_;
/**
* @brief Disalows RC functionality for all RC apps
* All registered apps will be unsubsribed from OnInteriorVehicleData
@@ -80,4 +79,4 @@ class RCOnRemoteControlSettingsNotification
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
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 194b423b1a..69b48bfecf 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
@@ -34,7 +34,9 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
#include "application_manager/commands/request_to_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -54,12 +56,8 @@ class RCSetInteriorVehicleDataRequest
* @param resource_allocation_manager ResourceAllocationManager
**/
RCSetInteriorVehicleDataRequest(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
~RCSetInteriorVehicleDataRequest();
};
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 f23acda4d4..8a63503220 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
@@ -30,11 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#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
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
#include "application_manager/commands/response_from_hmi.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -54,12 +56,8 @@ class RCSetInteriorVehicleDataResponse
* @param resource_allocation_manager ResourceAllocationManager
**/
RCSetInteriorVehicleDataResponse(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
@@ -68,4 +66,4 @@ class RCSetInteriorVehicleDataResponse
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_HMI_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
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 fa89c10bf9..d6ecfd0128 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_BUTTON_PRESS_REQUEST_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_BUTTON_PRESS_REQUEST_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
#include "rc_rpc_plugin/commands/rc_command_request.h"
@@ -41,12 +41,9 @@ namespace app_mngr = application_manager;
namespace commands {
class ButtonPressRequest : public RCCommandRequest {
public:
- ButtonPressRequest(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,
- ResourceAllocationManager& resource_allocation_manager);
+ ButtonPressRequest(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
/**
* @brief Execute command
@@ -96,4 +93,4 @@ class ButtonPressRequest : public RCCommandRequest {
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_BUTTON_PRESS_REQUEST_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_REQUEST_H_
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 16d7b0e3fe..0f3964494e 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
@@ -30,11 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_BUTTON_PRESS_RESPONSE_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_BUTTON_PRESS_RESPONSE_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -44,12 +46,9 @@ namespace commands {
class ButtonPressResponse
: public application_manager::commands::CommandResponseImpl {
public:
- ButtonPressResponse(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,
- ResourceAllocationManager& resource_allocation_manager);
+ ButtonPressResponse(
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
/**
* @brief ButtonPressResponse class destructor
@@ -59,4 +58,4 @@ class ButtonPressResponse
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_BUTTON_PRESS_RESPONSE_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_
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 c2ae0e887f..4624d79b56 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
@@ -43,12 +43,8 @@ namespace commands {
class GetInteriorVehicleDataRequest : public RCCommandRequest {
public:
GetInteriorVehicleDataRequest(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
/**
* @brief Execute command
*/
@@ -67,6 +63,9 @@ class GetInteriorVehicleDataRequest : public RCCommandRequest {
~GetInteriorVehicleDataRequest();
private:
+ std::vector<application_manager::ApplicationSharedPtr>
+ AppsSubscribedToModuleType(const std::string& module_type);
+
/**
* @brief Check if app wants to proceed with already setup subscription
* @param request_params request parameters to check
@@ -80,8 +79,7 @@ class GetInteriorVehicleDataRequest : public RCCommandRequest {
* @brief Handle subscription to vehicle data
* @param hmi_response json message with response from HMI
*/
- void ProccessSubscription(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_response);
+ void ProccessSubscription(const smart_objects::SmartObject& hmi_response);
/**
* @brief Cuts off subscribe parameter
@@ -91,6 +89,11 @@ class GetInteriorVehicleDataRequest : public RCCommandRequest {
std::string ModuleType() FINAL;
bool excessive_subscription_occured_;
+ bool ProcessCapabilities();
+ void ProcessResponseToMobileFromCache(app_mngr::ApplicationSharedPtr app);
+ bool CheckRateLimits();
+ bool AppShouldBeUnsubscribed();
+ bool TheLastAppShouldBeUnsubscribed(app_mngr::ApplicationSharedPtr app);
};
} // 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 78148ab7df..bf8208edc2 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
@@ -30,11 +30,13 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -45,12 +47,8 @@ class GetInteriorVehicleDataResponse
: public application_manager::commands::CommandResponseImpl {
public:
GetInteriorVehicleDataResponse(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
@@ -59,4 +57,4 @@ class GetInteriorVehicleDataResponse
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
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 20a7e69868..931e79366c 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
@@ -36,6 +36,8 @@
#include <string>
#include "application_manager/commands/command_notification_impl.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -46,18 +48,18 @@ class OnInteriorVehicleDataNotification
: public application_manager::commands::CommandNotificationImpl {
public:
OnInteriorVehicleDataNotification(
- 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_handler,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
std::string ModuleType();
~OnInteriorVehicleDataNotification();
+
+ private:
+ InteriorDataCache& interior_data_cache_;
+ void AddDataToCache(const std::string& module_type);
};
} // namespace commands
} // namespace rc_rpc_plugin
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 83a8dfdd75..d5de4981c6 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#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
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
#include "rc_rpc_plugin/commands/rc_command_request.h"
@@ -42,12 +42,8 @@ namespace commands {
class SetInteriorVehicleDataRequest : public RCCommandRequest {
public:
SetInteriorVehicleDataRequest(
- 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,
- rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
/**
* @brief Execute command
@@ -118,8 +114,17 @@ class SetInteriorVehicleDataRequest : public RCCommandRequest {
*/
const smart_objects::SmartObject& ControlData(
const smart_objects::SmartObject& module_data);
+
+ /**
+ * @brief CheckAudioSource check that if app wants to change
+ * the audio source from MOBILE_APP to other types of audio
+ * source without keepContext parameter or with keepContext=false
+ * then this app will go to HMI level 'BACKGROUND'
+ * @param module_data received params
+ */
+ void CheckAudioSource(const smart_objects::SmartObject& audio_data);
};
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
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 5661a57c07..1ab5ccc6bc 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
@@ -30,11 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_request.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -45,12 +47,8 @@ class SetInteriorVehicleDataResponse
: public application_manager::commands::CommandResponseImpl {
public:
SetInteriorVehicleDataResponse(
- 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,
- ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
void Run() OVERRIDE;
@@ -59,4 +57,4 @@ class SetInteriorVehicleDataResponse
} // namespace commands
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_COMMANDS_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
new file mode 100644
index 0000000000..8e7ed9c667
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
+
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+class HMICapabilities;
+}
+
+namespace policy {
+class PolicyHandlerInterface;
+}
+
+namespace rc_rpc_plugin {
+
+class ResourceAllocationManager;
+class InteriorDataCache;
+class InteriorDataManager;
+
+struct RCCommandParams {
+ application_manager::ApplicationManager& application_manager_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+ application_manager::HMICapabilities& hmi_capabilities_;
+ policy::PolicyHandlerInterface& policy_handler_;
+ rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager_;
+ rc_rpc_plugin::InteriorDataCache& interior_data_cache_;
+ rc_rpc_plugin::InteriorDataManager& interior_data_manager_;
+};
+}
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_
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 7c5e6f0ebc..ce95617b6c 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
@@ -30,12 +30,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "rc_rpc_plugin/rc_app_extension.h"
#include "application_manager/commands/command_request_impl.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_params.h"
namespace rc_rpc_plugin {
namespace app_mngr = application_manager;
@@ -56,12 +58,8 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
* @param resource_allocation_manager ResourceAllocationManager
**/
RCCommandRequest(
- 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_handl,
- rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager);
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params);
virtual ~RCCommandRequest();
@@ -73,9 +71,11 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
protected:
bool is_subscribed;
- ResourceAllocationManager& resource_allocation_manager_;
bool auto_allowed_;
+ ResourceAllocationManager& resource_allocation_manager_;
+ InteriorDataCache& interior_data_cache_;
+ InteriorDataManager& interior_data_manager_;
/**
* @brief AcquireResource try to allocate resource for application
* In case if allocation of resource is not required, return ALLOWED by
@@ -169,4 +169,4 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl {
}
}
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
new file mode 100644
index 0000000000..f12566d14c
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
+#include <string>
+#include "smart_objects/smart_object.h"
+
+namespace rc_rpc_plugin {
+
+/**
+ * @brief The InteriorDataCache interface for caching data class
+ * Provide ability to cache module data by module type name and clear cache
+ */
+class InteriorDataCache {
+ public:
+ /**
+ * @brief Add module data to cache
+ * @param module_type module type name
+ * @param module_data data to be cached
+ */
+ virtual void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) = 0;
+
+ /**
+ * @brief Retrieve Get cached data
+ * @param module_type data type to get from cache
+ * @return smart object with cached data, or nulll smart object
+ */
+ virtual smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const = 0;
+
+ /**
+ * @brief Contains check if data exists in cache
+ * @param module_type module type name to check in cache
+ * @return true if cached, false otherwize
+ */
+ virtual bool Contains(const std::string& module_type) const = 0;
+
+ /**
+ * @brief Remove cached data
+ * @param module_type data type to remove from cache
+ */
+ virtual void Remove(const std::string& module_type) = 0;
+
+ /**
+ * @brief Clear clear all cached data
+ */
+ virtual void Clear() = 0;
+};
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
new file mode 100644
index 0000000000..f2971e3d72
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
+
+#include <map>
+
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+namespace rc_rpc_plugin {
+class InteriorDataCacheImpl : public InteriorDataCache {
+ public:
+ InteriorDataCacheImpl();
+
+ ~InteriorDataCacheImpl();
+
+ void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) OVERRIDE;
+ smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const OVERRIDE;
+ bool Contains(const std::string& module_type) const OVERRIDE;
+ void Remove(const std::string& module_type) OVERRIDE;
+ void Clear() OVERRIDE;
+
+ private:
+ std::map<std::string, smart_objects::SmartObject> cached_data_;
+ mutable sync_primitives::Lock cached_data_lock_;
+};
+
+} // rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
new file mode 100644
index 0000000000..f28c388055
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
+
+#include "application_manager/application.h"
+#include "application_manager/plugin_manager/rpc_plugin.h"
+
+namespace rc_rpc_plugin {
+
+namespace app_mngr = application_manager;
+namespace plugins = application_manager::plugin_manager;
+
+class InteriorDataManager {
+ public:
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) = 0;
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnDisablingRC process disable RC event. Unsubscribe from all modules
+ * and clear cache
+ */
+ virtual void OnDisablingRC() = 0;
+
+ /**
+ * @brief StoreRequestToHMITime save information and time stamp of
+ * current interior data subscriptions
+ */
+ virtual void StoreRequestToHMITime(const std::string& module_type) = 0;
+
+ /**
+ * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed of
+ * bounce during current time frame.
+ * calculate amount of requests per module type in time frame and checks if it
+ * bigger then allowed by ini file
+ * @param module_type moduletype to calculate frequency on
+ * @return true if amount of requests was not exceeded, otherwise return false.
+ */
+ virtual bool CheckRequestsToHMIFrequency(const std::string& module_type) = 0;
+};
+
+} // namespace rc_rpc_plugin
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
new file mode 100644
index 0000000000..b36f47f260
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
+#include "rc_rpc_plugin/interior_data_manager.h"
+#include "utils/date_time.h"
+
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+}
+namespace rc_rpc_plugin {
+
+class InteriorDataCache;
+class RCRPCPlugin;
+
+class InteriorDataManagerImpl : public InteriorDataManager {
+ public:
+ InteriorDataManagerImpl(
+ RCRPCPlugin& rc_plugin,
+ InteriorDataCache& cache,
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service);
+
+ void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE;
+
+ void OnApplicationEvent(plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) OVERRIDE;
+
+ void OnDisablingRC() OVERRIDE;
+
+ void StoreRequestToHMITime(const std::string& module_type) OVERRIDE;
+
+ bool CheckRequestsToHMIFrequency(const std::string& module_type) OVERRIDE;
+
+ private:
+ /**
+ * @brief UpdateHMISubscriptionsOnPolicyUpdated process policy update event.
+ * If some modules was disabeled by policies and there are no applications
+ * that subscribed to them - send RC.GetInteriorVehicleData(subscribe=false)
+ * and clear cache
+ */
+ void UpdateHMISubscriptionsOnPolicyUpdated();
+
+ /**
+ * @brief UpdateHMISubscriptionsOnAppUnregistered process AppUnregistered
+ * event and unsubscribed from not actual module types
+ * @param app application that was unregistered
+ */
+ void UpdateHMISubscriptionsOnAppUnregistered(
+ application_manager::Application& app);
+
+ /**
+ * @brief UnsubscribeFromInteriorVehicleData remove module_type from cache and
+ * send RC.GetInteriorVehicleData(subscribe=false) to HMI
+ * @param module_type module type that need to be unsubscribed
+ */
+ void UnsubscribeFromInteriorVehicleData(const std::string& module_type);
+
+ void ClearOldRequestsToHMIHistory();
+ /**
+ * @brief AppsModules mapping from applications to list of modules
+ */
+ typedef std::map<application_manager::ApplicationSharedPtr,
+ std::vector<std::string> > AppsModules;
+
+ /**
+ * @brief AppsSubscribedModules get mapping of application to list of
+ * subscribed modules
+ * @return map of applications to list of subscribed modules
+ */
+ AppsModules AppsSubscribedModules();
+
+ /**
+ * @brief RequestsToHMIHistory mapping from module type to vector of time
+ * stamps
+ */
+ typedef std::map<std::string, std::deque<TimevalStruct> >
+ RequestsToHMIHistory;
+ RequestsToHMIHistory requests_to_hmi_history_;
+ mutable sync_primitives::Lock requests_to_hmi_history_lock_;
+
+ RCRPCPlugin& rc_plugin_;
+ InteriorDataCache& cache_;
+ application_manager::ApplicationManager& app_mngr_;
+ application_manager::rpc_service::RPCService& rpc_service_;
+};
+
+} // namespace rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_MANAGER_IMPL_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
index 72f29c7de1..14397237c5 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
#include <string>
#include <set>
@@ -69,6 +69,12 @@ class RCAppExtension : public application_manager::AppExtension {
*/
bool IsSubscibedToInteriorVehicleData(const std::string& module_type);
+ /**
+ * @brief get list of subscriptions of application
+ * @return list of subscriptions of application
+ */
+ std::set<std::string> InteriorVehicleDataSubscriptions() const;
+
private:
std::set<std::string> subscribed_interior_vehicle_data_;
@@ -84,4 +90,4 @@ typedef std::shared_ptr<RCAppExtension> RCAppExtensionPtr;
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
index 6f101cefef..56be342b56 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
#include <memory>
#include "application_manager/command_factory.h"
@@ -41,6 +41,8 @@
#include "application_manager/hmi_capabilities.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/commands/rc_command_params.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -56,11 +58,7 @@ class RCCommandFactory : public application_manager::CommandFactory {
* @param policy_handler PolicyHandlerInterface
* @param allocation_manager ResourceAllocationManager
**/
- RCCommandFactory(app_mngr::ApplicationManager& app_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- ResourceAllocationManager& allocation_manager);
+ RCCommandFactory(const RCCommandParams& params);
application_manager::CommandSharedPtr CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::commands::Command::CommandSource source) OVERRIDE;
@@ -84,11 +82,7 @@ class RCCommandFactory : public application_manager::CommandFactory {
hmi_apis::FunctionID::eType id,
hmi_apis::messageType::eType message_type) const;
- app_mngr::ApplicationManager& app_manager_;
- app_mngr::rpc_service::RPCService& rpc_service_;
- app_mngr::HMICapabilities& hmi_capabilities_;
- PolicyHandlerInterface& policy_handler_;
- ResourceAllocationManager& allocation_manager_;
+ RCCommandParams params_;
};
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
new file mode 100644
index 0000000000..cf3c6cd5e4
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2018, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
+
+#include <map>
+#include <string>
+#include "application_manager/application.h"
+#include "rc_rpc_plugin/rc_app_extension.h"
+
+namespace rc_rpc_plugin {
+class RCRPCPlugin;
+
+/**
+ * @brief The RCHelpers class contains frequently used static data
+ * structures related strictly to RC
+ * Converters, mapping, factory functions
+ */
+class RCHelpers {
+ public:
+ /**
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module data filed name
+ * @return module mapping from enum naming to filed name
+ */
+ static const std::function<std::string(const std::string& module_type)>
+ GetModuleTypeToDataMapping();
+
+ /**
+ * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to
+ * actual module capabilities key
+ * @return module mapping from enum naming to capabilities key
+ */
+ static const std::function<std::string(const std::string& module_type)>
+ GetModuleTypeToCapabilitiesMapping();
+
+ /**
+ * @brief GetModulesList get list of all known modules
+ * @return vector contains all known modules
+ */
+ static const std::vector<std::string> GetModulesList();
+
+ /**
+ * @brief GetRCExtension extract RC extension from application
+ * @param app application to extract extension
+ * @return rc extension of app is rc applicaiton, otherwise return emty shared
+ * pointer.
+ */
+ static RCAppExtensionPtr GetRCExtension(
+ application_manager::Application& app);
+
+ static smart_objects::SmartObjectSPtr CreateUnsubscribeRequestToHMI(
+ const std::string& module_type, const uint32_t correlation_id);
+
+ static std::vector<application_manager::ApplicationSharedPtr>
+ AppsSubscribedToModuleType(application_manager::ApplicationManager& app_mngr,
+ const std::string& module_type);
+
+ typedef std::map<application_manager::ApplicationSharedPtr,
+ std::vector<std::string> > AppsModules;
+ static AppsModules GetApplicationsAllowedModules(
+ application_manager::ApplicationManager& app_mngr);
+};
+
+} // rc_rpc_plugin
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
index f2037aabbb..e80507445b 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
namespace rc_rpc_plugin {
@@ -40,7 +40,23 @@ namespace strings {
const char kclimateControlCapabilities[] = "climateControlCapabilities";
const char kradioControlCapabilities[] = "radioControlCapabilities";
const char kbuttonCapabilities[] = "buttonCapabilities";
+const char kaudioControlCapabilities[] = "audioControlCapabilities";
+const char klightControlCapabilities[] = "lightControlCapabilities";
+const char khmiSettingsControlCapabilities[] = "hmiSettingsControlCapabilities";
const char kseatControlCapabilities[] = "seatControlCapabilities";
+// RemoteControlCapabilities constants
+
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+const char kSupportedLights[] = "supportedLights";
+
+// LightControlCapabilities
+const char kName[] = "name";
+const char kDensityAvailable[] = "densityAvailable";
+const char kRGBColorSpaceAvailable[] = "rgbColorSpaceAvailable";
+
+// RadioControlCapabilities
+const char kSiriusxmRadioAvailable[] = "siriusxmRadioAvailable";
} // strings
namespace result_codes {
@@ -139,6 +155,7 @@ const char kSignalStrength[] = "signalStrength";
const char kSignalChangeThreshold[] = "signalChangeThreshold";
const char kRadioEnable[] = "radioEnable";
const char kState[] = "state";
+const char kSisData[] = "sisData";
// RadioControlData struct
// ClimateControlData struct
@@ -153,11 +170,30 @@ const char kDefrostZone[] = "defrostZone";
const char kDualModeEnable[] = "dualModeEnable";
const char kACMaxEnable[] = "acMaxEnable";
const char kVentilationMode[] = "ventilationMode";
+const char kHeatedSteeringWheelEnable[] = "heatedSteeringWheelEnable";
+const char kHeatedWindshieldEnable[] = "heatedWindshieldEnable";
+const char kHeatedRearWindowEnable[] = "heatedRearWindowEnable";
+const char kHeatedMirrorsEnable[] = "heatedMirrorsEnable";
// ClimateControlData struct
+// LightControlData
+const char kLightState[] = "lightState";
+const char kStatus[] = "status";
+const char kDensity[] = "density";
+const char kColor[] = "color";
+
+// AudioControlData
+const char kSource[] = "source";
+const char kKeepContext[] = "keepContext";
+const char kEqualizerSettings[] = "equalizerSettings";
+const char kChannelName[] = "channelName";
+
// ModuleData struct
const char kRadioControlData[] = "radioControlData";
const char kClimateControlData[] = "climateControlData";
+const char kAudioControlData[] = "audioControlData";
+const char kLightControlData[] = "lightControlData";
+const char kHmiSettingsControlData[] = "hmiSettingsControlData";
const char kSeatControlData[] = "seatControlData";
// ModuleData struct
@@ -173,6 +209,9 @@ namespace enums_value {
const char kClimate[] = "CLIMATE";
const char kRadio[] = "RADIO";
const char kSeat[] = "SEAT";
+const char kAudio[] = "AUDIO";
+const char kLight[] = "LIGHT";
+const char kHmiSettings[] = "HMI_SETTINGS";
// ModuleType enum
// RadioBand enum
@@ -235,4 +274,4 @@ const char kAskDriver[] = "ASK_DRIVER";
} // namespace remote_control
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
index 910eda6d3c..ae88ed9cc0 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h
@@ -30,15 +30,21 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_PLUGIN_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_PLUGIN_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
+
+#include <memory>
+
#include "application_manager/plugin_manager/rpc_plugin.h"
#include "application_manager/command_factory.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
namespace rc_rpc_plugin {
namespace plugins = application_manager::plugin_manager;
namespace app_mngr = application_manager;
+
class RCRPCPlugin : public plugins::RPCPlugin {
public:
/**
@@ -72,6 +78,7 @@ class RCRPCPlugin : public plugins::RPCPlugin {
* @return plugins command factory
*/
app_mngr::CommandFactory& GetCommandFactory() OVERRIDE;
+
/**
* @brief OnPolicyEvent Processes policy related events
* @param event Policy event
@@ -92,11 +99,15 @@ class RCRPCPlugin : public plugins::RPCPlugin {
application_manager::ApplicationManager& app_mngr);
private:
+ application_manager::rpc_service::RPCService* rpc_service_;
+ application_manager::ApplicationManager* app_mngr_;
std::unique_ptr<application_manager::CommandFactory> command_factory_;
std::unique_ptr<ResourceAllocationManager> resource_allocation_manager_;
+ std::unique_ptr<InteriorDataCache> interior_data_cache_;
+ std::unique_ptr<InteriorDataManager> interior_data_manager_;
};
} // namespace rc_rpc_plugin
extern "C" application_manager::plugin_manager::RPCPlugin* Create();
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_PLUGIN_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_RPC_PLUGIN_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
index 91d1b09fca..67598b667b 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
#include <string>
#include "utils/macro.h"
@@ -154,9 +154,6 @@ class ResourceAllocationManager {
*/
virtual void ResetAllAllocations() = 0;
- virtual RCAppExtensionPtr GetApplicationExtention(
- application_manager::ApplicationSharedPtr application) = 0;
-
/**
* @brief Create and send OnRCStatusNotification to mobile and HMI
* @param event trigger for notification sending
@@ -178,4 +175,4 @@ class ResourceAllocationManager {
};
} // namespace rc_rpc_plugin
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
index d6124a026b..b359ee4d29 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
#include "rc_rpc_plugin/resource_allocation_manager.h"
#include "application_manager/application_impl.h"
#include "rc_rpc_plugin/rc_app_extension.h"
@@ -110,14 +110,6 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
void ResetAllAllocations() FINAL;
- /**
- * @brief GetApplicationExtention Provides access to application RC extention
- * @param application Application
- * @return Pointer to RC extention of application or NULL if not available
- */
- RCAppExtensionPtr GetApplicationExtention(
- application_manager::ApplicationSharedPtr application) FINAL;
-
void SendOnRCStatusNotifications(
NotificationTrigger::eType event,
application_manager::ApplicationSharedPtr application) FINAL;
@@ -198,8 +190,6 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
*/
void SetResourceFree(const std::string& module_type, const uint32_t app_id);
- std::vector<std::string> all_supported_modules();
-
/**
* @brief AllocatedResources contains link between resource and application
* owning that resource
@@ -231,4 +221,4 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
};
} // rc_rpc_plugin
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_
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 d392420238..75faf5db8c 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
@@ -31,6 +31,8 @@
*/
#include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h"
+#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
+
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -38,18 +40,12 @@ namespace commands {
RCButtonPressRequest::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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : app_mngr::commands::RequestToHMI(message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
RCButtonPressRequest::~RCButtonPressRequest() {}
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 c7c11354c7..5c1691ed7b 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
@@ -37,19 +37,14 @@ namespace rc_rpc_plugin {
namespace commands {
RCButtonPressResponse::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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
void RCButtonPressResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
index 875f1c8fbf..774ee04677 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_request.cc
@@ -38,18 +38,12 @@ namespace commands {
RCGetInteriorVehicleDataConsentRequest::RCGetInteriorVehicleDataConsentRequest(
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,
- ResourceAllocationManager& resource_allocation_manager)
+ const RCCommandParams& params)
: application_manager::commands::RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
RCGetInteriorVehicleDataConsentRequest::
~RCGetInteriorVehicleDataConsentRequest() {}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
index 3a9bb12df1..3244857656 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_consent_response.cc
@@ -38,19 +38,14 @@ namespace commands {
RCGetInteriorVehicleDataConsentResponse::
RCGetInteriorVehicleDataConsentResponse(
- 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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const application_manager::commands::MessageSharedPtr& message,
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
void RCGetInteriorVehicleDataConsentResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
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 0bb5f73c1b..c7baf75e27 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
@@ -38,18 +38,12 @@ namespace commands {
RCGetInteriorVehicleDataRequest::RCGetInteriorVehicleDataRequest(
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,
- ResourceAllocationManager& resource_allocation_manager)
+ const RCCommandParams& params)
: application_manager::commands::RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
RCGetInteriorVehicleDataRequest::~RCGetInteriorVehicleDataRequest() {}
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 f12512a38d..e56f9088bc 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
@@ -31,6 +31,7 @@
*/
#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
#include "application_manager/event_engine/event.h"
namespace rc_rpc_plugin {
@@ -38,24 +39,30 @@ namespace commands {
RCGetInteriorVehicleDataResponse::RCGetInteriorVehicleDataResponse(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
void RCGetInteriorVehicleDataResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
app_mngr::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+
+ smart_objects::SmartObject& module_data = (*message_)
+ [application_manager::strings::msg_params][message_params::kModuleData];
+ if (module_data.keyExists(message_params::kAudioControlData)) {
+ smart_objects::SmartObject& audio_control_data =
+ module_data[message_params::kAudioControlData];
+ if (audio_control_data.keyExists(message_params::kKeepContext)) {
+ audio_control_data.erase(message_params::kKeepContext);
+ }
+ }
+
event.set_smart_object(*message_);
event.raise(application_manager_.event_dispatcher());
}
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 487193bc4d..0117003f11 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
@@ -30,6 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h"
#include "utils/macro.h"
@@ -38,18 +39,13 @@ namespace commands {
RCOnInteriorVehicleDataNotification::RCOnInteriorVehicleDataNotification(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::NotificationFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : application_manager::commands::NotificationFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
RCOnInteriorVehicleDataNotification::~RCOnInteriorVehicleDataNotification() {}
@@ -57,6 +53,17 @@ void RCOnInteriorVehicleDataNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
(*message_)[app_mngr::strings::params][app_mngr::strings::function_id] =
static_cast<int>(mobile_apis::FunctionID::eType::OnInteriorVehicleDataID);
+
+ smart_objects::SmartObject& module_data = (*message_)
+ [application_manager::strings::msg_params][message_params::kModuleData];
+ if (module_data.keyExists(rc_rpc_plugin::message_params::kAudioControlData)) {
+ smart_objects::SmartObject& audio_control_data =
+ module_data[message_params::kAudioControlData];
+ if (audio_control_data.keyExists(message_params::kKeepContext)) {
+ audio_control_data.erase(message_params::kKeepContext);
+ }
+ }
+
SendNotificationToMobile(message_);
}
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 8bcb6b08ed..b67e3e2553 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
@@ -32,7 +32,9 @@
#include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -49,17 +51,15 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::NotificationFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle)
- , resource_allocation_manager_(resource_allocation_manager) {}
+ const RCCommandParams& params)
+ : application_manager::commands::NotificationFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , resource_allocation_manager_(params.resource_allocation_manager_)
+ , interior_data_manager_(params.interior_data_manager_) {}
RCOnRemoteControlSettingsNotification::
~RCOnRemoteControlSettingsNotification() {}
@@ -87,13 +87,6 @@ std::string AccessModeToString(
return error;
}
-void UnsubscribeFromInteriorVehicleDataForAllModules(
- RCAppExtensionPtr extension) {
- LOG4CXX_AUTO_TRACE(logger_);
- extension->UnsubscribeFromInteriorVehicleData(enums_value::kClimate);
- extension->UnsubscribeFromInteriorVehicleData(enums_value::kRadio);
-}
-
void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() {
LOG4CXX_AUTO_TRACE(logger_);
typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
@@ -103,14 +96,8 @@ void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() {
DCHECK(app);
application_manager_.ChangeAppsHMILevel(
app->app_id(), mobile_apis::HMILevel::eType::HMI_NONE);
-
- const RCAppExtensionPtr extension =
- std::static_pointer_cast<RCAppExtension>(
- app->QueryInterface(RCRPCPlugin::kRCPluginID));
- if (extension) {
- UnsubscribeFromInteriorVehicleDataForAllModules(extension);
- }
}
+ interior_data_manager_.OnDisablingRC();
}
void RCOnRemoteControlSettingsNotification::Run() {
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 69ceed17e9..f0d5ecc177 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
@@ -38,18 +38,12 @@ namespace commands {
RCSetInteriorVehicleDataRequest::RCSetInteriorVehicleDataRequest(
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,
- ResourceAllocationManager& resource_allocation_manager)
+ const RCCommandParams& params)
: application_manager::commands::RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
RCSetInteriorVehicleDataRequest::~RCSetInteriorVehicleDataRequest() {}
void RCSetInteriorVehicleDataRequest::Run() {
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 42c2452943..56d924debe 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
@@ -38,18 +38,13 @@ namespace commands {
RCSetInteriorVehicleDataResponse::RCSetInteriorVehicleDataResponse(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : application_manager::commands::ResponseFromHMI(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
void RCSetInteriorVehicleDataResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
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 88e4ebaa3c..05e44cfb44 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
@@ -50,17 +50,8 @@ typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap;
ButtonPressRequest::ButtonPressRequest(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : RCCommandRequest(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle,
- resource_allocation_manager) {}
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params) {}
ButtonPressRequest::~ButtonPressRequest() {}
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 dfdb128322..491b0363c9 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
@@ -38,18 +38,13 @@ namespace commands {
ButtonPressResponse::ButtonPressResponse(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::CommandResponseImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
ButtonPressResponse::~ButtonPressResponse() {}
void ButtonPressResponse::Run() {
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 06c44d2ff3..6178405808 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
@@ -32,6 +32,8 @@
#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h"
#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/macro.h"
#include "interfaces/MOBILE_API.h"
@@ -46,31 +48,21 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : RCCommandRequest(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle,
- resource_allocation_manager)
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params)
+
, excessive_subscription_occured_(false) {}
bool CheckIfModuleTypeExistInCapabilities(
const smart_objects::SmartObject& rc_capabilities,
const std::string& module_type) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::map<std::string, std::string> params = {
- {enums_value::kRadio, strings::kradioControlCapabilities},
- {enums_value::kClimate, strings::kclimateControlCapabilities},
- {enums_value::kSeat, strings::kseatControlCapabilities}};
+ const auto& mapping = RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ const auto& module_list = RCHelpers::GetModulesList();
bool is_module_type_valid = false;
- for (const auto& param : params) {
- if (param.first == module_type) {
- if (rc_capabilities.keyExists(param.second)) {
+ for (const auto& module : module_list) {
+ if (module == module_type) {
+ if (rc_capabilities.keyExists(mapping(module))) {
is_module_type_valid = true;
break;
}
@@ -79,9 +71,8 @@ bool CheckIfModuleTypeExistInCapabilities(
return is_module_type_valid;
}
-void GetInteriorVehicleDataRequest::Execute() {
+bool GetInteriorVehicleDataRequest::ProcessCapabilities() {
LOG4CXX_AUTO_TRACE(logger_);
-
const smart_objects::SmartObject* rc_capabilities =
hmi_capabilities_.rc_capability();
@@ -93,26 +84,107 @@ void GetInteriorVehicleDataRequest::Execute() {
SendResponse(false,
mobile_apis::Result::UNSUPPORTED_RESOURCE,
"Accessing not supported module data");
+ return false;
+ }
+ return true;
+}
+
+void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache(
+ app_mngr::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ auto data = interior_data_cache_.Retrieve(ModuleType());
+ auto response_msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ response_msg_params[message_params::kModuleData][data_mapping(ModuleType())] =
+ data;
+ response_msg_params[message_params::kModuleData]
+ [message_params::kModuleType] = ModuleType();
+
+ const auto& request_msg_params = (*message_)[app_mngr::strings::msg_params];
+ LOG4CXX_DEBUG(logger_,
+ "kSubscribe exist" << request_msg_params.keyExists(
+ message_params::kSubscribe));
+ if (request_msg_params.keyExists(message_params::kSubscribe)) {
+ response_msg_params[message_params::kIsSubscribed] =
+ request_msg_params[message_params::kSubscribe].asBool();
+ if (request_msg_params[message_params::kSubscribe].asBool()) {
+ auto extension = RCHelpers::GetRCExtension(*app);
+ DCHECK(extension);
+ extension->SubscribeToInteriorVehicleData(ModuleType());
+ }
+ }
+ SendResponse(
+ true, mobile_apis::Result::SUCCESS, nullptr, &response_msg_params);
+ if (AppShouldBeUnsubscribed()) {
+ auto extension = RCHelpers::GetRCExtension(*app);
+ DCHECK(extension);
+ extension->UnsubscribeFromInteriorVehicleData(ModuleType());
+ }
+}
+
+bool GetInteriorVehicleDataRequest::CheckRateLimits() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return interior_data_manager_.CheckRequestsToHMIFrequency(ModuleType());
+}
+
+bool GetInteriorVehicleDataRequest::AppShouldBeUnsubscribed() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& msg_params = (*message_)[app_mngr::strings::msg_params];
+ if (msg_params.keyExists(message_params::kSubscribe)) {
+ return !(msg_params[message_params::kSubscribe].asBool());
+ }
+ return false;
+}
+
+bool GetInteriorVehicleDataRequest::TheLastAppShouldBeUnsubscribed(
+ app_mngr::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (AppShouldBeUnsubscribed()) {
+ const auto subscribed_to_module_type =
+ RCHelpers::AppsSubscribedToModuleType(application_manager_,
+ ModuleType());
+ if (subscribed_to_module_type.size() == 1 &&
+ subscribed_to_module_type.front() == app) {
+ LOG4CXX_DEBUG(logger_,
+ "The last application unsubscribes from " << ModuleType());
+ return true;
+ }
+ }
+ return false;
+}
+
+void GetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!ProcessCapabilities()) {
return;
}
app_mngr::ApplicationSharedPtr app =
application_manager_.application(connection_key());
- if (HasRequestExcessiveSubscription()) {
- excessive_subscription_occured_ = true;
- is_subscribed =
- (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
- .asBool();
- RemoveExcessiveSubscription();
+ if (TheLastAppShouldBeUnsubscribed(app) ||
+ !interior_data_cache_.Contains(ModuleType())) {
+ if (HasRequestExcessiveSubscription()) {
+ excessive_subscription_occured_ = true;
+ is_subscribed =
+ (*message_)[app_mngr::strings::msg_params][message_params::kSubscribe]
+ .asBool();
+ RemoveExcessiveSubscription();
+ }
+ if (!CheckRateLimits()) {
+ LOG4CXX_WARN(logger_, "GetInteriorVehicleData frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ interior_data_manager_.StoreRequestToHMITime(ModuleType());
+ SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleData,
+ &(*message_)[app_mngr::strings::msg_params],
+ true);
+ return;
}
-
- (*message_)[app_mngr::strings::msg_params][app_mngr::strings::app_id] =
- app->app_id();
-
- SendHMIRequest(hmi_apis::FunctionID::RC_GetInteriorVehicleData,
- &(*message_)[app_mngr::strings::msg_params],
- true);
+ ProcessResponseToMobileFromCache(app);
}
void GetInteriorVehicleDataRequest::on_event(
@@ -144,7 +216,21 @@ void GetInteriorVehicleDataRequest::on_event(
}
if (result) {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ DCHECK_OR_RETURN_VOID(app);
+ if (TheLastAppShouldBeUnsubscribed(app)) {
+ interior_data_cache_.Remove(ModuleType());
+ }
ProccessSubscription(hmi_response);
+ if (is_subscribed) {
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ const auto module_data =
+ hmi_response[app_mngr::strings::msg_params]
+ [message_params::kModuleData][data_mapping(ModuleType())];
+ interior_data_cache_.Add(ModuleType(), module_data);
+ }
} else {
hmi_response[app_mngr::strings::msg_params].erase(
message_params::kIsSubscribed);
@@ -152,6 +238,7 @@ void GetInteriorVehicleDataRequest::on_event(
std::string response_info;
GetInfo(hmi_response, response_info);
SetResourceState(ModuleType(), ResourceState::FREE);
+
SendResponse(result,
result_code,
response_info.c_str(),
@@ -178,8 +265,7 @@ void GetInteriorVehicleDataRequest::ProccessSubscription(
app_mngr::ApplicationSharedPtr app =
application_manager_.application(CommandRequestImpl::connection_key());
- RCAppExtensionPtr extension =
- resource_allocation_manager_.GetApplicationExtention(app);
+ const auto extension = RCHelpers::GetRCExtension(*app);
const char* module_type;
NsSmartDeviceLink::NsSmartObjects::
EnumConversionHelper<mobile_apis::ModuleType::eType>::EnumToCString(
@@ -258,8 +344,7 @@ bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription() {
if (is_subscribe_present_in_request) {
app_mngr::ApplicationSharedPtr app =
application_manager_.application(CommandRequestImpl::connection_key());
- RCAppExtensionPtr extension =
- resource_allocation_manager_.GetApplicationExtention(app);
+ const auto extension = RCHelpers::GetRCExtension(*app);
const bool is_app_already_subscribed =
extension->IsSubscibedToInteriorVehicleData(ModuleType());
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 18ccc5b497..a7572f1d62 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
@@ -38,18 +38,13 @@ namespace commands {
GetInteriorVehicleDataResponse::GetInteriorVehicleDataResponse(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::CommandResponseImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {}
void GetInteriorVehicleDataResponse::Run() {
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 fca9962fb5..c8d1329c02 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
@@ -33,6 +33,7 @@
#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/macro.h"
@@ -43,26 +44,34 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification(
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_handler,
- ResourceAllocationManager& resource_allocation_manager)
+ const RCCommandParams& params)
: app_mngr::commands::CommandNotificationImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {
- UNUSED(resource_allocation_manager);
-}
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
+ , interior_data_cache_(params.interior_data_cache_) {}
OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() {}
+void OnInteriorVehicleDataNotification::AddDataToCache(
+ const std::string& module_type) {
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ const auto module_data =
+ (*message_)[app_mngr::strings::msg_params][message_params::kModuleData]
+ [data_mapping(module_type)];
+ interior_data_cache_.Add(module_type, module_data);
+}
+
void OnInteriorVehicleDataNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
const std::string module_type = ModuleType();
-
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(application_manager_, module_type);
+ if (!apps_subscribed.empty()) {
+ AddDataToCache(module_type);
+ }
typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
AppPtrs apps = RCRPCPlugin::GetRCApplications(application_manager_);
@@ -70,8 +79,7 @@ void OnInteriorVehicleDataNotification::Run() {
DCHECK(*it);
application_manager::Application& app = **it;
- RCAppExtensionPtr extension = std::static_pointer_cast<RCAppExtension>(
- app.QueryInterface(RCRPCPlugin::kRCPluginID));
+ const auto extension = RCHelpers::GetRCExtension(app);
DCHECK(extension);
LOG4CXX_TRACE(logger_,
"Check subscription for "
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 83bb526076..17a492b5aa 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
@@ -33,6 +33,7 @@
#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/macro.h"
#include "json/json.h"
@@ -57,18 +58,11 @@ std::vector<std::string> GetModuleReadOnlyParams(
module_ro_params.push_back(kSignalStrength);
module_ro_params.push_back(kSignalChangeThreshold);
module_ro_params.push_back(kState);
+ module_ro_params.push_back(kSisData);
}
return module_ro_params;
}
-const std::map<std::string, std::string> GetModuleTypeToDataMapping() {
- std::map<std::string, std::string> mapping = {
- {enums_value::kRadio, message_params::kRadioControlData},
- {enums_value::kClimate, message_params::kClimateControlData},
- {enums_value::kSeat, message_params::kSeatControlData}};
- return mapping;
-}
-
const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
std::map<std::string, std::string> mapping;
// climate
@@ -82,6 +76,10 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["dualModeEnable"] = "dualModeEnableAvailable";
mapping["acMaxEnable"] = "acMaxEnableAvailable";
mapping["ventilationMode"] = "ventilationModeAvailable";
+ mapping["heatedSteeringWheelEnable"] = "heatedSteeringWheelAvailable";
+ mapping["heatedWindshieldEnable"] = "heatedWindshieldAvailable";
+ mapping["heatedMirrorsEnable"] = "heatedMirrorsAvailable";
+ mapping["heatedRearWindowEnable"] = "heatedRearWindowAvailable";
// radio
mapping["band"] = "radioBandAvailable";
@@ -90,10 +88,12 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["rdsData"] = "rdsDataAvailable";
mapping["availableHDs"] = "availableHDsAvailable";
mapping["hdChannel"] = "availableHDsAvailable";
+ mapping["hdRadioEnable"] = "hdRadioEnableAvailable";
mapping["signalStrength"] = "signalStrengthAvailable";
mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
mapping["radioEnable"] = "radioEnableAvailable";
mapping["state"] = "stateAvailable";
+ mapping["sisData"] = "sisDataAvailable";
// seat
mapping["heatingEnabled"] = "heatingEnabledAvailable";
@@ -113,6 +113,16 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
mapping["massageMode"] = "massageModeAvailable";
mapping["massageCushionFirmness"] = "massageCushionFirmnessAvailable";
mapping["memory"] = "memoryAvailable";
+ // audio
+ mapping["source"] = "sourceAvailable";
+ mapping["keepContext"] = "keepContextAvailable";
+ mapping["volume"] = "volumeAvailable";
+ mapping["equalizerSettings"] = "equalizerAvailable";
+
+ // hmi settings
+ mapping["distanceUnit"] = "distanceUnitAvailable";
+ mapping["temperatureUnit"] = "temperatureUnitAvailable";
+ mapping["displayMode"] = "displayModeUnitAvailable";
return mapping;
}
@@ -122,37 +132,127 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : RCCommandRequest(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle,
- resource_allocation_manager) {}
+ const RCCommandParams& params)
+ : RCCommandRequest(message, params) {}
SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {}
+const std::string LightName(const smart_objects::SmartObject& light_name) {
+ const char* name;
+ const bool ok = NsSmartDeviceLink::NsSmartObjects::
+ EnumConversionHelper<mobile_apis::LightName::eType>::EnumToCString(
+ static_cast<mobile_apis::LightName::eType>(light_name.asUInt()),
+ &name);
+ return ok ? name : "unknown";
+}
+
+bool CheckLightDataByCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& light_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> lightCapsMapping = {
+ {message_params::kId, strings::kName},
+ {message_params::kDensity, strings::kDensityAvailable},
+ {message_params::kColor, strings::kRGBColorSpaceAvailable}};
+ auto it = light_data.map_begin();
+ for (; it != light_data.map_end(); ++it) {
+ if (message_params::kStatus == it->first ||
+ message_params::kId == it->first) {
+ continue;
+ }
+ const std::string& caps_key = lightCapsMapping[it->first];
+ LOG4CXX_DEBUG(logger_,
+ "Checking request parameter "
+ << it->first << " with capabilities. Appropriate key is "
+ << caps_key);
+
+ if (!capabilities.keyExists(caps_key)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is missed in RemoteControl capabilities");
+ return false;
+ }
+ if (!capabilities[caps_key].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is switched off in RemoteControl capabilities");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool CheckLightNameByCapabilities(
+ const smart_objects::SmartObject& capabilities_status,
+ const smart_objects::SmartObject& light_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto it = capabilities_status.asArray()->begin();
+ for (; it != capabilities_status.asArray()->end(); ++it) {
+ const smart_objects::SmartObject& so = *it;
+ const int64_t current_id = so[message_params::kName].asInt();
+ if (current_id == light_data[message_params::kId].asInt()) {
+ return CheckLightDataByCapabilities(so, light_data);
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "There is no such light name in capabilities");
+ return false;
+}
+
+bool CheckRadioBandByCapabilities(
+ const smart_objects::SmartObject& capabilities_status,
+ const smart_objects::SmartObject& request_parameter) {
+ mobile_apis::RadioBand::eType radio_band =
+ static_cast<mobile_apis::RadioBand::eType>(request_parameter.asUInt());
+ if (mobile_apis::RadioBand::XM == radio_band) {
+ if (!capabilities_status.keyExists(strings::kSiriusxmRadioAvailable)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << strings::kSiriusxmRadioAvailable
+ << " is missed in RemoteControl capabilities");
+ return false;
+ }
+ if (!capabilities_status[strings::kSiriusxmRadioAvailable].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << strings::kSiriusxmRadioAvailable
+ << " is switched off in RemoteControl capabilities");
+ return false;
+ }
+ }
+ return true;
+}
+
bool CheckControlDataByCapabilities(
- const smart_objects::SmartObject& module_caps,
+ const smart_objects::SmartObject& capabilities_status,
const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
std::map<std::string, std::string> mapping =
GetModuleDataToCapabilitiesMapping();
- const smart_objects::SmartObject& capabilities_status = module_caps[0];
auto it = control_data.map_begin();
for (; it != control_data.map_end(); ++it) {
const std::string& request_parameter = it->first;
if (message_params::kId == request_parameter) {
continue;
}
+ if (message_params::kLightState == request_parameter) {
+ auto light_data = control_data[request_parameter].asArray()->begin();
+ for (; light_data != control_data[request_parameter].asArray()->end();
+ ++light_data) {
+ if (!CheckLightNameByCapabilities(
+ capabilities_status[strings::kSupportedLights], *light_data)) {
+ return false;
+ }
+ }
+ return true;
+ }
const std::string& caps_key = mapping[request_parameter];
LOG4CXX_DEBUG(logger_,
"Checking request parameter "
<< request_parameter
<< " with capabilities. Appropriate key is " << caps_key);
+
if (!capabilities_status.keyExists(caps_key)) {
LOG4CXX_DEBUG(logger_,
"Capability "
@@ -167,6 +267,11 @@ bool CheckControlDataByCapabilities(
<< " is switched off in RemoteControl capabilities");
return false;
}
+ if (message_params::kBand == request_parameter &&
+ !CheckRadioBandByCapabilities(capabilities_status,
+ control_data[request_parameter])) {
+ return false;
+ }
}
return true;
}
@@ -175,21 +280,31 @@ bool CheckIfModuleDataExistInCapabilities(
const smart_objects::SmartObject& rc_capabilities,
const smart_objects::SmartObject& module_data) {
LOG4CXX_AUTO_TRACE(logger_);
- const std::map<std::string, std::string> params = {
- {message_params::kRadioControlData, strings::kradioControlCapabilities},
- {message_params::kClimateControlData,
- strings::kclimateControlCapabilities},
- {message_params::kSeatControlData, strings::kseatControlCapabilities}};
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& get_module_data_key = RCHelpers::GetModuleTypeToDataMapping();
+ const auto& get_capabilities_key =
+ RCHelpers::GetModuleTypeToCapabilitiesMapping();
+
bool is_module_data_valid = false;
- for (const auto& param : params) {
- if (module_data.keyExists(param.first)) {
- if (!rc_capabilities.keyExists(param.second)) {
- LOG4CXX_DEBUG(logger_, param.first << " capabilities not present");
+ for (const auto& module_type : all_module_types) {
+ const auto module_data_key = get_module_data_key(module_type);
+ const auto capabilities_key = get_capabilities_key(module_type);
+ if (module_data.keyExists(module_data_key)) {
+ if (!rc_capabilities.keyExists(capabilities_key)) {
+ LOG4CXX_DEBUG(logger_, module_data_key << " capabilities not present");
return false;
}
- const smart_objects::SmartObject& caps = rc_capabilities[param.second];
- is_module_data_valid =
- CheckControlDataByCapabilities(caps, module_data[param.first]);
+ const smart_objects::SmartObject& caps =
+ rc_capabilities[capabilities_key];
+ if (message_params::kHmiSettingsControlData == module_data_key ||
+ message_params::kLightControlData == module_data_key) {
+ is_module_data_valid =
+ CheckControlDataByCapabilities(caps, module_data[module_data_key]);
+ } else {
+ is_module_data_valid = CheckControlDataByCapabilities(
+ caps[0], module_data[module_data_key]);
+ }
}
}
return is_module_data_valid;
@@ -198,12 +313,12 @@ bool CheckIfModuleDataExistInCapabilities(
bool isModuleTypeAndDataMatch(const std::string& module_type,
const smart_objects::SmartObject& module_data) {
LOG4CXX_AUTO_TRACE(logger_);
- std::map<std::string, std::string> data_mapping =
- GetModuleTypeToDataMapping();
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
bool module_type_and_data_match = false;
- for (const auto& data : data_mapping) {
- if (data.first == module_type) {
- module_type_and_data_match = module_data.keyExists(data.second);
+ for (const auto& type : all_module_types) {
+ if (type == module_type) {
+ module_type_and_data_match = module_data.keyExists(data_mapping(type));
break;
}
}
@@ -249,6 +364,20 @@ void SetInteriorVehicleDataRequest::Execute() {
(*message_)[app_mngr::strings::msg_params][app_mngr::strings::app_id] =
app->app_id();
+ const bool app_wants_to_set_audio_src =
+ module_data.keyExists(message_params::kAudioControlData) &&
+ module_data[message_params::kAudioControlData].keyExists(
+ message_params::kSource);
+
+ if (app_wants_to_set_audio_src && !app->IsAllowedToChangeAudioSource()) {
+ LOG4CXX_WARN(logger_, "App is not allowed to change audio source");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::REJECTED,
+ "App is not allowed to change audio source");
+ return;
+ }
+
SendHMIRequest(hmi_apis::FunctionID::RC_SetInteriorVehicleData,
&(*message_)[app_mngr::strings::msg_params],
true);
@@ -284,6 +413,11 @@ void SetInteriorVehicleDataRequest::on_event(
smart_objects::SmartObject response_params;
if (result) {
response_params = hmi_response[app_mngr::strings::msg_params];
+ if (enums_value::kAudio == ModuleType()) {
+ CheckAudioSource((
+ *message_)[app_mngr::strings::msg_params][message_params::kModuleData]
+ [message_params::kAudioControlData]);
+ }
}
std::string info;
GetInfo(hmi_response, info);
@@ -294,17 +428,44 @@ void SetInteriorVehicleDataRequest::on_event(
const smart_objects::SmartObject& SetInteriorVehicleDataRequest::ControlData(
const smart_objects::SmartObject& module_data) {
const std::string module_type = ModuleType();
- std::map<std::string, std::string> data_mapping =
- GetModuleTypeToDataMapping();
- for (const auto& data : data_mapping) {
- if (data.first == module_type) {
- return module_data[data.second];
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ for (const auto& type : all_module_types) {
+ if (type == module_type) {
+ return module_data[data_mapping(type)];
}
}
NOTREACHED();
return module_data[0];
}
+void SetInteriorVehicleDataRequest::CheckAudioSource(
+ const smart_objects::SmartObject& audio_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool should_keep_context =
+ audio_data.keyExists(message_params::kKeepContext) &&
+ audio_data[message_params::kKeepContext].asBool();
+ const bool switch_source_from_app =
+ mobile_apis::PrimaryAudioSource::MOBILE_APP ==
+ application_manager_.get_current_audio_source() &&
+ mobile_apis::PrimaryAudioSource::MOBILE_APP !=
+ audio_data[message_params::kSource].asInt();
+ if (!should_keep_context && switch_source_from_app) {
+ app_mngr::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ if (app->mobile_projection_enabled()) {
+ application_manager_.ChangeAppsHMILevel(
+ app->app_id(), mobile_apis::HMILevel::eType::HMI_LIMITED);
+ } else {
+ application_manager_.ChangeAppsHMILevel(
+ app->app_id(), mobile_apis::HMILevel::eType::HMI_BACKGROUND);
+ }
+ }
+ application_manager_.set_current_audio_source(
+ audio_data[message_params::kSource].asUInt());
+}
+
bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
const smart_objects::SmartObject& module_data) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -320,13 +481,34 @@ bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
return true;
}
+bool CheckReadOnlyParamsForAudio(
+ const smart_objects::SmartObject& module_type_params) {
+ if (module_type_params.keyExists(message_params::kEqualizerSettings)) {
+ const auto& equalizer_settings =
+ module_type_params[message_params::kEqualizerSettings];
+ auto it = equalizer_settings.asArray()->begin();
+ for (; it != equalizer_settings.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kChannelName)) {
+ LOG4CXX_DEBUG(logger_,
+ " READ ONLY parameter: " << message_params::kChannelName);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent(
const smart_objects::SmartObject& module_data) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& module_type_params =
ControlData(module_data);
auto it = module_type_params.map_begin();
- std::vector<std::string> ro_params = GetModuleReadOnlyParams(ModuleType());
+ const std::string module_type = ModuleType();
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
+ if (enums_value::kAudio == module_type) {
+ return CheckReadOnlyParamsForAudio(module_type_params);
+ }
for (; it != module_type_params.map_end(); ++it) {
if (helpers::in_range(ro_params, it->first)) {
return true;
@@ -354,6 +536,20 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
}
}
}
+
+ if (enums_value::kAudio == module_type) {
+ auto& equalizer_settings = module_data[message_params::kAudioControlData]
+ [message_params::kEqualizerSettings];
+ auto it = equalizer_settings.asArray()->begin();
+ for (; it != equalizer_settings.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kChannelName)) {
+ it->erase(message_params::kChannelName);
+ LOG4CXX_DEBUG(logger_,
+ "Cutting-off READ ONLY parameter: "
+ << message_params::kChannelName);
+ }
+ }
+ }
}
std::string SetInteriorVehicleDataRequest::ModuleType() {
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 2d5d0350e1..4dedd4b5a2 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
@@ -1,4 +1,5 @@
#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
#include "utils/macro.h"
namespace rc_rpc_plugin {
@@ -6,18 +7,13 @@ namespace commands {
SetInteriorVehicleDataResponse::SetInteriorVehicleDataResponse(
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,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::CommandResponseImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {
- UNUSED(resource_allocation_manager);
-}
+ const RCCommandParams& params)
+ : application_manager::commands::CommandResponseImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_) {}
SetInteriorVehicleDataResponse::~SetInteriorVehicleDataResponse() {}
void SetInteriorVehicleDataResponse::Run() {
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 524e4db7fa..40249387a7 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
@@ -35,6 +35,7 @@
#include "application_manager/message_helper.h"
#include "application_manager/hmi_interfaces.h"
#include "smart_objects/enum_schema_item.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
@@ -43,18 +44,17 @@ namespace commands {
RCCommandRequest::RCCommandRequest(
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,
- rc_rpc_plugin::ResourceAllocationManager& resource_allocation_manager)
- : application_manager::commands::CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle)
+ const RCCommandParams& params)
+ : application_manager::commands::CommandRequestImpl(
+ message,
+ params.application_manager_,
+ params.rpc_service_,
+ params.hmi_capabilities_,
+ params.policy_handler_)
, is_subscribed(false)
- , resource_allocation_manager_(resource_allocation_manager) {}
+ , resource_allocation_manager_(params.resource_allocation_manager_)
+ , interior_data_cache_(params.interior_data_cache_)
+ , interior_data_manager_(params.interior_data_manager_) {}
RCCommandRequest::~RCCommandRequest() {}
@@ -79,12 +79,6 @@ bool RCCommandRequest::CheckDriverConsent() {
LOG4CXX_AUTO_TRACE(logger_);
app_mngr::ApplicationSharedPtr 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 = ModuleType();
rc_rpc_plugin::TypeAccess access = CheckModule(module_type, app);
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
new file mode 100644
index 0000000000..0eb175aa25
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <thread>
+#include <chrono>
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+#include "utils/date_time.h"
+#include "utils/logger.h"
+
+namespace rc_rpc_plugin {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+InteriorDataCacheImpl::InteriorDataCacheImpl() {}
+
+InteriorDataCacheImpl::~InteriorDataCacheImpl() {}
+
+/**
+ * @brief MergeModuleData key all keys and values from first parameter and
+ * update and append keys and values from the second
+ * @param data1 - initial data
+ * @param data2 - updated data
+ * @return updated data1 with data2 keys and values
+ */
+smart_objects::SmartObject MergeModuleData(
+ const smart_objects::SmartObject& data1,
+ const smart_objects::SmartObject& data2) {
+ smart_objects::SmartObject result = data1;
+ auto it = data2.map_begin();
+ for (; it != data2.map_end(); ++it) {
+ const std::string& key = it->first;
+ const smart_objects::SmartObject& value = it->second;
+ result[key] = value;
+ }
+ return result;
+}
+
+void InteriorDataCacheImpl::Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (cached_data_.end() == it) {
+ cached_data_[module_type] = module_data;
+ return;
+ }
+ cached_data_[module_type] = MergeModuleData(it->second, module_data);
+}
+
+smart_objects::SmartObject InteriorDataCacheImpl::Retrieve(
+ const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (it == cached_data_.end()) {
+ LOG4CXX_WARN(logger_,
+ "Module type " << module_type << " was not found in cache");
+ return smart_objects::SmartObject(smart_objects::SmartType_Null);
+ }
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ return it->second;
+}
+
+bool InteriorDataCacheImpl::Contains(const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ const bool contains = it != cached_data_.end();
+ LOG4CXX_TRACE(logger_,
+ "module_type : " << module_type << " "
+ << (contains ? "true" : "false"));
+ return contains;
+}
+
+void InteriorDataCacheImpl::Remove(const std::string& module_type) {
+ LOG4CXX_TRACE(logger_, "module_type : " << module_type);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ auto it = cached_data_.find(module_type);
+ if (cached_data_.end() == it) {
+ LOG4CXX_TRACE(logger_, "Not existing module_type : " << module_type);
+ return;
+ }
+ cached_data_.erase(it);
+}
+
+void InteriorDataCacheImpl::Clear() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(cached_data_lock_);
+ cached_data_.clear();
+}
+}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
new file mode 100644
index 0000000000..28ed2cd941
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
@@ -0,0 +1,159 @@
+#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/rpc_service.h"
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+InteriorDataManagerImpl::InteriorDataManagerImpl(
+ RCRPCPlugin& rc_plugin,
+ InteriorDataCache& cache,
+ application_manager::ApplicationManager& app_mngr,
+ application_manager::rpc_service::RPCService& rpc_service)
+ : rc_plugin_(rc_plugin)
+ , cache_(cache)
+ , app_mngr_(app_mngr)
+ , rpc_service_(rpc_service) {}
+
+void InteriorDataManagerImpl::OnPolicyEvent(plugins::PolicyEvent event) {
+ UpdateHMISubscriptionsOnPolicyUpdated();
+}
+
+void InteriorDataManagerImpl::OnApplicationEvent(
+ plugins::ApplicationEvent event,
+ app_mngr::ApplicationSharedPtr application) {
+ if (plugins::ApplicationEvent::kApplicationUnregistered == event ||
+ plugins::ApplicationEvent::kApplicationExit == event) {
+ UpdateHMISubscriptionsOnAppUnregistered(*application);
+ }
+}
+
+void InteriorDataManagerImpl::OnDisablingRC() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto existing_subscription = AppsSubscribedModules();
+ std::set<std::string> subscribed_modules;
+ for (auto& pair : existing_subscription) {
+ auto& app = pair.first;
+ auto rc_extension = RCHelpers::GetRCExtension(*app);
+ for (const auto& module : pair.second) {
+ subscribed_modules.insert(module);
+ rc_extension->UnsubscribeFromInteriorVehicleData(module);
+ }
+ }
+ for (auto& module : subscribed_modules) {
+ LOG4CXX_TRACE(logger_, "unsubscribe " << module);
+ UnsubscribeFromInteriorVehicleData(module);
+ }
+}
+
+void InteriorDataManagerImpl::StoreRequestToHMITime(
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_);
+ requests_to_hmi_history_[module_type].push_back(
+ date_time::DateTime::getCurrentTime());
+}
+
+bool InteriorDataManagerImpl::CheckRequestsToHMIFrequency(
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(requests_to_hmi_history_lock_);
+ ClearOldRequestsToHMIHistory();
+ const auto& history = requests_to_hmi_history_[module_type];
+ const auto limit =
+ app_mngr_.get_settings().get_interior_vehicle_data_frequency().first;
+ return history.size() < limit;
+}
+
+void InteriorDataManagerImpl::UpdateHMISubscriptionsOnPolicyUpdated() {
+ auto apps_allowed_modules =
+ RCHelpers::GetApplicationsAllowedModules(app_mngr_);
+ auto apps_subscribed_modules = AppsSubscribedModules();
+ InteriorDataManagerImpl::AppsModules apps_disallowed_modules;
+ for (auto& pair : apps_subscribed_modules) {
+ auto& allowed = apps_allowed_modules[pair.first];
+ auto& subscribed = pair.second;
+ std::vector<std::string> disallowed_modules;
+ std::set_difference(subscribed.begin(),
+ subscribed.end(),
+ allowed.begin(),
+ allowed.end(),
+ std::back_inserter(disallowed_modules));
+ apps_disallowed_modules[pair.first] = disallowed_modules;
+ }
+
+ for (auto& pair : apps_disallowed_modules) {
+ auto& app = pair.first;
+ auto rc_extension = RCHelpers::GetRCExtension(*app);
+ for (const auto& module : pair.second) {
+ rc_extension->UnsubscribeFromInteriorVehicleData(module);
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(app_mngr_, module);
+ if (apps_subscribed.empty()) {
+ UnsubscribeFromInteriorVehicleData(module);
+ }
+ }
+ }
+}
+
+void InteriorDataManagerImpl::UpdateHMISubscriptionsOnAppUnregistered(
+ application_manager::Application& app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto rc_extension = RCHelpers::GetRCExtension(app);
+ auto subscribed_data = rc_extension->InteriorVehicleDataSubscriptions();
+ rc_extension->UnsubscribeFromInteriorVehicleData();
+ for (auto& data : subscribed_data) {
+ auto apps_subscribed =
+ RCHelpers::AppsSubscribedToModuleType(app_mngr_, data);
+ if (apps_subscribed.empty()) {
+ UnsubscribeFromInteriorVehicleData(data);
+ }
+ if (apps_subscribed.size() == 1 &&
+ apps_subscribed.front()->hmi_app_id() == app.hmi_app_id()) {
+ UnsubscribeFromInteriorVehicleData(data);
+ }
+ }
+}
+
+void InteriorDataManagerImpl::UnsubscribeFromInteriorVehicleData(
+ const std::string& module_type) {
+ cache_.Remove(module_type);
+ auto unsubscribe_request = RCHelpers::CreateUnsubscribeRequestToHMI(
+ module_type, app_mngr_.GetNextHMICorrelationID());
+ LOG4CXX_DEBUG(logger_, "Send Unsubscribe from " << module_type);
+ rpc_service_.ManageHMICommand(unsubscribe_request);
+}
+
+void InteriorDataManagerImpl::ClearOldRequestsToHMIHistory() {
+ auto limit =
+ app_mngr_.get_settings().get_interior_vehicle_data_frequency().second;
+ uint32_t time_frame = limit * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ auto lest_that_time_frame_ago = [time_frame](TimevalStruct time) {
+ auto span = date_time::DateTime::calculateTimeSpan(time);
+ return span < time_frame;
+ };
+ for (auto& it : requests_to_hmi_history_) {
+ auto& history = it.second;
+ auto first_actual =
+ std::find_if(history.begin(), history.end(), lest_that_time_frame_ago);
+ history.erase(history.begin(), first_actual);
+ }
+}
+
+InteriorDataManagerImpl::AppsModules
+InteriorDataManagerImpl::AppsSubscribedModules() {
+ auto apps_list = RCRPCPlugin::GetRCApplications(app_mngr_);
+ InteriorDataManagerImpl::AppsModules result;
+ for (auto& app_ptr : apps_list) {
+ const auto rc_extension = RCHelpers::GetRCExtension(*app_ptr);
+ auto app_subscriptions = rc_extension->InteriorVehicleDataSubscriptions();
+ result[app_ptr] = std::vector<std::string>(app_subscriptions.size());
+ std::copy(app_subscriptions.begin(),
+ app_subscriptions.end(),
+ result[app_ptr].begin());
+ }
+ return result;
+}
+} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
index 5c0a94cccc..17f19e24e8 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
@@ -64,5 +64,9 @@ void RCAppExtension::SaveResumptionData(
void RCAppExtension::ProcessResumption(
const NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data) {}
+std::set<std::string> RCAppExtension::InteriorVehicleDataSubscriptions() const {
+ return subscribed_interior_vehicle_data_;
+}
+
RCAppExtension::~RCAppExtension() {}
} // namespace rc_rpc_plugin
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 707d35aa0f..ecfc1dcda4 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
@@ -29,6 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+#include <iostream>
#include "rc_rpc_plugin/rc_command_factory.h"
#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
@@ -53,24 +54,18 @@
#include "interfaces/HMI_API.h"
#include "rc_rpc_plugin/resource_allocation_manager.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
namespace application_manager {
using rc_rpc_plugin::ResourceAllocationManager;
+using rc_rpc_plugin::InteriorDataCache;
+using rc_rpc_plugin::RCCommandParams;
template <typename RCCommandType>
class RCCommandCreator : public CommandCreator {
public:
- RCCommandCreator(ApplicationManager& application_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- PolicyHandlerInterface& policy_handler,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager_(application_manager)
- , rpc_service_(rpc_service)
- , hmi_capabilities_(hmi_capabilities)
- , policy_handler_(policy_handler)
- , resource_allocation_manager_(resource_allocation_manager) {}
+ RCCommandCreator(const RCCommandParams& params) : params_(params) {}
private:
bool CanBeCreated() const override {
@@ -79,20 +74,11 @@ class RCCommandCreator : public CommandCreator {
CommandSharedPtr create(
const commands::MessageSharedPtr& message) const override {
- CommandSharedPtr command(new RCCommandType(message,
- application_manager_,
- rpc_service_,
- hmi_capabilities_,
- policy_handler_,
- resource_allocation_manager_));
+ CommandSharedPtr command(new RCCommandType(message, params_));
return command;
}
- ApplicationManager& application_manager_;
- RPCService& rpc_service_;
- HMICapabilities& hmi_capabilities_;
- PolicyHandlerInterface& policy_handler_;
- ResourceAllocationManager& resource_allocation_manager_;
+ RCCommandParams params_;
};
struct RCInvalidCommand {};
@@ -100,16 +86,8 @@ struct RCInvalidCommand {};
template <>
class RCCommandCreator<RCInvalidCommand> : public CommandCreator {
public:
- RCCommandCreator(ApplicationManager& application_manager,
- RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- PolicyHandlerInterface& policy_handler,
- ResourceAllocationManager& resource_allocation_manager) {
- UNUSED(application_manager);
- UNUSED(rpc_service);
- UNUSED(hmi_capabilities);
- UNUSED(policy_handler);
- UNUSED(resource_allocation_manager);
+ RCCommandCreator(const RCCommandParams& params) {
+ UNUSED(params);
}
private:
@@ -125,49 +103,23 @@ class RCCommandCreator<RCInvalidCommand> : public CommandCreator {
};
struct RCCommandCreatorFactory {
- RCCommandCreatorFactory(
- ApplicationManager& application_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- PolicyHandlerInterface& policy_handler,
- ResourceAllocationManager& resource_allocation_manager)
- : application_manager_(application_manager)
- , rpc_service_(rpc_service)
- , hmi_capabilities_(hmi_capabilities)
- , policy_handler_(policy_handler)
- , resource_allocation_manager_(resource_allocation_manager) {}
+ RCCommandCreatorFactory(const RCCommandParams& params) : params_(params) {}
template <typename RCCommandType>
CommandCreator& GetCreator() {
- static RCCommandCreator<RCCommandType> res(application_manager_,
- rpc_service_,
- hmi_capabilities_,
- policy_handler_,
- resource_allocation_manager_);
+ LOG4CXX_AUTO_TRACE(logger_);
+ static RCCommandCreator<RCCommandType> res(params_);
return res;
}
- ApplicationManager& application_manager_;
- RPCService& rpc_service_;
- HMICapabilities& hmi_capabilities_;
- PolicyHandlerInterface& policy_handler_;
- ResourceAllocationManager& resource_allocation_manager_;
+ const RCCommandParams params_;
};
}
namespace rc_rpc_plugin {
using namespace application_manager;
-RCCommandFactory::RCCommandFactory(
- app_mngr::ApplicationManager& app_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler,
- ResourceAllocationManager& allocation_manager)
- : app_manager_(app_manager)
- , rpc_service_(rpc_service)
- , hmi_capabilities_(hmi_capabilities)
- , policy_handler_(policy_handler)
- , allocation_manager_(allocation_manager) {}
+RCCommandFactory::RCCommandFactory(const RCCommandParams& params)
+ : params_(params) {}
CommandSharedPtr RCCommandFactory::CreateCommand(
const app_mngr::commands::MessageSharedPtr& message,
@@ -218,11 +170,7 @@ CommandCreator& RCCommandFactory::get_mobile_creator_factory(
LOG4CXX_DEBUG(logger_,
"CreateMobileCommand function_id: " << id << " message_type: "
<< message_type);
- RCCommandCreatorFactory rc_factory(app_manager_,
- rpc_service_,
- hmi_capabilities_,
- policy_handler_,
- allocation_manager_);
+ RCCommandCreatorFactory rc_factory(params_);
switch (id) {
case mobile_apis::FunctionID::ButtonPressID: {
@@ -259,11 +207,7 @@ CommandCreator& RCCommandFactory::get_hmi_creator_factory(
"CreateHMICommand function_id: " << id << " message_type: "
<< message_type);
- RCCommandCreatorFactory rc_factory(app_manager_,
- rpc_service_,
- hmi_capabilities_,
- policy_handler_,
- allocation_manager_);
+ RCCommandCreatorFactory rc_factory(params_);
switch (id) {
case hmi_apis::FunctionID::Buttons_ButtonPress: {
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
new file mode 100644
index 0000000000..0bdec55733
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc
@@ -0,0 +1,118 @@
+#include "rc_rpc_plugin/rc_helpers.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message.h"
+
+namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
+const std::function<std::string(const std::string& module_type)>
+RCHelpers::GetModuleTypeToDataMapping() {
+ auto mapping_lambda = [](const std::string& module_type) -> std::string {
+ static std::map<std::string, std::string> mapping = {
+ {enums_value::kClimate, message_params::kClimateControlData},
+ {enums_value::kRadio, message_params::kRadioControlData},
+ {enums_value::kSeat, message_params::kSeatControlData},
+ {enums_value::kAudio, message_params::kAudioControlData},
+ {enums_value::kLight, message_params::kLightControlData},
+ {enums_value::kHmiSettings, message_params::kHmiSettingsControlData}};
+ auto it = mapping.find(module_type);
+ if (mapping.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown module type" << module_type);
+ return std::string();
+ }
+ return it->second;
+ };
+
+ return mapping_lambda;
+}
+
+const std::function<std::string(const std::string& module_type)>
+RCHelpers::GetModuleTypeToCapabilitiesMapping() {
+ auto mapping_lambda = [](const std::string& module_type) -> std::string {
+ static std::map<std::string, std::string> mapping = {
+ {enums_value::kClimate, strings::kclimateControlCapabilities},
+ {enums_value::kRadio, strings::kradioControlCapabilities},
+ {enums_value::kSeat, strings::kseatControlCapabilities},
+ {enums_value::kAudio, strings::kaudioControlCapabilities},
+ {enums_value::kLight, strings::klightControlCapabilities},
+ {enums_value::kHmiSettings, strings::khmiSettingsControlCapabilities}};
+ auto it = mapping.find(module_type);
+ if (mapping.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown module type" << module_type);
+ return std::string();
+ }
+ return it->second;
+ };
+
+ return mapping_lambda;
+}
+
+const std::vector<std::string> RCHelpers::GetModulesList() {
+ using namespace enums_value;
+ return {kClimate, kRadio, kSeat, kAudio, kLight, kHmiSettings};
+}
+
+RCAppExtensionPtr RCHelpers::GetRCExtension(
+ application_manager::Application& app) {
+ auto extension_interface = app.QueryInterface(RCRPCPlugin::kRCPluginID);
+ auto extension =
+ std::static_pointer_cast<RCAppExtension>(extension_interface);
+ return extension;
+}
+
+smart_objects::SmartObjectSPtr RCHelpers::CreateUnsubscribeRequestToHMI(
+ const std::string& module_type, const uint32_t correlation_id) {
+ using namespace smart_objects;
+ namespace commands = application_manager::commands;
+ namespace am_strings = application_manager::strings;
+
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& params = (*message)[am_strings::params];
+ SmartObject& msg_params = (*message)[am_strings::msg_params];
+
+ params[am_strings::message_type] =
+ static_cast<int>(application_manager::kRequest);
+ params[am_strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ params[am_strings::protocol_type] = commands::CommandImpl::hmi_protocol_type_;
+ params[am_strings::correlation_id] = correlation_id;
+ params[am_strings::function_id] =
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData;
+ msg_params[message_params::kSubscribe] = false;
+ msg_params[message_params::kModuleType] = module_type;
+ return message;
+}
+
+std::vector<application_manager::ApplicationSharedPtr>
+RCHelpers::AppsSubscribedToModuleType(
+ application_manager::ApplicationManager& app_mngr,
+ const std::string& module_type) {
+ std::vector<application_manager::ApplicationSharedPtr> result;
+ auto rc_apps = RCRPCPlugin::GetRCApplications(app_mngr);
+ for (auto& app : rc_apps) {
+ auto rc_ext = RCHelpers::GetRCExtension(*app);
+ DCHECK_OR_RETURN(rc_ext, result);
+ if (rc_ext->IsSubscibedToInteriorVehicleData(module_type)) {
+ result.push_back(app);
+ }
+ }
+ return result;
+}
+
+RCHelpers::AppsModules RCHelpers::GetApplicationsAllowedModules(
+ app_mngr::ApplicationManager& app_mngr) {
+ auto apps_list = RCRPCPlugin::GetRCApplications(app_mngr);
+ RCHelpers::AppsModules result;
+ for (auto& app_ptr : apps_list) {
+ std::vector<std::string> allowed_modules;
+ app_mngr.GetPolicyHandler().GetModuleTypes(app_ptr->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+ result[app_ptr] = allowed_modules;
+ }
+ return result;
+}
+}
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 984d6ec9a0..fd6b4e86ac 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
@@ -34,10 +34,15 @@
#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 "rc_rpc_plugin/interior_data_cache_impl.h"
+#include "rc_rpc_plugin/interior_data_manager_impl.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "utils/helpers.h"
#include <memory>
namespace rc_rpc_plugin {
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule");
+
namespace plugins = application_manager::plugin_manager;
bool RCRPCPlugin::Init(
@@ -45,14 +50,22 @@ bool RCRPCPlugin::Init(
application_manager::rpc_service::RPCService& rpc_service,
application_manager::HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler) {
+ interior_data_cache_.reset(new InteriorDataCacheImpl());
+ interior_data_manager_.reset(new InteriorDataManagerImpl(
+ *this, *interior_data_cache_, app_manager, rpc_service));
+
resource_allocation_manager_.reset(
new ResourceAllocationManagerImpl(app_manager, rpc_service));
- command_factory_.reset(
- new rc_rpc_plugin::RCCommandFactory(app_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler,
- *resource_allocation_manager_));
+ RCCommandParams params{app_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler,
+ *(resource_allocation_manager_.get()),
+ *(interior_data_cache_.get()),
+ *(interior_data_manager_.get())};
+ command_factory_.reset(new rc_rpc_plugin::RCCommandFactory(params));
+ rpc_service_ = &rpc_service;
+ app_mngr_ = &app_manager;
return true;
}
@@ -73,14 +86,8 @@ application_manager::CommandFactory& RCRPCPlugin::GetCommandFactory() {
void RCRPCPlugin::OnPolicyEvent(
application_manager::plugin_manager::PolicyEvent event) {
- switch (event) {
- case plugins::kApplicationPolicyUpdated: {
- resource_allocation_manager_->OnPolicyEvent(event);
- break;
- }
- default:
- break;
- }
+ resource_allocation_manager_->OnPolicyEvent(event);
+ interior_data_manager_->OnPolicyEvent(event);
}
void RCRPCPlugin::OnApplicationEvent(
@@ -99,10 +106,12 @@ void RCRPCPlugin::OnApplicationEvent(
}
case plugins::kApplicationExit: {
resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
break;
}
case plugins::kApplicationUnregistered: {
resource_allocation_manager_->OnApplicationEvent(event, application);
+ interior_data_manager_->OnApplicationEvent(event, application);
break;
}
default:
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
index 011950b35a..ecd263b77a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc
@@ -36,9 +36,10 @@
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "smart_objects/enum_schema_item.h"
-#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "application_manager/message_helper.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_helpers.h"
#include "json/json.h"
#include "utils/helpers.h"
@@ -166,13 +167,10 @@ void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
allowed_modules.end(),
std::back_inserter(disallowed_modules));
- RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
+ auto rc_extention = RCHelpers::GetRCExtension(**app);
Resources::const_iterator module = disallowed_modules.begin();
for (; disallowed_modules.end() != module; ++module) {
ReleaseResource(*module, application_id);
- if (rc_extention) {
- rc_extention->UnsubscribeFromInteriorVehicleData(*module);
- }
}
if (!disallowed_modules.empty()) {
SendOnRCStatusNotifications(
@@ -182,40 +180,6 @@ void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
}
}
-RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention(
- application_manager::ApplicationSharedPtr application) {
- LOG4CXX_AUTO_TRACE(logger_);
- RCAppExtensionPtr rc_app_extension;
- if (!application) {
- return rc_app_extension;
- }
-
- application_manager::AppExtensionPtr app_extension =
- application->QueryInterface(RCRPCPlugin::kRCPluginID);
- if (!app_extension) {
- return rc_app_extension;
- }
-
- rc_app_extension = std::static_pointer_cast<RCAppExtension>(app_extension);
-
- return rc_app_extension;
-}
-
-void ResourceAllocationManagerImpl::RemoveAppsSubscriptions(const Apps& apps) {
- LOG4CXX_AUTO_TRACE(logger_);
- Apps::const_iterator app = apps.begin();
- for (; apps.end() != app; ++app) {
- application_manager::ApplicationSharedPtr app_ptr = *app;
- if (!app_ptr) {
- continue;
- }
- RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
- if (rc_extention) {
- rc_extention->UnsubscribeFromInteriorVehicleData();
- }
- }
-}
-
template <typename EnumType>
EnumType StringToEnum(const std::string& str) {
using smart_objects::EnumConversionHelper;
@@ -235,6 +199,7 @@ void ConstructOnRCStatusNotificationParams(
using smart_objects::SmartType_Map;
using smart_objects::SmartType_Array;
LOG4CXX_AUTO_TRACE(logger_);
+
auto modules_inserter = [](SmartObject& result_modules) {
return [&result_modules](const std::string& module_name) {
smart_objects::SmartObject module_data =
@@ -273,7 +238,7 @@ ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToMobile(
if (is_rc_enabled()) {
ConstructOnRCStatusNotificationParams(msg_params,
allocated_resources_,
- all_supported_modules(),
+ RCHelpers::GetModulesList(),
app->app_id());
} else {
msg_params[message_params::kAllocatedModules] =
@@ -292,8 +257,10 @@ ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToHmi(
auto msg_to_hmi =
MessageHelper::CreateHMINotification(hmi_apis::FunctionID::RC_OnRCStatus);
auto& msg_params = (*msg_to_hmi)[application_manager::strings::msg_params];
- ConstructOnRCStatusNotificationParams(
- msg_params, allocated_resources_, all_supported_modules(), app->app_id());
+ ConstructOnRCStatusNotificationParams(msg_params,
+ allocated_resources_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
msg_params[application_manager::strings::app_id] = app->hmi_app_id();
return msg_to_hmi;
}
@@ -361,15 +328,6 @@ void ResourceAllocationManagerImpl::SetResourceFree(
LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is released.");
}
-std::vector<std::string>
-ResourceAllocationManagerImpl::all_supported_modules() {
- std::vector<std::string> result;
- result.push_back(enums_value::kClimate);
- result.push_back(enums_value::kRadio);
- result.push_back(enums_value::kSeat);
- return result;
-}
-
std::vector<std::string> ResourceAllocationManagerImpl::GetAcquiredResources(
const uint32_t application_id) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -510,9 +468,6 @@ void ResourceAllocationManagerImpl::OnApplicationEvent(
NotificationTrigger::MODULE_ALLOCATION,
std::shared_ptr<application_manager::Application>());
}
- Apps app_list;
- app_list.push_back(application);
- RemoveAppsSubscriptions(app_list);
}
}
@@ -529,8 +484,6 @@ void ResourceAllocationManagerImpl::OnPolicyEvent(
if (PolicyEvent::kApplicationsDisabled == event) {
ResetAllAllocations();
- Apps app_list = RCRPCPlugin::GetRCApplications(app_mngr_);
- RemoveAppsSubscriptions(app_list);
return;
}
}
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 a1f0f5a6ff..c1c59d7e78 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
@@ -41,6 +41,7 @@ include_directories (
set (RC_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/resource_allocation_manager_impl_test.cc
+${CMAKE_CURRENT_SOURCE_DIR}/interior_data_cache_test.cc
)
set(RC_COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands)
@@ -72,5 +73,5 @@ if(ENABLE_LOG)
endif()
create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
-create_test("resource_allocation_manager_test" "${RC_TEST_SOURCES}" "${LIBRARIES}")
+create_test("rc_plugin_test" "${RC_TEST_SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
index 8ddcaa469d..022a3e51c9 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc
@@ -37,6 +37,8 @@
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/commands/command_request_test.h"
@@ -115,7 +117,7 @@ class ButtonPressRequestTest
}
rc_capabilities_[strings::kbuttonCapabilities] = button_caps;
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
- ON_CALL(mock_allocation_manager_, GetApplicationExtention(_))
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
.WillByDefault(Return(rc_app_extention_));
ON_CALL(app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_));
@@ -147,12 +149,14 @@ class ButtonPressRequestTest
template <class Command>
std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_,
- mock_allocation_manager_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
}
protected:
@@ -163,6 +167,10 @@ class ButtonPressRequestTest
mock_policy_handler_;
testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
};
TEST_F(ButtonPressRequestTest,
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
index a6f0ee12ca..0b30bbf654 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc
@@ -35,11 +35,17 @@
#include "application_manager/mock_application.h"
#include "rc_rpc_plugin/rc_app_extension.h"
#include "rc_rpc_plugin/rc_module_constants.h"
+#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "application_manager/message_helper.h"
#include "rc_rpc_plugin/rc_command_factory.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "application_manager/commands/command_request_test.h"
#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
+
+#include <thread>
+#include <chrono>
using ::testing::_;
using ::testing::Mock;
@@ -50,6 +56,7 @@ using ::testing::ReturnRef;
using ::testing::SaveArg;
using ::application_manager::Message;
using ::application_manager::MessageType;
+using application_manager::ApplicationSet;
using application_manager::commands::MessageSharedPtr;
using ::application_manager::ApplicationSharedPtr;
using ::protocol_handler::MessagePriority;
@@ -64,7 +71,11 @@ using test::components::commands_test::MobileResultCodeIs;
namespace {
const int32_t kConnectionKey = 5u;
const uint32_t kAppId = 0u;
+const uint32_t kAppId2 = 1u;
const int kModuleId = 153u;
+const auto module_type = mobile_apis::ModuleType::RADIO;
+const int32_t time_frame_of_allowed_requests = 1;
+const uint32_t max_request_in_time_frame = 5u;
}
namespace rc_rpc_plugin_test {
@@ -75,163 +86,508 @@ class GetInteriorVehicleDataRequestTest
public:
GetInteriorVehicleDataRequestTest()
: mock_app_(std::make_shared<NiceMock<MockApplication> >())
- , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId)) {
+ , mock_app2_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId))
+ , rc_app_extention2_(std::make_shared<RCAppExtension>(kModuleId))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_) {
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app2_, app_id()).WillByDefault(Return(kAppId2));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app2_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention_));
+ ON_CALL(*mock_app2_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention2_));
+ }
+
+ /**
+ * @brief CreateBasicMessage creates message for
+ * GetInteriorVehicleData request for app1
+ * @return message shared ptr
+ */
+ MessageSharedPtr CreateBasicMessage() {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::function_id] =
+ mobile_apis::FunctionID::GetInteriorVehicleDataID;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kConnectionKey;
+ (*message)[application_manager::strings::params]
+ [application_manager::strings::connection_key] = kAppId;
+ return message;
+ }
+
+ void SetUp() OVERRIDE {
+ std::pair<uint32_t, int32_t> frequency;
+ frequency.first = max_request_in_time_frame;
+ frequency.second = time_frame_of_allowed_requests;
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, get_interior_vehicle_data_frequency())
+ .WillByDefault(ReturnRef(frequency));
+
ON_CALL(app_mngr_, hmi_interfaces())
.WillByDefault(ReturnRef(mock_hmi_interfaces_));
-
ON_CALL(
mock_hmi_interfaces_,
GetInterfaceState(application_manager::HmiInterfaces::HMI_INTERFACE_RC))
.WillByDefault(Return(application_manager::HmiInterfaces::
InterfaceState::STATE_AVAILABLE));
ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
- ON_CALL(mock_allocation_manager_, GetApplicationExtention(_))
- .WillByDefault(Return(rc_app_extention_));
+ ON_CALL(app_mngr_, application(kAppId2)).WillByDefault(Return(mock_app2_));
ON_CALL(app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_));
ON_CALL(app_mngr_, hmi_capabilities())
.WillByDefault(ReturnRef(mock_hmi_capabilities_));
ON_CALL(mock_hmi_capabilities_, rc_capability())
- .WillByDefault(Return(&rc_capabilities_));
+ .WillByDefault(Return(nullptr));
ON_CALL(mock_policy_handler_,
CheckHMIType(
_, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, nullptr))
.WillByDefault(Return(true));
+ ON_CALL(mock_policy_handler_, CheckModule(_, _))
+ .WillByDefault(Return(true));
ON_CALL(mock_allocation_manager_, is_rc_enabled())
.WillByDefault(Return(true));
}
- MessageSharedPtr CreateBasicMessage() {
- MessageSharedPtr message = CreateMessage();
- (*message)[application_manager::strings::params]
- [application_manager::strings::function_id] =
- mobile_apis::FunctionID::GetInteriorVehicleDataID;
- (*message)[application_manager::strings::params]
- [application_manager::strings::connection_key] = kConnectionKey;
- (*message)[application_manager::strings::params]
- [application_manager::strings::connection_key] = kAppId;
- return message;
- }
template <class Command>
std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_,
- mock_allocation_manager_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
}
protected:
- smart_objects::SmartObject rc_capabilities_;
std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<MockApplication> mock_app2_;
std::shared_ptr<RCAppExtension> rc_app_extention_;
+ std::shared_ptr<RCAppExtension> rc_app_extention2_;
testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
};
+
TEST_F(GetInteriorVehicleDataRequestTest,
- Execute_MessageValidationOk_ExpectCorrectMessageSentToHMI) {
+ Execute_ExpectCorrectMessageSentToHMI_NoSubscriptionNoCache) {
// Arrange
- ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(true));
- EXPECT_CALL(mock_hmi_capabilities_, rc_capability())
- .WillOnce(Return(nullptr));
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ ON_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+
+ // Expectations
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(
hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
.WillOnce(Return(true));
+ // Act
+ command->Run();
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_SupscribeAppNoCache) {
+ // Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = true;
+ ON_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
std::shared_ptr<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ // Act
command->Run();
}
TEST_F(
GetInteriorVehicleDataRequestTest,
- Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ Execute_ExpectMessageNotSentToHMI_SuccessSentToMobile_AppSubscribed_DataFromCache) {
// Arrange
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
- (*mobile_message)[application_manager::strings::msg_params];
- msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
- ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(true));
- MessageSharedPtr command_result;
- EXPECT_CALL(mock_rpc_service_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData))).Times(0);
- EXPECT_CALL(
- mock_rpc_service_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _))
- .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
std::shared_ptr<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio))
+ .WillOnce(Return(radio_data));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
command->Run();
+
+ // Assert
+ EXPECT_EQ((*command_result)[application_manager::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kRadioControlData],
+ radio_data);
}
-TEST_F(GetInteriorVehicleDataRequestTest,
- OnEvent_ValidHmiResponse_ExpectSuccessfullResponseSentToMobile) {
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_ExpectCorrectMessageSentToHMI_LastAppSubscribedUnsubscibe_ClearCache) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
- (*mobile_message)[application_manager::strings::msg_params];
- msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
- MessageSharedPtr hmi_message = CreateBasicMessage();
+ MessageSharedPtr hmi_response = CreateBasicMessage();
NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_msg_params =
- (*hmi_message)[application_manager::strings::msg_params];
+ (*hmi_response)[application_manager::strings::msg_params];
hmi_apis::Common_Result::eType response_code =
hmi_apis::Common_Result::SUCCESS;
hmi_msg_params[application_manager::hmi_response::code] = response_code;
hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
EXPECT_CALL(
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
.WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_cache_, Remove(enums_value::kRadio));
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
- event.set_smart_object(*hmi_message);
+ event.set_smart_object(*hmi_response);
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectMessageNotSentToHMI_TwoApps_OneUnsubscribed) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ apps_.insert(mock_app_);
+ apps_.insert(mock_app2_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ rc_app_extention2_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+
std::shared_ptr<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio))
+ .WillOnce(Return(radio_data));
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ // Act
+ command->Run();
+
+ // Assert
+ EXPECT_FALSE(
+ rc_app_extention_->IsSubscibedToInteriorVehicleData(enums_value::kRadio));
+ EXPECT_EQ((*command_result)[application_manager::strings::msg_params]
+ [message_params::kModuleData]
+ [message_params::kRadioControlData],
+ radio_data);
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_CapabilitiesValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ smart_objects::SmartObject rc_capabilities;
+ ON_CALL(mock_hmi_capabilities_, rc_capability())
+ .WillByDefault(Return(&rc_capabilities));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE),
+ _)).WillOnce((Return(true)));
+ // Act
+ command->Run();
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_PolicyValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ (*mobile_message)[application_manager::strings::msg_params];
+ msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(false));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DISALLOWED), _))
+ .WillOnce((Return(true)));
+
+ // Act
+ command->Run();
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ExpectSuccessfulResponseSentToMobile_NoCache) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ auto& msg_params = (*mobile_message)[strings::msg_params];
+ msg_params[message_params::kModuleType] = module_type;
+
+ MessageSharedPtr hmi_response_message = CreateBasicMessage();
+ auto& hmi_response_params = (*hmi_response_message)[strings::msg_params];
+ hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ hmi_response_params[strings::connection_key] = kConnectionKey;
+
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+
+ // Act
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_response_message);
+ command->Run();
command->on_event(event);
}
TEST_F(GetInteriorVehicleDataRequestTest,
OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
+ using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest;
+ namespace hmi_response = application_manager::hmi_response;
+ namespace strings = application_manager::strings;
+
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ auto& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
- msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
+ msg_params[message_params::kModuleType] = module_type;
MessageSharedPtr hmi_message = CreateBasicMessage();
+ auto& hmi_msg_params = (*hmi_message)[strings::params];
+ hmi_msg_params[hmi_response::code] = hmi_apis::Common_Result::READ_ONLY;
+ hmi_msg_params[strings::connection_key] = kConnectionKey;
+ ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
+ .WillOnce(Return(true));
+
+ // Act
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData);
+ event.set_smart_object(*hmi_message);
+ auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message);
+ command->Run();
+ command->on_event(event);
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_DontUnsubscibeLastApp_NoClearCache) {
+ // Arrange
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kSubscribe] = false;
+
+ MessageSharedPtr hmi_response = CreateBasicMessage();
NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_msg_params =
- (*hmi_message)[application_manager::strings::params];
- hmi_apis::Common_Result::eType response_code =
+ (*hmi_response)[application_manager::strings::params];
+ hmi_msg_params[application_manager::hmi_response::code] =
hmi_apis::Common_Result::READ_ONLY;
- hmi_msg_params[application_manager::hmi_response::code] = response_code;
hmi_msg_params[application_manager::strings::connection_key] = kConnectionKey;
+
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kRadio);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_))
+ .WillByDefault(Return(true));
+
+ // Expectations
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillOnce(Return(true));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _))
- .WillOnce(Return(false));
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_cache_, Clear()).Times(0);
+
+ // Act
+ std::shared_ptr<
+ rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
+ mobile_message);
+ command->Run();
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
- event.set_smart_object(*hmi_message);
+ event.set_smart_object(*hmi_response);
+ command->on_event(event);
+
+ // Assert
+ EXPECT_TRUE(
+ rc_app_extention_->IsSubscibedToInteriorVehicleData(enums_value::kRadio));
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_ExpectRejectDuToRequestLimitation_NoCahce) {
+ // Arrange
+ rc_app_extention_->UnsubscribeFromInteriorVehicleData(enums_value::kRadio);
+ MessageSharedPtr mobile_message = CreateBasicMessage();
+ (*mobile_message)[application_manager::strings::msg_params]
+ [message_params::kModuleType] = module_type;
+ smart_objects::SmartObject radio_data;
+ radio_data[message_params::kBand] = enums_value::kAM;
std::shared_ptr<
rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
mobile_message);
- command->on_event(event);
+ size_t i = 0;
+ for (; i <= max_request_in_time_frame; ++i) {
+ // Expectations
+ EXPECT_CALL(mock_interior_data_manager_,
+ CheckRequestsToHMIFrequency(enums_value::kRadio))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_interior_data_manager_,
+ StoreRequestToHMITime(enums_value::kRadio));
+ EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio))
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData)))
+ .WillRepeatedly(Return(true));
+ // Act
+ command->Run();
+ }
+
+ // Expectations
+ EXPECT_CALL(mock_interior_data_manager_,
+ CheckRequestsToHMIFrequency(enums_value::kRadio))
+ .WillOnce(Return(false));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED), _))
+ .WillOnce(Return(false));
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
+
+ // Act
+ command->Run();
}
} // namespace rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
index df11bf8c88..b344471254 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc
@@ -37,6 +37,8 @@
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
@@ -56,6 +58,7 @@ namespace {
const uint32_t kAppId = 0u;
const uint32_t kConnectionKey = 1u;
const std::string kPolicyAppId = "Test";
+const int kModuleId = 153u;
}
namespace rc_rpc_plugin_test {
@@ -66,62 +69,72 @@ class OnInteriorVehicleDataNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
OnInteriorVehicleDataNotificationTest()
- : mock_app_(std::make_shared<NiceMock<MockApplication> >()) {}
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId))
+ , apps_lock_(std::make_shared<sync_primitives::Lock>())
+ , apps_da_(apps_, apps_lock_) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_app_, QueryInterface(_))
+ .WillByDefault(Return(rc_app_extention_));
+ }
MessageSharedPtr CreateBasicMessage() {
MessageSharedPtr message = CreateMessage();
(*message)[application_manager::strings::params]
[application_manager::strings::function_id] =
- mobile_apis::FunctionID::SetInteriorVehicleDataID;
+ mobile_apis::FunctionID::OnInteriorVehicleDataID;
(*message)[application_manager::strings::params]
[application_manager::strings::connection_key] = kConnectionKey;
(*message)[application_manager::strings::params]
- [application_manager::strings::connection_key] = kAppId;
+ [application_manager::strings::app_id] = kAppId;
smart_objects::SmartObject& msg_param =
(*message)[application_manager::strings::msg_params];
- msg_param[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
-
+ msg_param[message_params::kModuleData][message_params::kModuleType] =
+ mobile_apis::ModuleType::CLIMATE;
return message;
}
template <class Command>
std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_,
- mock_allocation_manager_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return ::std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
+ params);
}
protected:
std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
+ application_manager::ApplicationSet apps_;
+ const std::shared_ptr<sync_primitives::Lock> apps_lock_;
+ DataAccessor<application_manager::ApplicationSet> apps_da_;
};
TEST_F(OnInteriorVehicleDataNotificationTest,
Run_SendMessageToMobile_Notification) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- ApplicationSet app_set = {mock_app_};
- MessageSharedPtr message;
- std::shared_ptr<sync_primitives::Lock> apps_lock =
- std::make_shared<sync_primitives::Lock>();
- DataAccessor<ApplicationSet> accessor(app_set, apps_lock);
- // Expectations
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
-
- RCAppExtensionPtr rc_extention_ptr =
- std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
- rc_extention_ptr->SubscribeToInteriorVehicleData(enums_value::kClimate);
- ON_CALL(*mock_app_, QueryInterface(_))
- .WillByDefault(Return(rc_extention_ptr));
- ON_CALL(*mock_app_, is_remote_control_supported())
- .WillByDefault(Return(true));
+ apps_.insert(mock_app_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(enums_value::kClimate);
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_));
+ // Expectations
+ EXPECT_CALL(mock_interior_data_cache_, Add(enums_value::kClimate, _));
+ MessageSharedPtr message;
EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
.WillOnce(SaveArg<0>(&message));
// Act
@@ -130,8 +143,9 @@ TEST_F(OnInteriorVehicleDataNotificationTest,
rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>(
mobile_message);
command->Run();
+
// Assertions
- ASSERT_TRUE((bool)message);
+ ASSERT_TRUE(message.get());
Mock::VerifyAndClearExpectations(&app_mngr_);
}
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
index 9054ce4830..164623d926 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc
@@ -38,6 +38,8 @@
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
@@ -87,18 +89,24 @@ class RCOnRemoteControlSettingsNotificationTest
template <class Command>
std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_,
- mock_allocation_manager_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
}
protected:
std::shared_ptr<MockApplication> mock_app_;
testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
};
TEST_F(RCOnRemoteControlSettingsNotificationTest,
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
index 7f36d251cc..567d4b1e20 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc
@@ -46,6 +46,8 @@
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
#include "rc_rpc_plugin/commands/mobile/button_press_request.h"
#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h"
#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h"
@@ -100,11 +102,11 @@ class RCGetInteriorVehicleDataConsentTest
: mock_app_(std::make_shared<NiceMock<MockApplication> >())
, command_holder(app_mngr_)
, request_controller(mock_request_controler)
- , rpc_service(app_mngr_,
- request_controller,
- &mock_protocol_handler,
- &mock_hmi_handler,
- command_holder)
+ , rpc_service_(app_mngr_,
+ request_controller,
+ &mock_protocol_handler,
+ &mock_hmi_handler,
+ command_holder)
, rc_app_extention_(std::make_shared<RCAppExtension>(kPluginID))
, mock_rpc_plugin_manager(
std::make_shared<NiceMock<MockRPCPluginManager> >())
@@ -119,8 +121,10 @@ class RCGetInteriorVehicleDataConsentTest
.WillByDefault(Return(application_manager::HmiInterfaces::
InterfaceState::STATE_AVAILABLE));
ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
- ON_CALL(mock_allocation_manager_, GetApplicationExtention(_))
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
.WillByDefault(Return(rc_app_extention_));
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
ON_CALL(app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_));
ON_CALL(app_mngr_, hmi_capabilities())
@@ -146,12 +150,14 @@ class RCGetInteriorVehicleDataConsentTest
template <class Command>
std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
- app_mngr_,
- rpc_service,
- mock_hmi_capabilities_,
- mock_policy_handler_,
- mock_allocation_manager_);
+ RCCommandParams params{app_mngr_,
+ rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
}
MessageSharedPtr CreateBasicMessage() {
@@ -174,11 +180,15 @@ class RCGetInteriorVehicleDataConsentTest
am::CommandHolderImpl command_holder;
testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
smart_objects::SmartObject rc_capabilities_;
MockRPCPlugin mock_rpc_plugin;
MockCommandFactory mock_command_factory;
am::request_controller::RequestController request_controller;
- am::rpc_service::RPCServiceImpl rpc_service;
+ am::rpc_service::RPCServiceImpl rpc_service_;
std::shared_ptr<RCAppExtension> rc_app_extention_;
std::shared_ptr<am::plugin_manager::MockRPCPluginManager>
mock_rpc_plugin_manager;
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
index 8072783a71..4144beea2a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc
@@ -37,6 +37,8 @@
#include "rc_rpc_plugin/rc_rpc_plugin.h"
#include "rc_rpc_plugin/rc_module_constants.h"
#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_cache.h"
+#include "rc_rpc_plugin/mock/mock_interior_data_manager.h"
#include "gtest/gtest.h"
#include "interfaces/MOBILE_API.h"
@@ -76,7 +78,7 @@ class SetInteriorVehicleDataRequestTest
.WillByDefault(Return(application_manager::HmiInterfaces::
InterfaceState::STATE_AVAILABLE));
ON_CALL(app_mngr_, application(kAppId)).WillByDefault(Return(mock_app_));
- ON_CALL(mock_allocation_manager_, GetApplicationExtention(_))
+ ON_CALL(*mock_app_, QueryInterface(RCRPCPlugin::kRCPluginID))
.WillByDefault(Return(rc_app_extention_));
ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kPolicyAppId));
@@ -108,17 +110,23 @@ class SetInteriorVehicleDataRequestTest
template <class Command>
std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return std::make_shared<Command>(msg ? msg : msg = CreateMessage(),
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_,
- mock_allocation_manager_);
+ RCCommandParams params{app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_,
+ mock_allocation_manager_,
+ mock_interior_data_cache_,
+ mock_interior_data_manager_};
+ return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), params);
}
protected:
testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager>
mock_allocation_manager_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataCache>
+ mock_interior_data_cache_;
+ testing::NiceMock<rc_rpc_plugin_test::MockInteriorDataManager>
+ mock_interior_data_manager_;
std::shared_ptr<MockApplication> mock_app_;
std::shared_ptr<RCAppExtension> rc_app_extention_;
};
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
new file mode 100644
index 0000000000..45465f96b0
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
+
+namespace rc_rpc_plugin_test {
+
+class MockInteriorDataCache : public rc_rpc_plugin::InteriorDataCache {
+ public:
+ MOCK_METHOD2(Add,
+ void(const std::string&, const smart_objects::SmartObject&));
+ MOCK_CONST_METHOD1(Retrieve, smart_objects::SmartObject(const std::string&));
+ MOCK_CONST_METHOD1(Contains, bool(const std::string&));
+ MOCK_METHOD1(Remove, void(const std::string&));
+ MOCK_METHOD0(Clear, void());
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_CACHE_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h
new file mode 100644
index 0000000000..fc19c6a889
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_manager.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
+
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_manager.h"
+namespace rc_rpc_plugin_test {
+
+class MockInteriorDataManager : public rc_rpc_plugin::InteriorDataManager {
+ public:
+ MOCK_METHOD1(OnPolicyEvent,
+ void(application_manager::plugin_manager::PolicyEvent));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(application_manager::plugin_manager::ApplicationEvent,
+ application_manager::ApplicationSharedPtr));
+ MOCK_METHOD0(OnDisablingRC, void());
+ MOCK_METHOD1(StoreRequestToHMITime, void(const std::string&));
+ MOCK_METHOD1(CheckRequestsToHMIFrequency, bool(const std::string&));
+};
+
+} // namespace rc_rpc_plugin_test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_INTERIOR_DATA_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
index d74e8fcb65..72ace1432a 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
#include "gmock/gmock.h"
#include "application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h"
@@ -61,9 +61,6 @@ class MockResourceAllocationManager
const uint32_t app_id,
const rc_rpc_plugin::ResourceState::eType state));
MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type));
- MOCK_METHOD1(GetApplicationExtention,
- rc_rpc_plugin::RCAppExtensionPtr(
- application_manager::ApplicationSharedPtr application));
MOCK_METHOD0(ResetAllAllocations, void());
MOCK_METHOD2(SendOnRCStatusNotifications,
void(rc_rpc_plugin::NotificationTrigger::eType,
@@ -74,4 +71,4 @@ class MockResourceAllocationManager
} // namespace rc_rpc_plugin_test
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
new file mode 100644
index 0000000000..e6922a4c83
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. */
+
+#include "gtest/gtest.h"
+#include "rc_rpc_plugin/interior_data_cache_impl.h"
+
+namespace rc_rpc_plugin_test {
+
+class InteriorDataCacheTest : public ::testing::Test {};
+
+namespace {
+const uint32_t time_frame_alowed_requests = 1;
+} // namespace
+
+TEST_F(InteriorDataCacheTest,
+ InteriorDataCacheDoesNotContainRandomDataInitialy) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ std::string module_type_key = "random_module_type";
+ EXPECT_FALSE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(smart_objects::SmartType_Null, retrieved_data.getType());
+}
+
+TEST_F(InteriorDataCacheTest, CheckThatCacheContansDataAfterAdding) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(data, retrieved_data);
+}
+
+TEST_F(InteriorDataCacheTest, DataDoesNotExistAfterClear) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto Retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(Retrieved_data, data);
+ cache.Clear();
+ auto Retrieved_data_after_clear = cache.Retrieve(module_type_key);
+ EXPECT_EQ(smart_objects::SmartType_Null,
+ Retrieved_data_after_clear.getType());
+}
+
+TEST_F(InteriorDataCacheTest, MultipleDataCached) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type_key1 = "random_module_type";
+ smart_objects::SmartObject data1;
+ data1["key"] = "value1";
+ cache.Add(module_type_key1, data1);
+ EXPECT_TRUE(cache.Contains(module_type_key1));
+ auto retrieved_data1 = cache.Retrieve(module_type_key1);
+ EXPECT_EQ(data1, retrieved_data1);
+
+ std::string module_type_key2 = "random_module_type2";
+ smart_objects::SmartObject data2;
+ data2["key"] = "value2";
+ cache.Add(module_type_key2, data2);
+ EXPECT_TRUE(cache.Contains(module_type_key2));
+ auto retrieved_data2 = cache.Retrieve(module_type_key2);
+ EXPECT_EQ(retrieved_data2, data2);
+
+ ASSERT_TRUE(data1 != data2);
+ EXPECT_TRUE(data2 != retrieved_data1);
+ EXPECT_TRUE(data1 != retrieved_data2);
+}
+
+TEST_F(InteriorDataCacheTest, RemoveFromChacheSuccessful) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value1";
+ cache.Add(module_type, data);
+ EXPECT_TRUE(cache.Contains(module_type));
+ auto retrieved_data1 = cache.Retrieve(module_type);
+ EXPECT_EQ(data, retrieved_data1);
+
+ cache.Remove(module_type);
+ EXPECT_FALSE(cache.Contains(module_type));
+ auto retreived = cache.Retrieve(module_type);
+ EXPECT_EQ(smart_objects::SmartType_Null, retreived.getType());
+}
+
+TEST_F(InteriorDataCacheTest, RemoveNotExistingNoSideEffects) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+ const std::string module_type_key = "random_module_type";
+ smart_objects::SmartObject data;
+ data["key"] = "value";
+
+ cache.Add(module_type_key, data);
+ cache.Remove("some other module_type");
+
+ EXPECT_TRUE(cache.Contains(module_type_key));
+ auto retrieved_data = cache.Retrieve(module_type_key);
+ EXPECT_EQ(data, retrieved_data);
+}
+
+TEST_F(InteriorDataCacheTest, Exist2ModuleTypesRemoveOneAnotherOneLeft) {
+ rc_rpc_plugin::InteriorDataCacheImpl cache;
+
+ const std::string module_type_key1 = "random_module_type";
+ smart_objects::SmartObject data1;
+ data1["key"] = "value1";
+ cache.Add(module_type_key1, data1);
+
+ std::string module_type_key2 = "random_module_type2";
+ smart_objects::SmartObject data2;
+ data2["key"] = "value2";
+ cache.Add(module_type_key2, data2);
+
+ ASSERT_TRUE(data1 != data2);
+
+ cache.Remove(module_type_key1);
+ EXPECT_FALSE(cache.Contains(module_type_key1));
+ EXPECT_TRUE(cache.Contains(module_type_key2));
+
+ auto retrieved_data1 = cache.Retrieve(module_type_key1);
+ EXPECT_EQ(smart_objects::SmartType_Null, retrieved_data1.getType());
+ auto retrieved_data2 = cache.Retrieve(module_type_key2);
+ EXPECT_EQ(data2, retrieved_data2);
+}
+
+} // rc_rpc_plugin_test
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
index 4e2e4d7895..86c58b9d46 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc
@@ -71,7 +71,7 @@ const uint32_t kAppId1 = 11u;
const uint32_t kHMIAppId1 = 1u;
const uint32_t kAppId2 = 22u;
const std::string policy_app_id_1_ = "policy_id_1";
-const uint32_t kSizeOfModules = 3u;
+const uint32_t kSizeOfModules = 6u;
}
namespace rc_rpc_plugin_test {
@@ -298,13 +298,6 @@ TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillRepeatedly(Return(mock_app_2_));
- RCAppExtensionPtr rc_extention_ptr =
- std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
-
- EXPECT_CALL(*mock_app_2_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
// Act
application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
@@ -358,13 +351,6 @@ TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId1))
.WillRepeatedly(Return(mock_app_2_));
- RCAppExtensionPtr rc_extention_ptr =
- std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
-
- EXPECT_CALL(*mock_app_2_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
// Act
application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
index 6db222a401..1a4c248a02 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h
@@ -109,15 +109,6 @@ class PerformAudioPassThruRequest
ResponseParams response_params_;
/**
- * @brief Prepare result code, result and info for sending to mobile
- * application
- * @param result_code contains result code for sending to mobile application
- * @return result for sending to mobile application.
- * @deprecated
- */
- DEPRECATED bool PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info);
- /**
* @brief Prepare result code, 'success' result and info for sending
* to mobile application
* @param result_code contains result code for sending to mobile application
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
index 40e706b851..2d4cbc9afc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h
@@ -213,6 +213,13 @@ class PerformInteractionRequest
const smart_objects::SmartObject& choice_set_id_list) const;
/**
+ * @brief Checks each choice in each set for having a VRcommands parameter
+ * @param app contains pointer to application.
+ * @return returns false if request has choice sets with no vrCommands
+ */
+ bool CheckChoiceSetListVRCommands(app_mngr::ApplicationSharedPtr app);
+
+ /**
* @brief Tells if there are sent requests without responses
* @return If there is request without response method returns TRUE
* otherwise returns FALSE
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
index 9cac2ab34f..542fdac5f8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
@@ -83,12 +83,6 @@ class RegisterAppInterfaceRequest
**/
virtual void Run();
- /**
- * @brief Prepares and sends RegisterAppInterface response to mobile
- * considering application type
- **/
- void SendRegisterAppInterfaceResponseToMobile();
-
private:
/**
* @brief The AppicationType enum defines whether application is newly
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
index 9b7653ac52..d50708c4eb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc
@@ -130,10 +130,30 @@ void CreateInteractionChoiceSetRequest::Run() {
SendResponse(false, result);
return;
}
- uint32_t grammar_id = application_manager_.GenerateGrammarID();
- (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(
+ (*message_)[strings::msg_params][strings::choice_set]);
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::MIXED) {
+ // this is an error
+ SendResponse(false,
+ Result::INVALID_DATA,
+ "Some choices don't contain VR commands. Either all or none "
+ "must have voice commands.");
+ return; // exit now, this is a bad set
+ } else if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ // everyone had a vr command, setup the grammar
+ uint32_t grammar_id = application_manager_.GenerateGrammarID();
+ (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
+ }
+ // continue on as usual
app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]);
- SendVRAddCommandRequests(app);
+
+ if (vr_status == MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ // we have VR commands
+ SendVRAddCommandRequests(app);
+ } else {
+ // we have none, just return with success
+ SendResponse(true, Result::SUCCESS);
+ }
}
mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
@@ -155,7 +175,7 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
(*current_choice_set_it)[strings::choice_id].asInt());
if (!ins_res.second) {
LOG4CXX_ERROR(logger_,
- "Choise with ID "
+ "Choice with ID "
<< (*current_choice_set_it)[strings::choice_id].asInt()
<< " already exists");
return mobile_apis::Result::INVALID_ID;
@@ -179,12 +199,15 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
bool CreateInteractionChoiceSetRequest::compareSynonyms(
const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
+ // only compare if they both have vr commands
+ if (!(choice1.keyExists(strings::vr_commands) &&
+ choice2.keyExists(strings::vr_commands))) {
+ return false; // clearly there isn't a duplicate if one of them is null
+ }
smart_objects::SmartArray* vr_cmds_1 =
choice1[strings::vr_commands].asArray();
- DCHECK(vr_cmds_1 != NULL);
smart_objects::SmartArray* vr_cmds_2 =
choice2[strings::vr_commands].asArray();
- DCHECK(vr_cmds_2 != NULL);
smart_objects::SmartArray::iterator it;
it = std::find_first_of(vr_cmds_1->begin(),
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
index 86a644a778..c90038a8b7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc
@@ -250,13 +250,6 @@ PerformAudioPassThruRequest::PrepareResponseParameters() {
return response_params_;
}
-bool PerformAudioPassThruRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
- LOG4CXX_AUTO_TRACE(logger_);
- NOTREACHED();
- return false;
-}
-
void PerformAudioPassThruRequest::SendSpeakRequest() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
index ec06f0bb31..42489fd8bd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
@@ -186,7 +186,8 @@ void PerformInteractionRequest::Run() {
case mobile_apis::InteractionMode::BOTH: {
LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH");
if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) ||
- !CheckVrHelpItemPositions(app)) {
+ !CheckVrHelpItemPositions(app) ||
+ !CheckChoiceSetListVRCommands(app)) {
return;
}
break;
@@ -201,7 +202,8 @@ void PerformInteractionRequest::Run() {
}
case mobile_apis::InteractionMode::VR_ONLY: {
LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY");
- if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app)) {
+ if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app) ||
+ !CheckChoiceSetListVRCommands(app)) {
return;
}
break;
@@ -542,7 +544,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
smart_objects::SmartObject* choice_set =
app->FindChoiceSet(choice_list[i].asInt());
if (!choice_set) {
- LOG4CXX_WARN(logger_, "Couldn't found choiset");
+ LOG4CXX_WARN(logger_, "Couldn't found choiceset");
continue;
}
msg_params[strings::grammar_id][grammar_id_index++] =
@@ -750,6 +752,15 @@ bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
size_t jj = 0;
for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ if (!((*i_choice_set)[strings::choice_set][ii].keyExists(
+ strings::vr_commands) &&
+ (*j_choice_set)[strings::choice_set][jj].keyExists(
+ strings::vr_commands))) {
+ LOG4CXX_DEBUG(logger_,
+ "One or both sets has missing vr commands, skipping "
+ "synonym check");
+ return true;
+ }
// choice_set pointer contains SmartObject msg_params
smart_objects::SmartObject& ii_vr_commands =
(*i_choice_set)[strings::choice_set][ii][strings::vr_commands];
@@ -946,6 +957,45 @@ bool PerformInteractionRequest::CheckChoiceIDFromResponse(
return false;
}
+bool PerformInteractionRequest::CheckChoiceSetListVRCommands(
+ ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const smart_objects::SmartObject& choice_set_id_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ smart_objects::SmartObject* choice_set = nullptr;
+
+ for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
+ choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt());
+
+ // this should never ever happen since this was already checked
+ if (choice_set == nullptr) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt());
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ const smart_objects::SmartObject& choices_list =
+ (*choice_set)[strings::choice_set];
+ auto vr_status = MessageHelper::CheckChoiceSetVRCommands(choices_list);
+
+ // if not all choices have vr commands
+ if (vr_status != MessageHelper::ChoiceSetVRCommandsStatus::ALL) {
+ LOG4CXX_ERROR(logger_,
+ "PerformInteraction has choice sets with "
+ "missing vrCommands, not in MANUAL_ONLY mode");
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "Some choices don't contain VR commands.");
+ return false;
+ }
+ }
+ return true;
+}
+
bool PerformInteractionRequest::CheckChoiceIDFromRequest(
ApplicationSharedPtr app,
const size_t choice_set_id_list_length,
@@ -962,9 +1012,10 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest(
if (!choice_set) {
LOG4CXX_ERROR(
logger_,
- "Couldn't find choiset_id = " << choice_set_id_list[i].asInt());
+ "Couldn't find choiceset_id = " << choice_set_id_list[i].asInt());
return false;
}
+
choice_list_length = (*choice_set)[strings::choice_set].length();
const smart_objects::SmartObject& choices_list =
(*choice_set)[strings::choice_set];
@@ -973,7 +1024,7 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest(
choice_id_set.insert(choices_list[k][strings::choice_id].asInt());
if (!ins_res.second) {
LOG4CXX_ERROR(logger_,
- "Choise with ID "
+ "choice with ID "
<< choices_list[k][strings::choice_id].asInt()
<< " already exists");
return false;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
index 4d1e4339f5..d5a13c99a0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc
@@ -212,10 +212,9 @@ void PutFileRequest::Run() {
return;
}
const std::string full_path = file_path + "/" + sync_file_name_;
- const size_t bin_data_size = binary_data.size();
if ((*message_)[strings::msg_params].keyExists(strings::crc32_check_sum)) {
- LOG4CXX_TRACE(logger_, "Binary Data Size: " << bin_data_size);
+ LOG4CXX_TRACE(logger_, "Binary Data Size: " << binary_data.size());
const uint32_t crc_received =
(*message_)[strings::msg_params][strings::crc32_check_sum].asUInt();
LOG4CXX_TRACE(logger_, "CRC32 SUM Received: " << crc_received);
@@ -232,7 +231,7 @@ void PutFileRequest::Run() {
}
LOG4CXX_DEBUG(logger_,
- "Writing " << bin_data_size << " bytes to " << full_path
+ "Writing " << binary_data.size() << " bytes to " << full_path
<< " (current size is"
<< file_system::FileSize(full_path) << ")");
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
index 675ffcd31a..70307b8da2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -840,11 +840,6 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
SendChangeRegistrationOnHMI(application);
}
-DEPRECATED void
-RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
- SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
-}
-
void RegisterAppInterfaceRequest::SendChangeRegistration(
const hmi_apis::FunctionID::eType function_id,
const int32_t language,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
index da51c3e4e4..1a206c2cce 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt
@@ -6,6 +6,7 @@ include_directories(
${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/
${COMPONENTS_DIR}/application_manager/test/include/
${POLICY_MOCK_INCLUDE_PATH}/
+ ${CMAKE_SOURCE_DIR}/src
)
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
index dd51078614..fe82b16f3f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc
@@ -872,7 +872,7 @@ TEST_F(HMICommandsNotificationsTest,
SubscribeForSignal();
command->Run();
- utils::WaitTerminationSignals(sig_handler);
+ utils::Signals::WaitTerminationSignals(sig_handler);
EXPECT_EQ(am::mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF,
mob_reason);
@@ -914,7 +914,7 @@ TEST_F(HMICommandsNotificationsTest,
SubscribeForSignal();
command->Run();
- utils::WaitTerminationSignals(sig_handler);
+ utils::Signals::WaitTerminationSignals(sig_handler);
#endif
}
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
index ed264ff2ab..c42be48e57 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc
@@ -199,6 +199,8 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
10;
(*msg_vr)[strings::msg_params][strings::choice_set][0][strings::menu_name] =
"menu_name";
+ (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::vr_commands]
+ [0] = kVrCommands1;
(*msg_vr)[strings::msg_params][strings::interaction_choice_set_id] = 11;
std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
@@ -231,7 +233,8 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
-
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
req_vr->Run();
MessageSharedPtr vr_command_result;
@@ -436,6 +439,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -481,6 +487,79 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
command_->Run();
}
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_WithoutVrCommands_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillOnce(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::NONE));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ // No VR commands
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_WithMixedVrCommands_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillOnce(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::MIXED));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(0);
+
+ command_->Run();
+}
+
TEST_F(CreateInteractionChoiceSetRequestTest,
OnEvent_InvalidEventId_UNSUCCESS) {
Event event(hmi_apis::FunctionID::INVALID_ENUM);
@@ -523,6 +602,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) {
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -557,6 +639,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -592,6 +677,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -640,6 +728,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -682,6 +773,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
@@ -723,6 +817,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest,
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
+
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
ON_CALL(app_mngr_, GetNextHMICorrelationID())
.WillByDefault(Return(kCorrelationId));
@@ -796,6 +893,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
.WillRepeatedly(Return(choice_set_id));
+ ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_))
+ .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL));
+
EXPECT_CALL(app_mngr_, GenerateGrammarID())
.WillRepeatedly(Return(kGrammarId));
EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(2);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
index 6e084e0869..7c6e1754da 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h
@@ -113,14 +113,6 @@ class SubscribeVehicleDataRequest
app_mngr::ApplicationSharedPtr app,
const smart_objects::SmartObject& msg_params) const;
- DEPRECATED void CheckVISubscribtions(
- app_mngr::ApplicationSharedPtr app,
- std::string& out_info,
- mobile_apis::Result::eType& out_result_code,
- smart_objects::SmartObject& out_response_params,
- smart_objects::SmartObject& out_request_params,
- bool& out_result);
-
/**
* @brief Checks if current application and other applications
* were subscribed to VI, prepare data that need to send to mobile app
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
index 41fd35b8b5..65f4fde0b2 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -234,21 +234,6 @@ bool SubscribeVehicleDataRequest::IsSomeoneSubscribedFor(
return it != accessor.GetData().end();
}
-void SubscribeVehicleDataRequest::CheckVISubscribtions(
- ApplicationSharedPtr app,
- std::string& out_info,
- mobile_apis::Result::eType& out_result_code,
- smart_objects::SmartObject& out_response_params,
- smart_objects::SmartObject& out_request_params,
- bool& out_result) {
- CheckVISubscriptions(app,
- out_info,
- out_result_code,
- out_response_params,
- out_request_params,
- out_result);
-}
-
void SubscribeVehicleDataRequest::CheckVISubscriptions(
ApplicationSharedPtr app,
std::string& out_info,
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 3855d6733b..9311cea6d7 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
@@ -89,6 +89,7 @@ app_mngr::CommandSharedPtr VehicleInfoHmiCommandFactory::CreateCommand(
message_type_str = "error response";
}
+ UNUSED(message_type_str);
LOG4CXX_DEBUG(logger_,
"HMICommandFactory::CreateCommand function_id: "
<< function_id << ", message type: " << message_type_str);
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
index caa832dde4..7600afa091 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc
@@ -86,6 +86,7 @@ app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand(
message_type_str = "notification";
}
+ UNUSED(message_type_str);
LOG4CXX_DEBUG(logger_,
"HMICommandFactory::CreateCommand function_id: "
<< function_id << ", message type: " << message_type_str);
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index a26418d917..8f76d81104 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -314,6 +314,13 @@ const HmiStatePtr ApplicationImpl::RegularHmiState() const {
return state_.GetState(HmiState::STATE_ID_REGULAR);
}
+bool ApplicationImpl::IsAllowedToChangeAudioSource() const {
+ if (is_remote_control_supported() && is_media_application()) {
+ return true;
+ }
+ return false;
+}
+
const HmiStatePtr ApplicationImpl::PostponedHmiState() const {
return state_.GetState(HmiState::STATE_ID_POSTPONED);
}
@@ -664,10 +671,6 @@ void ApplicationImpl::set_app_allowed(const bool allowed) {
is_app_allowed_ = allowed;
}
-void ApplicationImpl::set_device(connection_handler::DeviceHandle device) {
- device_id_ = device;
-}
-
void ApplicationImpl::set_secondary_device(
connection_handler::DeviceHandle secondary_device) {
secondary_device_id_ = secondary_device;
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index e7b518f0fd..55112e153c 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -178,7 +178,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, is_low_voltage_(false)
, apps_size_(0)
, is_stopping_(false) {
- std::srand(std::time(0));
+ std::srand(std::time(nullptr));
AddPolicyObserver(this);
dir_type_to_string_map_ = {{TYPE_STORAGE, "Storage"},
@@ -405,6 +405,7 @@ void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
ApplicationConstSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
bool voice_state = app->is_voice_communication_supported();
bool media_state = app->is_media_application();
bool navi_state = app->is_navi();
@@ -665,16 +666,6 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
return application;
}
-DEPRECATED bool ApplicationManagerImpl::RemoveAppDataFromHMI(
- ApplicationSharedPtr app) {
- return true;
-}
-
-DEPRECATED bool ApplicationManagerImpl::LoadAppDataToHMI(
- ApplicationSharedPtr app) {
- return true;
-}
-
bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
using namespace mobile_api;
LOG4CXX_AUTO_TRACE(logger_);
@@ -801,16 +792,6 @@ uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
return corelation_id_;
}
-bool ApplicationManagerImpl::BeginAudioPassThrough() {
- sync_primitives::AutoLock lock(audio_pass_thru_lock_);
- if (audio_pass_thru_active_) {
- return false;
- } else {
- audio_pass_thru_active_ = true;
- return true;
- }
-}
-
bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) {
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
if (audio_pass_thru_active_) {
@@ -822,16 +803,6 @@ bool ApplicationManagerImpl::BeginAudioPassThru(uint32_t app_id) {
}
}
-bool ApplicationManagerImpl::EndAudioPassThrough() {
- sync_primitives::AutoLock lock(audio_pass_thru_lock_);
- if (audio_pass_thru_active_) {
- audio_pass_thru_active_ = false;
- return true;
- } else {
- return false;
- }
-}
-
bool ApplicationManagerImpl::EndAudioPassThru(uint32_t app_id) {
sync_primitives::AutoLock lock(audio_pass_thru_lock_);
if (audio_pass_thru_active_ && audio_pass_thru_app_id_ == app_id) {
@@ -853,11 +824,6 @@ void ApplicationManagerImpl::set_driver_distraction_state(
driver_distraction_state_ = state;
}
-DEPRECATED void ApplicationManagerImpl::set_vr_session_started(
- const bool state) {
- is_vr_session_strated_ = state;
-}
-
void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
is_all_apps_allowed_ = allowed;
}
@@ -876,18 +842,6 @@ HmiStatePtr ApplicationManagerImpl::CreateRegularState(
return state;
}
-HmiStatePtr ApplicationManagerImpl::CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const {
- HmiStatePtr state(new HmiState(app_id, *this));
- state->set_hmi_level(hmi_level);
- state->set_audio_streaming_state(audio_state);
- state->set_system_context(system_context);
- return state;
-}
-
void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
int32_t correlation_id,
int32_t max_duration,
@@ -1307,111 +1261,6 @@ uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
return hmi_app_id;
}
-void ApplicationManagerImpl::ReplaceMobileByHMIAppId(
- smart_objects::SmartObject& message) {
- MessageHelper::PrintSmartObject(message);
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application_ptr =
- application(message[strings::app_id].asUInt());
- if (application_ptr.use_count() != 0) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceMobileByHMIAppId from "
- << message[strings::app_id].asInt() << " to "
- << application_ptr->hmi_app_id());
- message[strings::app_id] = application_ptr->hmi_app_id();
- }
- } else {
- switch (message.getType()) {
- case smart_objects::SmartType::SmartType_Array: {
- smart_objects::SmartArray* message_array = message.asArray();
- smart_objects::SmartArray::iterator it = message_array->begin();
- for (; it != message_array->end(); ++it) {
- ReplaceMobileByHMIAppId(*it);
- }
- break;
- }
- case smart_objects::SmartType::SmartType_Map: {
- std::set<std::string> keys = message.enumerate();
- std::set<std::string>::const_iterator key = keys.begin();
- for (; key != keys.end(); ++key) {
- std::string k = *key;
- ReplaceMobileByHMIAppId(message[*key]);
- }
- break;
- }
- default: { break; }
- }
- }
-}
-
-void ApplicationManagerImpl::ReplaceHMIByMobileAppId(
- smart_objects::SmartObject& message) {
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application =
- application_by_hmi_app(message[strings::app_id].asUInt());
-
- if (application.use_count() != 0) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceHMIByMobileAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->app_id());
- message[strings::app_id] = application->app_id();
- }
- } else {
- switch (message.getType()) {
- case smart_objects::SmartType::SmartType_Array: {
- smart_objects::SmartArray* message_array = message.asArray();
- smart_objects::SmartArray::iterator it = message_array->begin();
- for (; it != message_array->end(); ++it) {
- ReplaceHMIByMobileAppId(*it);
- }
- break;
- }
- case smart_objects::SmartType::SmartType_Map: {
- std::set<std::string> keys = message.enumerate();
- std::set<std::string>::const_iterator key = keys.begin();
- for (; key != keys.end(); ++key) {
- ReplaceHMIByMobileAppId(message[*key]);
- }
- break;
- }
- default: { break; }
- }
- }
-}
-
-bool ApplicationManagerImpl::StartNaviService(
- uint32_t app_id, protocol_handler::ServiceType service_type) {
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (HMILevelAllowsStreaming(app_id, service_type)) {
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it) {
- std::pair<NaviServiceStatusMap::iterator, bool> res =
- navi_service_status_.insert(
- std::pair<uint32_t, std::pair<bool, bool> >(
- app_id, std::make_pair(false, false)));
- if (!res.second) {
- LOG4CXX_WARN(logger_, "Navi service refused");
- return false;
- }
- it = res.first;
- }
- // Fill NaviServices map. Set true to first value of pair if
- // we've started video service or to second value if we've
- // started audio service
- service_type == ServiceType::kMobileNav ? it->second.first = true
- : it->second.second = true;
-
- application(app_id)->StartStreaming(service_type);
- return true;
- } else {
- LOG4CXX_WARN(logger_, "Refused navi service by HMI level");
- }
- return false;
-}
-
bool ApplicationManagerImpl::StartNaviService(
uint32_t app_id,
protocol_handler::ServiceType service_type,
@@ -1551,46 +1400,6 @@ void ApplicationManagerImpl::StopNaviService(
app->StopStreaming(service_type);
}
-// Suppress warning for deprecated method used within another deprecated method
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-bool ApplicationManagerImpl::OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) {
- using namespace helpers;
- using namespace protocol_handler;
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "ServiceType = " << type << ". Session = " << std::hex
- << session_key);
-
- if (type == kRpc) {
- LOG4CXX_DEBUG(logger_, "RPC service is about to be started.");
- return true;
- }
- ApplicationSharedPtr app = application(session_key);
- if (!app) {
- LOG4CXX_WARN(logger_,
- "The application with id:" << session_key
- << " doesn't exists.");
- return false;
- }
-
- if (Compare<ServiceType, EQ, ONE>(
- type, ServiceType::kMobileNav, ServiceType::kAudio)) {
- if (app->is_navi()) {
- return StartNaviService(session_key, type);
- } else {
- LOG4CXX_WARN(logger_, "Refuse not navi application");
- }
- } else {
- LOG4CXX_WARN(logger_, "Refuse unknown service");
- }
- return false;
-}
-#pragma GCC diagnostic pop
-
void ApplicationManagerImpl::OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -1965,6 +1774,8 @@ bool ApplicationManagerImpl::Stop() {
stopping_application_mng_lock_.Release();
application_list_update_timer_.Stop();
try {
+ SetUnregisterAllApplicationsReason(
+ mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF);
UnregisterAllApplications();
} catch (...) {
LOG4CXX_ERROR(logger_,
@@ -2344,6 +2155,14 @@ void ApplicationManagerImpl::set_application_id(const int32_t correlation_id,
std::pair<const int32_t, const uint32_t>(correlation_id, app_id));
}
+uint32_t ApplicationManagerImpl::get_current_audio_source() const {
+ return current_audio_source_;
+}
+
+void ApplicationManagerImpl::set_current_audio_source(const uint32_t source) {
+ current_audio_source_ = source;
+}
+
void ApplicationManagerImpl::AddPolicyObserver(
policy::PolicyHandlerObserver* listener) {
GetPolicyHandler().add_listener(listener);
@@ -2436,7 +2255,10 @@ void ApplicationManagerImpl::ClearAppsPersistentData() {
void ApplicationManagerImpl::SendOnSDLClose() {
LOG4CXX_AUTO_TRACE(logger_);
-
+ if (IsLowVoltage()) {
+ LOG4CXX_TRACE(logger_, "SDL is in Low Voltage State");
+ return;
+ }
// must be sent to PASA HMI on shutdown synchronously
smart_objects::SmartObjectSPtr msg =
std::make_shared<smart_objects::SmartObject>(
@@ -2626,11 +2448,13 @@ void ApplicationManagerImpl::UnregisterApplication(
return;
}
+
if (is_resuming) {
resume_controller().SaveApplication(app_to_remove);
} else {
resume_controller().RemoveApplicationFromSaved(app_to_remove);
}
+
(hmi_capabilities_->get_hmi_language_handler())
.OnUnregisterApplication(app_id);
AppV4DevicePredicate finder(handle);
@@ -2734,14 +2558,24 @@ bool ApplicationManagerImpl::is_audio_pass_thru_active() const {
void ApplicationManagerImpl::OnLowVoltage() {
LOG4CXX_AUTO_TRACE(logger_);
is_low_voltage_ = true;
+ resume_ctrl_->SaveLowVoltageTime();
+ resume_ctrl_->StopSavePersistentDataTimer();
request_ctrl_.OnLowVoltage();
}
-bool ApplicationManagerImpl::IsLowVoltage() {
- LOG4CXX_TRACE(logger_, "result: " << is_low_voltage_);
+bool ApplicationManagerImpl::IsLowVoltage() const {
+ LOG4CXX_TRACE(logger_, "Result: " << is_low_voltage_);
return is_low_voltage_;
}
+void ApplicationManagerImpl::OnWakeUp() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_low_voltage_ = false;
+ resume_ctrl_->SaveWakeUpTime();
+ resume_ctrl_->StartSavePersistentDataTimer();
+ request_ctrl_.OnWakeUp();
+}
+
std::string ApplicationManagerImpl::GetHashedAppID(
uint32_t connection_key, const std::string& mobile_app_id) const {
connection_handler::DeviceHandle device_id = 0;
@@ -3160,12 +2994,6 @@ policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
return GetPolicyHandler().GetUserConsentForDevice(device_id);
}
-void ApplicationManagerImpl::OnWakeUp() {
- LOG4CXX_AUTO_TRACE(logger_);
- is_low_voltage_ = false;
- request_ctrl_.OnWakeUp();
-}
-
mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
const std::vector<uint8_t>& binary_data,
const std::string& file_path,
@@ -3629,30 +3457,6 @@ void ApplicationManagerImpl::ClearTTSGlobalPropertiesList() {
}
bool ApplicationManagerImpl::IsAppSubscribedForWayPoints(
- const uint32_t app_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- if (subscribed_way_points_apps_list_.find(app_id) ==
- subscribed_way_points_apps_list_.end()) {
- return false;
- }
- return true;
-}
-
-void ApplicationManagerImpl::SubscribeAppForWayPoints(const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.insert(app_id);
-}
-
-void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
- const uint32_t app_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.erase(app_id);
-}
-
-bool ApplicationManagerImpl::IsAppSubscribedForWayPoints(
ApplicationSharedPtr app) const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index db78ad15f0..dcc521ae57 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -155,13 +155,6 @@ bool CommandImpl::ReplaceMobileWithHMIAppId(
return true;
}
-DEPRECATED void CommandImpl::ReplaceMobileByHMIAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
- if (!ReplaceMobileWithHMIAppId(message)) {
- LOG4CXX_ERROR(logger_, "Substitution mobile --> HMI id is failed.");
- }
-}
-
bool CommandImpl::ReplaceHMIWithMobileAppId(
NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
if (message.keyExists(strings::app_id)) {
@@ -207,12 +200,5 @@ bool CommandImpl::ReplaceHMIWithMobileAppId(
return true;
}
-DEPRECATED void CommandImpl::ReplaceHMIByMobileAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
- if (!ReplaceHMIWithMobileAppId(message)) {
- LOG4CXX_ERROR(logger_, "Substitution HMI --> mobile id is failed.");
- }
-}
-
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 0033fe4fb6..aa4c979ae7 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -67,27 +67,6 @@ HmiState::HmiState(std::shared_ptr<Application> app,
LOG4CXX_DEBUG(logger_, *this);
}
-DEPRECATED HmiState::HmiState(uint32_t app_id,
- const ApplicationManager& app_mngr,
- StateID state_id)
- : state_id_(state_id)
- , app_mngr_(app_mngr)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
- , audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
- app_ = app_mngr_.application(app_id);
-}
-
-DEPRECATED HmiState::HmiState(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : state_id_(STATE_ID_REGULAR)
- , app_mngr_(app_mngr)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
- , audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
- , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
- app_ = app_mngr_.application(app_id);
-}
-
void HmiState::set_parent(HmiStatePtr parent) {
DCHECK_OR_RETURN_VOID(parent);
parent_ = parent;
@@ -119,18 +98,10 @@ VRHmiState::VRHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_VR_SESSION) {}
-DEPRECATED VRHmiState::VRHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_VR_SESSION) {}
-
TTSHmiState::TTSHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_TTS_SESSION) {}
-DEPRECATED TTSHmiState::TTSHmiState(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_TTS_SESSION) {}
-
mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
const {
using namespace helpers;
@@ -189,10 +160,6 @@ PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {}
-DEPRECATED PhoneCallHmiState::PhoneCallHmiState(
- uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_PHONE_CALL) {}
-
mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
using namespace helpers;
using namespace mobile_apis;
@@ -214,18 +181,10 @@ SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {}
-DEPRECATED SafetyModeHmiState::SafetyModeHmiState(
- uint32_t app_id, const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_SAFETY_MODE) {}
-
DeactivateHMI::DeactivateHMI(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
-DEPRECATED DeactivateHMI::DeactivateHMI(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
-
mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
using namespace helpers;
using namespace mobile_apis;
@@ -242,16 +201,15 @@ AudioSource::AudioSource(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE) {}
-DEPRECATED AudioSource::AudioSource(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_AUDIO_SOURCE) {}
-
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
// Checking for NONE is necessary to avoid issue during
// calculation of HMI level during setting default HMI level
if (mobile_apis::HMILevel::HMI_NONE == parent()->hmi_level()) {
return mobile_apis::HMILevel::HMI_NONE;
}
+ if (mobile_apis::HMILevel::HMI_FULL == parent()->hmi_level()) {
+ return mobile_apis::HMILevel::HMI_FULL;
+ }
return mobile_apis::HMILevel::HMI_BACKGROUND;
}
@@ -260,10 +218,6 @@ EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
-DEPRECATED EmbeddedNavi::EmbeddedNavi(uint32_t app_id,
- const ApplicationManager& app_mngr)
- : HmiState(app_id, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
-
mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
using namespace mobile_apis;
using namespace helpers;
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index b005af0fb5..332d68adbf 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.cc
@@ -190,19 +190,6 @@ void Message::set_message_type(MessageType type) {
type_ = type;
}
-void Message::set_binary_data(BinaryData* data) {
- if (NULL == data) {
- NOTREACHED();
- return;
- }
-
- if (binary_data_) {
- delete binary_data_;
- }
-
- binary_data_ = new BinaryData(*data);
-}
-
void Message::set_binary_data(const BinaryData* data) {
if (NULL == data) {
NOTREACHED();
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 052d619fcc..0ad86b5541 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -2690,6 +2690,40 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
return mobile_apis::Result::WARNINGS;
}
+MessageHelper::ChoiceSetVRCommandsStatus
+MessageHelper::CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set) {
+ // if this is false, someone doesn't have vrCommands
+ bool all_have = true;
+ // if this is false, someone has vrCommands
+ bool none_have = true;
+ smart_objects::SmartArray::const_iterator current_choice_set_it =
+ choice_set.asArray()->begin();
+ // Iterate through choices
+ for (; choice_set.asArray()->end() != current_choice_set_it;
+ ++current_choice_set_it) {
+ // if the vrCommands is present
+ if (current_choice_set_it->keyExists(
+ application_manager::strings::vr_commands)) {
+ // this one has the parameter
+ none_have = false;
+ } else {
+ // this one doesn't
+ all_have = false;
+ }
+ }
+ // everyone has it
+ if (all_have) {
+ return MessageHelper::ChoiceSetVRCommandsStatus::ALL;
+ }
+ // No one has it
+ if (none_have) {
+ return MessageHelper::ChoiceSetVRCommandsStatus::NONE;
+ }
+ // mix-and-match
+ return MessageHelper::ChoiceSetVRCommandsStatus::MIXED;
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index 42dc335878..3e77078ee5 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -74,7 +74,9 @@ ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
, is_resumption_active_(false)
, is_data_saved_(false)
, is_suspended_(false)
- , launch_time_(time(NULL))
+ , launch_time_(time(nullptr))
+ , low_voltage_time_(0)
+ , wake_up_time_(0)
, application_manager_(application_manager) {}
#ifdef BUILD_TESTS
void ResumeCtrlImpl::set_resumption_storage(
@@ -128,6 +130,8 @@ bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
application_manager_.get_settings()
.app_resumption_save_persistent_data_timeout(),
timer::kPeriodic);
+
+ resumption_storage_->IncrementGlobalIgnOnCounter();
return true;
}
@@ -144,9 +148,13 @@ void ResumeCtrlImpl::SaveAllApplications() {
void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(application);
- LOG4CXX_INFO(logger_,
- "application with appID " << application->app_id()
- << " will be saved");
+ if (application_manager_.IsLowVoltage()) {
+ LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "application with appID " << application->app_id()
+ << " will be saved");
resumption_storage_->SaveApplication(application);
}
@@ -310,6 +318,10 @@ uint32_t ResumeCtrlImpl::GetHMIApplicationID(
bool ResumeCtrlImpl::RemoveApplicationFromSaved(
ApplicationConstSharedPtr application) {
+ if (application_manager_.IsLowVoltage()) {
+ LOG4CXX_DEBUG(logger_, "Low Voltage state is active");
+ return false;
+ }
const std::string& device_mac = application->mac_address();
return resumption_storage_->RemoveApplicationFromSaved(
application->policy_app_id(), device_mac);
@@ -323,8 +335,11 @@ void ResumeCtrlImpl::OnSuspend() {
void ResumeCtrlImpl::OnIgnitionOff() {
LOG4CXX_AUTO_TRACE(logger_);
- resumption_storage_->IncrementIgnOffCount();
- FinalPersistData();
+ if (!application_manager_.IsLowVoltage()) {
+ resumption_storage_->IncrementIgnOffCount();
+ resumption_storage_->ResetGlobalIgnOnCount();
+ FinalPersistData();
+ }
}
void ResumeCtrlImpl::OnAwake() {
@@ -334,6 +349,25 @@ void ResumeCtrlImpl::OnAwake() {
StartSavePersistentDataTimer();
}
+void ResumeCtrlImpl::SaveLowVoltageTime() {
+ low_voltage_time_ = time(nullptr);
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage timestamp : " << low_voltage_time_ << " saved");
+}
+
+void ResumeCtrlImpl::SaveWakeUpTime() {
+ wake_up_time_ = std::time(nullptr);
+ LOG4CXX_DEBUG(logger_, "Wake Up timestamp : " << wake_up_time_ << " saved");
+}
+
+time_t ResumeCtrlImpl::LowVoltageTime() const {
+ return low_voltage_time_;
+}
+
+time_t ResumeCtrlImpl::WakeUpTime() const {
+ return wake_up_time_;
+}
+
bool ResumeCtrlImpl::is_suspended() const {
return is_suspended_;
}
@@ -440,12 +474,25 @@ void ResumeCtrlImpl::StartAppHmiStateResumption(
LOG4CXX_ERROR(logger_, "Application was not saved");
return;
}
- const uint32_t ign_off_count = saved_app[strings::ign_off_count].asUInt();
- bool restore_data_allowed = false;
- restore_data_allowed =
- CheckAppRestrictions(application, saved_app) &&
- ((0 == ign_off_count) || CheckIgnCycleRestrictions(saved_app));
- if (restore_data_allowed) {
+
+ const bool is_hmi_level_applicable_to_resume =
+ CheckAppRestrictions(application, saved_app);
+
+ if (!is_hmi_level_applicable_to_resume) {
+ LOG4CXX_DEBUG(logger_, "No applicable HMI level found for resuming");
+ return;
+ }
+
+ const bool is_resume_allowed_by_low_voltage =
+ CheckLowVoltageRestrictions(saved_app);
+
+ const bool is_hmi_level_allowed_by_ign_cycle =
+ CheckIgnCycleRestrictions(saved_app);
+
+ const bool restore_hmi_level_allowed =
+ is_resume_allowed_by_low_voltage && is_hmi_level_allowed_by_ign_cycle;
+
+ if (restore_hmi_level_allowed) {
LOG4CXX_INFO(logger_,
"Resume application " << application->policy_app_id());
RestoreAppHMIState(application);
@@ -716,30 +763,62 @@ void ResumeCtrlImpl::AddSubscriptions(
bool ResumeCtrlImpl::CheckIgnCycleRestrictions(
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
- bool result = true;
if (!CheckDelayAfterIgnOn()) {
- LOG4CXX_INFO(logger_, "Application was connected long after ign on");
- result = false;
+ LOG4CXX_DEBUG(logger_, "Application was connected long after ign on");
+ return false;
}
- if (!DisconnectedJustBeforeIgnOff(saved_app)) {
- LOG4CXX_INFO(logger_, "Application was dissconnected long before ign off");
- result = false;
+ if (!CheckDelayBeforeIgnOff(saved_app)) {
+ LOG4CXX_DEBUG(logger_, "Application was disconnected long before ign off");
+ return false;
}
- return result;
+ return true;
}
-bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
+bool ResumeCtrlImpl::CheckLowVoltageRestrictions(
const smart_objects::SmartObject& saved_app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!CheckDelayBeforeLowVoltage(saved_app)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application was disconnected long before low voltage");
+ return false;
+ }
+
+ if (!CheckDelayAfterWakeUp()) {
+ LOG4CXX_DEBUG(logger_, "Application was connected long after wake up");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "HMI Level resuming in not restricted by Low Voltage");
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckDelayBeforeIgnOff(
+ const smart_objects::SmartObject& saved_app) const {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
const time_t time_stamp =
static_cast<time_t>(saved_app[strings::time_stamp].asInt());
- time_t ign_off_time =
+ const time_t ign_off_time =
static_cast<time_t>(resumption_storage_->GetIgnOffTime());
+
+ if (CheckIgnCyclesData() && 0 == ign_off_time) {
+ LOG4CXX_DEBUG(
+ logger_, "No IGNITION OFF records found: This is first Ignition cycle");
+ return true;
+ }
+
+ // This means that ignition off timestamp was not saved
+ // Possible reasons: Low Voltage event, core crash etc.
+ if (ign_off_time < time_stamp) {
+ LOG4CXX_DEBUG(logger_, "Last IGNITION OFF record missed");
+ return true;
+ }
+
const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp);
LOG4CXX_DEBUG(
logger_,
@@ -752,6 +831,71 @@ bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
application_manager_.get_settings().resumption_delay_before_ign();
}
+bool ResumeCtrlImpl::CheckDelayBeforeLowVoltage(
+ const smart_objects::SmartObject& saved_app) const {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
+
+ if (0 == LowVoltageTime()) {
+ LOG4CXX_DEBUG(logger_, "No Low Voltage signal timestamp saved");
+ return true;
+ }
+
+ const time_t unregistration_time_stamp =
+ static_cast<time_t>(saved_app[strings::time_stamp].asInt());
+ const time_t low_voltage_timestamp = static_cast<time_t>(LowVoltageTime());
+ const int32_t sec_spent_before_low_voltage =
+ (low_voltage_timestamp - unregistration_time_stamp);
+ if (0 > sec_spent_before_low_voltage) {
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage time: "
+ << low_voltage_timestamp
+ << "; App disconnect time: " << unregistration_time_stamp
+ << "; Secs between app disconnect and low voltage event "
+ << sec_spent_before_low_voltage);
+ return true;
+ }
+
+ const uint32_t secs_between_app_disconnect_and_low_voltage =
+ static_cast<uint32_t>(sec_spent_before_low_voltage);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_before_ign();
+ LOG4CXX_DEBUG(logger_,
+ "Low Voltage time: "
+ << low_voltage_timestamp
+ << "; App disconnect time: " << unregistration_time_stamp
+ << "; Secs between app disconnect and low voltage event "
+ << secs_between_app_disconnect_and_low_voltage
+ << "; Timeout for HMI level resuming: " << wait_time);
+ return secs_between_app_disconnect_and_low_voltage <= wait_time;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterWakeUp() const {
+ using namespace date_time;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (0 == WakeUpTime()) {
+ LOG4CXX_DEBUG(logger_, "No WakeUp signal timestamp saved");
+ return true;
+ }
+
+ const time_t current_time = time(nullptr);
+ const time_t wake_up_timestamp = static_cast<time_t>(WakeUpTime());
+
+ const uint32_t seconds_from_wake_up_signal =
+ labs(current_time - wake_up_timestamp);
+ const uint32_t wait_time =
+ application_manager_.get_settings().resumption_delay_after_ign();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Current time: " << current_time << "; WakeUp Signal time: "
+ << wake_up_timestamp << "; Seconds passed from wake up: "
+ << seconds_from_wake_up_signal
+ << "; Timeout for HMI level resuming: " << wait_time);
+ return seconds_from_wake_up_signal <= wait_time;
+}
+
bool ResumeCtrlImpl::CheckAppRestrictions(
ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app) {
@@ -773,9 +917,10 @@ bool ResumeCtrlImpl::CheckAppRestrictions(
? true
: false;
LOG4CXX_DEBUG(logger_,
- "is_media_app " << application->is_media_application()
- << "; hmi_level " << hmi_level << " result "
- << result);
+ "is_media_app: " << application->is_media_application()
+ << "; hmi_level: " << hmi_level << "; result: "
+ << (result ? "Applicable for resume"
+ : "Non-applicable for resume"));
return result;
}
@@ -788,11 +933,36 @@ bool ResumeCtrlImpl::CheckIcons(ApplicationSharedPtr application,
return mobile_apis::Result::INVALID_DATA != verify_images;
}
-bool ResumeCtrlImpl::CheckDelayAfterIgnOn() {
+bool ResumeCtrlImpl::CheckIgnCyclesData() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t global_ign_on_count =
+ resumption_storage_->GetGlobalIgnOnCounter();
+ const uint32_t the_first_ignition = 1;
+ const bool is_emergency_ign_off_occurred =
+ global_ign_on_count > the_first_ignition;
+ // global_ign_on_count is reseting to 0 at ignition off
+ // global_ign_on_count is incrementing at ignition on
+ // global_ign_on_count > 1 means that correct ignition off was not present.
+ if (is_emergency_ign_off_occurred) {
+ LOG4CXX_WARN(logger_,
+ "Emergency IGN OFF occurred. Possibly after Low Voltage");
+ return false;
+ }
+ return true;
+}
+
+bool ResumeCtrlImpl::CheckDelayAfterIgnOn() const {
using namespace date_time;
LOG4CXX_AUTO_TRACE(logger_);
- const time_t curr_time = time(NULL);
+ const time_t ign_off_time = GetIgnOffTime();
+
+ if (CheckIgnCyclesData() && 0 == ign_off_time) {
+ LOG4CXX_DEBUG(logger_, "This is first Ignition cycle");
+ return true;
+ }
+ const time_t curr_time = time(nullptr);
const time_t sdl_launch_time = LaunchTime();
+
const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time);
const uint32_t wait_time =
application_manager_.get_settings().resumption_delay_after_ign();
@@ -808,7 +978,7 @@ time_t ResumeCtrlImpl::LaunchTime() const {
return launch_time_;
}
-time_t ResumeCtrlImpl::GetIgnOffTime() {
+time_t ResumeCtrlImpl::GetIgnOffTime() const {
return resumption_storage_->GetIgnOffTime();
}
@@ -856,6 +1026,8 @@ void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) {
"Application ID " << app_id << " have been added"
" to resumption queue.");
if (run_resumption) {
+ LOG4CXX_DEBUG(logger_,
+ "Application ID " << app_id << " will be restored by timer");
restore_hmi_level_timer_.Start(
application_manager_.get_settings().app_resuming_timeout(),
timer::kSingleShot);
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index 2fe7330a9c..1591ce566a 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -163,11 +163,10 @@ void ResumptionDataDB::SaveApplication(
}
if (application->is_application_data_changed()) {
- if (application_exist) {
- if (!DeleteSavedApplication(policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Deleting of application data is not finished");
- return;
- }
+ if (application_exist &&
+ !DeleteSavedApplication(policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Deleting of application data is not finished");
+ return;
}
if (!SaveApplicationToDB(application, policy_app_id, device_mac)) {
@@ -176,23 +175,15 @@ void ResumptionDataDB::SaveApplication(
}
LOG4CXX_INFO(logger_, "All data from application were saved successfully");
application->set_is_application_data_changed(false);
- } else {
- if (application_exist) {
- if (!UpdateApplicationData(application, policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Updating application data is failed");
- return;
- }
- LOG4CXX_INFO(logger_, "Application data were updated successfully");
- } else {
- if (Compare<HMILevel::eType, EQ, ONE>(application->hmi_level(),
- HMILevel::HMI_FULL,
- HMILevel::HMI_LIMITED)) {
- if (!InsertApplicationData(application, policy_app_id, device_mac)) {
- LOG4CXX_ERROR(logger_, "Saving data of application is failed");
- return;
- }
- }
+ } else if (application_exist) {
+ if (!UpdateApplicationData(application, policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Updating application data is failed");
+ return;
}
+ LOG4CXX_INFO(logger_, "Application data were updated successfully");
+ } else if (!InsertApplicationData(application, policy_app_id, device_mac)) {
+ LOG4CXX_ERROR(logger_, "Saving data of application is failed");
+ return;
}
WriteDb();
}
@@ -212,8 +203,6 @@ uint32_t ResumptionDataDB::GetHMIApplicationID(
return hmi_app_id;
}
-DEPRECATED void ResumptionDataDB::OnSuspend() {}
-
void ResumptionDataDB::IncrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -240,7 +229,7 @@ void ResumptionDataDB::IncrementIgnOffCount() {
}
}
- if (query_update_last_ign_off_time.Prepare(KUpdateLastIgnOffTime)) {
+ if (query_update_last_ign_off_time.Prepare(kUpdateLastIgnOffTime)) {
query_update_last_ign_off_time.Bind(0, static_cast<int64_t>(time(NULL)));
if (query_update_last_ign_off_time.Exec()) {
LOG4CXX_INFO(logger_, "Data last_ign_off_time was updated");
@@ -293,8 +282,6 @@ bool ResumptionDataDB::GetHashId(const std::string& policy_app_id,
return SelectHashId(policy_app_id, device_id, hash_id);
}
-DEPRECATED void ResumptionDataDB::OnAwake() {}
-
void ResumptionDataDB::DecrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -376,10 +363,61 @@ bool ResumptionDataDB::RemoveApplicationFromSaved(
uint32_t ResumptionDataDB::GetIgnOffTime() const {
LOG4CXX_AUTO_TRACE(logger_);
-
return SelectIgnOffTime();
}
+uint32_t ResumptionDataDB::GetGlobalIgnOnCounter() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(kSelectGlobalIgnOnCounter)) {
+ LOG4CXX_ERROR(logger_,
+ "Problem with prepare query : " << kSelectGlobalIgnOnCounter);
+ return 1;
+ }
+
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "Problem with exec query : " << kSelectGlobalIgnOnCounter);
+ return 1;
+ }
+
+ const auto global_ign_on_counter = query.GetUInteger(0);
+ LOG4CXX_DEBUG(logger_, "Global Ign On Counter = " << global_ign_on_counter);
+ return global_ign_on_counter;
+}
+
+void ResumptionDataDB::IncrementGlobalIgnOnCounter() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ db_->BeginTransaction();
+ utils::dbms::SQLQuery query_update_global_ign_on_count(db());
+ if (query_update_global_ign_on_count.Prepare(kUpdateGlobalIgnOnCount)) {
+ if (query_update_global_ign_on_count.Exec()) {
+ LOG4CXX_DEBUG(logger_,
+ "Data query_update_global_ign_on_count was updated");
+ }
+ }
+ db_->CommitTransaction();
+ WriteDb();
+}
+
+void ResumptionDataDB::ResetGlobalIgnOnCount() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+
+ LOG4CXX_DEBUG(logger_, "Global IGN ON counter resetting");
+
+ utils::dbms::SQLQuery query_update_global_ign_on_count(db());
+ if (query_update_global_ign_on_count.Prepare(kResetGlobalIgnOnCount)) {
+ if (query_update_global_ign_on_count.Exec()) {
+ LOG4CXX_DEBUG(logger_, "Data was updated");
+ }
+ }
+}
+
ssize_t ResumptionDataDB::IsApplicationSaved(
const std::string& policy_app_id, const std::string& device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -557,7 +595,6 @@ void ResumptionDataDB::SelectDataForLoadResumeData(
using namespace app_mngr;
using namespace smart_objects;
LOG4CXX_AUTO_TRACE(logger_);
-
utils::dbms::SQLQuery select_data(db());
utils::dbms::SQLQuery count_application(db());
if (!select_data.Prepare(kSelectDataForLoadResumeData) ||
diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc
index b6a50fd5de..87241c883a 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -143,8 +143,6 @@ uint32_t ResumptionDataJson::GetHMIApplicationID(
return hmi_app_id;
}
-DEPRECATED void ResumptionDataJson::OnSuspend() {}
-
void ResumptionDataJson::IncrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
@@ -169,8 +167,6 @@ void ResumptionDataJson::IncrementIgnOffCount() {
LOG4CXX_DEBUG(logger_, GetResumptionData().toStyledString());
}
-DEPRECATED void ResumptionDataJson::OnAwake() {}
-
void ResumptionDataJson::DecrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
@@ -283,6 +279,51 @@ uint32_t ResumptionDataJson::GetIgnOffTime() const {
return resumption[strings::last_ign_off_time].asUInt();
}
+uint32_t ResumptionDataJson::GetGlobalIgnOnCounter() const {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+ if (resumption.isMember(strings::global_ign_on_counter)) {
+ const uint32_t global_ign_on_counter =
+ resumption[strings::global_ign_on_counter].asUInt();
+ LOG4CXX_DEBUG(logger_, "Global Ign On Counter = " << global_ign_on_counter);
+ return global_ign_on_counter;
+ }
+ return 1;
+}
+
+void ResumptionDataJson::IncrementGlobalIgnOnCounter() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+ if (resumption.isMember(strings::global_ign_on_counter)) {
+ const uint32_t global_ign_on_counter =
+ resumption[strings::global_ign_on_counter].asUInt();
+ LOG4CXX_DEBUG(
+ logger_,
+ "Global IGN ON counter in resumption data: " << global_ign_on_counter);
+ resumption[strings::global_ign_on_counter] = global_ign_on_counter + 1;
+ LOG4CXX_DEBUG(logger_,
+ "Global IGN ON counter new value: "
+ << resumption[strings::global_ign_on_counter].asUInt());
+ } else {
+ resumption[strings::global_ign_on_counter] = 1;
+ }
+ last_state().SaveStateToFileSystem();
+}
+
+void ResumptionDataJson::ResetGlobalIgnOnCount() {
+ using namespace app_mngr;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ Json::Value& resumption = GetResumptionData();
+
+ resumption[strings::global_ign_on_counter] = 0;
+ LOG4CXX_DEBUG(logger_, "Global IGN ON counter resetting");
+}
+
ssize_t ResumptionDataJson::IsApplicationSaved(
const std::string& policy_app_id, const std::string& device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/src/resumption/resumption_sql_queries.cc b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
index 9ca91e859a..4770bafef4 100644
--- a/src/components/application_manager/src/resumption/resumption_sql_queries.cc
+++ b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
@@ -37,6 +37,7 @@ const std::string kCreateSchema =
"BEGIN ; "
"CREATE TABLE IF NOT EXISTS `resumption`( "
" `idresumption` INTEGER PRIMARY KEY, "
+ " `global_ign_on_count` INTEGER, "
" `last_ign_off_time` INTEGER "
" ); "
"CREATE TABLE IF NOT EXISTS `subscribedForWayPoints`( "
@@ -372,7 +373,9 @@ const std::string kDropSchema =
"VACUUM;";
const std::string kInsertInitData =
- "INSERT OR IGNORE INTO `resumption` (`last_ign_off_time`) VALUES (0); "
+ "INSERT OR IGNORE INTO `resumption` "
+ "(`last_ign_off_time`, `global_ign_on_count`) "
+ "VALUES (0, 0); "
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); ";
const std::string kChecksResumptionData =
@@ -410,6 +413,17 @@ const std::string kSelectHashId =
const std::string kSelectIgnOffTime =
"SELECT `last_ign_off_time` FROM `resumption`";
+const std::string kSelectGlobalIgnOnCounter =
+ "SELECT `global_ign_on_count` FROM `resumption`";
+
+const std::string kResetGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = 0";
+
+const std::string kUpdateGlobalIgnOnCount =
+ "UPDATE `resumption` "
+ "SET `global_ign_on_count` = `global_ign_on_count` + 1 ";
+
const std::string kCheckApplication =
"SELECT COUNT (`deviceID`) FROM `application` "
"WHERE `deviceID` = ? AND `appID` = ?";
@@ -445,7 +459,7 @@ const std::string kUpdateSuspendData =
"UPDATE `application` "
"SET `ign_off_count` = `ign_off_count` + 1";
-const std::string KUpdateLastIgnOffTime =
+const std::string kUpdateLastIgnOffTime =
"UPDATE `resumption` "
"SET `last_ign_off_time` = ?";
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index bf1ff78d36..9c2aa497d6 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -267,7 +267,8 @@ bool RPCHandlerImpl::ConvertMessageToSO(
((output.validate(&report, msg_version) !=
smart_objects::Errors::OK))) {
LOG4CXX_WARN(logger_,
- "Failed to parse string to smart object :"
+ "Failed to parse string to smart object with API version "
+ << msg_version.toString() << " : "
<< message.json_message());
std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index aab2042973..ff9ebb6208 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -277,6 +277,7 @@ const char* last_ign_off_time = "last_ign_off_time";
const char* resume_vr_grammars = "resumeVrGrammars";
const char* ign_off_count = "ign_off_count";
+const char* global_ign_on_counter = "global_ign_on_counter";
const char* suspend_count = "suspend_count";
const char* connection_info = "connection_info";
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index f7a147d6df..3d44709657 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -458,6 +458,8 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::HMILevel::eType result = hmi_level;
+ LOG4CXX_DEBUG(logger_, "HMI Level: " << hmi_level);
+
if (!IsStreamableHMILevel(hmi_level)) {
return result;
}
@@ -465,6 +467,7 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
const bool is_audio_app = app->IsAudioApplication();
const bool does_audio_app_with_same_type_exist =
app_mngr_.IsAppTypeExistsInFullOrLimited(app);
+
if (mobile_apis::HMILevel::HMI_LIMITED == hmi_level) {
if (!is_audio_app || does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
index e368163cca..22ac534215 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -110,7 +110,9 @@ class ApplicationManagerImplTest : public ::testing::Test {
application_manager::MockMessageHelper::message_helper_mock())
{
+#ifdef ENABLE_LOG
logger::create_log_message_loop_thread();
+#endif
Mock::VerifyAndClearExpectations(mock_message_helper_);
}
~ApplicationManagerImplTest() {
@@ -252,7 +254,8 @@ TEST_F(
ApplicationManagerImplTest,
IsAnyAppSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
EXPECT_FALSE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
- app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
}
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index 165b5fc0fb..33258e60db 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -35,6 +35,7 @@ include_directories(
${COMPONENTS_DIR}/application_manager/include/
${COMPONENTS_DIR}/application_manager/include/application_manager/
${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
+ ${CMAKE_SOURCE_DIR}/src
)
set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands)
diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
index d795557f80..9a961ea1a9 100644
--- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
@@ -44,6 +44,7 @@
#include "application_manager/test/include/application_manager/mock_hmi_interface.h"
#include "application_manager/test/include/application_manager/mock_application.h"
#include "application_manager/test/include/application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_rpc_service.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
@@ -149,8 +150,10 @@ class CommandsTest : public ::testing::Test {
MockAppManager app_mngr_;
MockRPCService mock_rpc_service_;
- application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
- policy_test::MockPolicyHandlerInterface mock_policy_handler_;
+ testing::NiceMock<application_manager_test::MockHMICapabilities>
+ mock_hmi_capabilities_;
+ testing::NiceMock<policy_test::MockPolicyHandlerInterface>
+ mock_policy_handler_;
MockAppManagerSettings app_mngr_settings_;
MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
am::MockMessageHelper& mock_message_helper_;
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index 602d228147..d7552060ff 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -51,9 +51,6 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(curHash, const std::string&());
MOCK_METHOD0(UpdateHash, void());
- DEPRECATED MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
- DEPRECATED MOCK_METHOD1(set_flag_sending_hash_change_after_awake,
- void(bool flag));
MOCK_CONST_METHOD0(IsHashChangedDuringSuspend, bool());
MOCK_METHOD1(SetHashChangedDuringSuspend, void(const bool flag));
MOCK_CONST_METHOD0(is_application_data_changed, bool());
@@ -114,6 +111,7 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(secondary_device, connection_handler::DeviceHandle());
MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(IsAllowedToChangeAudioSource, bool());
MOCK_CONST_METHOD0(PostponedHmiState,
const application_manager::HmiStatePtr());
MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 8641a3781e..8a06102e99 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -195,6 +195,9 @@ class MockMessageHelper {
mobile_apis::Result::eType(smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD1(CheckChoiceSetVRCommands,
+ MessageHelper::ChoiceSetVRCommandsStatus(
+ const smart_objects::SmartObject&));
MOCK_METHOD6(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
index 3c4a3806d6..0fa7a898be 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
@@ -50,8 +50,15 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
MOCK_METHOD0(OnSuspend, void());
MOCK_METHOD0(OnIgnitionOff, void());
MOCK_METHOD0(OnAwake, void());
+ MOCK_CONST_METHOD0(LowVoltageTime, time_t());
+ MOCK_CONST_METHOD0(WakeUpTime, time_t());
+ MOCK_METHOD0(SaveLowVoltageTime, void());
+ MOCK_METHOD0(SaveWakeUpTime, void());
+ MOCK_METHOD0(ResetLowVoltageTime, void());
+ MOCK_METHOD0(ResetWakeUpTime, void());
MOCK_CONST_METHOD0(is_suspended, bool());
MOCK_METHOD0(StopSavePersistentDataTimer, void());
+ MOCK_METHOD0(StartSavePersistentDataTimer, void());
MOCK_METHOD2(StartResumption,
bool(app_mngr::ApplicationSharedPtr application,
const std::string& hash));
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
index cfec034653..38d1944dba 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -66,6 +66,10 @@ class MockResumptionData : public ::resumption::ResumptionData {
const std::string& device_id,
std::string& hash_id));
MOCK_METHOD0(OnAwake, void());
+ MOCK_METHOD0(IncrementGlobalIgnOnCounter, void());
+ MOCK_CONST_METHOD0(GetGlobalIgnOnCounter, uint32_t());
+ MOCK_METHOD0(ResetGlobalIgnOnCount, void());
+
MOCK_METHOD0(DecrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetSavedApplication,
bool(const std::string& policy_app_id,
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 9e2eb75a55..0850361a20 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -340,6 +340,13 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
message, app, app_mngr);
}
+MessageHelper::ChoiceSetVRCommandsStatus
+MessageHelper::CheckChoiceSetVRCommands(
+ const smart_objects::SmartObject& choice_set) {
+ return MockMessageHelper::message_helper_mock()->CheckChoiceSetVRCommands(
+ choice_set);
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index 54c76fcf94..1c2339096c 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -44,6 +44,7 @@
#include "application_manager/application_manager_impl.h"
#include "application_manager/application.h"
#include "utils/data_accessor.h"
+#include "config_profile/profile.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager.h"
@@ -89,7 +90,11 @@ class ResumeCtrlTest : public ::testing::Test {
, kDefaultDeferredTestLevel_(eType::INVALID_ENUM)
, kNaviLowbandwidthLevel_("LIMITED")
, kProjectionLowbandwidthLevel_("NONE")
- , kMediaLowbandwidthLevel_("NONE") {}
+ , kMediaLowbandwidthLevel_("NONE") {
+ profile::Profile profile_;
+ profile_.set_config_file_name("smartDeviceLink.ini");
+ resumption_delay_before_ign_ = profile_.resumption_delay_before_ign();
+ }
virtual void SetUp() OVERRIDE {
Mock::VerifyAndClearExpectations(&mock_app_mngr_);
@@ -153,7 +158,7 @@ class ResumeCtrlTest : public ::testing::Test {
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
- application_manager_test::MockApplicationManager mock_app_mngr_;
+ NiceMock<application_manager_test::MockApplicationManager> mock_app_mngr_;
std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
mock_app_extension_;
MockStateController mock_state_controller_;
@@ -172,6 +177,7 @@ class ResumeCtrlTest : public ::testing::Test {
const std::string kHash_;
const uint32_t kAppResumingTimeout_;
const uint32_t kTestTimeStamp_;
+ uint32_t resumption_delay_before_ign_;
std::shared_ptr<sync_primitives::Lock> app_set_lock_ptr_;
sync_primitives::Lock app_set_lock_;
const mobile_apis::HMILevel::eType kDefaultDeferredTestLevel_;
@@ -613,8 +619,12 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
application_manager::CommandsMap command;
DataAccessor<application_manager::CommandsMap> data_accessor(
@@ -661,8 +671,12 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppHasDeferredResumption) {
mobile_apis::HMILevel::eType deferred_level = eType::HMI_FULL;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
// resume into deferred level instead of restored level
EXPECT_CALL(mock_state_controller_, SetRegularState(_, deferred_level))
@@ -693,8 +707,12 @@ TEST_F(ResumeCtrlTest,
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
.Times(AtLeast(1));
@@ -731,8 +749,12 @@ TEST_F(
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
uint32_t ign_off_count = 0;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
// in this test, it is expected that the app will resume into LIMITED, which
// is the higher level among NONE and LIMITED
@@ -869,8 +891,12 @@ TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
const uint32_t ign_off_count = 0u;
smart_objects::SmartObject saved_app;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
saved_app[application_manager::strings::ign_off_count] = ign_off_count;
saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
MockStateController state_controller;
EXPECT_CALL(mock_app_mngr_, state_controller())
@@ -1203,6 +1229,194 @@ TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_AskedAppFound_INVALID_ENUM) {
res_ctrl_->GetSavedAppHmiLevel(kTestPolicyAppId_, kMacAddress_));
}
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInFullUnregisteredWithinTimeFrame_HMILevelRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInFullUnregisteredBeyondTimeFrame_HMILevelNotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest, ResumptionLowVoltage_AppInBackground_NotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_BACKGROUND;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInLimitedlUnregisteredWithinTimeFrame_HMILevelRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ + time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_ + time_offset));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ ResumptionLowVoltage_AppInLimitedlUnregisteredBeyondTimeFrame_HMILevelNotRestored) {
+ const mobile_apis::HMILevel::eType restored_test_type = eType::HMI_LIMITED;
+ const uint32_t time_offset = 5;
+ const uint32_t time_stamp =
+ time(nullptr) - resumption_delay_before_ign_ - time_offset;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+ saved_app[application_manager::strings::time_stamp] = time_stamp;
+
+ application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
+ EXPECT_CALL(mock_app_mngr_, state_controller()).Times(0);
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillRepeatedly(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*mock_app_, commands_map()).WillRepeatedly(Return(data_accessor));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ EXPECT_CALL(mock_app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+
+ EXPECT_CALL(app_mngr_settings_, resumption_delay_before_ign())
+ .WillOnce(Return(resumption_delay_before_ign_));
+
+ res_ctrl_->SaveLowVoltageTime();
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
} // namespace resumption_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index 953f43e056..8423520b9f 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -123,7 +123,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
void SetZeroIgnOffTime() {
utils::dbms::SQLQuery query(test_db());
- EXPECT_TRUE(query.Prepare(KUpdateLastIgnOffTime));
+ EXPECT_TRUE(query.Prepare(kUpdateLastIgnOffTime));
query.Bind(0, 0);
EXPECT_TRUE(query.Exec());
}
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index fd2503da33..3731848d89 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -64,6 +64,7 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::ReturnPointee;
+using ::testing::SaveArg;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::InSequence;
@@ -2829,6 +2830,78 @@ TEST_F(StateControllerImplTest,
state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
}
+TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppRemainInFull) {
+ const uint32_t app_id = simple_app_->app_id();
+ InsertApplication(simple_app_);
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(FullAudibleState()));
+
+ HmiStatePtr new_state;
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
+ .WillOnce(SaveArg<0>(&new_state));
+
+ state_ctrl_->on_event(event);
+
+ EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_EQ(new_state->audio_streaming_state(),
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+}
+
+TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) {
+ const uint32_t app_id = simple_app_->app_id();
+ InsertApplication(simple_app_);
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::VideoStreamingState::NOT_STREAMABLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(LimitedState()));
+
+ HmiStatePtr new_state;
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_))
+ .WillOnce(SaveArg<0>(&new_state));
+
+ state_ctrl_->on_event(event);
+
+ EXPECT_EQ(new_state->hmi_level(), mobile_apis::HMILevel::HMI_BACKGROUND);
+ EXPECT_EQ(new_state->audio_streaming_state(),
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+}
+
TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectHmiLevel) {
smart_objects::SmartObject msg;
const uint32_t app_id = simple_app_->app_id();
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 4cc57e5b0a..57e925cd43 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -110,10 +110,25 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::string& app_resource_folder() const;
/**
- * @brief Returns true, if SDL 4.0 is enabled
- * @deprecated use max_supported_protocol_version instead
- */
- DEPRECATED bool enable_protocol_4() const OVERRIDE;
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGLOWVOLTAGE
+ * which is used for handling LOW Voltage functionality
+ */
+ int low_voltage_signal_offset() const;
+
+ /**
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGWAKEUP
+ * which is used for handling LOW Voltage functionality
+ */
+ int wake_up_signal_offset() const;
+
+ /**
+ * @brief Returns offset from SIGRTMIN for user defined signal
+ * SIGIGNITIONOFF
+ * which is used for handling LOW Voltage functionality
+ */
+ int ignition_off_signal_offset() const;
/**
* @brief Returns application icons folder path
@@ -753,6 +768,8 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const OVERRIDE;
+ const std::pair<uint32_t, int32_t>& get_interior_vehicle_data_frequency()
+ const OVERRIDE;
const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const OVERRIDE;
@@ -979,6 +996,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
std::pair<uint32_t, int32_t> get_vehicle_data_frequency_;
+ /*
+ * first value is count of request
+ * second is time scale
+ */
+ std::pair<uint32_t, int32_t> get_interior_vehicle_data_frequency_;
+
/**
* first value is count of retries for start stream
* second for timer
@@ -1025,6 +1048,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::vector<std::string> video_service_transports_;
bool error_occured_;
std::string error_description_;
+ int low_voltage_signal_offset_;
+ int wake_up_signal_offset_;
+ int ignition_off_signal_offset_;
DISALLOW_COPY_AND_ASSIGN(Profile);
};
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 7fa67fc34c..57984324aa 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -190,6 +190,8 @@ const char* kAckMQKey = "AckMQ";
const char* kApplicationListUpdateTimeoutKey = "ApplicationListUpdateTimeout";
const char* kReadDIDFrequencykey = "ReadDIDRequest";
const char* kGetVehicleDataFrequencyKey = "GetVehicleDataRequest";
+const char* kGetInteriorVehicleDataFrequencyKey =
+ "GetInteriorVehicleDataRequest";
const char* kLegacyProtocolMaskKey = "LegacyProtocol";
const char* kHubProtocolMaskKey = "HubProtocol";
const char* kPoolProtocolMaskKey = "PoolProtocol";
@@ -223,6 +225,9 @@ const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS";
const char* kAppTransportChangeTimerKey = "AppTransportChangeTimer";
const char* kAppTransportChangeTimerAdditionKey =
"AppTransportChangeTimerAddition";
+const char* kLowVoltageSignalOffsetKey = "LowVoltageSignal";
+const char* kWakeUpSignalOffsetKey = "WakeUpSignal";
+const char* kIgnitionOffSignalOffsetKey = "IgnitionOffSignal";
const char* kMultipleTransportsEnabledKey = "MultipleTransportsEnabled";
const char* kSecondaryTransportForBluetoothKey =
"SecondaryTransportForBluetooth";
@@ -340,6 +345,7 @@ const uint32_t kDefaultTransportManagerDisconnectTimeout = 0;
const uint32_t kDefaultApplicationListUpdateTimeout = 1;
const std::pair<uint32_t, uint32_t> kReadDIDFrequency = {5, 1};
const std::pair<uint32_t, uint32_t> kGetVehicleDataFrequency = {5, 1};
+const std::pair<uint32_t, uint32_t> kGetInteriorVehicleDataFrequency = {20, 1};
const std::pair<uint32_t, uint32_t> kStartStreamRetryAmount = {3, 1};
const uint32_t kDefaultMaxThreadPoolSize = 2;
const int kDefaultIAP2HubConnectAttempts = 0;
@@ -373,6 +379,9 @@ const uint16_t kDefaultWaitTimeBetweenApps = 4000;
const bool kDefaultEnableAppLaunchIOS = true;
const uint32_t kDefaultAppTransportChangeTimer = 500u;
const uint32_t kDefaultAppTransportChangeTimerAddition = 0u;
+const int32_t kDefaultLowVoltageSignalOffset = 1;
+const int32_t kDefaultWakeUpSignalOffset = 2;
+const int32_t kDefaultIgnitionOffSignalOffset = 3;
const std::string kAllowedSymbols =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
const bool kDefaultMultipleTransportsEnabled = false;
@@ -487,7 +496,10 @@ Profile::Profile()
kDefaultAppTransportChangeTimerAddition)
, multiple_transports_enabled_(kDefaultMultipleTransportsEnabled)
, error_occured_(false)
- , error_description_() {
+ , error_description_()
+ , low_voltage_signal_offset_(kDefaultLowVoltageSignalOffset)
+ , wake_up_signal_offset_(kDefaultWakeUpSignalOffset)
+ , ignition_off_signal_offset_(kDefaultIgnitionOffSignalOffset) {
// SDL version
ReadStringValue(
&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
@@ -532,8 +544,16 @@ const std::string& Profile::app_resource_folder() const {
return app_resource_folder_;
}
-bool Profile::enable_protocol_4() const {
- return max_supported_protocol_version_ >= 4;
+int Profile::low_voltage_signal_offset() const {
+ return low_voltage_signal_offset_;
+}
+
+int Profile::wake_up_signal_offset() const {
+ return wake_up_signal_offset_;
+}
+
+int Profile::ignition_off_signal_offset() const {
+ return ignition_off_signal_offset_;
}
const std::string& Profile::app_icons_folder() const {
@@ -796,6 +816,11 @@ const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency()
return get_vehicle_data_frequency_;
}
+const std::pair<uint32_t, int32_t>&
+Profile::get_interior_vehicle_data_frequency() const {
+ return get_interior_vehicle_data_frequency_;
+}
+
const std::pair<uint32_t, int32_t>& Profile::start_stream_retry_amount() const {
return start_stream_retry_amount_;
}
@@ -1878,6 +1903,11 @@ void Profile::UpdateValues() {
kMainSection,
kGetVehicleDataFrequencyKey);
+ ReadUintIntPairValue(&get_interior_vehicle_data_frequency_,
+ kGetInteriorVehicleDataFrequency,
+ kMainSection,
+ kGetInteriorVehicleDataFrequencyKey);
+
ReadUIntValue(&max_thread_pool_size_,
kDefaultMaxThreadPoolSize,
kApplicationManagerSection,
@@ -2139,6 +2169,30 @@ void Profile::UpdateValues() {
kAppTransportChangeTimerAdditionKey,
kMainSection);
+ ReadIntValue(&low_voltage_signal_offset_,
+ kDefaultLowVoltageSignalOffset,
+ kMainSection,
+ kLowVoltageSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ low_voltage_signal_offset_, kLowVoltageSignalOffsetKey, kMainSection);
+
+ ReadIntValue(&wake_up_signal_offset_,
+ kDefaultWakeUpSignalOffset,
+ kMainSection,
+ kWakeUpSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ wake_up_signal_offset_, kWakeUpSignalOffsetKey, kMainSection);
+
+ ReadIntValue(&ignition_off_signal_offset_,
+ kDefaultIgnitionOffSignalOffset,
+ kMainSection,
+ kIgnitionOffSignalOffsetKey);
+
+ LOG_UPDATED_VALUE(
+ ignition_off_signal_offset_, kIgnitionOffSignalOffsetKey, kMainSection);
+
ReadBoolValue(&multiple_transports_enabled_,
kDefaultMultipleTransportsEnabled,
kMultipleTransportsSection,
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
index 730d7ebe32..1ab70ce702 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
@@ -196,25 +196,6 @@ class ConnectionHandlerImpl
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates start of new session.
- * \param connection_handle Connection identifier within which session has to
- * be started.
- * \param session_id Identifier of the session to be started
- * \param service_type Type of service
- * \param is_protected would be service protected
- * \param hash_id pointer for session hash identifier
- * \return uint32_t Id (number) of new session if successful, otherwise 0.
- * \deprecated
- */
- virtual uint32_t OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id);
-
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates start of new session.
* Result must be notified through NotifySessionStartedContext().
* \param connection_handle Connection identifier within which session
* has to be started.
@@ -230,22 +211,7 @@ class ConnectionHandlerImpl
const protocol_handler::ServiceType& service_type,
const bool is_protected,
const BsonObject* params);
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates session ending.
- * \param connection_handle Connection identifier within which session exists
- * \param sessionId Identifier of the session to be ended
- * \param hashCode Hash used only in second version of SmartDeviceLink
- * protocol.
- * If not equal to hash assigned to session on start then operation fails.
- * \return uint32_t 0 if operation fails, session key otherwise
- * \deprecated
- */
- uint32_t OnSessionEndedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const uint32_t& hashCode,
- const protocol_handler::ServiceType& service_type) OVERRIDE;
+
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates session ending.
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 9aa84989d9..045985f650 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -338,77 +338,6 @@ bool AllowProtection(const ConnectionHandlerSettings& settings,
}
#endif // ENABLE_SECURITY
-uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (hash_id) {
- *hash_id = protocol_handler::HASH_ID_WRONG;
- }
-
-#ifdef ENABLE_SECURITY
- if (!AllowProtection(get_settings(), service_type, is_protected)) {
- return 0;
- }
-#endif // ENABLE_SECURITY
- sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(connection_handle);
- if (connection_list_.end() == it) {
- LOG4CXX_ERROR(logger_, "Unknown connection!");
- return 0;
- }
- uint32_t new_session_id = 0;
-
- Connection* connection = it->second;
- if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
- new_session_id = connection->AddNewSession(connection_handle);
- if (0 == new_session_id) {
- LOG4CXX_ERROR(logger_, "Couldn't start new session!");
- return 0;
- }
- if (hash_id) {
- *hash_id = KeyFromPair(connection_handle, new_session_id);
- }
- } else { // Could be create new service or protected exists one
- if (!connection->AddNewService(
- session_id, service_type, is_protected, connection_handle)) {
- LOG4CXX_ERROR(logger_,
- "Couldn't establish "
-#ifdef ENABLE_SECURITY
- << (is_protected ? "protected" : "non-protected")
-#endif // ENABLE_SECURITY
- << " service " << static_cast<int>(service_type)
- << " for session " << static_cast<int>(session_id));
- return 0;
- }
- new_session_id = session_id;
- if (hash_id) {
- *hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED;
- }
- }
- sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
- if (connection_handler_observer_) {
- const uint32_t session_key = KeyFromPair(connection_handle, new_session_id);
- const bool success = connection_handler_observer_->OnServiceStartedCallback(
- connection->connection_device_handle(), session_key, service_type);
- if (!success) {
- LOG4CXX_WARN(logger_,
- "Service starting forbidden by connection_handler_observer");
- if (protocol_handler::kRpc == service_type) {
- connection->RemoveSession(new_session_id);
- } else {
- connection->RemoveService(session_id, service_type);
- }
- return 0;
- }
- }
- return new_session_id;
-}
-
void ConnectionHandlerImpl::OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
@@ -643,16 +572,6 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback(
uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
- const uint32_t& hashCode,
- const protocol_handler::ServiceType& service_type) {
- uint32_t hashValue = hashCode;
- return OnSessionEndedCallback(
- connection_handle, session_id, &hashValue, service_type);
-}
-
-uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
uint32_t* hashCode,
const protocol_handler::ServiceType& service_type) {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc
index 8d3b11add5..4f46026039 100644
--- a/src/components/hmi_message_handler/src/mb_controller.cc
+++ b/src/components/hmi_message_handler/src/mb_controller.cc
@@ -222,7 +222,7 @@ void CMessageBrokerController::exitReceivingThread() {
it;
for (it = mConnectionList.begin(); it != mConnectionList.end();) {
(*it)->Shutdown();
- mConnectionList.erase(it++);
+ it = mConnectionList.erase(it);
}
mConnectionListLock.Release();
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 6345ce0c36..bce2878f69 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+#include <ctime>
#include <string>
#include <vector>
#include <set>
@@ -239,6 +240,18 @@ class ApplicationManager {
*/
virtual void set_application_id(const int32_t correlation_id,
const uint32_t app_id) = 0;
+ /**
+ * @brief get_current_audio_source
+ * @return current audio source
+ */
+ virtual uint32_t get_current_audio_source() const = 0;
+
+ /**
+ * @brief set_current_audio_source
+ * @param source
+ * set current audio source
+ */
+ virtual void set_current_audio_source(const uint32_t source) = 0;
/**
* @brief OnHMILevelChanged the callback that allows SDL to react when
@@ -271,29 +284,6 @@ class ApplicationManager {
virtual void SendDriverDistractionState(ApplicationSharedPtr application) = 0;
/**
- * DEPRECATED
- * @brief Checks if Application is subscribed for way points
- * @param Application AppID
- * @return true if Application is subscribed for way points
- * otherwise false
- */
- virtual bool IsAppSubscribedForWayPoints(const uint32_t app_id) const = 0;
-
- /**
- * DEPRECATED
- * @brief Subscribe Application for way points
- * @param Application AppID
- */
- virtual void SubscribeAppForWayPoints(const uint32_t app_id) = 0;
-
- /**
- * DEPRECATED
- * @brief Unsubscribe Application for way points
- * @param Application AppID
- */
- virtual void UnsubscribeAppFromWayPoints(const uint32_t app_id) = 0;
-
- /**
* @brief Checks if Application is subscribed for way points
* @param Application pointer
* @return true if Application is subscribed for way points
@@ -412,12 +402,10 @@ class ApplicationManager {
*/
virtual void EndNaviServices(uint32_t app_id) = 0;
- /* @brief Starts audio passthru process
- * @deprecated Use BeginAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is already in process
+ /**
+ * @brief returns true if low voltage state is active
*/
- DEPRECATED virtual bool BeginAudioPassThrough() = 0;
+ virtual bool IsLowVoltage() const = 0;
/**
* @brief Starts AudioPassThru process by given application
@@ -426,14 +414,6 @@ class ApplicationManager {
*/
virtual bool BeginAudioPassThru(uint32_t app_id) = 0;
- /*
- * @brief Finishes already started audio passthru process
- * @deprecated Use EndAudioPassThru(uint32_t app_id) instead
- *
- * @return true on success, false if passthru is not active
- */
- DEPRECATED virtual bool EndAudioPassThrough() = 0;
-
/**
* @brief Finishes already started AudioPassThru process by given application
* @param app_id ID of the application which started the process
@@ -486,8 +466,6 @@ class ApplicationManager {
virtual bool IsStopping() const = 0;
- virtual bool IsLowVoltage() = 0;
-
virtual void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) = 0;
virtual mobile_apis::Result::eType SaveBinary(
@@ -704,21 +682,6 @@ class ApplicationManager {
mobile_apis::SystemContext::eType system_context) const = 0;
/**
- * DEPRECATED
- * @brief CreateRegularState create regular HMI state for application
- * @param app_id Application id
- * @param hmi_level of returned state
- * @param audio_state of returned state
- * @param system_context of returned state
- * @return new regular HMI state
- */
- virtual HmiStatePtr CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const = 0;
-
- /**
* @brief Checks if application can stream (streaming service is started and
* streaming is enabled in application)
* @param app_id Application id
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index bb8afc0a5b..8fdca4125f 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -50,6 +50,8 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::pair<uint32_t, int32_t>& read_did_frequency() const = 0;
virtual const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency()
const = 0;
+ virtual const std::pair<uint32_t, int32_t>&
+ get_interior_vehicle_data_frequency() const = 0;
virtual uint32_t hash_string_size() const = 0;
virtual const uint32_t& app_dir_quota() const = 0;
virtual uint32_t stop_streaming_timeout() const = 0;
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
index 2f4ee94449..154a2a8e34 100644
--- a/src/components/include/connection_handler/connection_handler_observer.h
+++ b/src/components/include/connection_handler/connection_handler_observer.h
@@ -86,19 +86,6 @@ class ConnectionHandlerObserver {
/**
* \brief Callback function used by connection_handler
* when Mobile Application initiates start of new service.
- * \param deviceHandle Device identifier within which session has to be
- * started.
- * \param sessionKey Key of started session.
- * \param type Established service type
- */
- virtual bool OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) = 0;
-
- /**
- * \brief Callback function used by connection_handler
- * when Mobile Application initiates start of new service.
* Result must be notified through NotifyServiceStartedResult().
* \param deviceHandle Device identifier within which session has to be
* started.
diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h
index c023f3c7fc..c446c87d1b 100644
--- a/src/components/include/policy/policy_external/policy/policy_listener.h
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -52,13 +52,6 @@ class PolicyListener {
const Permissions& permissions) = 0;
virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0;
virtual void OnUpdateStatusChanged(const std::string&) = 0;
-
- /**
- * Gets device ID
- * @param policy_app_id
- * @return device ID
- * @deprecated see std::vector<std::string> GetDevicesIds(const std::string&)
- */
virtual std::string OnCurrentDeviceIdUpdateRequired(
const std::string& policy_app_id) = 0;
virtual void OnSystemInfoUpdateRequired() = 0;
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index bb79964b12..d65902030b 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -125,27 +125,6 @@ class ProtocolHandler {
virtual SessionObserver& get_session_observer() = 0;
/**
- * \brief Called by connection handler to notify the result of
- * OnSessionStartedCallback().
- * \param connection_id Identifier of connection within which session exists
- * \param session_id session ID passed to OnSessionStartedCallback()
- * \param generated_session_id Generated session ID, will be 0 if session is
- * not started
- * \param hash_id Generated Hash ID
- * \param protection whether the service will be protected
- * \param rejected_params list of parameters' name that are rejected.
- * Only valid when generated_session_id is 0. Note, even if
- * generated_session_id is 0, the list may be empty.
- */
- DEPRECATED virtual void NotifySessionStartedResult(
- int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params) = 0;
-
- /**
* @brief Called by connection handler to notify the context of
* OnSessionStartedCallback().
* @param context reference to structure with started session data
diff --git a/src/components/include/protocol_handler/protocol_handler_settings.h b/src/components/include/protocol_handler/protocol_handler_settings.h
index c4f9bb6420..62a24df32c 100644
--- a/src/components/include/protocol_handler/protocol_handler_settings.h
+++ b/src/components/include/protocol_handler/protocol_handler_settings.h
@@ -34,12 +34,6 @@ class ProtocolHandlerSettings {
*/
virtual uint16_t max_supported_protocol_version() const = 0;
- /*
- * @brief Returns true, if SDL 4.0 is enabled
- * @deprecated Use max_supported_protocol_version instead
- */
- DEPRECATED virtual bool enable_protocol_4() const = 0;
-
virtual uint32_t multiframe_waiting_timeout() const = 0;
#ifdef ENABLE_SECURITY
/**
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index d50b1e694e..e71557fecf 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -125,26 +125,6 @@ class SessionObserver {
/**
* \brief Callback function used by ProtocolHandler
* when Mobile Application initiates start of new session.
- * \param connection_handle Connection identifier within which session
- * has to be started.
- * \param sessionId Identifier of the session to be start
- * \param service_type Type of service
- * \param protocol_version Version of protocol
- * \param is_protected would be service protected
- * \param hash_id pointer for session hash identifier, uint32_t* hash_id
- * \return uint32_t Id (number) of new session if successful, otherwise 0.
- * \deprecated
- */
- DEPRECATED virtual uint32_t OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t sessionId,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id) = 0;
-
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates start of new session.
* Result must be notified through NotifySessionStartedContext().
* \param connection_handle Connection identifier within which session
* has to be started.
@@ -167,24 +147,6 @@ class SessionObserver {
* \param connection_handle Connection identifier within which session exists
* \param sessionId Identifier of the session to be ended
* \param hashCode Hash used only in second version of SmartDeviceLink
- * protocol.
- * If not equal to hash assigned to session on start then operation fails.
- * \param service_type Type of service
- * \return uint32_t 0 if operation fails, session key otherwise
- * \deprecated
- */
- DEPRECATED virtual uint32_t OnSessionEndedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t sessionId,
- const uint32_t& hashCode,
- const protocol_handler::ServiceType& service_type) = 0;
-
- /**
- * \brief Callback function used by ProtocolHandler
- * when Mobile Application initiates session ending.
- * \param connection_handle Connection identifier within which session exists
- * \param sessionId Identifier of the session to be ended
- * \param hashCode Hash used only in second version of SmartDeviceLink
* protocol. (Set to HASH_ID_WRONG if the hash is incorrect)
* If not equal to hash assigned to session on start then operation fails.
* \param service_type Type of service
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
index f1f1452614..c4405b0ffd 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -140,6 +140,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(const smart_objects::SmartObject& sm_object,
const uint32_t connection_key));
MOCK_CONST_METHOD0(is_attenuated_supported, bool());
+ MOCK_CONST_METHOD0(IsLowVoltage, bool());
MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
bool(application_manager::ApplicationConstSharedPtr app));
MOCK_METHOD1(OnApplicationRegistered,
@@ -160,9 +161,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
- DEPRECATED MOCK_METHOD0(BeginAudioPassThrough, bool());
MOCK_METHOD1(BeginAudioPassThru, bool(uint32_t app_id));
- DEPRECATED MOCK_METHOD0(EndAudioPassThrough, bool());
MOCK_METHOD1(EndAudioPassThru, bool(uint32_t app_id));
MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
MOCK_METHOD0(OnHMIStartedCooperation, void());
@@ -180,7 +179,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD1(IsAppsQueriedFrom,
bool(const connection_handler::DeviceHandle handle));
MOCK_CONST_METHOD0(IsStopping, bool());
- MOCK_METHOD0(IsLowVoltage, bool());
MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList,
void(const uint32_t app_id));
MOCK_METHOD4(
@@ -256,13 +254,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
mobile_apis::AudioStreamingState::eType audio_state,
mobile_apis::VideoStreamingState::eType video_state,
mobile_apis::SystemContext::eType system_context));
- DEPRECATED MOCK_CONST_METHOD4(
- CreateRegularState,
- application_manager::HmiStatePtr(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context));
MOCK_METHOD2(SendAudioPassThroughNotification,
void(uint32_t session_key, std::vector<uint8_t>& binary_data));
@@ -282,11 +273,6 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD2(IsSOStructValid,
bool(const hmi_apis::StructIdentifiers::eType struct_id,
const smart_objects::SmartObject& display_capabilities));
-
- DEPRECATED MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
- bool(const uint32_t));
- DEPRECATED MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t));
- DEPRECATED MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t));
MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
bool(application_manager::ApplicationSharedPtr));
MOCK_METHOD1(SubscribeAppForWayPoints,
@@ -322,6 +308,8 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD1(IsAppInReconnectMode,
bool(const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetCommandFactory, application_manager::CommandFactory&());
+ MOCK_CONST_METHOD0(get_current_audio_source, uint32_t());
+ MOCK_METHOD1(set_current_audio_source, void(const uint32_t));
};
} // namespace application_manager_test
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index d42202c57b..cfabf41b91 100644
--- a/src/components/include/test/application_manager/mock_application_manager_settings.h
+++ b/src/components/include/test/application_manager/mock_application_manager_settings.h
@@ -55,6 +55,8 @@ class MockApplicationManagerSettings
// typedef for the return type.
MOCK_CONST_METHOD0(get_vehicle_data_frequency,
const std::pair<uint32_t, int32_t>&());
+ MOCK_CONST_METHOD0(get_interior_vehicle_data_frequency,
+ const std::pair<uint32_t, int32_t>&());
MOCK_CONST_METHOD0(hash_string_size, uint32_t());
MOCK_CONST_METHOD0(app_storage_folder, const std::string&());
MOCK_CONST_METHOD0(app_info_storage, const std::string&());
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
index ede08a9a4a..a9e4349bec 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -48,11 +48,6 @@ class MockConnectionHandlerObserver
MOCK_METHOD0(OnFindNewApplicationsRequest, void());
MOCK_METHOD1(RemoveDevice,
void(const connection_handler::DeviceHandle& device_handle));
- DEPRECATED MOCK_METHOD3(
- OnServiceStartedCallback,
- bool(const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type));
MOCK_METHOD4(OnServiceStartedCallback,
void(const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h
index 13c0264cb8..f6db0c7097 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h
@@ -63,13 +63,6 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler {
MOCK_CONST_METHOD0(get_settings,
const ::protocol_handler::ProtocolHandlerSettings&());
MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&());
- DEPRECATED MOCK_METHOD6(NotifySessionStartedResult,
- void(int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params));
MOCK_METHOD2(NotifySessionStarted,
void(const ::protocol_handler::SessionContext& context,
std::vector<std::string>& rejected_params));
diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h
index c0612ce137..0d74b15f64 100644
--- a/src/components/include/test/protocol_handler/mock_session_observer.h
+++ b/src/components/include/test/protocol_handler/mock_session_observer.h
@@ -47,13 +47,6 @@ namespace protocol_handler_test {
*/
class MockSessionObserver : public ::protocol_handler::SessionObserver {
public:
- DEPRECATED MOCK_METHOD5(
- OnSessionStartedCallback,
- uint32_t(const transport_manager::ConnectionUID connection_handle,
- const uint8_t sessionId,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- uint32_t* hash_id));
MOCK_METHOD5(OnSessionStartedCallback,
void(const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
index 8bba7ade8b..e63469190c 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -60,14 +60,10 @@ class TransportAdapterListener;
/**
* @brief The DeviceType enum defines types based on available transport
* adapters
- * @deprecated PASA_AOA, PASA_BLUETOOTH, MME
*/
enum DeviceType {
AOA,
- PASA_AOA,
BLUETOOTH,
- PASA_BLUETOOTH,
- MME,
IOS_BT,
IOS_USB,
TCP,
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
index 5d55960943..7a001a85cc 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
@@ -91,30 +91,6 @@ class TransportAdapterEvent {
, event_error(error) {}
/**
- * DEPRECATED
- * @brief Constructor.
- *
- * @param type Event type.
- * @param transport_adapter Transport adapter
- * @param device_handle Handle of device.
- * @param application_id Handle of application.
- * @param data Smart pointer to the raw message.
- * @param error Error class that contains details of this error situation.
- */
- TransportAdapterEvent(int type,
- transport_adapter::TransportAdapter* adapter,
- const DeviceUID& device_handle,
- const ApplicationHandle& application_id,
- ::protocol_handler::RawMessagePtr data,
- BaseErrorPtr error)
- : event_type(static_cast<EventTypeEnum>(type))
- , application_id(application_id)
- , device_uid(device_handle)
- , transport_adapter(adapter)
- , event_data(data)
- , event_error(error) {}
-
- /**
* @brief Value that describe event type.
*/
EventTypeEnum event_type;
diff --git a/src/components/include/utils/typed_enum_print.h b/src/components/include/utils/typed_enum_print.h
new file mode 100644
index 0000000000..e2b903c948
--- /dev/null
+++ b/src/components/include/utils/typed_enum_print.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+
+#include <type_traits>
+#include <ostream>
+
+namespace utils {
+
+// Generic overloaded operator "<<" to be able to send enum class values to
+// std::ostream
+template <typename T>
+std::ostream& operator<<(
+ typename std::enable_if<std::is_enum<T>::value, std::ostream>::type& stream,
+ const T& e) {
+ return stream << static_cast<int>(e);
+}
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index bdbb60f98a..a9854ef730 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -971,6 +971,8 @@
<description>Reflects the current primary audio source (if selected).</description>
<element name="NO_SOURCE_SELECTED">
</element>
+ <element name="CD">
+ </element>
<element name="USB">
</element>
<element name="USB2">
@@ -983,6 +985,14 @@
</element>
<element name="MOBILE_APP">
</element>
+ <element name="AM">
+ </element>
+ <element name="FM">
+ </element>
+ <element name="XM">
+ </element>
+ <element name="DAB">
+ </element>
</enum>
<enum name="CompassDirection">
@@ -1581,6 +1591,9 @@
<element name="CLIMATE"/>
<element name="RADIO"/>
<element name="SEAT"/>
+ <element name="AUDIO"/>
+ <element name="LIGHT"/>
+ <element name="HMI_SETTINGS"/>
</enum>
<enum name="MassageZone">
@@ -1748,6 +1761,92 @@
<element name="NOT_FOUND"/>
</enum>
+ <struct name="StationIDNumber">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>PDOP.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>HDOP.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>VDOP.</description>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Common.Dimension" mandatory="false">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+
+ <struct name="SisData">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements. Includes a high priority delivery feature to convey emergencies that may be in the listening area.</description>
+ </param>
+ </struct>
+
<struct name="RadioControlData">
<param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
<description>The integer part of the frequency ie for 101.7 this value should be 101</description>
@@ -1759,10 +1858,13 @@
</param>
<param name="rdsData" type="Common.RdsData" mandatory="false">
</param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdRadioEnable" type="Boolean" mandatory="false">
+ <description> True if the hd radio is on, false is the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
<description>number of HD sub-channels if available</description>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false">
<description>Current HD sub-channel if available</description>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
@@ -1775,6 +1877,9 @@
</param>
<param name="state" type="Common.RadioState" mandatory="false">
</param>
+ <param name="sisData" type="SisData" mandatory="false">
+ <description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
+ </param>
</struct>
<struct name="RadioControlCapabilities">
@@ -1836,6 +1941,24 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
<enum name="DefrostZone">
@@ -1887,6 +2010,18 @@
</param>
<param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
</param>
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
+ </param>
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
</struct>
<struct name="ClimateControlCapabilities">
@@ -1964,6 +2099,253 @@
A set of all ventilation modes that are controllable.
</description>
</param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="EqualizerSettings">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <struct name="AudioControlData">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ In a getter response or a notification, it is the current primary audio source of the system.
+ In a setter request, it is the target audio source that the system shall switch to.
+ If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ This parameter shall not be present in any getter responses or notifications.
+ This parameter is optional in a setter request. The default value is false.
+ If it is false, the system not only changes the audio source but also brings the default application
+ or system UI associated with the audio source to foreground.
+ If it is true, the system changes the audio source, but still keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext paramter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+
+ <struct name="RGBColor">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <enum name="LightName">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front, left and right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights an trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus">
+ <element name="ON"/>
+ <element name="OFF"/>
+ </enum>
+
+ <struct name="LightCapabilities">
+ <param name="name" type="LightName" mandatory="true" />
+ <!-- Assuming light ON/OFF status is always available -->
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the RGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available light names that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+ <enum name="DistanceUnit">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
</struct>
<struct name="ModuleData">
@@ -1976,13 +2358,19 @@
</param>
<param name="seatControlData" type="SeatControlData" mandatory="false">
</param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false">
+ </param>
</struct>
<enum name="RCAccessMode">
- <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
- <element name="AUTO_ALLOW"/>
- <element name="AUTO_DENY"/>
- <element name="ASK_DRIVER"/>
+ <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
+ <element name="AUTO_ALLOW"/>
+ <element name="AUTO_DENY"/>
+ <element name="ASK_DRIVER"/>
</enum>
<!-- End Remote Control -->
@@ -2122,11 +2510,6 @@
</param>
</struct>
-<struct name="RGBColor">
- <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
-</struct>
<struct name="TemplateColorScheme">
<description>
@@ -2497,65 +2880,6 @@
</element>
</enum>
-<struct name="GPSData">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
- <description>The current UTC year.</description>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>The current UTC month.</description>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>The current UTC day.</description>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>The current UTC hour.</description>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC minute.</description>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>The current UTC second.</description>
- </param>
- <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
- <description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>PDOP.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>HDOP.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
- <description>VDOP.</description>
- </param>
- <param name="actual" type="Boolean" mandatory="false">
- <description>
- True, if actual.
- False, if infered.
- </description>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>Number of satellites in view</description>
- </param>
- <param name="dimension" type="Common.Dimension" mandatory="false">
- <description>See Dimension</description>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
- <description>Altitude in meters</description>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
- <description>The heading. North is 0. Resolution is 0.01</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
- <description>The speed in KPH</description>
- </param>
-</struct>
-
<struct name="SingleTireStatus">
<param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
<description>The status of component volume. See ComponentVolumeStatus.</description>
@@ -2945,10 +3269,19 @@
<param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
<description>If included, the platform supports RC button controls with the included button names.</description >
</param>
- <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>
- If included, the platform supports seat controls.
- </description >
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports seat controls.
+ </description >
+ </param>
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description> If included, the platform supports audio controls. </description >
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false">
+ <description> If included, the platform supports hmi setting controls. </description >
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false">
+ <description> If included, the platform supports light controls. </description >
</param>
</struct>
@@ -5363,9 +5696,6 @@
<param name="subscribe" type="Boolean" mandatory="false">
<description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
</param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal SDL-assigned ID of the related application</description>
- </param>
</function>
<function name="GetInteriorVehicleData" messagetype="response">
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 14875d3ce7..7ca2c66a66 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-<interface name="SmartDeviceLink RAPI" version="4.5.0" minVersion="1.0.0" date="2017-09-22">
- <enum name="Result" internal_scope="base">
+<interface name="SmartDeviceLink RAPI" version="5.0.0" minVersion="1.0.0" date="2018-08-17">
+ <enum name="Result" internal_scope="base" since="1.0">
<element name="SUCCESS">
<description>The request succeeded</description>
</element>
@@ -45,7 +45,7 @@
For example when trying to delete a command set that is currently involved in an interaction.
</description>
</element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE">
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" since="2.0">
<description>The requested vehicle data is not available on this vehicle or is not published.</description>
</element>
<element name="TIMED_OUT">
@@ -99,48 +99,48 @@
<element name="GENERIC_ERROR">
<description>Provided data is valid but something went wrong in the lower layers.</description>
</element>
- <element name="USER_DISALLOWED">
+ <element name="USER_DISALLOWED" since="2.0">
<description>RPC is included in a functional group explicitly blocked by the user.</description>
</element>
<element name="TRUNCATED_DATA">
<description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
</element>
- <element name="UNSUPPORTED_VERSION">
+ <element name="UNSUPPORTED_VERSION" since="2.0">
<description>Sync doesn't support the protocol that is requested by the mobile application</description>
</element>
- <element name="VEHICLE_DATA_NOT_ALLOWED">
+ <element name="VEHICLE_DATA_NOT_ALLOWED" since="2.0">
<description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
</element>
- <element name="FILE_NOT_FOUND">
+ <element name="FILE_NOT_FOUND" since="3.0">
<description>A specified file could not be found on the headunit.</description>
</element>
<element name="CANCEL_ROUTE">
<description>User selected to Cancel Route.</description>
</element>
- <element name="SAVED">
+ <element name="SAVED" since="2.0">
<description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
</element>
- <element name="INVALID_CERT">
+ <element name="INVALID_CERT" since="3.0">
<description>The certificate provided during authentication is invalid.</description>
</element>
- <element name="EXPIRED_CERT">
+ <element name="EXPIRED_CERT" since="3.0">
<description>The certificate provided during authentication is expired.</description>
</element>
- <element name="RESUME_FAILED">
+ <element name="RESUME_FAILED" since="3.0">
<description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
</element>
- <element name="DATA_NOT_AVAILABLE">
+ <element name="DATA_NOT_AVAILABLE" since="4.5">
<description>The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. </description>
</element>
- <element name="READ_ONLY">
+ <element name="READ_ONLY" since="4.5">
<description>The value being set is read only</description>
</element>
- <element name="CORRUPTED_DATA">
+ <element name="CORRUPTED_DATA" since="5.0">
<description>The data sent failed to pass CRC check in receiver end</description>
</element>
</enum>
- <enum name="ButtonPressMode">
+ <enum name="ButtonPressMode" since="1.0">
<element name="LONG">
<description>
A button was released, after it was pressed for a long time
@@ -155,7 +155,7 @@
</element>
</enum>
- <enum name="ButtonEventMode">
+ <enum name="ButtonEventMode" since="1.0">
<element name="BUTTONUP">
<description>A button has been released up</description>
</element>
@@ -164,7 +164,7 @@
</element>
</enum>
- <enum name="Language">
+ <enum name="Language" since="1.0">
<element name="EN-US" internal_name="EN_US">
<description>English - US</description>
</element>
@@ -174,117 +174,117 @@
<element name="FR-CA" internal_name="FR_CA">
<description>French - Canada</description>
</element>
- <element name="DE-DE" internal_name="DE_DE">
+ <element name="DE-DE" internal_name="DE_DE" since="2.0">
<description>German - Germany</description>
</element>
- <element name="ES-ES" internal_name="ES_ES">
+ <element name="ES-ES" internal_name="ES_ES" since="2.0">
<description>Spanish - Spain</description>
</element>
- <element name="EN-GB" internal_name="EN_GB">
+ <element name="EN-GB" internal_name="EN_GB" since="2.0">
<description>English - GB</description>
</element>
- <element name="RU-RU" internal_name="RU_RU">
+ <element name="RU-RU" internal_name="RU_RU" since="2.0">
<description>Russian - Russia</description>
</element>
- <element name="TR-TR" internal_name="TR_TR">
+ <element name="TR-TR" internal_name="TR_TR" since="2.0">
<description>Turkish - Turkey</description>
</element>
- <element name="PL-PL" internal_name="PL_PL">
+ <element name="PL-PL" internal_name="PL_PL" since="2.0">
<description>Polish - Poland</description>
</element>
- <element name="FR-FR" internal_name="FR_FR">
+ <element name="FR-FR" internal_name="FR_FR" since="2.0">
<description>French - France</description>
</element>
- <element name="IT-IT" internal_name="IT_IT">
+ <element name="IT-IT" internal_name="IT_IT" since="2.0">
<description>Italian - Italy</description>
</element>
- <element name="SV-SE" internal_name="SV_SE">
+ <element name="SV-SE" internal_name="SV_SE" since="2.0">
<description>Swedish - Sweden</description>
</element>
- <element name="PT-PT" internal_name="PT_PT">
+ <element name="PT-PT" internal_name="PT_PT" since="2.0">
<description>Portuguese - Portugal</description>
</element>
- <element name="NL-NL" internal_name="NL_NL">
+ <element name="NL-NL" internal_name="NL_NL" since="2.0">
<description>Dutch (Standard) - Netherlands</description>
</element>
- <element name="EN-AU" internal_name="EN_AU">
+ <element name="EN-AU" internal_name="EN_AU" since="2.0">
<description>English - Australia</description>
</element>
- <element name="ZH-CN" internal_name="ZH_CN">
+ <element name="ZH-CN" internal_name="ZH_CN" since="2.0">
<description>Mandarin - China</description>
</element>
- <element name="ZH-TW" internal_name="ZH_TW">
+ <element name="ZH-TW" internal_name="ZH_TW" since="2.0">
<description>Mandarin - Taiwan</description>
</element>
- <element name="JA-JP" internal_name="JA_JP">
+ <element name="JA-JP" internal_name="JA_JP" since="2.0">
<description>Japanese - Japan</description>
</element>
- <element name="AR-SA" internal_name="AR_SA">
+ <element name="AR-SA" internal_name="AR_SA" since="2.0">
<description>Arabic - Saudi Arabia</description>
</element>
- <element name="KO-KR" internal_name="KO_KR">
+ <element name="KO-KR" internal_name="KO_KR" since="2.0">
<description>Korean - South Korea</description>
</element>
- <element name="PT-BR" internal_name="PT_BR">
+ <element name="PT-BR" internal_name="PT_BR" since="2.0">
<description>Portuguese - Brazil</description>
</element>
- <element name="CS-CZ" internal_name="CS_CZ">
+ <element name="CS-CZ" internal_name="CS_CZ" since="2.0">
<description>Czech - Czech Republic</description>
</element>
- <element name="DA-DK" internal_name="DA_DK">
+ <element name="DA-DK" internal_name="DA_DK" since="2.0">
<description>Danish - Denmark</description>
</element>
- <element name="NO-NO" internal_name="NO_NO">
+ <element name="NO-NO" internal_name="NO_NO" since="2.0">
<description>Norwegian - Norway</description>
</element>
- <element name="NL-BE" internal_name="NL_BE">
+ <element name="NL-BE" internal_name="NL_BE" since="2.0">
<description>Dutch (Flemish) - Belgium</description>
</element>
- <element name="EL-GR" internal_name="EL_GR">
+ <element name="EL-GR" internal_name="EL_GR" since="2.0">
<description>Greek - Greece</description>
</element>
- <element name="HU-HU" internal_name="HU_HU">
+ <element name="HU-HU" internal_name="HU_HU" since="2.0">
<description>Hungarian - Hungary</description>
</element>
- <element name="FI-FI" internal_name="FI_FI">
+ <element name="FI-FI" internal_name="FI_FI" since="2.0">
<description>Finnish - Finland</description>
</element>
- <element name="SK-SK" internal_name="SK_SK">
+ <element name="SK-SK" internal_name="SK_SK" since="2.0">
<description>Slovak - Slovakia</description>
</element>
- <element name="EN-IN" internal_name="EN_IN">
+ <element name="EN-IN" internal_name="EN_IN" since="4.5">
<description>English - India</description>
</element>
- <element name="TH-TH" internal_name="TH_TH">
+ <element name="TH-TH" internal_name="TH_TH" since="4.5">
<description>Thai - Thailand</description>
</element>
- <element name="EN-SA" internal_name="EN_SA">
+ <element name="EN-SA" internal_name="EN_SA" since="4.5">
<description>English - Middle East</description>
</element>
- <element name="HE-IL" internal_name="HE_IL">
+ <element name="HE-IL" internal_name="HE_IL" since="4.5">
<description>Hebrew - Israel</description>
</element>
- <element name="RO-RO" internal_name="RO_RO">
+ <element name="RO-RO" internal_name="RO_RO" since="4.5">
<description>Romanian - Romania</description>
</element>
- <element name="UK-UA" internal_name="UK_UA">
+ <element name="UK-UA" internal_name="UK_UA" since="4.5">
<description>Ukrainian - Ukraine</description>
</element>
- <element name="ID-ID" internal_name="ID_ID">
+ <element name="ID-ID" internal_name="ID_ID" since="4.5">
<description>Indonesian - Indonesia</description>
</element>
- <element name="VI-VN" internal_name="VI_VN">
+ <element name="VI-VN" internal_name="VI_VN" since="4.5">
<description>Vietnamese - Vietnam</description>
</element>
- <element name="MS-MY" internal_name="MS_MY">
+ <element name="MS-MY" internal_name="MS_MY" since="4.5">
<description>Malay - Malaysia</description>
</element>
- <element name="HI-IN" internal_name="HI_IN">
+ <element name="HI-IN" internal_name="HI_IN" since="4.5">
<description>Hindi - India</description>
</element>
</enum>
- <enum name="UpdateMode">
+ <enum name="UpdateMode" since="1.0">
<description>Describes how the media clock timer should behave on the platform</description>
<element name="COUNTUP" >
<description>Starts the media clock timer counting upwards, as in time elapsed.</description>
@@ -302,22 +302,23 @@
<description>Clears the media clock timer (previously done through Show->mediaClock)</description>
</element>
</enum>
- <enum name="AudioStreamingIndicator">
- <element name="PLAY_PAUSE">
- <description>Default playback indicator.</description>
- </element>
- <element name="PLAY">
- <description>Indicates that a button press of the Play/Pause button would start the playback.</description>
- </element>
- <element name="PAUSE">
- <description>Indicates that a button press of the Play/Pause button would pause the current playback.</description>
- </element>
- <element name="STOP">
- <description>Indicates that a button press of the Play/Pause button would stop the current playback.</description>
- </element>
- </enum>
-
- <enum name="TimerMode">
+
+ <enum name="AudioStreamingIndicator" since="5.0">
+ <element name="PLAY_PAUSE">
+ <description>Default playback indicator.</description>
+ </element>
+ <element name="PLAY">
+ <description>Indicates that a button press of the Play/Pause button would start the playback.</description>
+ </element>
+ <element name="PAUSE">
+ <description>Indicates that a button press of the Play/Pause button would pause the current playback.</description>
+ </element>
+ <element name="STOP">
+ <description>Indicates that a button press of the Play/Pause button would stop the current playback.</description>
+ </element>
+ </enum>
+
+ <enum name="TimerMode" since="1.0">
<element name="UP" >
<description>Causes the media clock timer to update from 0:00 to a specified time</description>
</element>
@@ -329,7 +330,7 @@
</element>
</enum>
- <enum name="InteractionMode">
+ <enum name="InteractionMode" since="1.0">
<description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
<element name="MANUAL_ONLY" >
<description>This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display. No Voice Interaction.</description>
@@ -342,7 +343,7 @@
</element>
</enum>
- <enum name="LayoutMode">
+ <enum name="LayoutMode" since="3.0">
<description>For touchscreen interactions, the mode of how the choices are presented.</description>
<element name="ICON_ONLY" >
<description>This mode causes the interaction to display the previous set of choices as icons.</description>
@@ -361,7 +362,7 @@
</element>
</enum>
- <enum name="HMILevel">
+ <enum name="HMILevel" since="1.0">
<description>Enumeration that describes current levels of HMI.</description>
<element name="FULL" internal_name="HMI_FULL" />
<element name="LIMITED" internal_name="HMI_LIMITED" />
@@ -369,20 +370,20 @@
<element name="NONE" internal_name="HMI_NONE" />
</enum>
- <enum name="AudioStreamingState">
+ <enum name="AudioStreamingState" since="1.0">
<description>Enumeration that describes possible states of audio streaming.</description>
<element name="AUDIBLE" />
<element name="ATTENUATED" />
<element name="NOT_AUDIBLE" />
</enum>
- <enum name="VideoStreamingState">
+ <enum name="VideoStreamingState" since="5.0">
<description>Enumeration that describes possible states of video streaming. </description>
<element name="STREAMABLE" />
<element name="NOT_STREAMABLE" />
</enum>
- <enum name="SystemAction">
+ <enum name="SystemAction" since="1.0">
<description>Enumeration that describes system actions that can be triggered.</description>
<element name="DEFAULT_ACTION">
<description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
@@ -395,7 +396,7 @@
</element>
</enum>
- <enum name="SystemContext">
+ <enum name="SystemContext" since="1.0">
<description>Enumeration that describes possible contexts an app's HMI might be in. Communicated to whichever app is in HMI FULL, except Alert.</description>
<element name="MAIN" internal_name="SYSCTXT_MAIN">
<description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
@@ -414,14 +415,14 @@
</element>
</enum>
- <enum name="SoftButtonType">
+ <enum name="SoftButtonType" since="2.0">
<description>Contains information about the SoftButton capabilities.</description>
<element name="TEXT" internal_name="SBT_TEXT"/>
<element name="IMAGE" internal_name="SBT_IMAGE"/>
<element name="BOTH" internal_name="SBT_BOTH"/>
</enum>
- <enum name="AppInterfaceUnregisteredReason">
+ <enum name="AppInterfaceUnregisteredReason" since="1.0">
<description>Error code, which comes from the module side.</description>
<!-- Deprecate
<element name="USER_EXIT" />
@@ -435,41 +436,41 @@
<element name="LANGUAGE_CHANGE" />
<element name="MASTER_RESET" />
<element name="FACTORY_DEFAULTS" />
- <element name="APP_UNAUTHORIZED" />
- <element name="PROTOCOL_VIOLATION" />
- <element name="UNSUPPORTED_HMI_RESOURCE" />
+ <element name="APP_UNAUTHORIZED" since="2.0" />
+ <element name="PROTOCOL_VIOLATION" since="4.0" />
+ <element name="UNSUPPORTED_HMI_RESOURCE" since="4.1" />
</enum>
- <enum name="TriggerSource">
+ <enum name="TriggerSource" since="1.0">
<description>Indicates the source from where the command was triggered.</description>
<element name="MENU" internal_name="TS_MENU" />
<element name="VR" internal_name="TS_VR" />
- <element name="KEYBOARD" internal_name="TS_KEYBOARD" />
+ <element name="KEYBOARD" internal_name="TS_KEYBOARD" since="3.0" />
</enum>
- <enum name="HmiZoneCapabilities">
+ <enum name="HmiZoneCapabilities" since="1.0">
<description>Contains information about the HMI zone capabilities.</description>
<description>For future use.</description>
<element name="FRONT" />
<element name="BACK" />
</enum>
- <enum name="SpeechCapabilities">
+ <enum name="SpeechCapabilities" since="1.0">
<description>Contains information about the TTS capabilities.</description>
<element name="TEXT" internal_name="SC_TEXT"/>
<element name="SAPI_PHONEMES" />
<element name="LHPLUS_PHONEMES" />
<element name="PRE_RECORDED" />
<element name="SILENCE" />
- <element name="FILE" />
+ <element name="FILE" since="5.0" />
</enum>
- <enum name="VrCapabilities">
+ <enum name="VrCapabilities" since="1.0">
<description>Contains information about the VR capabilities.</description>
<element name="TEXT" internal_name="VR_TEXT"/>
</enum>
- <enum name="PrerecordedSpeech">
+ <enum name="PrerecordedSpeech" since="1.0">
<description>Contains a list of prerecorded speech items present on the platform.</description>
<element name="HELP_JINGLE" />
<element name="INITIAL_JINGLE" />
@@ -478,7 +479,7 @@
<element name="NEGATIVE_JINGLE" />
</enum>
- <enum name="SamplingRate">
+ <enum name="SamplingRate" since="2.0">
<description>Describes different sampling options for PerformAudioPassThru.</description>
<element name="8KHZ" internal_name="SamplingRate_8KHZ">
<description>Sampling rate of 8000 Hz.</description>
@@ -494,7 +495,7 @@
</element>
</enum>
- <enum name="BitsPerSample">
+ <enum name="BitsPerSample" since="2.0">
<description>Describes different quality options for PerformAudioPassThru.</description>
<element name="8_BIT" internal_name="BitsPerSample_8_BIT">
<description>Audio sample is 8 bits wide, unsigned.</description>
@@ -504,14 +505,14 @@
</element>
</enum>
- <enum name="AudioType">
+ <enum name="AudioType" since="2.0">
<description>Describes different audio type options for PerformAudioPassThru.</description>
<element name="PCM">
<description>Linear PCM.</description>
</element>
</enum>
- <struct name="AudioPassThruCapabilities">
+ <struct name="AudioPassThruCapabilities" since="2.0">
<description>
Describes different audio type configurations for PerformAudioPassThru.
e.g. {8kHz,8-bit,PCM}
@@ -522,7 +523,7 @@
<param name="audioType" type="AudioType" mandatory="true"/>
</struct>
- <enum name="VehicleDataType">
+ <enum name="VehicleDataType" since="2.0">
<description>Defines the data types that can be published and subscribed to.</description>
<element name="VEHICLEDATA_GPS">
<description>Notifies GPSData may be subscribed</description>
@@ -533,7 +534,7 @@
<element name="VEHICLEDATA_FUELLEVEL_STATE" />
<element name="VEHICLEDATA_FUELCONSUMPTION" />
<element name="VEHICLEDATA_EXTERNTEMP" />
- <element name="VEHICLEDATA_TURNSIGNAL" />
+ <element name="VEHICLEDATA_TURNSIGNAL" since="5.0" />
<element name="VEHICLEDATA_VIN" />
<element name="VEHICLEDATA_PRNDL" />
<element name="VEHICLEDATA_TIREPRESSURE" />
@@ -553,12 +554,12 @@
<element name="VEHICLEDATA_ENGINETORQUE" />
<element name="VEHICLEDATA_ACCPEDAL" />
<element name="VEHICLEDATA_STEERINGWHEEL" />
- <element name="VEHICLEDATA_FUELRANGE" />
- <element name="VEHICLEDATA_ENGINEOILLIFE" />
- <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" />
+ <element name="VEHICLEDATA_FUELRANGE" since="5.0" />
+ <element name="VEHICLEDATA_ENGINEOILLIFE" since="5.0" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" since="5.0" />
</enum>
- <enum name="ButtonName">
+ <enum name="ButtonName" since="1.0">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description>
<element name="OK" />
<element name="SEEKLEFT" />
@@ -578,28 +579,28 @@
<element name="CUSTOM_BUTTON" />
<element name="SEARCH" />
<!-- Climate Buttons -->
- <element name="AC_MAX" />
- <element name="AC" />
- <element name="RECIRCULATE" />
- <element name="FAN_UP" />
- <element name="FAN_DOWN" />
- <element name="TEMP_UP" />
- <element name="TEMP_DOWN" />
- <element name="DEFROST_MAX" />
- <element name="DEFROST" />
- <element name="DEFROST_REAR" />
- <element name="UPPER_VENT" />
- <element name="LOWER_VENT" />
+ <element name="AC_MAX" since="4.5" />
+ <element name="AC" since="4.5" />
+ <element name="RECIRCULATE" since="4.5" />
+ <element name="FAN_UP" since="4.5" />
+ <element name="FAN_DOWN" since="4.5" />
+ <element name="TEMP_UP" since="4.5" />
+ <element name="TEMP_DOWN" since="4.5" />
+ <element name="DEFROST_MAX" since="4.5" />
+ <element name="DEFROST" since="4.5" />
+ <element name="DEFROST_REAR" since="4.5" />
+ <element name="UPPER_VENT" since="4.5" />
+ <element name="LOWER_VENT" since="4.5" />
<!-- Radio Buttons -->
- <element name="VOLUME_UP" />
- <element name="VOLUME_DOWN" />
- <element name="EJECT" />
- <element name="SOURCE" />
- <element name="SHUFFLE" />
- <element name="REPEAT" />
+ <element name="VOLUME_UP" since="4.5" />
+ <element name="VOLUME_DOWN" since="4.5" />
+ <element name="EJECT" since="4.5" />
+ <element name="SOURCE" since="4.5" />
+ <element name="SHUFFLE" since="4.5" />
+ <element name="REPEAT" since="4.5" />
</enum>
- <enum name="MediaClockFormat">
+ <enum name="MediaClockFormat" since="1.0">
<element name="CLOCK1">
<description>
minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
@@ -612,7 +613,7 @@
used for Type V headunit
</description>
</element>
- <element name="CLOCK3">
+ <element name="CLOCK3" since="2.0">
<description>
minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
used for GEN1.1 MFD3/4/5 headunits
@@ -649,7 +650,7 @@
used for Type V headunit
</description>
</element>
- <element name="CLOCKTEXT4">
+ <element name="CLOCKTEXT4" since="2.0">
<description>
6 chars possible
Format: c :|sp c c : c c
@@ -660,22 +661,25 @@
</element>
</enum>
- <enum name="DisplayType">
+ <enum name="DisplayType" deprecated="true" since="5.0">
<description>See DAES for further infos regarding the displays</description>
<element name="CID"/>
<element name="TYPE2" />
<element name="TYPE5" />
<element name="NGN" />
- <element name="GEN2_8_DMA" />
- <element name="GEN2_6_DMA" />
- <element name="MFD3" />
- <element name="MFD4" />
- <element name="MFD5" />
- <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" />
- <element name="SDL_GENERIC" />
+ <element name="GEN2_8_DMA" since="3.0" />
+ <element name="GEN2_6_DMA" since="3.0" />
+ <element name="MFD3" since="2.0" />
+ <element name="MFD4" since="2.0" />
+ <element name="MFD5" since="2.0" />
+ <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" since="3.0" />
+ <element name="SDL_GENERIC" since="4.0" />
+ <history>
+ <enum name="DisplayType" since="1.0" until="5.0"/>
+ </history>
</enum>
- <enum name="TextFieldName">
+ <enum name="TextFieldName" since="1.0">
<element name="mainField1">
<description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
</element>
@@ -708,51 +712,51 @@
<description>The first line of the alert text field; applies to "Alert"</description>
</element>
- <element name="alertText2">
+ <element name="alertText2" since="2.0">
<description>The second line of the alert text field; applies to "Alert"</description>
</element>
- <element name="alertText3">
+ <element name="alertText3" since="2.0">
<description>The third line of the alert text field; applies to "Alert"</description>
</element>
- <element name="scrollableMessageBody">
+ <element name="scrollableMessageBody" since="2.0">
<description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
</element>
- <element name="initialInteractionText">
+ <element name="initialInteractionText" since="2.0">
<description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
</element>
- <element name="navigationText1">
+ <element name="navigationText1" since="2.0">
<description> First line of navigation text</description>
</element>
- <element name="navigationText2">
+ <element name="navigationText2" since="2.0">
<description> Second line of navigation text</description>
</element>
- <element name="ETA">
+ <element name="ETA" since="2.0">
<description> Estimated Time of Arrival time for navigation</description>
</element>
- <element name="totalDistance">
+ <element name="totalDistance" since="2.0">
<description> Total distance to destination for navigation</description>
</element>
- <element name="audioPassThruDisplayText1">
+ <element name="audioPassThruDisplayText1" since="2.0">
<description> First line of text for audio pass thru</description>
</element>
- <element name="audioPassThruDisplayText2">
+ <element name="audioPassThruDisplayText2" since="2.0">
<description> Second line of text for audio pass thru</description>
</element>
- <element name="sliderHeader">
+ <element name="sliderHeader" since="2.0">
<description> Header text for slider</description>
</element>
- <element name="sliderFooter">
+ <element name="sliderFooter" since="2.0">
<description> Footer text for slider</description>
</element>
@@ -772,25 +776,25 @@
<description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
</element>
- <element name="locationName">
+ <element name="locationName" since="4.0">
<description> Optional name / title of intended location for SendLocation.</description>
</element>
- <element name="locationDescription">
+ <element name="locationDescription" since="4.0">
<description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
</element>
- <element name="addressLines">
+ <element name="addressLines" since="4.0">
<description> Optional location address (if applicable) for SendLocation.</description>
</element>
- <element name="phoneNumber">
+ <element name="phoneNumber" since="4.0">
<description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
</element>
</enum>
- <enum name="ImageFieldName">
+ <enum name="ImageFieldName" since="3.0">
<element name="softButtonImage">
<description>The image field for SoftButton</description>
</element>
@@ -827,7 +831,7 @@
<description>The primary image field for Show</description>
</element>
- <element name="secondaryGraphic">
+ <element name="secondaryGraphic" since="5.0">
<description>The secondary image field for Show</description>
</element>
@@ -839,13 +843,13 @@
<description>The secondary image field for ShowConstantTBT</description>
</element>
- <element name="locationImage">
+ <element name="locationImage" since="4.0">
<description>The optional image of a destination / location</description>
</element>
</enum>
- <enum name="CharacterSet">
+ <enum name="CharacterSet" since="1.0">
<description>The list of potential character sets</description>
<element name="TYPE2SET">
<description>See [@TODO: create file ref]</description>
@@ -861,14 +865,14 @@
</element>
</enum>
- <enum name="TextAlignment">
+ <enum name="TextAlignment" since="1.0">
<description>The list of possible alignments, left, right, or centered</description>
<element name="LEFT_ALIGNED" />
<element name="RIGHT_ALIGNED" />
<element name="CENTERED" />
</enum>
- <enum name="TBTState">
+ <enum name="TBTState" since="2.0">
<description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
<element name="ROUTE_UPDATE_REQUEST" />
<element name="ROUTE_ACCEPTED" />
@@ -882,26 +886,26 @@
<element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
</enum>
- <enum name="DriverDistractionState">
+ <enum name="DriverDistractionState" since="2.0">
<description>Enumeration that describes possible states of driver distraction.</description>
<element name="DD_ON" />
<element name="DD_OFF" />
</enum>
- <enum name="ImageType">
+ <enum name="ImageType" since="2.0">
<description>Contains information about the type of image.</description>
<element name="STATIC" />
<element name="DYNAMIC" />
</enum>
- <enum name="DeliveryMode">
+ <enum name="DeliveryMode" since="4.1">
<description>The mode in which the SendLocation request is sent</description>
<element name="PROMPT" />
<element name="DESTINATION" />
<element name="QUEUE" />
</enum>
- <enum name="VideoStreamingProtocol">
+ <enum name="VideoStreamingProtocol" since="4.5">
<description>Enum for each type of video streaming protocol type.</description>
<element name="RAW">
<description>Raw stream bytes that contains no timestamp data and is the lowest supported video streaming</description>
@@ -920,7 +924,7 @@
</element>
</enum>
- <enum name="VideoStreamingCodec">
+ <enum name="VideoStreamingCodec" since="4.5">
<description>Enum for each type of video streaming codec.</description>
<element name="H264">
<description>A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content.</description>
@@ -939,19 +943,19 @@
</element>
</enum>
- <struct name="Image">
+ <struct name="Image" since="2.0">
<param name="value" minlength="0" maxlength="65535" type="String" mandatory="true">
<description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
</param>
<param name="imageType" type="ImageType" mandatory="true">
<description>Describes, whether it is a static or dynamic image.</description>
</param>
- <param name="isTemplate" type="Boolean" mandatory="false">
+ <param name="isTemplate" type="Boolean" mandatory="false" since="5.0">
<description>Optional value to specify whether it's a template image. A template image can be (re)colored by the HMI as needed by using an image pattern</description>
</param>
</struct>
- <struct name="SoftButton">
+ <struct name="SoftButton" since="2.0">
<param name="type" type="SoftButtonType" mandatory="true">
<description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
</param>
@@ -975,24 +979,28 @@
</param>
</struct>
- <struct name="Choice">
+ <struct name="Choice" since="1.0">
<description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
<param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
<param name="menuName" type="String" maxlength="500" mandatory="true"/>
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true"/>
- <param name="image" type="Image" mandatory="false"/>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false" since="5.0">
+ <history>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="image" type="Image" mandatory="false" since="2.0" />
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false" since="3.0">
<description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
</param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false" since="3.0">
<description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
</param>
- <param name="secondaryImage" type="Image" mandatory="false">
+ <param name="secondaryImage" type="Image" mandatory="false" since="3.0">
<description>Optional secondary image struct for choice</description>
</param>
</struct>
- <struct name="VrHelpItem">
+ <struct name="VrHelpItem" since="2.0">
<param name="text" maxlength="500" type="String" mandatory="true">
<description>Text to display for VR Help item</description>
</param>
@@ -1004,7 +1012,7 @@
</param>
</struct>
- <struct name="SyncMsgVersion">
+ <struct name="SyncMsgVersion" since="1.0">
<description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application</description>
<param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
@@ -1013,37 +1021,37 @@
<param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
<description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
</param>
- <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false" since="4.3">
<description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
</param>
</struct>
- <enum name="GlobalProperty">
+ <enum name="GlobalProperty" since="1.0">
<description>The different global properties.</description>
- <element name="HELPPROMPT">
+ <element name="HELPPROMPT" since="1.0">
<description>The property helpPrompt of setGlobalProperties</description>
</element>
- <element name="TIMEOUTPROMPT">
+ <element name="TIMEOUTPROMPT" since="1.0">
<description>The property timeoutPrompt of setGlobalProperties</description>
</element>
- <element name="VRHELPTITLE">
+ <element name="VRHELPTITLE" since="2.0">
<description>The property vrHelpTitle of setGlobalProperties</description>
</element>
- <element name="VRHELPITEMS">
+ <element name="VRHELPITEMS" since="2.0">
<description>The property array of vrHelp of setGlobalProperties</description>
</element>
- <element name="MENUNAME">
+ <element name="MENUNAME" since="3.0">
<description>The property in-app menu name of setGlobalProperties</description>
</element>
- <element name="MENUICON">
+ <element name="MENUICON" since="3.0">
<description>The property in-app menu icon of setGlobalProperties</description>
</element>
- <element name="KEYBOARDPROPERTIES">
+ <element name="KEYBOARDPROPERTIES" since="3.0">
<description>The on-screen keyboard configuration of setGlobalProperties</description>
</element>
</enum>
- <enum name="CompassDirection">
+ <enum name="CompassDirection" since="2.0">
<description>The list of potential compass directions</description>
<element name="NORTH">
</element>
@@ -1063,7 +1071,7 @@
</element>
</enum>
- <enum name="Dimension">
+ <enum name="Dimension" since="2.0">
<description>The supported dimensions of the GPS</description>
<element name="NO_FIX" internal_name="Dimension_NO_FIX">
<description>No GPS at all</description>
@@ -1076,7 +1084,7 @@
</element>
</enum>
- <enum name="PRNDL">
+ <enum name="PRNDL" since="2.0">
<description>The selected gear.</description>
<element name="PARK">
<description>Parking</description>
@@ -1117,7 +1125,7 @@
</element>
</enum>
- <enum name="ComponentVolumeStatus">
+ <enum name="ComponentVolumeStatus" since="2.0">
<description>The volume status of a vehicle component.</description>
<element name="UNKNOWN" internal_name="CVS_UNKNOWN">
</element>
@@ -1133,7 +1141,7 @@
</element>
</enum>
- <enum name="TPMS">
+ <enum name="TPMS" since="5.0">
<element name="UNKNOWN">
<description>If set the status of the tire is not known.</description>
</element>
@@ -1160,7 +1168,7 @@
</element>
</enum>
- <enum name="ElectronicParkBrakeStatus">
+ <enum name="ElectronicParkBrakeStatus" since="5.0">
<element name="CLOSED">
<description>
Park brake actuators have been fully applied.
@@ -1188,7 +1196,7 @@
</element>
</enum>
- <enum name="FuelType">
+ <enum name="FuelType" since="5.0">
<element name="GASOLINE" />
<element name="DIESEL" />
<element name="CNG">
@@ -1209,7 +1217,7 @@
</element>
</enum>
- <struct name="FuelRange">
+ <struct name="FuelRange" since="5.0">
<param name="type" type="FuelType" mandatory="false"/>
<param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
<description>
@@ -1218,19 +1226,19 @@
</param>
</struct>
- <struct name="SingleTireStatus">
+ <struct name="SingleTireStatus" since="2.0">
<param name="status" type="ComponentVolumeStatus" mandatory="true">
<description>See ComponentVolumeStatus.</description>
</param>
- <param name="tpms" type="TPMS" mandatory="false">
+ <param name="tpms" type="TPMS" mandatory="false" since="5.0">
<description>The status of TPMS according to the particular tire.</description>
</param>
- <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000">
+ <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000" since="5.0">
<description>The pressure value of the particular tire in kilo pascal.</description>
</param>
</struct>
- <enum name="WarningLightStatus">
+ <enum name="WarningLightStatus" since="2.0">
<description>Reflects the status of a cluster instrument warning light.</description>
<element name="OFF" internal_name="WLS_OFF">
</element>
@@ -1242,7 +1250,7 @@
</element>
</enum>
- <enum name="VehicleDataNotificationStatus">
+ <enum name="VehicleDataNotificationStatus" since="2.0">
<description>Reflects the status of a vehicle data notification.</description>
<element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
</element>
@@ -1254,7 +1262,7 @@
</element>
</enum>
- <enum name="IgnitionStableStatus">
+ <enum name="IgnitionStableStatus" since="2.0">
<description>Reflects the ignition switch stability.</description>
<element name="IGNITION_SWITCH_NOT_STABLE">
</element>
@@ -1264,7 +1272,7 @@
</element>
</enum>
- <enum name="IgnitionStatus">
+ <enum name="IgnitionStatus" since="2.0">
<description>Reflects the status of ignition.</description>
<element name="UNKNOWN" internal_name="IS_UNKNOWN">
</element>
@@ -1280,7 +1288,7 @@
</element>
</enum>
- <enum name="VehicleDataEventStatus">
+ <enum name="VehicleDataEventStatus" since="2.0">
<description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
<element name="NO_EVENT" internal_name="VDES_NO_EVENT">
</element>
@@ -1294,7 +1302,7 @@
</element>
</enum>
- <enum name="DeviceLevelStatus">
+ <enum name="DeviceLevelStatus" since="2.0">
<description>Reflects the reported battery status of the connected device, if reported.</description>
<element name="ZERO_LEVEL_BARS">
</element>
@@ -1310,10 +1318,12 @@
</element>
</enum>
- <enum name="PrimaryAudioSource">
+ <enum name="PrimaryAudioSource" since="2.0">
<description>Reflects the current primary audio source (if selected).</description>
<element name="NO_SOURCE_SELECTED">
</element>
+ <element name="CD" since="5.0">
+ </element>
<element name="USB">
</element>
<element name="USB2">
@@ -1326,9 +1336,17 @@
</element>
<element name="MOBILE_APP">
</element>
+ <element name="AM" since="5.0">
+ </element>
+ <element name="FM" since="5.0">
+ </element>
+ <element name="XM" since="5.0">
+ </element>
+ <element name="DAB" since="5.0">
+ </element>
</enum>
- <enum name="WiperStatus">
+ <enum name="WiperStatus" since="2.0">
<description>Reflects the status of the wipers.</description>
<element name="OFF" />
<element name="AUTO_OFF" />
@@ -1347,7 +1365,7 @@
<element name="NO_DATA_EXISTS" />
</enum>
- <enum name="VehicleDataStatus">
+ <enum name="VehicleDataStatus" since="2.0">
<description>Reflects the status of a binary vehicle data item.</description>
<element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
</element>
@@ -1357,7 +1375,7 @@
</element>
</enum>
- <enum name="MaintenanceModeStatus">
+ <enum name="MaintenanceModeStatus" since="2.0">
<description>Reflects the status of a vehicle maintenance mode.</description>
<element name="NORMAL" internal_name="MMS_NORMAL">
</element>
@@ -1369,7 +1387,7 @@
</element>
</enum>
- <enum name="VehicleDataActiveStatus">
+ <enum name="VehicleDataActiveStatus" since="2.0">
<description>Reflects the status of given vehicle component.</description>
<element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
</element>
@@ -1383,7 +1401,7 @@
</element>
</enum>
- <enum name="AmbientLightStatus">
+ <enum name="AmbientLightStatus" since="2.0">
<description>Reflects the status of the ambient light sensor.</description>
<element name="NIGHT" />
<element name="TWILIGHT_1" />
@@ -1395,45 +1413,48 @@
<element name="INVALID" />
</enum>
- <enum name="ModuleType">
+ <enum name="ModuleType" since="4.5">
<element name="CLIMATE"/>
<element name="RADIO"/>
- <element name="SEAT"/>
+ <element name="SEAT" since="5.0"/>
+ <element name="AUDIO" since="5.0"/>
+ <element name="LIGHT" since="5.0"/>
+ <element name="HMI_SETTINGS" since="5.0"/>
</enum>
- <enum name="DefrostZone">
+ <enum name="DefrostZone" since="4.5">
<element name="FRONT"/>
<element name="REAR"/>
<element name="ALL"/>
<element name="NONE"/>
</enum>
- <enum name="VentilationMode">
+ <enum name="VentilationMode" since="4.5">
<element name="UPPER"/>
<element name="LOWER"/>
<element name="BOTH"/>
<element name="NONE"/>
</enum>
- <enum name="RadioBand">
+ <enum name="RadioBand" since="4.5">
<element name="AM"/>
<element name="FM"/>
<element name="XM"/>
</enum>
- <enum name="RadioState">
+ <enum name="RadioState" since="4.5">
<element name="ACQUIRING"/>
<element name="ACQUIRED"/>
<element name="MULTICAST"/>
<element name="NOT_FOUND"/>
</enum>
- <enum name="TemperatureUnit">
+ <enum name="TemperatureUnit" since="4.5">
<element name="FAHRENHEIT"/>
<element name="CELSIUS"/>
</enum>
- <struct name="BeltStatus">
+ <struct name="BeltStatus" since="2.0">
<param name="driverBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
@@ -1481,7 +1502,7 @@
</param>
</struct>
- <struct name="BodyInformation">
+ <struct name="BodyInformation" since="2.0">
<param name="parkBrakeActive" type="Boolean" mandatory="true">
<description>References signal "PrkBrkActv_B_Actl".</description>
</param>
@@ -1505,7 +1526,7 @@
</param>
</struct>
- <struct name="DeviceStatus">
+ <struct name="DeviceStatus" since="2.0">
<param name="voiceRecOn" type="Boolean" mandatory="true">
<description>References signal "CPM_VoiceRec_STAT".</description>
</param>
@@ -1541,7 +1562,7 @@
</param>
</struct>
- <struct name="HeadLampStatus">
+ <struct name="HeadLampStatus" since="2.0">
<param name="lowBeamsOn" type="Boolean" mandatory="true">
<description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
</param>
@@ -1553,7 +1574,7 @@
</param>
</struct>
- <struct name="AppInfo">
+ <struct name="AppInfo" since="4.2">
<description>Contains detailed information about the registered application.</description>
<param name="appDisplayName" type="String" maxlength="100" mandatory="true">
@@ -1576,7 +1597,7 @@
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Ford Specific Data Items -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <enum name="FileType">
+ <enum name="FileType" since="2.0">
<description>Enumeration listing possible file types.</description>
<element name="GRAPHIC_BMP" />
<element name="GRAPHIC_JPEG" />
@@ -1588,7 +1609,7 @@
<element name="JSON" />
</enum>
- <enum name="FuelCutoffStatus" >
+ <enum name="FuelCutoffStatus" since="2.0">
<description>Reflects the status of the RCM fuel cutoff.</description>
<element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
</element>
@@ -1598,7 +1619,7 @@
</element>
</enum>
- <enum name="EmergencyEventType">
+ <enum name="EmergencyEventType" since="2.0">
<description>Reflects the emergency event status of the vehicle.</description>
<element name="NO_EVENT" internal_name="EET_NO_EVENT">
</element>
@@ -1616,7 +1637,7 @@
</element>
</enum>
- <enum name="ECallConfirmationStatus">
+ <enum name="ECallConfirmationStatus" since="2.0">
<description>Reflects the status of the eCall Notification.</description>
<element name="NORMAL" internal_name="ECCS_NORMAL">
</element>
@@ -1634,7 +1655,7 @@
</element>
</enum>
- <enum name="PowerModeQualificationStatus" >
+ <enum name="PowerModeQualificationStatus" since="2.0">
<description>Reflects the status of the current power mode qualification.</description>
<element name="POWER_MODE_UNDEFINED">
</element>
@@ -1646,7 +1667,7 @@
</element>
</enum>
- <enum name="PowerModeStatus">
+ <enum name="PowerModeStatus" since="2.0">
<description>Reflects the status of the current power mode.</description>
<element name="KEY_OUT">
</element>
@@ -1668,7 +1689,7 @@
</element>
</enum>
- <enum name="CarModeStatus">
+ <enum name="CarModeStatus" since="2.0">
<description>Reflects the status of the current car mode.</description>
<element name="NORMAL" internal_name="CMS_NORMAL">
</element>
@@ -1680,7 +1701,7 @@
</element>
</enum>
- <struct name="ECallInfo">
+ <struct name="ECallInfo" since="2.0">
<param name="eCallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
</param>
@@ -1692,7 +1713,7 @@
</param>
</struct>
- <struct name="AirbagStatus">
+ <struct name="AirbagStatus" since="2.0">
<param name="driverAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
@@ -1719,7 +1740,7 @@
</param>
</struct>
- <struct name="EmergencyEvent">
+ <struct name="EmergencyEvent" since="2.0">
<param name="emergencyEventType" type="EmergencyEventType" mandatory="true">
<description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
</param>
@@ -1742,7 +1763,7 @@
</param>
</struct>
- <struct name="ClusterModeStatus">
+ <struct name="ClusterModeStatus" since="2.0">
<param name="powerModeActive" type="Boolean" mandatory="true">
<description>References signal "PowerMode_UB".</description>
</param>
@@ -1757,7 +1778,7 @@
</param>
</struct>
- <struct name="MyKey">
+ <struct name="MyKey" since="2.0">
<param name="e911Override" type="VehicleDataStatus" mandatory="true">
<description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
</param>
@@ -1767,7 +1788,7 @@
<!-- / Ford Specific Data Items -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <enum name="VehicleDataResultCode">
+ <enum name="VehicleDataResultCode" since="2.0">
<description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
<element name="SUCCESS" internal_name="VDRC_SUCCESS">
<description>Individual vehicle data item / DTC / DID request or subscription successful</description>
@@ -1798,7 +1819,7 @@
</element>
</enum>
- <struct name="TireStatus">
+ <struct name="TireStatus" since="2.0">
<description>The status and pressure of the tires.</description>
<param name="pressureTelltale" type="WarningLightStatus" mandatory="true">
@@ -1825,7 +1846,7 @@
</struct>
- <enum name="TurnSignal">
+ <enum name="TurnSignal" since="5.0">
<description>Enumeration that describes the status of the turn light indicator.</description>
<element name="OFF">
<description>Turn signal is OFF</description>
@@ -1841,66 +1862,114 @@
</element>
</enum>
- <struct name="GPSData">
+ <struct name="GPSData" since="2.0">
<description>Struct with the GPS data.</description>
<param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
</param>
<param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
</param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true">
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false" since="5.0">
<description>The current UTC year.</description>
+ <history>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true">
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="5.0">
<description>The current UTC month.</description>
+ <history>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true">
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="5.0">
<description>The current UTC day.</description>
+ <history>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true">
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="5.0">
<description>The current UTC hour.</description>
+ <history>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
<description>The current UTC minute.</description>
+ <history>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
<description>The current UTC second.</description>
+ <history>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="compassDirection" type="CompassDirection" mandatory="true">
+ <param name="compassDirection" type="CompassDirection" mandatory="false" since="5.0">
<description>See CompassDirection.</description>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
- <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
- <description>HDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
- <description>VDOP. If value is unknown, value shall be set to 0.</description>
- </param>
- <param name="actual" type="Boolean" mandatory="true">
+ <history>
+ <param name="compassDirection" type="CompassDirection" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false" since="5.0">
+ <description>PDOP.</description>
+ <history>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false" since="5.0">
+ <description>HDOP.</description>
+ <history>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" mandatory="false" since="5.0">
+ <description>VDOP.</description>
+ <history>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false" since="5.0">
<description>
True, if actual.
False, if inferred.
</description>
+ <history>
+ <param name="actual" type="Boolean" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true">
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false" since="5.0">
<description>Number of satellites in view</description>
+ <history>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="dimension" type="Dimension" mandatory="true">
+ <param name="dimension" type="Dimension" mandatory="false" since="5.0">
<description>See Dimension</description>
+ <history>
+ <param name="dimension" type="Dimension" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true">
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false" since="5.0">
<description>Altitude in meters</description>
+ <history>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true">
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false" since="5.0">
<description>The heading. North is 0. Resolution is 0.01</description>
+ <history>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true">
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false" since="5.0">
<description>The speed in KPH</description>
+ <history>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
+ </history>
</param>
</struct>
- <struct name="VehicleDataResult">
+ <struct name="VehicleDataResult" since="2.0">
<description>Individual published data request result</description>
<param name="dataType" type="VehicleDataType" mandatory="true">
<description>Defined published data element type.</description>
@@ -1910,7 +1979,7 @@
</param>
</struct>
- <struct name="DIDResult">
+ <struct name="DIDResult" since="2.0">
<description>Individual requested DID result and data</description>
<param name="resultCode" type="VehicleDataResultCode" mandatory="true">
<description>Individual DID result code.</description>
@@ -1923,7 +1992,7 @@
</param>
</struct>
- <struct name="StartTime">
+ <struct name="StartTime" since="1.0">
<param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
<description>
The hour of the media clock.
@@ -1934,7 +2003,7 @@
<param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
</struct>
- <struct name="TextField">
+ <struct name="TextField" since="1.0">
<param name="name" type="TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
@@ -1949,7 +2018,7 @@
</param>
</struct>
- <struct name="ImageResolution">
+ <struct name="ImageResolution" since="3.0">
<param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
<description>The image resolution width.</description>
</param>
@@ -1958,7 +2027,7 @@
</param>
</struct>
- <struct name="ImageField">
+ <struct name="ImageField" since="3.0">
<param name="name" type="ImageFieldName" mandatory="true">
<description>The name that identifies the field. See ImageFieldName.</description>
</param>
@@ -1970,7 +2039,7 @@
</param>
</struct>
- <struct name="TouchCoord">
+ <struct name="TouchCoord" since="3.0">
<param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
<description>The x coordinate of the touch.</description>
</param>
@@ -1979,14 +2048,14 @@
</param>
</struct>
- <enum name="TouchType">
+ <enum name="TouchType" since="3.0">
<element name="BEGIN"/>
<element name="MOVE"/>
<element name="END"/>
- <element name="CANCEL"/>
+ <element name="CANCEL" since="4.5"/>
</enum>
- <struct name="TouchEvent">
+ <struct name="TouchEvent" since="3.0">
<param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
<description>
A touch's unique identifier. The application can track the current touch events by id.
@@ -2006,7 +2075,7 @@
</param>
</struct>
- <struct name="TouchEventCapabilities">
+ <struct name="TouchEventCapabilities" since="3.0">
<param name="pressAvailable" type="Boolean" mandatory="true">
</param>
<param name="multiTouchAvailable" type="Boolean" mandatory="true">
@@ -2015,7 +2084,7 @@
</param>
</struct>
- <struct name="ScreenParams">
+ <struct name="ScreenParams" since="3.0">
<param name="resolution" type="ImageResolution" mandatory="true">
<description>The resolution of the prescribed screen area.</description>
</param>
@@ -2024,7 +2093,7 @@
</param>
</struct>
- <enum name="PermissionStatus">
+ <enum name="PermissionStatus" since="2.0">
<description>Enumeration that describes possible permission states of a policy table entry.</description>
<element name="ALLOWED" internal_name="PS_ALLOWED"/>
<element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
@@ -2032,7 +2101,7 @@
<element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
</enum>
- <struct name="HMIPermissions">
+ <struct name="HMIPermissions" since="2.0">
<param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
<description>A set of all HMI levels that are permitted for this given RPC.</description>
</param>
@@ -2041,7 +2110,7 @@
</param>
</struct>
- <struct name="ParameterPermissions">
+ <struct name="ParameterPermissions" since="2.0">
<param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
<description>A set of all parameters that are permitted for this given RPC.</description>
</param>
@@ -2050,7 +2119,7 @@
</param>
</struct>
- <struct name="PermissionItem">
+ <struct name="PermissionItem" since="2.0">
<param name="rpcName" type="String" maxlength="100" mandatory="true">
<description>Name of the individual RPC in the policy table.</description>
</param>
@@ -2058,12 +2127,15 @@
<param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
</struct>
- <struct name="DisplayCapabilities">
+ <struct name="DisplayCapabilities" since="1.0">
<description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType" mandatory="true">
+ <param name="displayType" type="DisplayType" mandatory="true" deprecated="true" since="5.0">
<description>The type of the display. See DisplayType</description>
+ <history>
+ <param name="displayType" type="DisplayType" mandatory="true" since="1.0" until="5.0"/>
+ </history>
</param>
- <param name="displayName" type="String" mandatory="false">
+ <param name="displayName" type="String" mandatory="false" since="5.0">
<description>The name of the display the app is connected to.</description>
</param>
<param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
@@ -2075,22 +2147,23 @@
<param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
<description>A set of all supported formats of the media clock. See MediaClockFormat</description>
</param>
- <param name="graphicSupported" type="Boolean" mandatory="true">
+ <param name="graphicSupported" type="Boolean" mandatory="true" since="2.0">
<description>The display's persistent screen supports referencing a static or dynamic image.</description>
</param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false">
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false" since="3.0">
<description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
</param>
- <param name="screenParams" type="ScreenParams" mandatory="false">
+ <param name="screenParams" type="ScreenParams" mandatory="false" since="3.0">
<description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
</param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false" since="3.0">
<description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
</param>
<!-- TODO: Add pixel density? -->
</struct>
- <struct name="ButtonCapabilities">
+
+ <struct name="ButtonCapabilities" since="1.0">
<description>Contains information about a button's capabilities.</description>
<param name="name" type="ButtonName" mandatory="true">
<description>The name of the button. See ButtonName.</description>
@@ -2115,7 +2188,8 @@
</description>
</param>
</struct>
- <struct name="SoftButtonCapabilities">
+
+ <struct name="SoftButtonCapabilities" since="2.0">
<description>Contains information about a SoftButton's capabilities.</description>
<param name="shortPressAvailable" type="Boolean" mandatory="true">
<description>
@@ -2140,27 +2214,30 @@
<description>The button supports referencing a static or dynamic image.</description>
</param>
</struct>
- <struct name="PresetBankCapabilities">
+
+ <struct name="PresetBankCapabilities" since="2.0">
<description>Contains information about on-screen preset capabilities.</description>
<param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
<description>Onscreen custom presets are available.</description>
</param>
</struct>
- <struct name="HMICapabilities">
+
+ <struct name="HMICapabilities" since="3.0">
<param name="navigation" type="Boolean" mandatory="false">
<description>Availability of build in Nav. True: Available, False: Not Available</description>
</param>
<param name="phoneCall" type="Boolean" mandatory="false">
<description>Availability of build in phone. True: Available, False: Not Available </description>
</param>
- <param name="videoStreaming" type="Boolean" mandatory="false">
+ <param name="videoStreaming" type="Boolean" mandatory="false" since="4.5">
<description>Availability of video streaming. </description>
</param>
- <param name="remoteControl" type="Boolean" mandatory="false">
+ <param name="remoteControl" type="Boolean" mandatory="false" since="4.5">
<description>Availability of remote control feature. True: Available, False: Not Available</description>
</param>
- </struct>
- <struct name="MenuParams">
+ </struct>
+
+ <struct name="MenuParams" since="1.0">
<param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
<description>
unique ID of the sub menu, the command will be added to.
@@ -2179,8 +2256,9 @@
<param name="menuName" type="String" maxlength="500" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
- </struct>
- <struct name="TTSChunk">
+ </struct>
+
+ <struct name="TTSChunk" since="1.0">
<description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
<param name="text" minlength="0" maxlength="500" type="String" mandatory="true">
<description>
@@ -2188,11 +2266,13 @@
May not be empty.
</description>
</param>
+
<param name="type" type="SpeechCapabilities" mandatory="true">
<description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities</description>
</param>
</struct>
- <struct name="Turn">
+
+ <struct name="Turn" since="2.0">
<param name="navigationText" type="String" maxlength="500" mandatory="false">
<description>Individual turn text. Must provide at least text or icon for a given turn.</description>
</param>
@@ -2200,7 +2280,8 @@
<description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
</param>
</struct>
- <struct name="VehicleType">
+
+ <struct name="VehicleType" since="2.0">
<param name="make" type="String" maxlength="500" mandatory="false">
<description>Make of the vehicle, e.g. Ford</description>
</param>
@@ -2213,14 +2294,16 @@
<param name="trim" type="String" maxlength="500" mandatory="false">
<description>Trim of the vehicle, e.g. SE</description>
</param>
- </struct>
- <enum name="KeyboardLayout">
+ </struct>
+
+ <enum name="KeyboardLayout" since="3.0">
<description>Enumeration listing possible keyboard layouts.</description>
<element name="QWERTY" />
<element name="QWERTZ" />
<element name="AZERTY" />
</enum>
- <enum name="KeyboardEvent" >
+
+ <enum name="KeyboardEvent" since="3.0">
<description>Enumeration listing possible keyboard events.</description>
<element name="KEYPRESS" />
<element name="ENTRY_SUBMITTED" />
@@ -2228,7 +2311,8 @@
<element name="ENTRY_CANCELLED" />
<element name="ENTRY_ABORTED" />
</enum>
- <enum name="KeypressMode">
+
+ <enum name="KeypressMode" since="3.0">
<description>Enumeration listing possible keyboard events.</description>
<element name="SINGLE_KEYPRESS">
<description>Each keypress is individually sent as the user presses the keyboard keys.</description>
@@ -2240,7 +2324,8 @@
<description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
</element>
</enum>
- <struct name="KeyboardProperties">
+
+ <struct name="KeyboardProperties" since="3.0">
<description>Configuration of on-screen keyboard (if available).</description>
<param name="language" type="Language" mandatory="false">
<description>The keyboard language.</description>
@@ -2263,7 +2348,8 @@
<description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
</param>
</struct>
- <struct name="DeviceInfo">
+
+ <struct name="DeviceInfo" since="3.0">
<description>Various information about connecting device.</description>
<param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
<description>Device model</description>
@@ -2284,7 +2370,8 @@
<description>Omitted if connected not via BT.</description>
</param>
</struct>
- <enum name="RequestType">
+
+ <enum name="RequestType" since="3.0">
<description>Enumeration listing possible asynchronous requests.</description>
<element name="HTTP" />
<element name="FILE_RESUME" />
@@ -2306,9 +2393,10 @@
<element name="EMERGENCY" />
<element name="MEDIA" />
<element name="FOTA" />
- <element name="OEM_SPECIFIC" />
+ <element name="OEM_SPECIFIC" since="5.0" />
</enum>
- <enum name="AppHMIType">
+
+ <enum name="AppHMIType" since="2.0">
<description>Enumeration listing possible app types.</description>
<element name="DEFAULT" />
<element name="COMMUNICATION" />
@@ -2320,10 +2408,11 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
- <element name="PROJECTION" />
- <element name="REMOTE_CONTROL" />
+ <element name="PROJECTION" since="4.5" />
+ <element name="REMOTE_CONTROL" since="4.5" />
</enum>
- <enum name="PredefinedLayout" platform="documentation">
+
+ <enum name="PredefinedLayout" platform="documentation" since="3.0">
<description>Predefined screen layout.</description>
<element name="DEFAULT" rootscreen="true">
<description>
@@ -2446,104 +2535,105 @@
</description>
</element>
</enum>
- <enum name="FunctionID" internal_scope="base">
+
+ <enum name="FunctionID" internal_scope="base" since="1.0">
<description>Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0.</description>
- <element name="RESERVED" value="0" />
+ <element name="RESERVED" value="0" since="1.0" />
<!--
Base Request / Response RPCs
Range = 0x 0000 0001 - 0x 0000 7FFF
-->
- <element name="RegisterAppInterfaceID" value="1" hexvalue="1" />
- <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" />
- <element name="SetGlobalPropertiesID" value="3" hexvalue="3" />
- <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" />
- <element name="AddCommandID" value="5" hexvalue="5" />
- <element name="DeleteCommandID" value="6" hexvalue="6" />
- <element name="AddSubMenuID" value="7" hexvalue="7" />
- <element name="DeleteSubMenuID" value="8" hexvalue="8" />
- <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" />
- <element name="PerformInteractionID" value="10" hexvalue="A" />
- <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" />
- <element name="AlertID" value="12" hexvalue="C" />
- <element name="ShowID" value="13" hexvalue="D" />
- <element name="SpeakID" value="14" hexvalue="E" />
- <element name="SetMediaClockTimerID" value="15" hexvalue="F" />
- <element name="PerformAudioPassThruID" value="16" hexvalue="10" />
- <element name="EndAudioPassThruID" value="17" hexvalue="11" />
- <element name="SubscribeButtonID" value="18" hexvalue="12" />
- <element name="UnsubscribeButtonID" value="19" hexvalue="13" />
- <element name="SubscribeVehicleDataID" value="20" hexvalue="14" />
- <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" />
- <element name="GetVehicleDataID" value="22" hexvalue="16" />
- <element name="ReadDIDID" value="23" hexvalue="17" />
- <element name="GetDTCsID" value="24" hexvalue="18" />
- <element name="ScrollableMessageID" value="25" hexvalue="19" />
- <element name="SliderID" value="26" hexvalue="1A" />
- <element name="ShowConstantTBTID" value="27" hexvalue="1B" />
- <element name="AlertManeuverID" value="28" hexvalue="1C" />
- <element name="UpdateTurnListID" value="29" hexvalue="1D" />
- <element name="ChangeRegistrationID" value="30" hexvalue="1E" />
- <element name="GenericResponseID" value="31" hexvalue="1F" />
- <element name="PutFileID" value="32" hexvalue="20" />
- <element name="DeleteFileID" value="33" hexvalue="21" />
- <element name="ListFilesID" value="34" hexvalue="22" />
- <element name="SetAppIconID" value="35" hexvalue="23" />
- <element name="SetDisplayLayoutID" value="36" hexvalue="24" />
- <element name="DiagnosticMessageID" value="37" hexvalue="25" />
- <element name="SystemRequestID" value="38" hexvalue="26" />
- <element name="SendLocationID" value="39" hexvalue="27" />
- <element name="DialNumberID" value="40" hexvalue="28" />
- <element name="ButtonPressID" value="41" hexvalue="29" />
- <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" />
- <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" />
- <element name="GetWayPointsID" value="45" hexvalue="2D" />
- <element name="SubscribeWayPointsID" value="46" hexvalue="2E" />
- <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" />
- <element name="GetSystemCapabilityID" value="48" hexvalue="30" />
- <element name="SendHapticDataID" value="49" hexvalue="31" />
+ <element name="RegisterAppInterfaceID" value="1" hexvalue="1" since="1.0" />
+ <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" since="1.0" />
+ <element name="SetGlobalPropertiesID" value="3" hexvalue="3" since="1.0" />
+ <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" since="1.0" />
+ <element name="AddCommandID" value="5" hexvalue="5" since="1.0" />
+ <element name="DeleteCommandID" value="6" hexvalue="6" since="1.0" />
+ <element name="AddSubMenuID" value="7" hexvalue="7" since="1.0" />
+ <element name="DeleteSubMenuID" value="8" hexvalue="8" since="1.0" />
+ <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" since="1.0" />
+ <element name="PerformInteractionID" value="10" hexvalue="A" since="1.0" />
+ <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" since="1.0" />
+ <element name="AlertID" value="12" hexvalue="C" since="1.0" />
+ <element name="ShowID" value="13" hexvalue="D" since="1.0" />
+ <element name="SpeakID" value="14" hexvalue="E" since="1.0" />
+ <element name="SetMediaClockTimerID" value="15" hexvalue="F" since="1.0" />
+ <element name="PerformAudioPassThruID" value="16" hexvalue="10" since="2.0" />
+ <element name="EndAudioPassThruID" value="17" hexvalue="11" since="2.0" />
+ <element name="SubscribeButtonID" value="18" hexvalue="12" since="1.0" />
+ <element name="UnsubscribeButtonID" value="19" hexvalue="13" since="1.0" />
+ <element name="SubscribeVehicleDataID" value="20" hexvalue="14" since="2.0" />
+ <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" since="2.0" />
+ <element name="GetVehicleDataID" value="22" hexvalue="16" since="2.0" />
+ <element name="ReadDIDID" value="23" hexvalue="17" since="2.0" />
+ <element name="GetDTCsID" value="24" hexvalue="18" since="2.0" />
+ <element name="ScrollableMessageID" value="25" hexvalue="19" since="2.0" />
+ <element name="SliderID" value="26" hexvalue="1A" since="2.0" />
+ <element name="ShowConstantTBTID" value="27" hexvalue="1B" since="2.0" />
+ <element name="AlertManeuverID" value="28" hexvalue="1C" since="2.0" />
+ <element name="UpdateTurnListID" value="29" hexvalue="1D" since="2.0" />
+ <element name="ChangeRegistrationID" value="30" hexvalue="1E" since="2.0" />
+ <element name="GenericResponseID" value="31" hexvalue="1F" since="1.0" />
+ <element name="PutFileID" value="32" hexvalue="20" since="3.0" />
+ <element name="DeleteFileID" value="33" hexvalue="21" since="3.0" />
+ <element name="ListFilesID" value="34" hexvalue="22" since="3.0" />
+ <element name="SetAppIconID" value="35" hexvalue="23" since="3.0" />
+ <element name="SetDisplayLayoutID" value="36" hexvalue="24" since="3.0" />
+ <element name="DiagnosticMessageID" value="37" hexvalue="25" since="3.0" />
+ <element name="SystemRequestID" value="38" hexvalue="26" since="3.0" />
+ <element name="SendLocationID" value="39" hexvalue="27" since="3.0" />
+ <element name="DialNumberID" value="40" hexvalue="28" since="3.0" />
+ <element name="ButtonPressID" value="41" hexvalue="29" since="4.5" />
+ <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" since="4.5" />
+ <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" since="4.5" />
+ <element name="GetWayPointsID" value="45" hexvalue="2D" since="4.1" />
+ <element name="SubscribeWayPointsID" value="46" hexvalue="2E" since="4.1" />
+ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" />
+ <element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" />
+ <element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
<!--
Base Notifications
Range = 0x 0000 8000 - 0x 0000 FFFF
-->
- <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
- <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
- <element name="OnButtonEventID" value="32770" hexvalue="8002" />
- <element name="OnButtonPressID" value="32771" hexvalue="8003" />
- <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
- <element name="OnCommandID" value="32773" hexvalue="8005" />
- <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
- <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
- <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
- <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
- <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
- <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
- <element name="OnTouchEventID" value="32780" hexvalue="800C" />
- <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
- <element name="OnHashChangeID" value="32782" hexvalue="800E" />
- <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" />
- <element name="OnWayPointChangeID" value="32784" hexvalue="8010" />
- <element name="OnRCStatusID" value="32785" hexvalue="8011" />
+ <element name="OnHMIStatusID" value="32768" hexvalue="8000" since="1.0" />
+ <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" since="1.0" />
+ <element name="OnButtonEventID" value="32770" hexvalue="8002" since="1.0" />
+ <element name="OnButtonPressID" value="32771" hexvalue="8003" since="1.0" />
+ <element name="OnVehicleDataID" value="32772" hexvalue="8004" since="2.0" />
+ <element name="OnCommandID" value="32773" hexvalue="8005" since="1.0" />
+ <element name="OnTBTClientStateID" value="32774" hexvalue="8006" since="1.0" />
+ <element name="OnDriverDistractionID" value="32775" hexvalue="8007" since="1.0" />
+ <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" since="2.0" />
+ <element name="OnAudioPassThruID" value="32777" hexvalue="8009" since="2.0" />
+ <element name="OnLanguageChangeID" value="32778" hexvalue="800A" since="2.0" />
+ <element name="OnKeyboardInputID" value="32779" hexvalue="800B" since="3.0" />
+ <element name="OnTouchEventID" value="32780" hexvalue="800C" since="3.0" />
+ <element name="OnSystemRequestID" value="32781" hexvalue="800D" since="3.0" />
+ <element name="OnHashChangeID" value="32782" hexvalue="800E" since="3.0" />
+ <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" since="4.5" />
+ <element name="OnWayPointChangeID" value="32784" hexvalue="8010" since="4.1" />
+ <element name="OnRCStatusID" value="32785" hexvalue="8011" since="5.0" />
<!--
Ford Specific Request / Response RPCs
Range = 0x 0001 0000 - 0x 0001 7FFF
-->
- <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" />
- <element name="SyncPDataID" value="65537" hexvalue="10001" />
+ <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" since="1.0" />
+ <element name="SyncPDataID" value="65537" hexvalue="10001" since="1.0" />
<!--
Ford Specific Notifications
Range = 0x 0001 8000 - 0x 0001 FFFF
-->
- <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" />
- <element name="OnSyncPDataID" value="98305" hexvalue="18001" />
+ <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" since="1.0" />
+ <element name="OnSyncPDataID" value="98305" hexvalue="18001" since="1.0" />
</enum>
- <enum name="messageType">
+ <enum name="messageType" since="1.0">
<description>
Enumeration linking message types with function types in WiPro protocol.
Assumes enumeration starts at value 0.
@@ -2553,43 +2643,67 @@
<element name="notification" value="2" />
</enum>
- <struct name="DateTime">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <struct name="DateTime" since="4.1">
+ <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false" since="4.2.2">
<description>Milliseconds </description>
</param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false" since="4.2.2">
<description>Seconds part of time</description>
+ <history>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="4.2.2">
<description>Minutes part of time</description>
+ <history>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="4.2.2">
<description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
+ <history>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="4.2.2">
<description>Day of the month</description>
+ <history>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="4.2.2">
<description>Month of the year</description>
+ <history>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false">
+ <param name="year" type="Integer" maxvalue="4095" mandatory="false" since="4.2.2">
<description>The year in YYYY format</description>
+ <history>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false" since="4.2.2">
<description>Time zone offset in Hours wrt UTC.</description>
+ <history>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false" since="4.2.2">
<description>Time zone offset in Min wrt UTC.</description>
+ <history>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
</param>
</struct>
- <enum name="WayPointType">
+ <enum name="WayPointType" since="4.1">
<description>Describes what kind of waypoint is requested/provided.</description>
<element name="ALL" />
<element name="DESTINATION" />
</enum>
- <struct name="Coordinate">
+ <struct name="Coordinate" since="4.1">
<param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
<description>Latitude of the location.</description>
</param>
@@ -2598,7 +2712,7 @@
</param>
</struct>
- <struct name="OASISAddress">
+ <struct name="OASISAddress" since="4.1">
<param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
<description>Name of the country (localized)</description>
</param>
@@ -2628,7 +2742,7 @@
</param>
</struct>
- <struct name="LocationDetails">
+ <struct name="LocationDetails" since="4.1">
<param name="coordinate" type="Coordinate" mandatory="false">
<description>Latitude/Longitude of the location.</description>
</param>
@@ -2652,7 +2766,7 @@
</param>
</struct>
- <enum name="SystemCapabilityType">
+ <enum name="SystemCapabilityType" since="4.5">
<description>Enumerations of all available system capability types</description>
<element name="NAVIGATION"/>
<element name="PHONE_CALL"/>
@@ -2660,7 +2774,7 @@
<element name="REMOTE_CONTROL"/>
</enum>
- <struct name="NavigationCapability">
+ <struct name="NavigationCapability" since="4.5">
<description>Extended capabilities for an onboard navigation system</description>
<param name="sendLocationEnabled" type="Boolean" mandatory="false">
<description>If the module has the ability to add locations to the onboard nav</description>
@@ -2670,14 +2784,14 @@
</param>
</struct>
- <struct name="PhoneCapability">
+ <struct name="PhoneCapability" since="4.5">
<description>Extended capabilities of the module's phone feature</description>
<param name="dialNumberEnabled" type="Boolean" mandatory="false">
<description>If the module has the ability to perform dial number</description>
</param>
</struct>
- <struct name="VideoStreamingFormat">
+ <struct name="VideoStreamingFormat" since="4.5">
<description>Video streaming formats and their specifications.</description>
<param name="protocol" type="VideoStreamingProtocol" mandatory="true">
<description>Protocol type, see VideoStreamingProtocol</description>
@@ -2687,7 +2801,7 @@
</param>
</struct>
- <struct name="VideoStreamingCapability">
+ <struct name="VideoStreamingCapability" since="4.5">
<description>Contains information about this system's video streaming capabilities.</description>
<param name="preferredResolution" type="ImageResolution" mandatory="false">
<description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
@@ -2702,10 +2816,31 @@
<description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
</param>
</struct>
+
+ <struct name="RGBColor" since="5.0">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <struct name="TemplateColorScheme" since="5.0">
+ <description>
+ A color scheme for all display layout templates.
+ </description>
+ <param name="primaryColor" type="RGBColor" mandatory="false">
+ <description>The primary "accent" color</description>
+ </param>
+ <param name="secondaryColor" type="RGBColor" mandatory="false">
+ <description>The secondary "accent" color</description>
+ </param>
+ <param name="backgroundColor" type="RGBColor" mandatory="false">
+ <description>The color of the background</description>
+ </param>
+ </struct>
<!---Remote control -->
- <enum name="MassageZone">
+ <enum name="MassageZone" since="5.0">
<description>List possible zones of a multi-contour massage seat.</description>
<element name="LUMBAR">
<description>The back of a multi-contour massage seat. or SEAT_BACK</description>
@@ -2715,20 +2850,20 @@
</element>
</enum>
- <enum name="MassageMode">
+ <enum name="MassageMode" since="5.0">
<description>List possible modes of a massage zone.</description>
<element name="OFF"/>
<element name="LOW"/>
<element name="HIGH"/>
</enum>
- <struct name="MassageModeData">
+ <struct name="MassageModeData" since="5.0">
<description>Specify the mode of a massage zone.</description>
<param name="massageZone" type="MassageZone" mandatory="true"></param>
<param name="massageMode" type="MassageMode" mandatory="true"></param>
</struct>
- <enum name="MassageCushion">
+ <enum name="MassageCushion" since="5.0">
<description>List possible cushions of a multi-contour massage seat.</description>
<element name="TOP_LUMBAR"/>
<element name="MIDDLE_LUMBAR"/>
@@ -2737,13 +2872,13 @@
<element name="SEAT_BOLSTERS"/>
</enum>
- <struct name="MassageCushionFirmness">
+ <struct name="MassageCushionFirmness" since="5.0">
<description>The intensity or firmness of a cushion.</description>
<param name="cushion" type="MassageCushion" mandatory="true"></param>
<param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
</struct>
- <enum name="SeatMemoryActionType">
+ <enum name="SeatMemoryActionType" since="5.0">
<element name="SAVE">
<description>Save current seat postions and settings to seat memory.</description>
</element>
@@ -2755,19 +2890,19 @@
</element>
</enum>
- <struct name="SeatMemoryAction">
+ <struct name="SeatMemoryAction" since="5.0">
<param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
<param name="label" type="String" maxlength="100" mandatory="false"/>
<param name="action" type="SeatMemoryActionType" mandatory="true"/>
</struct>
- <enum name="SupportedSeat">
+ <enum name="SupportedSeat" since="5.0">
<description>List possible seats that is a remote controllable seat.</description>
<element name="DRIVER"/>
<element name="FRONT_PASSENGER"/>
</enum>
- <struct name="SeatControlData">
+ <struct name="SeatControlData" since="5.0">
<description>Seat control data corresponds to "SEAT" ModuleType. </description>
<param name="id" type="SupportedSeat" mandatory="true"></param>
@@ -2791,7 +2926,7 @@
<param name="memory" type="SeatMemoryAction" mandatory="false"></param>
</struct>
- <struct name="SeatControlCapabilities">
+ <struct name="SeatControlCapabilities" since="5.0">
<param name="moduleName" type="String" maxlength="100" mandatory="true">
<description>
The short friendly name of the light control module.
@@ -2830,7 +2965,7 @@
</param>
</struct>
- <struct name="Temperature">
+ <struct name="Temperature" since="4.5">
<param name="unit" type="TemperatureUnit" mandatory="true">
<description>Temperature Unit</description>
</param>
@@ -2839,7 +2974,7 @@
</param>
</struct>
- <struct name="RdsData">
+ <struct name="RdsData" since="4.5">
<param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
<description>Program Service Name</description>
</param>
@@ -2865,8 +3000,35 @@
<description>Region</description>
</param>
</struct>
+
+ <struct name="StationIDNumber" since="5.0">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="SisData" since="5.0">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements. Includes a high priority delivery feature to convey emergencies that may be in the listening area.</description>
+ </param>
+ </struct>
- <struct name="RadioControlData">
+ <struct name="RadioControlData" since="4.5">
<param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
<description>The integer part of the frequency ie for 101.7 this value should be 101</description>
</param>
@@ -2877,11 +3039,20 @@
</param>
<param name="rdsData" type="RdsData" mandatory="false">
</param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
+ <description> True if the hd radio is on, false is the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
<description>number of HD sub-channels if available</description>
+ <history>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
</param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
<description>Current HD sub-channel if available</description>
+ <history>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
</param>
<param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
</param>
@@ -2889,13 +3060,16 @@
<description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
</param>
<param name="radioEnable" type="Boolean" mandatory="false">
- <description> True if the radio is on, false is the radio is off</description>
+ <description> True if the radio is on, false is the radio is off. If set to false, no other data will be included.</description>
</param>
<param name="state" type="RadioState" mandatory="false">
</param>
+ <param name="sisData" type="SisData" mandatory="false" since="5.0">
+ <description>Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number</description>
+ </param>
</struct>
- <struct name="ClimateControlData">
+ <struct name="ClimateControlData" since="4.5">
<param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
</param>
<param name="currentTemperature" type="Temperature" mandatory="false">
@@ -2916,9 +3090,21 @@
</param>
<param name="ventilationMode" type="VentilationMode" mandatory="false">
</param>
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
+ </param>
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
</struct>
-
- <struct name="RadioControlCapabilities">
+
+ <struct name="RadioControlCapabilities" since="4.5">
<description>Contains information about a radio control module's capabilities.</description>
<!-- need an ID in the future -->
<param name="moduleName" type="String" maxlength="100" mandatory="true">
@@ -2981,9 +3167,27 @@
True: Available, False: Not Available, Not present: Not Available.
</description>
</param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
</struct>
- <struct name="ClimateControlCapabilities">
+ <struct name="ClimateControlCapabilities" since="4.5">
<description>Contains information about a climate control module's capabilities.</description>
<!-- need an ID in the future -->
<param name="moduleName" type="String" maxlength="100" mandatory="true">
@@ -3054,9 +3258,249 @@
A set of all ventilation modes that are controllable.
</description>
</param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="EqualizerSettings" since="5.0">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <struct name="AudioControlData" since="5.0">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ In a getter response or a notification, it is the current primary audio source of the system.
+ In a setter request, it is the target audio source that the system shall switch to.
+ If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ This parameter shall not be present in any getter responses or notifications.
+ This parameter is optional in a setter request. The default value is false.
+ If it is false, the system not only changes the audio source but also brings the default application
+ or system UI associated with the audio source to foreground.
+ If it is true, the system changes the audio source, but still keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext paramter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+ <enum name="LightName" since="5.0">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front, left and right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights an trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus" since="5.0">
+ <element name="ON"/>
+ <element name="OFF"/>
+ </enum>
+
+ <struct name="LightCapabilities" since="5.0">
+ <param name="name" type="LightName" mandatory="true" />
+ <!-- Assuming light ON/OFF status is always available -->
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the RGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available light names that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState" since="5.0">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData" since="5.0">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode" since="5.0">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+ <enum name="DistanceUnit" since="5.0">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData" since="5.0">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
</struct>
- <struct name="ModuleData">
+ <struct name="ModuleData" since="4.5">
<description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
<param name="moduleType" type="ModuleType" mandatory="true">
</param>
@@ -3064,11 +3508,17 @@
</param>
<param name="climateControlData" type="ClimateControlData" mandatory="false">
</param>
- <param name="seatControlData" type="SeatControlData" mandatory="false">
+ <param name="seatControlData" type="SeatControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false" since="5.0">
</param>
</struct>
- <struct name="RemoteControlCapabilities">
+ <struct name="RemoteControlCapabilities" since="4.5">
<param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
<description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
</param>
@@ -3078,15 +3528,24 @@
<param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
<description>If included, the platform supports RC button controls with the included button names.</description >
</param>
- <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
<description>
If included, the platform supports seat controls.
</description >
</param>
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description> If included, the platform supports audio controls. </description >
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false" since="5.0">
+ <description> If included, the platform supports hmi setting controls. </description >
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false" since="5.0">
+ <description> If included, the platform supports light controls. </description >
+ </param>
</struct>
<!-- End of RC -->
- <struct name="SystemCapability">
+ <struct name="SystemCapability" since="4.5">
<description>The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
<param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
<description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other para included.</description>
@@ -3105,7 +3564,7 @@
</param>
</struct>
- <enum name="MetadataType">
+ <enum name="MetadataType" since="4.5">
<element name="mediaTitle">
<description>The data in this field contains the title of the currently playing audio track.</description>
</element>
@@ -3143,8 +3602,8 @@
<description>The data in this field describes the current humidity value.</description>
</element>
</enum>
-
- <struct name="MetadataTags">
+
+ <struct name="MetadataTags" since="4.5">
<param name="mainField1" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
<description>The type of data contained in the "mainField1" text field.</description>
</param>
@@ -3159,7 +3618,7 @@
</param>
</struct>
- <struct name="Rectangle">
+ <struct name="Rectangle" since="4.5">
<param name="x" type="Float" mandatory="true">
<description>The upper left X-coordinate of the rectangle</description>
</param>
@@ -3173,8 +3632,8 @@
<description>The height of the rectangle</description>
</param>
</struct>
-
- <struct name="HapticRect">
+
+ <struct name="HapticRect" since="4.5">
<description>Defines haptic data for each user control object for video streaming application</description>
<param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>A user control spatial identifier</description>
@@ -3183,40 +3642,20 @@
<description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
</param>
</struct>
-
- <struct name="RGBColor">
- <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- </struct>
-
- <struct name="TemplateColorScheme">
- <description>
- A color scheme for all display layout templates.
- </description>
- <param name="primaryColor" type="RGBColor" mandatory="false">
- <description>The primary "accent" color</description>
- </param>
- <param name="secondaryColor" type="RGBColor" mandatory="false">
- <description>The secondary "accent" color</description>
- </param>
- <param name="backgroundColor" type="RGBColor" mandatory="false">
- <description>The color of the background</description>
- </param>
- </struct>
+
<!-- Requests/Responses -->
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
<description>
Establishes an interface with a mobile application.
Before registerAppInterface no other commands will be accepted/executed.
</description>
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true">
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true" since="1.0">
<description>See SyncMsgVersion</description>
</param>
- <param name="appName" type="String" maxlength="100" mandatory="true">
+ <param name="appName" type="String" maxlength="100" mandatory="true" since="1.0">
<description>
The mobile application name, e.g. "Ford Drive Green".
Needs to be unique over all applications.
@@ -3228,7 +3667,7 @@
</description>
</param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
@@ -3239,7 +3678,7 @@
</description>
</param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="1.0">
<description>
Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
If not provided, the appName is used instead (and will be truncated if too long)
@@ -3247,7 +3686,7 @@
</description>
</param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
Defines an additional voice recognition command.
May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
@@ -3255,20 +3694,20 @@
</description>
</param>
- <param name="isMediaApplication" type="Boolean" mandatory="true">
+ <param name="isMediaApplication" type="Boolean" mandatory="true" since="1.0">
<description>
Indicates if the application is a media or a non-media application.
Only media applications will be able to stream audio to the module that is audible outside of the BT media source.
</description>
</param>
- <param name="languageDesired" type="Language" mandatory="true">
+ <param name="languageDesired" type="Language" mandatory="true" since="1.0">
<description>
See Language
Current app's expected VR+TTS language
If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
</description>
</param>
- <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true">
+ <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true" since="2.0">
<description>
See Language
Current app's expected display language
@@ -3276,14 +3715,14 @@
</description>
</param>
- <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
See AppHMIType
List of all applicable app HMI types stating which HMI classifications to be given to the app.
</description>
</param>
- <param name="hashID" type="String" maxlength="100" mandatory="false">
+ <param name="hashID" type="String" maxlength="100" mandatory="false" since="3.0">
<description>
ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
@@ -3291,29 +3730,29 @@
When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
</description>
</param>
- <param name="deviceInfo" type="DeviceInfo" mandatory="false">
+ <param name="deviceInfo" type="DeviceInfo" mandatory="false" since="3.0">
<description>
See DeviceInfo.
</description>
</param>
- <param name="appID" type="String" maxlength="100" mandatory="true">
+ <param name="appID" type="String" maxlength="100" mandatory="true" since="2.0">
<description>ID used to validate app with policy table entries</description>
</param>
- <param name="fullAppID" type="String" maxlength="100" mandatory="true">
+ <param name="fullAppID" type="String" maxlength="100" mandatory="true" since="5.0">
<description>ID used to validate app with policy table entries</description>
</param>
- <param name="appInfo" type="AppInfo" mandatory="false">
+ <param name="appInfo" type="AppInfo" mandatory="false" since="2.0">
<description>
See AppInfo.
</description>
</param>
- <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false"/>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
- <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false"/>
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
</function>
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response" since="1.0">
<description>The response to registerAppInterface</description>
<param name="success" type="Boolean" platform="documentation" mandatory="true">
@@ -3349,7 +3788,7 @@
<description>The currently active VR+TTS language on the module. See "Language" for options.</description>
</param>
- <param name="hmiDisplayLanguage" type="Language" mandatory="false">
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false" since="2.0">
<description>The currently active display language on the module. See "Language" for options.</description>
</param>
@@ -3361,59 +3800,59 @@
<description>See ButtonCapabilities</description >
</param>
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
</param>
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0">
<description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
</param>
- <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See HmiZoneCapabilities</description>
</param>
- <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See SpeechCapabilities</description>
</param>
- <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
<description>See PrerecordedSpeech</description>
</param>
- <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>See VrCapabilities</description>
</param>
- <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>See AudioPassThruCapability</description>
</param>
- <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false">
+ <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false" since="4.1">
<description>See AudioPassThruCapability</description>
</param>
- <param name="vehicleType" type="VehicleType" mandatory="false">
+ <param name="vehicleType" type="VehicleType" mandatory="false" since="2.0">
<description>Specifies the vehicle's type. See VehicleType.</description>
</param>
- <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" >
+ <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" since="3.0">
<description>
Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
If a mode outside this list is requested, it will be rejected.
</description>
</param>
- <param name="hmiCapabilities" type="HMICapabilities" mandatory="false">
+ <param name="hmiCapabilities" type="HMICapabilities" mandatory="false" since="3.0">
<description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
</param>
- <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
+ <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
<description>The SmartDeviceLink version.</description>
</param>
- <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation">
+ <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
<description>The software version of the system that implements the SmartDeviceLink core.</description>
</param>
- <param name="iconResumed" type="Boolean" mandatory="false">
+ <param name="iconResumed" type="Boolean" mandatory="false" since="5.0">
<description>
Existence of apps icon at system. If true, apps icon
was resumed at system. If false, apps icon is not resumed at system
@@ -3421,7 +3860,7 @@
</param>
</function>
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request">
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request" since="1.0">
<description>
Closes an interface from a mobile application.
After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
@@ -3429,7 +3868,7 @@
</description>
</function>
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response">
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3451,10 +3890,10 @@
</function>
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request">
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
<description>Allows setting global properties.</description>
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
The help prompt.
An array of text chunks of type TTSChunk. See TTSChunk.
@@ -3462,7 +3901,7 @@
</description>
</param>
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
<description>
Help text for a wait timeout.
An array of text chunks of type TTSChunk. See TTSChunk.
@@ -3470,7 +3909,7 @@
</description>
</param>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false" since="2.0">
<description>
VR Help Title text.
If omitted on supported displays, the default module help title shall be used.
@@ -3478,7 +3917,7 @@
</description>
</param>
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
VR Help Items.
If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
@@ -3486,20 +3925,20 @@
If omitted and a vrHelpTitle is provided, the request will be rejected.
</description>
</param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false">
+ <param name="menuTitle" maxlength="500" type="String" mandatory="false" since="3.0">
<description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
</param>
- <param name="menuIcon" type="Image" mandatory="false">
- <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ <param name="menuIcon" type="Image" mandatory="false" since="3.0">
+ <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
</param>
- <param name="keyboardProperties" type="KeyboardProperties" mandatory="false">
+ <param name="keyboardProperties" type="KeyboardProperties" mandatory="false" since="3.0">
<description>On-screen keyboard configuration (if available).</description>
</param>
</function>
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3525,7 +3964,7 @@
</function>
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request" since="1.0">
<description>Allows resetting global properties.</description>
<param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="true">
@@ -3533,7 +3972,7 @@
</param>
</function>
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3556,7 +3995,7 @@
</param>
</function>
- <function name="AddCommand" functionID="AddCommandID" messagetype="request">
+ <function name="AddCommand" functionID="AddCommandID" messagetype="request" since="1.0">
<description>
Adds a command to the in application menu.
Either menuParams or vrCommands must be provided.
@@ -3577,7 +4016,7 @@
</description>
</param>
- <param name="cmdIcon" type="Image" mandatory="false">
+ <param name="cmdIcon" type="Image" mandatory="false" since="2.0">
<description>
Image struct determining whether static or dynamic icon.
If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
@@ -3586,7 +4025,7 @@
</function>
- <function name="AddCommand" functionID="AddCommandID" messagetype="response">
+ <function name="AddCommand" functionID="AddCommandID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3614,7 +4053,7 @@
</function>
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request" since="1.0">
<description>Deletes all commands from the in-application menu with the specified command id.</description>
<param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
@@ -3623,7 +4062,7 @@
</function>
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3647,7 +4086,7 @@
</function>
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request" since="1.0">
<description>Adds a sub menu to the in-application menu.</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
@@ -3668,12 +4107,12 @@
<param name="menuName" maxlength="500" type="String" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
- <param name="menuIcon" type="Image" mandatory="false">
+ <param name="menuIcon" type="Image" mandatory="false" since="5.0">
<description>The image field for AddSubMenu</description>
</param>
</function>
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3696,7 +4135,7 @@
</param>
</function>
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request" since="1.0">
<description>Deletes a submenu from the in-application menu.</description>
<param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
@@ -3705,7 +4144,7 @@
</function>
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3730,7 +4169,7 @@
</function>
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request" since="1.0">
<description>creates interaction choice set to be used later by performInteraction</description>
<param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
@@ -3740,7 +4179,7 @@
<param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
</function>
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3764,7 +4203,7 @@
</param>
</function>
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request" since="1.0">
<description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
<param name="initialText" type="String" maxlength="500" mandatory="true">
@@ -3813,21 +4252,20 @@
</description>
</param>
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
<description>
Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
If omitted on supported displays, the default generated list of suggested choices shall be displayed.
</description>
</param>
- <param name="interactionLayout" type="LayoutMode" mandatory="false">
+ <param name="interactionLayout" type="LayoutMode" mandatory="false" since="3.0">
<description>See LayoutMode.</description>
</param>
</function>
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
-
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3860,7 +4298,7 @@
</description>
</param>
- <param name="manualTextEntry" type="String" maxlength="500" mandatory="false">
+ <param name="manualTextEntry" type="String" maxlength="500" mandatory="false" since="3.0">
<description>
Manually entered text selection, e.g. through keyboard
Can be returned in lieu of choiceID, depending on trigger source
@@ -3876,7 +4314,7 @@
</function>
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request" since="1.0">
<description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
<description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
@@ -3885,7 +4323,7 @@
</param>
</function>
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -3908,7 +4346,7 @@
</param>
</function>
- <function name="Alert" functionID="AlertID" messagetype="request">
+ <function name="Alert" functionID="AlertID" messagetype="request" since="1.0">
<description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
<param name="alertText1" type="String" maxlength="500" mandatory="false">
@@ -3919,7 +4357,7 @@
<description>The second line of the alert text field</description>
</param>
- <param name="alertText3" type="String" maxlength="500" mandatory="false">
+ <param name="alertText3" type="String" maxlength="500" mandatory="false" since="2.0">
<description>The optional third line of the alert text field</description>
</param>
@@ -3945,13 +4383,13 @@
</description>
</param>
- <param name="progressIndicator" type="Boolean" mandatory="false">
+ <param name="progressIndicator" type="Boolean" mandatory="false" since="3.0">
<description>
If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
</description>
</param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false">
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false" since="2.0">
<description>
App defined SoftButtons.
If omitted on supported displays, the displayed alert shall not have any SoftButtons.
@@ -3960,7 +4398,7 @@
</function>
- <function name="Alert" functionID="AlertID" messagetype="response">
+ <function name="Alert" functionID="AlertID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -3986,7 +4424,7 @@
<description>Provides additional human readable info regarding the result.</description>
</param>
- <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="2.0">
<description>
Amount of time (in seconds) that an app must wait before resending an alert.
If provided, another system event or overlay currently has a higher priority than this alert.
@@ -3996,10 +4434,10 @@
</function>
- <function name="Show" functionID="ShowID" messagetype="request">
+ <function name="Show" functionID="ShowID" messagetype="request" since="1.0">
<description>Updates the persistent display. Supported fields depend on display capabilities.</description>
- <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
The text that should be displayed in a single or upper display line.
If this text is not set, the text of mainField1 stays unchanged.
@@ -4007,7 +4445,7 @@
</description>
</param>
- <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
The text that should be displayed on the second display line.
If this text is not set, the text of mainField2 stays unchanged.
@@ -4015,7 +4453,7 @@
</description>
</param>
- <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
<description>
The text that should be displayed on the second "page" first display line.
If this text is not set, the text of mainField3 stays unchanged.
@@ -4023,7 +4461,7 @@
</description>
</param>
- <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
<description>
The text that should be displayed on the second "page" second display line.
If this text is not set, the text of mainField4 stays unchanged.
@@ -4031,25 +4469,25 @@
</description>
</param>
- <param name="alignment" type="TextAlignment" mandatory="false">
+ <param name="alignment" type="TextAlignment" mandatory="false" since="1.0">
<description>
Specifies how mainField1 and mainField2 texts should be aligned on display.
If omitted, texts will be centered.
</description>
</param>
- <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
</param>
- <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
Text value for MediaClock field. Has to be properly formatted by Mobile App according to the module's capabilities.
If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
</description>
</param>
- <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
<description>
The text that should be displayed in the track field.
If this text is not set, the text of mediaTrack stays unchanged.
@@ -4057,43 +4495,42 @@
</description>
</param>
- <param name="graphic" type="Image" mandatory="false">
+ <param name="graphic" type="Image" mandatory="false" since="3.0">
<description>
Image struct determining whether static or dynamic image to display in app.
If omitted on supported displays, the displayed graphic shall not change.
</description>
</param>
- <param name="secondaryGraphic" type="Image" mandatory="false">
+ <param name="secondaryGraphic" type="Image" mandatory="false" since="3.0">
<description>
Image struct determining whether static or dynamic secondary image to display in app.
If omitted on supported displays, the displayed secondary graphic shall not change.
</description>
</param>
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false" since="2.0">
<description>
App defined SoftButtons.
If omitted on supported displays, the currently displayed SoftButton values will not change.
</description>
</param>
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false" since="3.0">
<description>
App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions).
If omitted on supported displays, the presets will be shown as not defined.
</description>
</param>
- <param name="metadataTags" type="MetadataTags" mandatory="false">
+ <param name="metadataTags" type="MetadataTags" mandatory="false" since="4.5">
<description>App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
If omitted on supported displays, the currently set metadata tags will not change.
If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
</param>
</function>
- <function name="Show" functionID="ShowID" messagetype="response">
+ <function name="Show" functionID="ShowID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -4119,7 +4556,7 @@
</param>
</function>
- <function name="Speak" functionID="SpeakID" messagetype="request">
+ <function name="Speak" functionID="SpeakID" messagetype="request" since="1.0">
<description>Speaks a text.</description>
<param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
@@ -4131,7 +4568,7 @@
</function>
- <function name="Speak" functionID="SpeakID" messagetype="response">
+ <function name="Speak" functionID="SpeakID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
@@ -4157,7 +4594,7 @@
</function>
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request" since="1.0">
<description>Sets the initial media clock value and automatic update method.</description>
<param name="startTime" type="StartTime" mandatory="false">
@@ -4169,7 +4606,7 @@
</description>
</param>
- <param name="endTime" type="StartTime" mandatory="false">
+ <param name="endTime" type="StartTime" mandatory="false" since="3.0">
<description>
See StartTime.
endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
@@ -4185,12 +4622,12 @@
In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
</description>
</param>
- <param name="audioStreamingIndicator" type="AudioStreamingIndicator" mandatory="false">
- <description>Indicates that a button press of the Play/Pause button would play, pause or Stop the current playback.</description>
- </param>
+ <param name="audioStreamingIndicator" type="AudioStreamingIndicator" mandatory="false" since="5.0">
+ <description>Indicates that a button press of the Play/Pause button would play, pause or Stop the current playback.</description>
+ </param>
</function>
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4212,7 +4649,7 @@
</param>
</function>
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request" since="2.0">
<description>Starts audio pass thru session </description>
<param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
<description>
@@ -4248,7 +4685,7 @@
</param>
</function>
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response">
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4273,11 +4710,11 @@
</param>
</function>
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request" since="2.0">
<description>When this request is invoked, the audio capture stops.</description>
</function>
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4299,7 +4736,7 @@
</param>
</function>
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request" since="1.0">
<description>
Subscribes to built-in HMI buttons.
The application will be notified by the OnButtonEvent and OnButtonPress.
@@ -4311,7 +4748,7 @@
</param>
</function>
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4334,7 +4771,7 @@
</param>
</function>
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request" since="1.0">
<description>Unsubscribes from built-in HMI buttons.</description>
<param name="buttonName" type="ButtonName" mandatory="true">
@@ -4342,7 +4779,7 @@
</param>
</function>
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false, if failed </description>
</param>
@@ -4365,7 +4802,7 @@
</param>
</function>
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request">
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request" since="2.0">
<description>
Subscribes for specific published data items.
The data will be only sent if it has changed.
@@ -4391,13 +4828,13 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="Boolean" mandatory="false">
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- <param name="turnSignal" type="Boolean" mandatory="false">
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="prndl" type="Boolean" mandatory="false">
@@ -4436,10 +4873,10 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="Boolean" mandatory="false">
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -4465,7 +4902,7 @@
</function>
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response">
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4507,13 +4944,13 @@
<param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="VehicleDataResult" mandatory="false">
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
- <param name="turnSignal" type="VehicleDataResult" mandatory="false">
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="prndl" type="VehicleDataResult" mandatory="false">
@@ -4552,10 +4989,10 @@
<param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="VehicleDataResult" mandatory="false">
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -4580,7 +5017,7 @@
</function>
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request" since="2.0">
<description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
<param name="gps" type="Boolean" mandatory="false">
@@ -4601,13 +5038,13 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="Boolean" mandatory="false">
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius.</description>
</param>
- <param name="turnSignal" type="Boolean" mandatory="false">
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="prndl" type="Boolean" mandatory="false">
@@ -4646,10 +5083,10 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="Boolean" mandatory="false">
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -4674,7 +5111,7 @@
</function>
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -4715,13 +5152,13 @@
<param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="VehicleDataResult" mandatory="false">
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="VehicleDataResult" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- <param name="turnSignal" type="VehicleDataResult" mandatory="false">
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="prndl" type="VehicleDataResult" mandatory="false">
@@ -4760,10 +5197,10 @@
<param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="VehicleDataResult" mandatory="false">
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -4788,7 +5225,7 @@
</function>
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request">
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request" since="2.0">
<description>Non periodic vehicle data read request.</description>
<param name="gps" type="Boolean" mandatory="false">
@@ -4809,13 +5246,13 @@
<param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="Boolean" mandatory="false">
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- <param name="turnSignal" type="Boolean" mandatory="false">
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="vin" type="Boolean" mandatory="false">
@@ -4857,10 +5294,10 @@
<param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="Boolean" mandatory="false">
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -4885,7 +5322,7 @@
</function>
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response">
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -4927,13 +5364,13 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- <param name="turnSignal" type="TurnSignal" mandatory="false">
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="vin" type="String" maxlength="17" mandatory="false">
@@ -4975,10 +5412,10 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -5003,7 +5440,7 @@
</function>
- <function name="ReadDID" functionID="ReadDIDID" messagetype="request">
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="request" since="2.0">
<description>Non periodic vehicle data read request</description>
<param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -5014,7 +5451,7 @@
</param>
</function>
- <function name="ReadDID" functionID="ReadDIDID" messagetype="response">
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -5044,7 +5481,7 @@
</function>
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="request">
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="request" since="2.0">
<description>Vehicle module diagnostic trouble code request.</description>
<param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -5057,7 +5494,7 @@
</function>
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="response">
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -5094,7 +5531,7 @@
</function>
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request">
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request" since="3.0">
<description>Non periodic vehicle diagnostic request</description>
<param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
@@ -5112,7 +5549,7 @@
</param>
</function>
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response">
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -5144,7 +5581,7 @@
</function>
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request">
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request" since="2.0">
<description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
<param name="scrollableMessageBody" type="String" maxlength="500" mandatory="true">
<description>Body of text that can include newlines and tabs.</description>
@@ -5160,7 +5597,7 @@
</param>
</function>
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response">
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5186,7 +5623,7 @@
</function>
- <function name="Slider" functionID="SliderID" messagetype="request">
+ <function name="Slider" functionID="SliderID" messagetype="request" since="2.0">
<description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
<param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
<description>Number of selectable items on a horizontal axis</description>
@@ -5214,7 +5651,7 @@
</param>
</function>
- <function name="Slider" functionID="SliderID" messagetype="response">
+ <function name="Slider" functionID="SliderID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5247,40 +5684,40 @@
</param>
</function>
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
- <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request" since="2.0">
+ <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false" since="3.0">
</param>
- <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
+ <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
</param>
- <param name="turnIcon" type="Image" mandatory="false">
+ <param name="turnIcon" type="Image" mandatory="false" since="2.0">
</param>
- <param name="nextTurnIcon" type="Image" mandatory="false">
+ <param name="nextTurnIcon" type="Image" mandatory="false" since="3.0">
</param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
<description>
Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
Used to calculate progress bar.
</description>
</param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
<description>
Distance till next maneuver (starting from) from previous maneuver.
Used to calculate progress bar.
</description>
</param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
+ <param name="maneuverComplete" type="Boolean" mandatory="false" since="2.0">
<description>
If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
If omitted the value will be assumed as FALSE.
</description>
</param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false" since="2.0">
<description>
Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
If omitted on supported displays, the currently displayed SoftButton values will not change.
@@ -5288,7 +5725,7 @@
</param>
</function>
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5310,7 +5747,7 @@
</param>
</function>
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request" since="2.0">
<param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
<description>An array of text chunks of type TTSChunk. See TTSChunk</description>
</param>
@@ -5319,7 +5756,7 @@
</param>
</function>
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5344,7 +5781,7 @@
</param>
</function>
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request" since="2.0">
<param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
</param>
<param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
@@ -5352,7 +5789,7 @@
</param>
</function>
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5374,32 +5811,29 @@
</param>
</function>
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request" since="2.0">
<param name="language" type="Language" mandatory="true">
<description>Requested voice engine (VR+TTS) language registration</description>
</param>
<param name="hmiDisplayLanguage" type="Language" mandatory="true">
<description>Request display language registration</description>
</param>
- <param name="appName" type="String" maxlength="100" mandatory="false">
+ <param name="appName" type="String" maxlength="100" mandatory="false" since="3.0">
<description>Request new app name registration</description>
</param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
<description>Request new ttsName registration</description>
</param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="3.0">
<description>Request new app short name registration</description>
</param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
<description>Request new VR synonyms registration</description>
</param>
</function>
-
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
-
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response" since="2.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description>
true, if successful
@@ -5425,7 +5859,7 @@
</function>
- <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
+ <function name="GenericResponse" functionID="GenericResponseID" messagetype="response" since="1.0">
<description>
Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
Currently, only resultCode INVALID_DATA is used.
@@ -5444,7 +5878,7 @@
</param>
</function>
- <function name="PutFile" functionID="PutFileID" messagetype="request">
+ <function name="PutFile" functionID="PutFileID" messagetype="request" since="3.0">
<description>
Used to push a binary data onto the module from a mobile device, such as icons and album art
Not supported on first generation of SDL enabled modules.
@@ -5486,12 +5920,12 @@
If offset is set to 0, then length is the total length of the file to be downloaded
</description>
</param>
- <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false">
+ <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false" since="5.0">
<description> Additional CRC32 checksum to protect data integrity up to 512 Mbits . </description>
</param>
</function>
- <function name="PutFile" functionID="PutFileID" messagetype="response">
+ <function name="PutFile" functionID="PutFileID" messagetype="response" since="3.0">
<description>Response is sent, when the file data was copied (success case). Or when an error occurred.</description>
<description>Not supported on first generation SDL enabled vehicles. </description>
<param name="success" type="Boolean" platform="documentation" mandatory="true">
@@ -5523,7 +5957,7 @@
</param>
</function>
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="request" since="3.0">
<description>
Used to delete a file resident on the module in the app's local cache.
Not supported on first generation SDL enabled vehicles.
@@ -5535,7 +5969,7 @@
</function>
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="response" since="3.0">
<description>
Response is sent, when the file data was deleted (success case). Or when an error occurred.
Not supported on First generation SDL enabled vehicles.
@@ -5565,14 +5999,14 @@
</param>
</function>
- <function name="ListFiles" functionID="ListFilesID" messagetype="request">
+ <function name="ListFiles" functionID="ListFilesID" messagetype="request" since="3.0">
<description>
Requests the current list of resident filenames for the registered app.
Not supported on first generation SDL enabled vehicles.
</description>
</function>
- <function name="ListFiles" functionID="ListFilesID" messagetype="response">
+ <function name="ListFiles" functionID="ListFilesID" messagetype="response" since="3.0">
<description>
Returns the current list of resident filenames for the registered app along with the current space available
Not supported on First generation SDL enabled vehicles.
@@ -5609,7 +6043,7 @@
</param>
</function>
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request" since="3.0">
<description>
Used to set existing local file on the module as the app's icon
Not supported on first generation SDL enabled vehicles.
@@ -5621,7 +6055,7 @@
</function>
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response" since="3.0">
<description>
Response is sent, when the file data was copied (success case). Or when an error occurred.
Not supported on First generation SDL enabled vehicles.
@@ -5649,7 +6083,7 @@
</function>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0">
<description>
Used to set an alternate display layout.
If not sent, default screen for given platform will be shown
@@ -5662,12 +6096,12 @@
</description>
</param>
- <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false"/>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
- <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false"/>
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
</function>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
@@ -5694,11 +6128,11 @@
</param>
<param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
</param>
<param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
</param>
<param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
@@ -5707,7 +6141,7 @@
</function>
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" >
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" since="3.0">
<description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)</description>
<param name="requestType" type="RequestType" mandatory="true">
<description>
@@ -5715,7 +6149,7 @@
Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
</description>
</param>
- <param name="requestSubType" type="String" maxlength="255" mandatory="false">
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
<description>
This parameter is filled for supporting OEM proprietary data exchanges.
</description>
@@ -5729,7 +6163,7 @@
</param>
</function>
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" >
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5755,7 +6189,7 @@
</param>
</function>
- <function name="SendLocation" functionID="SendLocationID" messagetype="request">
+ <function name="SendLocation" functionID="SendLocationID" messagetype="request" since="3.0">
<param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
</param>
<param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
@@ -5786,21 +6220,21 @@
</description>
</param>
- <param name="timeStamp" type="DateTime" mandatory="false">
+ <param name="timeStamp" type="DateTime" mandatory="false" since="4.1">
<description>
timestamp in ISO 8601 format
</description>
</param>
- <param name="address" type="OASISAddress" mandatory="false">
+ <param name="address" type="OASISAddress" mandatory="false" since="4.1">
<description>Address to be used for setting destination</description>
</param>
- <param name="deliveryMode" type="DeliveryMode" mandatory="false">
+ <param name="deliveryMode" type="DeliveryMode" mandatory="false" since="4.1">
<description>Defines the mode of prompt for user</description>
</param>
</function>
- <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5823,7 +6257,7 @@
</param>
</function>
- <function name="DialNumber" functionID="DialNumberID" messagetype="request">
+ <function name="DialNumber" functionID="DialNumberID" messagetype="request" since="3.0">
<description>Dials a phone number and switches to phone application.</description>
<param name="number" type="String" maxlength="40" mandatory="true">
@@ -5834,7 +6268,7 @@
</param>
</function>
- <function name="DialNumber" functionID="DialNumberID" messagetype="response">
+ <function name="DialNumber" functionID="DialNumberID" messagetype="response" since="3.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
@@ -5856,7 +6290,7 @@
</param>
</function>
- <function name="ButtonPress" functionID="ButtonPressID" messagetype="request">
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="request" since="4.5">
<param name="moduleType" type="ModuleType" mandatory="true">
<description>The module where the button should be pressed</description>
</param>
@@ -5868,7 +6302,7 @@
</param>
</function>
- <function name="ButtonPress" functionID="ButtonPressID" messagetype="response">
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="response" since="4.5">
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
@@ -5889,22 +6323,25 @@
</param>
</function>
- <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request">
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request" since="4.5">
<param name="moduleType" type="ModuleType" mandatory="true">
<description>
The type of a RC module to retrieve module data from the vehicle.
In the future, this should be the Identification of a module.
</description>
</param>
- <param name="subscribe" type="Boolean" mandatory="false">
+ <param name="subscribe" type="Boolean" mandatory="false" since="5.0">
<description>
If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
</description>
+ <history>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false" since="4.5" until="5.0"/>
+ </history>
</param>
</function>
- <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response">
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response" since="4.5">
<param name="moduleData" type="ModuleData" mandatory="true">
</param>
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
@@ -5935,13 +6372,13 @@
</param>
</function>
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request" since="4.5">
<param name="moduleData" type="ModuleData" mandatory="true">
<description>The module data to set for the requested RC module.</description>
</param>
</function>
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response">
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response" since="4.5">
<description>Used to set the values of one remote control module </description>
<param name="moduleData" type="ModuleData" mandatory="true">
</param>
@@ -5968,11 +6405,11 @@
</param>
</function>
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request" since="4.1">
<description>To subscribe in getting changes for Waypoints/destinations</description>
</function>
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response" since="4.1">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -5991,14 +6428,14 @@
</param>
</function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request" since="4.1">
<description>Request for getting waypoint/destination data.</description>
<param name="wayPointType" type="WayPointType" mandatory="true">
<description>To request for either the destination only or for all waypoints including destination</description>
</param>
</function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response" since="4.1">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -6022,11 +6459,11 @@
</param>
</function>
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request" since="4.1">
<description>Request to unsubscribe from WayPoints and Destination</description>
</function>
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response">
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response" since="4.1">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -6048,14 +6485,14 @@
</param>
</function>
- <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request">
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request" since="4.5">
<description>Request for expanded information about a supported system/HMI capability</description>
<param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
<description>The type of system capability to get more information on</description>
</param>
</function>
- <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response">
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
<param name="systemCapability" type="SystemCapability" mandatory="true">
</param>
<param name="resultCode" type="Result" platform="documentation" mandatory="true">
@@ -6085,14 +6522,14 @@
</param>
</function>
- <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request">
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request" since="4.5">
<description>Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
<param name="hapticRectData" type="HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
<description>Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared</description>
</param>
</function>
- <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response">
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response" since="4.5">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true if successful; false if failed </description>
</param>
@@ -6108,7 +6545,7 @@
<!-- Notifications -->
- <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
<param name="hmiLevel" type="HMILevel" mandatory="true">
<description>See HMILevel</description>
</param>
@@ -6120,40 +6557,40 @@
<param name="systemContext" type="SystemContext" mandatory="true">
<description>See SystemContext</description>
</param>
- <param name="videoStreamingState" type="VideoStreamingState" mandatory="false" defvalue="STREAMABLE">
+ <param name="videoStreamingState" type="VideoStreamingState" mandatory="false" defvalue="STREAMABLE" since="5.0">
<description>See VideoStreamingState. If it is NOT_STREAMABLE, the app must stop streaming video to SDL.</description>
</param>
</function>
- <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification" since="1.0">
<param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
<description>See AppInterfaceUnregisteredReason</description>
</param>
</function>
- <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification">
+ <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification" since="1.0">
<description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
<param name="buttonName" type="ButtonName" mandatory="true"/>
<param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
<description>Indicates whether this is an UP or DOWN event.</description>
</param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
<description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
</param>
</function>
- <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification">
+ <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification" since="1.0">
<description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
<param name="buttonName" type="ButtonName" mandatory="true"/>
<param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
<description>Indicates whether this is a LONG or SHORT button press event.</description>
</param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
<description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
</param>
</function>
- <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification">
+ <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification" since="2.0">
<description>Callback for the periodic and non periodic vehicle data read function.</description>
<param name="gps" type="GPSData" mandatory="false">
<description>See GPSData</description>
@@ -6173,13 +6610,13 @@
<param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
<description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
</param>
<param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- <param name="turnSignal" type="TurnSignal" mandatory="false">
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
<description>See TurnSignal</description>
</param>
<param name="vin" type="String" maxlength="17" mandatory="false">
@@ -6221,10 +6658,10 @@
<param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false">
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
<description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
</param>
@@ -6249,7 +6686,7 @@
</function>
- <function name="OnCommand" functionID="OnCommandID" messagetype="notification">
+ <function name="OnCommand" functionID="OnCommandID" messagetype="notification" since="1.0">
<param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>Command ID, which is related to a specific menu entry</description>
</param>
@@ -6259,32 +6696,32 @@
</param>
</function>
- <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" >
+ <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" since="1.0">
<description>Provides applications with notifications specific to the current TBT client status on the module</description>
<param name="state" type="TBTState" mandatory="true">
<description>Current State of TBT client</description>
</param>
</function>
- <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" >
+ <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" since="1.0">
<description>Provides driver distraction state to mobile applications</description>
<param name="state" type="DriverDistractionState" mandatory="true">
<description>Current State of Driver Distraction</description>
</param>
</function>
- <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" >
+ <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" since="2.0">
<description>Provides update to app of which policy-table-enabled functions are available</description>
<param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true" mandatory="true">
<description>Change in permissions for a given set of RPCs</description>
</param>
</function>
- <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification">
+ <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification" since="2.0">
<description>Binary data is in binary part of hybrid msg</description>
</function>
- <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification">
+ <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification" since="2.0">
<param name="language" type="Language" mandatory="true">
<description>Current SDL voice engine (VR+TTS) language</description>
</param>
@@ -6293,7 +6730,7 @@
</param>
</function>
- <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" >
+ <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" since="3.0">
<description>On-screen keyboard event.</description>
<description>Can be full string or individual keypresses depending on keyboard mode.</description>
@@ -6311,7 +6748,7 @@
</function>
- <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" >
+ <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" since="3.0">
<description>Notifies about touch events on the screen's prescribed area</description>
<param name="type" type="TouchType" mandatory="true">
<description>The type of touch event.</description>
@@ -6321,7 +6758,7 @@
</param>
</function>
- <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" >
+ <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" since="3.0">
<description>
An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
@@ -6329,7 +6766,7 @@
<param name="requestType" type="RequestType" mandatory="true">
<description>The type of system request.</description>
</param>
- <param name="requestSubType" type="String" maxlength="255" mandatory="false">
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
<description>
This parameter is filled for supporting OEM proprietary data exchanges.
</description>
@@ -6358,7 +6795,7 @@
</param>
</function>
- <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
+ <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification" since="3.0">
<description>
Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
@@ -6368,19 +6805,19 @@
</param>
</function>
- <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
+ <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification" since="4.1">
<description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
<param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
<description>See LocationDetails</description>
</param>
</function>
- <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification">
+ <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification" since="4.5">
<param name="moduleData" type="ModuleData" mandatory="true">
</param>
</function>
- <function name="OnRCStatus" functionID="OnRCStatusID" messagetype="notification">
+ <function name="OnRCStatus" functionID="OnRCStatusID" messagetype="notification" since="5.0">
<description>Issued by SDL to notify the application about remote control status change on SDL</description>
<param name="allowed" type="Boolean" mandatory="false">
<description>
@@ -6399,7 +6836,7 @@
<!-- Ford Specific APIs -->
<!-- ~~~~~~~~~~~~~~~~~~ -->
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" >
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" since="1.0">
<description>
Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
Legacy / v1 Protocol implementation; use SyncPData instead.
@@ -6412,7 +6849,7 @@
</param>
</function>
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" >
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" since="1.0">
<param name="success" type="Boolean" platform="documentation" mandatory="true">
<description> true, if successful; false, if failed </description>
</param>
@@ -6463,7 +6900,7 @@
</function>
-->
- <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" >
+ <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" since="1.0">
<description>
Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.
Legacy / v1 Protocol implementation; responds to EncodedSyncPData.
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h
index e446c0b2e3..6f916b7cd0 100644
--- a/src/components/policy/policy_external/include/policy/policy_helper.h
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -255,8 +255,26 @@ struct FillNotificationData {
const std::set<Parameter>& target);
void InitRpcKeys(const std::string& rpc_name);
bool RpcParametersEmpty(RpcPermissions& rpc);
- bool IsSectionEmpty(ParameterPermissions& permissions,
- const std::string& section);
+
+ /**
+ * @brief Checks if specific section in specified permissions is empty
+ * @param permissions reference to the permissions structure
+ * @param section reference to the section name
+ * @return true if specified section in permissions is empty otherwise returns
+ * false
+ */
+ bool IsSectionEmpty(const ParameterPermissions& permissions,
+ const std::string& section) const;
+
+ /**
+ * @brief Checks if at least one parameter is allowed for the specified
+ * permissions
+ * @param permissions reference to the permissions structure
+ * @return true if at least one parameter is allowed for the specified
+ * permissions otherwise returns false
+ */
+ bool IsSomeParameterAllowed(const ParameterPermissions& permissions) const;
+
std::string current_key_;
Permissions& data_;
const bool does_require_user_consent_;
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index d13c545a94..5fc43603d8 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -167,7 +167,14 @@ bool IsValidEnum(Input val);
const char* EnumToJsonString(Input val);
bool EnumFromJsonString(const std::string& literal, Input* result);
-enum ModuleType { MT_CLIMATE, MT_RADIO, MT_SEAT };
+enum ModuleType {
+ MT_CLIMATE,
+ MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS
+};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
index 7246bec800..26af165506 100644
--- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
@@ -98,8 +98,7 @@
<typedef name="HmiLevels" type="HmiLevel" array="true"
maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
+ <typedef name="Parameters" type="Parameter" array="true"/>
<struct name="RpcParameters">
<!-- maxsizes are equal to number of currently known elements of
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
index ed12cdde3a..2358c54bef 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -620,7 +620,16 @@ void FillNotificationData::UpdateParameters(
ParametersConstItr it_parameters = in_parameters.begin();
ParametersConstItr it_parameters_end = in_parameters.end();
- // Due to APPLINK-24201 SDL must consider cases when 'parameters' section is
+ // To determine consent for a particular RPC in a particular HMI level with
+ // particular parameters (if applicable), the system shall find all of the
+ // functional groups the RPC is included in. If user consent is needed as
+ // listed within the functional group in the policy table, the system shall
+ // use a logical AND: backend permissions AND User permissions. If the RPC is
+ // listed under more than one group, the system shall perform a logical OR
+ // amongst all of the possible allowed permissions scenarios for the RPC (and
+ // parameter/or HMI level) defined by each of the functional groups.
+
+ // Due to requirements SDL must consider cases when 'parameters' section is
// not present for RPC or present, but is empty.
// If 'parameters' section is like: 'parameters' : []
@@ -635,10 +644,8 @@ void FillNotificationData::UpdateParameters(
// If 'parameters' section is omitted
if (!in_parameters.is_initialized()) {
- if (!does_require_user_consent_) {
- out_parameter.any_parameter_allowed = true;
- }
- if (does_require_user_consent_ && kAllowedKey == current_key_) {
+ if (!does_require_user_consent_ ||
+ (does_require_user_consent_ && kAllowedKey == current_key_)) {
out_parameter.any_parameter_allowed = true;
}
}
@@ -647,6 +654,13 @@ void FillNotificationData::UpdateParameters(
out_parameter[current_key_].insert(
policy_table::EnumToJsonString(*it_parameters));
}
+
+ // We should reset ALL DISALLOWED flags if at least one parameter is allowed
+ // due to a logical OR permissions check
+ if (IsSomeParameterAllowed(out_parameter)) {
+ out_parameter.any_parameter_disallowed_by_policy = false;
+ out_parameter.any_parameter_disallowed_by_user = false;
+ }
}
void FillNotificationData::ExcludeSame(RpcPermissions& rpc) {
@@ -769,16 +783,24 @@ bool FillNotificationData::RpcParametersEmpty(RpcPermissions& rpc) {
no_user_disallowed_parameters;
}
-bool FillNotificationData::IsSectionEmpty(ParameterPermissions& permissions,
- const std::string& section) {
+bool FillNotificationData::IsSectionEmpty(
+ const ParameterPermissions& permissions, const std::string& section) const {
ParameterPermissions::const_iterator it_section = permissions.find(section);
ParameterPermissions::const_iterator end = permissions.end();
if (end != it_section) {
- return permissions[section].empty();
+ return it_section->second.empty();
}
return true;
}
+bool FillNotificationData::IsSomeParameterAllowed(
+ const ParameterPermissions& permissions) const {
+ const bool are_any_consented_parameters_allowed =
+ kAllowedKey == current_key_ && !IsSectionEmpty(permissions, current_key_);
+ return permissions.any_parameter_allowed ||
+ are_any_consented_parameters_allowed;
+}
+
ProcessFunctionalGroup::ProcessFunctionalGroup(
const policy_table::FunctionalGroupings& fg,
const std::vector<FunctionalGroupPermission>& group_permissions,
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index 58bae43000..c2b304df67 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -771,6 +771,12 @@ bool IsValidEnum(ModuleType val) {
return true;
case MT_RADIO:
return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
case MT_SEAT:
return true;
default:
@@ -783,6 +789,12 @@ const char* EnumToJsonString(ModuleType val) {
return "CLIMATE";
case MT_RADIO:
return "RADIO";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
case MT_SEAT:
return "SEAT";
default:
@@ -800,6 +812,15 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("SEAT" == literal) {
*result = MT_SEAT;
return true;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
} else {
return false;
}
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index 537e40e170..4ef6ed3e10 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -757,18 +757,18 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in LIMITED level
policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
@@ -778,9 +778,9 @@ TEST_F(PolicyManagerImplTest2,
input_params,
output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
// Reset output
ResetOutputList(output);
@@ -845,17 +845,17 @@ TEST_F(PolicyManagerImplTest2,
policy_manager_->CheckPermissions(
application_id_, kHmiLevelFull, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in LIMITED level
policy_manager_->CheckPermissions(
application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
ResetOutputList(output);
// Rpc in BACKGROUND level
@@ -864,9 +864,9 @@ TEST_F(PolicyManagerImplTest2,
"SendLocation",
input_params,
output);
- EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
- EXPECT_TRUE(output.list_of_allowed_params.empty());
- EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
// Reset output
ResetOutputList(output);
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index 8d81a742e4..4107fad398 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -153,7 +153,14 @@ bool IsValidEnum(Input val);
const char* EnumToJsonString(Input val);
bool EnumFromJsonString(const std::string& literal, Input* result);
-enum ModuleType { MT_CLIMATE, MT_RADIO, MT_SEAT };
+enum ModuleType {
+ MT_CLIMATE,
+ MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS
+};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h
index 4737707e09..e201251745 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -65,7 +65,7 @@ typedef Array<Enum<AppHMIType>, 0, 255> AppHMITypes;
typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
-typedef Array<Enum<Parameter>, 0, 24> Parameters;
+typedef Array<Enum<Parameter>, 0, 255> Parameters;
typedef Map<RpcParameters, 0, UINT_MAX> Rpc;
diff --git a/src/components/policy/policy_regular/policy_table_interface_ext.xml b/src/components/policy/policy_regular/policy_table_interface_ext.xml
index a6a5b343c2..7a751c0ea9 100644
--- a/src/components/policy/policy_regular/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_regular/policy_table_interface_ext.xml
@@ -94,8 +94,7 @@
<typedef name="HmiLevels" type="HmiLevel" array="true"
maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
+ <typedef name="Parameters" type="Parameter" array="true"/>
<struct name="RpcParameters">
<!-- maxsizes are equal to number of currently known elements of
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 2f5ba69ad7..83ace2feb2 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -643,6 +643,12 @@ bool IsValidEnum(ModuleType val) {
return true;
case MT_SEAT:
return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
default:
return false;
}
@@ -655,6 +661,12 @@ const char* EnumToJsonString(ModuleType val) {
return "RADIO";
case MT_SEAT:
return "SEAT";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
default:
return "";
}
@@ -670,9 +682,17 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("SEAT" == literal) {
*result = MT_SEAT;
return true;
- } else {
- return false;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
}
+ return false;
}
const std::string kDefaultApp = "default";
diff --git a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
index be81493e7a..cb52c9d375 100644
--- a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
@@ -52,19 +52,6 @@ class ProtocolHandlerImpl;
*/
class HandshakeHandler : public security_manager::SecurityManagerListener {
public:
- DEPRECATED HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
- SessionObserver& session_observer,
- uint32_t connection_key,
- ConnectionID connection_id,
- uint8_t session_id,
- uint8_t protocol_version,
- uint32_t hash_id,
- ServiceType service_type,
- const std::vector<int>& force_protected_service,
- const bool is_new_service,
- utils::SemanticVersion& full_version,
- std::shared_ptr<BsonObject> payload);
-
HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
SessionObserver& session_observer,
utils::SemanticVersion& full_version,
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
index e763be8c1b..3e7d64e9d2 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
@@ -418,27 +418,6 @@ class ProtocolHandlerImpl
SessionObserver& get_session_observer() OVERRIDE;
/**
- * \brief Called by connection handler to notify the result of
- * OnSessionStartedCallback().
- * \param connection_id Identifier of connection within which session exists
- * \param session_id session ID passed to OnSessionStartedCallback()
- * \param generated_session_id Generated session ID, will be 0 if session is
- * not started
- * \param hash_id Generated Hash ID
- * \param protection whether the service will be protected
- * \param rejected_params list of parameters' name that are rejected.
- * Only valid when generated_session_id is 0. Note, even if
- * generated_session_id is 0, the list may be empty.
- */
- DEPRECATED void NotifySessionStartedResult(
- int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params) OVERRIDE;
-
- /**
* @brief Called by connection handler to notify the result of
* OnSessionStartedCallback().
* @param context reference to structure with started session data
@@ -649,9 +628,6 @@ class ProtocolHandlerImpl
RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet);
- DEPRECATED RESULT_CODE
- HandleControlMessageStartSession(const ProtocolPacket& packet);
-
RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet);
RESULT_CODE HandleControlMessageRegisterSecondaryTransport(
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
index f6ab08319e..775d77db66 100644
--- a/src/components/protocol_handler/src/handshake_handler.cc
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -43,26 +43,6 @@ namespace protocol_handler {
CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
-HandshakeHandler::HandshakeHandler(
- ProtocolHandlerImpl& protocol_handler,
- SessionObserver& session_observer,
- uint32_t connection_key,
- ConnectionID connection_id,
- uint8_t session_id,
- uint8_t protocol_version,
- uint32_t hash_id,
- ServiceType service_type,
- const std::vector<int>& force_protected_service,
- const bool is_new_service,
- utils::SemanticVersion& full_version,
- std::shared_ptr<BsonObject> payload)
- : protocol_handler_(protocol_handler)
- , session_observer_(session_observer)
- , context_()
- , full_version_(full_version)
- , protocol_version_(protocol_version)
- , payload_(payload) {}
-
HandshakeHandler::HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
SessionObserver& session_observer,
utils::SemanticVersion& full_version,
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 0e49e28397..b595c977aa 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -290,6 +290,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
static_cast<int64_t>(
protocol_header_validator_.max_payload_size_by_service_type(
serviceTypeValue)));
+ UNUSED(mtu_written)
LOG4CXX_DEBUG(logger_,
"MTU parameter was written to bson params: "
<< mtu_written << "; Value: "
@@ -300,6 +301,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
// Hash ID is only used in RPC case
const bool hash_written = bson_object_put_int32(
&params, strings::hash_id, static_cast<int32_t>(hash_id));
+ UNUSED(hash_written);
LOG4CXX_DEBUG(logger_,
"Hash parameter was written to bson params: "
<< hash_written << "; Value: "
@@ -317,6 +319,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
const bool protocol_ver_written = bson_object_put_string(
&params, strings::protocol_version, protocolVersionString);
+ UNUSED(protocol_ver_written);
LOG4CXX_DEBUG(
logger_,
"Protocol version parameter was written to bson params: "
@@ -1546,166 +1549,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
return RESULT_OK;
}
-// Suppress warning for deprecated method used within another deprecated method
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
- const ProtocolPacket& packet) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(
- logger_,
- "Protocol version:" << static_cast<int>(packet.protocol_version()));
- const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
-
-#ifdef ENABLE_SECURITY
- const bool protection =
- // Protocol version 1 is not support protection
- (packet.protocol_version() > PROTOCOL_VERSION_1)
- ? packet.protection_flag()
- : false;
-#else
- const bool protection = false;
-#endif // ENABLE_SECURITY
-
- uint32_t hash_id;
- const ConnectionID connection_id = packet.connection_id();
- const uint32_t session_id = session_observer_.OnSessionStartedCallback(
- connection_id, packet.session_id(), service_type, protection, &hash_id);
-
- if (0 == session_id) {
- LOG4CXX_WARN(logger_,
- "Refused by session_observer to create service "
- << static_cast<int32_t>(service_type) << " type.");
- SendStartSessionNAck(connection_id,
- packet.session_id(),
- packet.protocol_version(),
- packet.service_type());
- return RESULT_OK;
- }
-
-#ifdef ENABLE_SECURITY
- // for packet is encrypted and security plugin is enable
- if (protection && security_manager_) {
- const uint32_t connection_key =
- session_observer_.KeyFromPair(connection_id, session_id);
-
- security_manager::SSLContext* ssl_context =
- security_manager_->CreateSSLContext(
- connection_key, security_manager::SecurityManager::kUseExisting);
- if (!ssl_context) {
- const std::string error("CreateSSLContext failed");
- LOG4CXX_ERROR(logger_, error);
- security_manager_->SendInternalError(
- connection_key,
- security_manager::SecurityManager::ERROR_INTERNAL,
- error);
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
- return RESULT_OK;
- }
- utils::SemanticVersion* fullVersion;
- std::vector<std::string> rejectedParams(0, std::string(""));
- // Can't check protocol_version because the first packet is v1, but there
- // could still be a payload, in which case we can get the real protocol
- // version
- if (packet.service_type() == kRpc && packet.data_size() != 0) {
- BsonObject obj = bson_object_from_bytes(packet.data());
- fullVersion = new utils::SemanticVersion(
- std::string(bson_object_get_string(&obj, "protocolVersion")));
- bson_object_deinitialize(&obj);
- // Constructed payloads added in Protocol v5
- if (fullVersion->major_version_ < PROTOCOL_VERSION_5) {
- rejectedParams.push_back(std::string("protocolVersion"));
- }
- } else {
- fullVersion = new utils::SemanticVersion();
- }
- if (!rejectedParams.empty()) {
- SendStartSessionNAck(connection_id,
- packet.session_id(),
- packet.protocol_version(),
- packet.service_type(),
- rejectedParams);
- } else if (ssl_context->IsInitCompleted()) {
- // mark service as protected
- session_observer_.SetProtectionFlag(connection_key, service_type);
- // Start service as protected with current SSLContext
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_ON,
- *fullVersion);
- } else {
- security_manager_->AddListener(
- new HandshakeHandler(*this,
- session_observer_,
- connection_key,
- connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- service_type,
- get_settings().force_protected_service(),
- false,
- *fullVersion,
- NULL));
- if (!ssl_context->IsHandshakePending()) {
- // Start handshake process
- security_manager_->StartHandshake(connection_key);
- }
- }
- delete fullVersion;
- LOG4CXX_DEBUG(logger_,
- "Protection establishing for connection "
- << connection_key << " is in progress");
- return RESULT_OK;
- }
-#endif // ENABLE_SECURITY
- if (packet.service_type() == kRpc && packet.data_size() != 0) {
- BsonObject obj = bson_object_from_bytes(packet.data());
- utils::SemanticVersion fullVersion(
- bson_object_get_string(&obj, "protocolVersion"));
- bson_object_deinitialize(&obj);
-
- if (fullVersion.major_version_ >= PROTOCOL_VERSION_5) {
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF,
- fullVersion);
- } else {
- std::vector<std::string> rejectedParams(1,
- std::string("protocolVersion"));
- SendStartSessionNAck(connection_id,
- packet.session_id(),
- packet.protocol_version(),
- packet.service_type(),
- rejectedParams);
- }
-
- } else {
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
- }
- return RESULT_OK;
-}
-#pragma GCC diagnostic pop
-
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1795,24 +1638,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageRegisterSecondaryTransport(
return RESULT_OK;
}
-void ProtocolHandlerImpl::NotifySessionStartedResult(
- int32_t connection_id,
- uint8_t session_id,
- uint8_t generated_session_id,
- uint32_t hash_id,
- bool protection,
- std::vector<std::string>& rejected_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- protocol_handler::SessionContext context(connection_id,
- connection_id,
- session_id,
- generated_session_id,
- ServiceType::kInvalidServiceType,
- hash_id,
- protection);
- NotifySessionStarted(context, rejected_params);
-}
-
void ProtocolHandlerImpl::NotifySessionStarted(
const SessionContext& context, std::vector<std::string>& rejected_params) {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/security_manager/include/security_manager/security_manager_impl.h b/src/components/security_manager/include/security_manager/security_manager_impl.h
index 70b87de0ef..c53d39ba87 100644
--- a/src/components/security_manager/include/security_manager/security_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/security_manager_impl.h
@@ -195,12 +195,6 @@ class SecurityManagerImpl : public SecurityManager,
* @brief Notifiers for listeners.
* Allows to notify that certificate should be updated
*/
- DEPRECATED void NotifyOnCertififcateUpdateRequired();
-
- /**
- * @brief Notifiers for listeners.
- * Allows to notify that certificate should be updated
- */
void NotifyOnCertificateUpdateRequired() OVERRIDE;
/**
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index c5d14406a9..70f835fb93 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -403,10 +403,6 @@ void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
}
}
-void SecurityManagerImpl::NotifyOnCertififcateUpdateRequired() {
- NotifyOnCertificateUpdateRequired();
-}
-
void SecurityManagerImpl::NotifyOnCertificateUpdateRequired() {
LOG4CXX_AUTO_TRACE(logger_);
std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
index a7b93012bb..a6cd1cb4ed 100644
--- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
@@ -47,13 +47,6 @@ class CAlwaysFalseSchemaItem : public ISchemaItem {
* @return Shared pointer to a new schema item.
**/
static std::shared_ptr<CAlwaysFalseSchemaItem> create();
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
* @brief Validate smart object.
diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
index b025723ea6..5651cffc9e 100644
--- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
@@ -47,13 +47,6 @@ class CAlwaysTrueSchemaItem : public ISchemaItem {
* @return Shared pointer to a new schema item.
**/
static std::shared_ptr<CAlwaysTrueSchemaItem> create();
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
* @brief Validate smart object.
diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h
index 4dc416007a..d92283ba76 100644
--- a/src/components/smart_objects/include/smart_objects/array_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h
@@ -64,17 +64,6 @@ class CArraySchemaItem : public ISchemaItem {
TSchemaItemParameter<size_t>());
/**
- * @deprecated
- *
- * @brief Validate smart object.
- *
- * @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
-
- /**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h
index 7d5b33b1a6..2b0802ee7e 100644
--- a/src/components/smart_objects/include/smart_objects/default_shema_item.h
+++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h
@@ -49,14 +49,6 @@ class CDefaultSchemaItem : public ISchemaItem {
public:
typedef TSchemaItemParameter<Type> ParameterType;
/**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
-
- /**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
@@ -110,12 +102,6 @@ CDefaultSchemaItem<Type>::CDefaultSchemaItem(const ParameterType& DefaultValue)
: mDefaultValue(DefaultValue) {}
template <typename Type>
-Errors::eType CDefaultSchemaItem<Type>::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-template <typename Type>
Errors::eType CDefaultSchemaItem<Type>::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
index 41102933f3..52301656e1 100644
--- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
@@ -102,13 +102,6 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
ElementSignatures,
const TSchemaItemParameter<EnumType>& DefaultValue =
TSchemaItemParameter<EnumType>());
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
* @brief Validate smart object.
@@ -286,12 +279,6 @@ TEnumSchemaItem<EnumType>::createWithSignatures(
}
template <typename EnumType>
-Errors::eType TEnumSchemaItem<EnumType>::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-template <typename EnumType>
const ElementSignature TEnumSchemaItem<EnumType>::getSignature(
const std::vector<ElementSignature>& signatures,
const utils::SemanticVersion& MessageVersion) {
diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h
index 0f3246ef5f..dff3617246 100644
--- a/src/components/smart_objects/include/smart_objects/number_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h
@@ -66,14 +66,6 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
TSchemaItemParameter<NumberType>());
/**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
-
- /**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
@@ -143,13 +135,6 @@ bool TNumberSchemaItem<NumberType>::isValidNumberType(SmartType type) {
template <typename NumberType>
Errors::eType TNumberSchemaItem<NumberType>::validate(
- const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
-template <typename NumberType>
-Errors::eType TNumberSchemaItem<NumberType>::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
const utils::SemanticVersion& MessageVersion) {
diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
index 4785211694..ddb34ea518 100644
--- a/src/components/smart_objects/include/smart_objects/object_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h
@@ -103,13 +103,6 @@ class CObjectSchemaItem : public ISchemaItem {
* @return Shared pointer to a new schema item.
**/
static std::shared_ptr<CObjectSchemaItem> create(const Members& Members);
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
* @brief Validate smart object.
diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h
index 2e951f7f9f..5626b0cf23 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -39,6 +39,7 @@
#include "smart_objects/errors.h"
#include <memory>
+#include <vector>
#include "utils/macro.h"
#include "utils/semantic_version.h"
@@ -52,17 +53,6 @@ class SmartObject;
class ISchemaItem {
public:
/**
- * @deprecated
- *
- * @brief Validate smart object.
- *
- * @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
- **/
- DEPRECATED virtual Errors::eType validate(const SmartObject& Object);
-
- /**
* @brief Validate smart object.
*
* @param Object Object to validate.
diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
index d81e18569f..022dc6cb13 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -35,6 +35,7 @@
#include <set>
#include <string>
+#include <sstream>
#include <vector>
#include <map>
@@ -671,14 +672,6 @@ class SmartObject FINAL {
bool isValid() const;
/**
- * @deprecated
- * @brief Validates object according to attached schema.
- *
- * @return Result of validation.
- */
- DEPRECATED Errors::eType validate();
-
- /**
* @brief Validates object according to attached schema.
*
* @param report__ object for reporting errors during validation
diff --git a/src/components/smart_objects/include/smart_objects/smart_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
index d3fcc0e28d..80a85e1778 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -61,17 +61,6 @@ class CSmartSchema FINAL {
explicit CSmartSchema(const ISchemaItemPtr SchemaItem);
/**
- * @deprecated
- *
- * @brief Validate smart object.
- *
- * @param Object Object to validate.
- *
- * @return NsSmartObjects::Errors::eType
- **/
- DEPRECATED Errors::eType validate(const SmartObject& Object) const;
-
- /**
* @brief Validate smart object.
*
* @param Object Object to validate.
diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h
index dcaad364b2..709cf7d568 100644
--- a/src/components/smart_objects/include/smart_objects/string_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h
@@ -59,13 +59,6 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
TSchemaItemParameter<size_t>(),
const TSchemaItemParameter<std::string>& DefaultValue =
TSchemaItemParameter<std::string>());
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
* @brief Validate smart object.
diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc
index db16640265..9975085b79 100644
--- a/src/components/smart_objects/src/always_false_schema_item.cc
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -41,11 +41,6 @@ std::shared_ptr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
return std::shared_ptr<CAlwaysFalseSchemaItem>(new CAlwaysFalseSchemaItem());
}
-Errors::eType CAlwaysFalseSchemaItem::validate(const SmartObject& object) {
- rpc::ValidationReport report("RPC");
- return validate(object, &report);
-}
-
Errors::eType CAlwaysFalseSchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc
index 0a3b8be134..93c20c9bce 100644
--- a/src/components/smart_objects/src/always_true_schema_item.cc
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -39,10 +39,6 @@ std::shared_ptr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
return std::shared_ptr<CAlwaysTrueSchemaItem>(new CAlwaysTrueSchemaItem());
}
-Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object) {
- return Errors::OK;
-}
-
Errors::eType CAlwaysTrueSchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index 60081c5222..56a52da761 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -42,11 +42,6 @@ std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize));
}
-Errors::eType CArraySchemaItem::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
Errors::eType CArraySchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index 879c280a67..cfe6f58efa 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -104,11 +104,6 @@ std::shared_ptr<CObjectSchemaItem> CObjectSchemaItem::create(
return std::shared_ptr<CObjectSchemaItem>(new CObjectSchemaItem(members));
}
-Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
- rpc::ValidationReport report("RPC");
- return validate(object, &report);
-}
-
Errors::eType CObjectSchemaItem::validate(
const SmartObject& object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index ae7f3665bb..a47fe4d1fb 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -35,10 +35,6 @@
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
-Errors::eType ISchemaItem::validate(const SmartObject& Object) {
- return Errors::ERROR;
-}
-
Errors::eType ISchemaItem::validate(
const SmartObject& object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index 691f45f63b..cf6f290971 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -873,11 +873,6 @@ bool SmartObject::isValid() const {
return (Errors::OK == m_schema.validate(*this, &report));
}
-Errors::eType SmartObject::validate() {
- rpc::ValidationReport report("RPC");
- return validate(&report);
-}
-
Errors::eType SmartObject::validate(
rpc::ValidationReport* report__,
const utils::SemanticVersion& MessageVersion) {
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index 3ab94caf85..62f2101f03 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -40,11 +40,6 @@ CSmartSchema::CSmartSchema() : mSchemaItem(CAlwaysTrueSchemaItem::create()) {}
CSmartSchema::CSmartSchema(const ISchemaItemPtr SchemaItem)
: mSchemaItem(SchemaItem) {}
-Errors::eType CSmartSchema::validate(const SmartObject& Object) const {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
Errors::eType CSmartSchema::validate(
const SmartObject& object,
rpc::ValidationReport* report__,
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
index f3c39eff8f..936db7dbc9 100644
--- a/src/components/smart_objects/src/string_schema_item.cc
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -46,11 +46,6 @@ std::shared_ptr<CStringSchemaItem> CStringSchemaItem::create(
new CStringSchemaItem(MinLength, MaxLength, DefaultValue));
}
-Errors::eType CStringSchemaItem::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
-}
-
Errors::eType CStringSchemaItem::validate(
const SmartObject& Object,
rpc::ValidationReport* report__,
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
index ccdfe3ea2e..ff7b9da9d6 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -87,7 +87,6 @@ class TelemetryMonitor {
virtual void Stop();
virtual void Start();
virtual void SendMetric(std::shared_ptr<MetricWrapper> metric);
- DEPRECATED void set_streamer(Streamer* streamer);
void set_streamer(std::shared_ptr<Streamer> streamer);
const std::string& ip() const;
int16_t port() const;
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index c17b09c567..c101672bbd 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -63,8 +63,6 @@ void TelemetryMonitor::Start() {
thread_ = threads::CreateThread("TelemetryMonitor", streamer_.get());
}
-void TelemetryMonitor::set_streamer(Streamer* streamer) {}
-
void TelemetryMonitor::set_streamer(std::shared_ptr<Streamer> streamer) {
LOG4CXX_AUTO_TRACE(logger_);
if (thread_ && !thread_->is_running()) {
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
index 356776cea9..c1df49f91b 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -245,14 +245,6 @@ class TransportManagerImpl
int Visibility(const bool& on_off) const OVERRIDE;
/**
- * DEPRECATED
- * Must be moved under 'private' section
- * @brief Updates total device list with info from specific transport adapter.
- * @param ta Transport adapter
- */
- void UpdateDeviceList(TransportAdapter* ta);
-
- /**
* @brief OnDeviceListUpdated updates device list and sends appropriate
* notifications to listeners in case of something is changed
* @param ta Transport adapter to check for updated devices state
@@ -501,6 +493,12 @@ class TransportManagerImpl
* @return True if mapping has been updated, otherwise - false
*/
bool UpdateDeviceMapping(TransportAdapter* ta);
+
+ /**
+ * @brief Updates total device list with info from specific transport adapter.
+ * @param ta Transport adapter
+ */
+ void UpdateDeviceList(TransportAdapter* ta);
}; // class TransportManagerImpl
} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
diff --git a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
index 6b7d44ea8d..e2e5b98190 100644
--- a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
+++ b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
@@ -78,6 +78,7 @@ IAP2USBEmulationTransportAdapter::IAP2USBEmulationTransportAdapter(
signal_handler_ = threads::CreateThread("iAP signal handler", delegate);
signal_handler_->start();
const auto result = mkfifo(out_signals_channel, mode);
+ UNUSED(result);
LOG4CXX_DEBUG(logger_, "Out signals channel creation result: " << result);
}
@@ -123,6 +124,7 @@ IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
IAPSignalHandlerDelegate(IAP2USBEmulationTransportAdapter& adapter)
: adapter_(adapter), run_flag_(true), in_(0) {
const auto result = mkfifo(in_signals_channel, mode);
+ UNUSED(result);
LOG4CXX_DEBUG(logger_, "In signals channel creation result: " << result);
}
diff --git a/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
index 29e55b97dd..7f4562004f 100644
--- a/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
+++ b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
@@ -652,6 +652,7 @@ void PlatformSpecificNetworkInterfaceListener::DumpTable() const {
for (auto it = status_table_.begin(); it != status_table_.end(); ++it) {
const std::string ifname = it->first;
const InterfaceStatus& status = it->second;
+ UNUSED(status);
LOG4CXX_DEBUG(
logger_,
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
index c50309d437..9b6b09e44a 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -52,13 +52,9 @@ const char* tc_tcp_ip_address = "tcp_ip_address";
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
namespace {
-// @deprecated DeviceTypes: PASA_AOA, PASA_BLUETOOTH, MME
DeviceTypes devicesType = {
std::make_pair(DeviceType::AOA, std::string("USB_AOA")),
- std::make_pair(DeviceType::PASA_AOA, std::string("USB_AOA")),
std::make_pair(DeviceType::BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(DeviceType::PASA_BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(DeviceType::MME, std::string("USB_IOS")),
std::make_pair(DeviceType::IOS_BT, std::string("BLUETOOTH_IOS")),
std::make_pair(DeviceType::IOS_USB, std::string("USB_IOS")),
std::make_pair(DeviceType::TCP, std::string("WIFI")),
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index abe4edd812..143498205c 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -532,6 +532,8 @@ int TransportManagerImpl::Reinit() {
LOG4CXX_AUTO_TRACE(logger_);
DisconnectAllDevices();
TerminateAllAdapters();
+ device_to_adapter_map_.clear();
+ connection_id_counter_ = 0;
int ret = InitAllAdapters();
return ret;
}
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index ed90c6fb45..a6ded9a186 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -40,6 +40,7 @@ include_directories (
${COMPONENTS_DIR}/protocol_handler/include
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src
)
# dbms
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
index 72d29a9e28..bda83f315f 100644
--- a/src/components/utils/include/utils/signals.h
+++ b/src/components/utils/include/utils/signals.h
@@ -38,11 +38,61 @@ typedef void (*sighandler_t)(int);
#else
#include <signal.h>
#endif
+#include "appMain/low_voltage_signals_handler.h"
namespace utils {
-bool UnsibscribeFromTermination();
-bool WaitTerminationSignals(sighandler_t sig_handler);
+class Signals {
+ public:
+ /**
+ * @brief Unsubscribe thread from termination signals SIGINT and SIGTERM
+ * @return True if thread unsubscribed successfuly, otherwise false
+ */
+ static bool UnsubscribeFromTermination();
+
+ /**
+ * @brief Triggers thread to wait for termination signals SIGINT and SIGTERM
+ * @param sig_handler - handler to work with signals specidied above
+ * @return True if handler handles signals successfuly, otherwise false
+ */
+ static bool WaitTerminationSignals(sighandler_t sig_handler);
+
+ /**
+ * @brief Unsubscribe thread from low voltage signals
+ * SIGLOWVOLTAGE, SIGWAKEUP and SIGIGNOFF
+ * @return True if thread unsubscribed successfuly, otherwise false
+ */
+ static bool UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data);
+
+ /**
+ * @brief Sends signal to specified process
+ * @param signal to send
+ * @param destination process signal to be sent to
+ */
+ static void SendSignal(const int signo, const pid_t pid);
+
+ /**
+ * @brief Creates child process
+ * @return created process id or -1 in case of error
+ */
+ static pid_t Fork();
+
+ /**
+ * @brief Wait for child process to be terminated
+ * @param cpid - process to wait for termination
+ * @param status store status information in the int to which it points
+ * @param options - options for exit form function
+ * detailed options can be found here: https://linux.die.net/man/2/waitpid
+ */
+ static void WaitPid(pid_t cpid, int* status, int options);
+
+ /**
+ * @brief Exits for process
+ * @param status - exit status code
+ */
+ static void ExitProcess(const int status);
+};
} // namespace utils
diff --git a/src/components/utils/src/signals_posix.cc b/src/components/utils/src/signals_posix.cc
index 274c254716..e13dc04f40 100644
--- a/src/components/utils/src/signals_posix.cc
+++ b/src/components/utils/src/signals_posix.cc
@@ -29,13 +29,16 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/wait.h>
#include <csignal>
#include <cstdlib>
#include <stdint.h>
+#include <iostream>
#include "utils/signals.h"
-bool utils::UnsibscribeFromTermination() {
+namespace utils {
+bool Signals::UnsubscribeFromTermination() {
// Disable some system signals receiving in thread
// by blocking those signals
// (system signals processes only in the main thread)
@@ -51,6 +54,42 @@ bool utils::UnsibscribeFromTermination() {
return !pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
}
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ // Disable Low Voltage signals in main thread
+ // due to all further threads will inherit signals mask
+ sigset_t signal_set;
+ sigemptyset(&signal_set);
+ const int SIGLOWVOLTAGE = SIGRTMIN + offset_data.low_voltage_signal_offset;
+ const int SIGWAKEUP = SIGRTMIN + offset_data.wake_up_signal_offset;
+ const int SIGIGNOFF = SIGRTMIN + offset_data.ignition_off_signal_offset;
+ sigaddset(&signal_set, SIGLOWVOLTAGE);
+ sigaddset(&signal_set, SIGWAKEUP);
+ sigaddset(&signal_set, SIGIGNOFF);
+
+ // Set signals mask to be blocked by thread
+ return !pthread_sigmask(SIG_BLOCK, &signal_set, nullptr);
+}
+
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ if (kill(pid, signo) == -1) {
+ std::cerr << "Error sending signal: " << strsignal(signo) << " to " << pid
+ << " .Error: " << strerror(errno) << std::endl;
+ }
+}
+
+pid_t Signals::Fork() {
+ return fork();
+}
+
+void Signals::ExitProcess(const int status) {
+ exit(status);
+}
+
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ waitpid(cpid, status, options);
+}
+
namespace {
bool CatchSIGSEGV(sighandler_t handler) {
struct sigaction act;
@@ -63,7 +102,7 @@ bool CatchSIGSEGV(sighandler_t handler) {
}
} // namespace
-bool utils::WaitTerminationSignals(sighandler_t sig_handler) {
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
sigset_t signal_set;
int sig = -1;
@@ -81,3 +120,4 @@ bool utils::WaitTerminationSignals(sighandler_t sig_handler) {
}
return false;
}
+} // namespace utils
diff --git a/src/components/utils/test/include/utils/mock_signals_posix.h b/src/components/utils/test/include/utils/mock_signals_posix.h
new file mode 100644
index 0000000000..1aad2d5873
--- /dev/null
+++ b/src/components/utils/test/include/utils/mock_signals_posix.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
+#define SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
+
+#include "gmock/gmock.h"
+#include "utils/signals.h"
+#include <signal.h>
+#include "appMain/low_voltage_signals_handler.h"
+
+namespace utils {
+
+class MockSignalsPosix {
+ public:
+ MOCK_METHOD0(UnsubscribeFromTermination, bool());
+ MOCK_METHOD1(WaitTerminationSignals, bool(sighandler_t sig_handler));
+ MOCK_METHOD1(
+ UnsubscribeFromLowVoltageSignals,
+ bool(const main_namespace::LowVoltageSignalsOffset& offset_data));
+ MOCK_METHOD2(SendSignal, void(const int signo, const pid_t pid));
+ MOCK_METHOD0(Fork, pid_t());
+ MOCK_METHOD1(ExitProcess, void(const int status));
+ MOCK_METHOD3(WaitPid, void(pid_t cpid, int* status, int options));
+
+ static MockSignalsPosix* signals_posix_mock();
+};
+
+} // namespace utils
+#endif // SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_MOCK_SIGNALS_POSIX_H_
diff --git a/src/components/utils/test/mock_signals_posix.cc b/src/components/utils/test/mock_signals_posix.cc
new file mode 100644
index 0000000000..47531b4a9f
--- /dev/null
+++ b/src/components/utils/test/mock_signals_posix.cc
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "utils/mock_signals_posix.h"
+#include "utils/signals.h"
+
+namespace utils {
+
+bool Signals::UnsubscribeFromTermination() {
+ return MockSignalsPosix::signals_posix_mock()->UnsubscribeFromTermination();
+}
+
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
+ return MockSignalsPosix::signals_posix_mock()->WaitTerminationSignals(
+ sig_handler);
+}
+
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ return MockSignalsPosix::signals_posix_mock()
+ ->UnsubscribeFromLowVoltageSignals(offset_data);
+}
+
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ MockSignalsPosix::signals_posix_mock()->SendSignal(signo, pid);
+}
+
+void Signals::ExitProcess(const int status) {
+ MockSignalsPosix::signals_posix_mock()->ExitProcess(status);
+}
+
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ MockSignalsPosix::signals_posix_mock()->WaitPid(cpid, status, options);
+}
+
+pid_t Signals::Fork() {
+ return MockSignalsPosix::signals_posix_mock()->Fork();
+}
+
+MockSignalsPosix* MockSignalsPosix::signals_posix_mock() {
+ static ::testing::NiceMock<MockSignalsPosix> signals_posix_mock;
+ return &signals_posix_mock;
+}
+
+} // namespace utils
diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
index ffb54fdbfc..21f07e6ac5 100755
--- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py
+++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
@@ -889,7 +889,6 @@ class Parser(object):
return dot_str.join(version_array)
def _parse_history(self, history, prefix, parent):
- print "Pare History of Size: %d" % len(history)
if history.tag != "history":
raise ParseError("Invalid history tag: " + interface.tag)