summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml4
-rw-r--r--CMakeLists.txt14
-rw-r--r--README.md3
-rw-r--r--src/3rd_party/CMakeLists.txt59
-rw-r--r--src/appMain/CMakeLists.txt19
-rw-r--r--src/appMain/audio.8bit.wavbin88244 -> 44144 bytes
-rwxr-xr-xsrc/appMain/hmi_capabilities.json344
-rw-r--r--src/appMain/life_cycle.h113
-rw-r--r--src/appMain/life_cycle_impl.cc (renamed from src/appMain/life_cycle.cc)97
-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/sdl_preloaded_pt.json17
-rw-r--r--src/appMain/signal_handlers.cc4
-rw-r--r--src/appMain/smartDeviceLink.ini84
-rw-r--r--src/appMain/test/CMakeLists.txt (renamed from src/components/dbus/test/CMakeLists.txt)25
-rw-r--r--src/appMain/test/low_voltage_signals_handler_test.cc138
-rw-r--r--src/appMain/test/mock_life_cycle.h (renamed from src/components/dbus/test/include/dbus/mock_subscriber.h)40
-rw-r--r--src/components/CMakeLists.txt5
-rw-r--r--src/components/application_manager/CMakeLists.txt6
-rw-r--r--src/components/application_manager/include/application_manager/app_extension.h12
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data.h4
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h3
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/apps_launcher.h3
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h34
-rw-r--r--src/components/application_manager/include/application_manager/application.h66
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h10
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h56
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h209
-rw-r--r--src/components/application_manager/include/application_manager/command_factory.h11
-rw-r--r--src/components/application_manager/include/application_manager/command_holder.h1
-rw-r--r--src/components/application_manager/include/application_manager/command_holder_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h1
-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.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/request_from_hmi.h4
-rw-r--r--src/components/application_manager/include/application_manager/commands/response_to_hmi.h2
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager.h96
-rw-r--r--src/components/application_manager/include/application_manager/help_prompt_manager_impl.h188
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h63
-rw-r--r--src/components/application_manager/include/application_manager/message.h6
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h67
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h2
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h12
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h2
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h34
-rw-r--r--src/components/application_manager/include/application_manager/request_tracker.h2
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h35
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h112
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h22
-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/rpc_handler_impl.h32
-rw-r--r--src/components/application_manager/include/application_manager/rpc_service_impl.h12
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h11
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/telemetry_observer.h10
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h8
-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.h36
-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.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_icon_response.cc)50
-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.h (renamed from src/components/dbus/include/dbus/dbus_message_controller.h)76
-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.h25
-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.h51
-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.h37
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h34
-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.cc47
-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.cc17
-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.cc175
-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.cc39
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc583
-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.cc36
-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.cc158
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc9
-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.cc45
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc168
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/CMakeLists.txt4
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc65
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc493
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc80
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc47
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc55
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc47
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h (renamed from src/components/dbus/include/dbus/message_descriptions.h)53
-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.h14
-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.cc240
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_request.h77
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_request_template.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_response_template.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_request_template.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_response_template.h82
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h83
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h84
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h11
-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/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_request.h91
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_response.h79
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc1
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc61
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc17
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc2
-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.cc111
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc150
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc40
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc80
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_icon_request.cc149
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc18
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc859
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc7
-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/activate_app_request_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc57
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc186
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc28
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc20
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc136
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc11
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc113
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc71
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc21
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc14
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc47
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc12
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc9
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc46
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc29
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc344
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc33
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc135
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc8
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc15
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc67
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc10
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc55
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc24
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc66
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h16
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h22
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h14
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc2
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc172
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc157
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc137
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc3
-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/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc3
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc16
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc4
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc17
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc6
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc14
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc3
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_db.cc5
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc12
-rw-r--r--src/components/application_manager/src/app_launch/apps_launcher.cc4
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc122
-rw-r--r--src/components/application_manager/src/application_data_impl.cc16
-rw-r--r--src/components/application_manager/src/application_impl.cc77
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc603
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc2
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc20
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc17
-rw-r--r--src/components/application_manager/src/commands/notification_from_hmi.cc5
-rw-r--r--src/components/application_manager/src/commands/request_from_hmi.cc5
-rw-r--r--src/components/application_manager/src/commands/response_from_hmi.cc5
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc3
-rw-r--r--src/components/application_manager/src/help_prompt_manager_impl.cc395
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc1
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc22
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc2
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc3
-rw-r--r--src/components/application_manager/src/hmi_state.cc74
-rw-r--r--src/components/application_manager/src/message.cc13
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc489
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc2
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc9
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc57
-rw-r--r--src/components/application_manager/src/request_controller.cc18
-rw-r--r--src/components/application_manager/src/request_info.cc19
-rw-r--r--src/components/application_manager/src/request_tracker.cc15
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc441
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc2
-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.cc65
-rw-r--r--src/components/application_manager/src/resumption/resumption_sql_queries.cc18
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc117
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc20
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc5
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc33
-rw-r--r--src/components/application_manager/src/usage_statistics.cc7
-rwxr-xr-x[-rw-r--r--]src/components/application_manager/test/CMakeLists.txt9
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc14
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_db_test.cc10
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc44
-rw-r--r--src/components/application_manager/test/application_helper_test.cc7
-rw-r--r--src/components/application_manager/test/application_impl_test.cc46
-rw-r--r--src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc37
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc474
-rw-r--r--src/components/application_manager/test/application_state_test.cc78
-rw-r--r--src/components/application_manager/test/command_holder_test.cc14
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt12
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc9
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc9
-rw-r--r--src/components/application_manager/test/commands/command_response_impl_test.cc17
-rw-r--r--src/components/application_manager/test/event_engine_test.cc2
-rw-r--r--src/components/application_manager/test/help_prompt_manager_test.cc369
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json6
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc16
-rw-r--r--src/components/application_manager/test/hmi_language_handler_test.cc14
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h55
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h18
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_command_factory.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h (renamed from src/components/dbus/test/mock_subscriber.cc)62
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h17
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h11
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h7
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc131
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc17
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc7
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc31
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc94
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc18
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc12
-rw-r--r--src/components/application_manager/test/request_info_test.cc119
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc497
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc6
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc7
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc9
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json4
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json4
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc150
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc19
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc2
-rw-r--r--src/components/config_profile/include/config_profile/profile.h155
-rw-r--r--src/components/config_profile/src/profile.cc369
-rw-r--r--src/components/config_profile/test/profile_test.cc26
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h59
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h134
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h4
-rw-r--r--src/components/connection_handler/src/connection.cc137
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc549
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc9
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc239
-rw-r--r--src/components/connection_handler/test/connection_test.cc178
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc68
-rw-r--r--src/components/dbus/CMakeLists.txt82
-rw-r--r--src/components/dbus/codegen/code_formatter.py58
-rw-r--r--src/components/dbus/codegen/ford_xml_parser.py231
-rw-r--r--src/components/dbus/codegen/introspection_xml.cc327
-rwxr-xr-xsrc/components/dbus/codegen/make_hmi_requests.py343
-rwxr-xr-xsrc/components/dbus/codegen/make_introspection_c.py126
-rwxr-xr-xsrc/components/dbus/codegen/make_message_descriptions.py273
-rwxr-xr-xsrc/components/dbus/codegen/make_notifications_qml.py387
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_cpp.py736
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_qml.py217
-rw-r--r--src/components/dbus/codegen/make_qml_requests_cpp.py253
-rwxr-xr-xsrc/components/dbus/codegen/make_request_to_sdl.py335
-rw-r--r--src/components/dbus/include/dbus/dbus_adapter.h375
-rw-r--r--src/components/dbus/include/dbus/dbus_message.h179
-rw-r--r--src/components/dbus/include/dbus/dbus_message_inl.h214
-rw-r--r--src/components/dbus/include/dbus/schema.h98
-rw-r--r--src/components/dbus/src/dbus_adapter.cc937
-rw-r--r--src/components/dbus/src/dbus_message.cc217
-rw-r--r--src/components/dbus/src/dbus_message_controller.cc90
-rw-r--r--src/components/dbus/src/introspection_xml.cc327
-rw-r--r--src/components/dbus/src/message_descriptions.cc10424
-rw-r--r--src/components/dbus/src/schema.cc145
-rw-r--r--src/components/dbus/test/dbus_message_controller_test.cc116
-rw-r--r--src/components/dbus/test/include/dbus/mock_dbus_message_controller.h75
-rw-r--r--src/components/dbus/test/schema_test.cc118
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonBase.h12
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h30
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h44
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.h62
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h46
-rw-r--r--src/components/formatters/include/formatters/generic_json_formatter.h16
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h18
-rw-r--r--src/components/formatters/src/CFormatterJsonBase.cc34
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv1.cc10
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv2.cc10
-rw-r--r--src/components/formatters/src/CSmartFactory.cc34
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc57
-rw-r--r--src/components/formatters/src/generic_json_formatter.cc16
-rw-r--r--src/components/formatters/src/meta_formatter.cc10
-rw-r--r--src/components/formatters/test/CFormatterJsonBase_test.cc4
-rw-r--r--src/components/formatters/test/CSmartFactory_test.cc42
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc10
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc12
-rw-r--r--src/components/formatters/test/formatter_json_rpc_test.cc8
-rw-r--r--src/components/formatters/test/generic_json_formatter_test.cc8
-rw-r--r--src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h14
-rw-r--r--src/components/formatters/test/include/formatters/create_smartSchema.h6
-rw-r--r--src/components/formatters/test/include/formatters/meta_formatter_test_helper.h14
-rw-r--r--src/components/formatters/test/src/SmartFactoryTestHelper.cc31
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc6
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc4
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt10
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h98
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h4
-rw-r--r--src/components/hmi_message_handler/mock_hmi_message_handler.h4
-rw-r--r--src/components/hmi_message_handler/src/dbus_message_adapter.cc223
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc2
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc2
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt2
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_adapter_test.cc8
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc6
-rw-r--r--src/components/include/application_manager/application_manager.h95
-rw-r--r--src/components/include/application_manager/application_manager_settings.h12
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h4
-rw-r--r--src/components/include/connection_handler/connection_handler.h68
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h30
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h6
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h2
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h7
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h4
-rw-r--r--src/components/include/policy/policy_external/policy/policy_settings.h2
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h4
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_settings.h2
-rw-r--r--src/components/include/protocol/bson_object_keys.h6
-rw-r--r--src/components/include/protocol/common.h16
-rw-r--r--src/components/include/protocol/raw_message.h4
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h31
-rw-r--r--src/components/include/protocol_handler/protocol_handler_settings.h28
-rw-r--r--src/components/include/protocol_handler/session_observer.h68
-rw-r--r--src/components/include/protocol_handler/telemetry_observer.h10
-rw-r--r--src/components/include/security_manager/security_query.h4
-rw-r--r--src/components/include/test/application_manager/mock_app_extension.h8
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h31
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h10
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h2
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler.h29
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h10
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h4
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h4
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h2
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_settings.h1
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h4
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h2
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h1
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler.h12
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler_settings.h11
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h18
-rw-r--r--src/components/include/test/protocol_handler/mock_telemetry_observer.h5
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_listener.h2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h2
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h2
-rw-r--r--src/components/include/transport_manager/error.h4
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h5
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h27
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h27
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h9
-rw-r--r--src/components/include/transport_manager/transport_manager_listener_empty.h8
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h6
-rw-r--r--src/components/include/utils/atomic_object.h112
-rw-r--r--src/components/include/utils/conditional_variable.h19
-rw-r--r--src/components/include/utils/data_accessor.h10
-rw-r--r--src/components/include/utils/date_time.h95
-rw-r--r--src/components/include/utils/lock.hbin5418 -> 6172 bytes
-rw-r--r--src/components/include/utils/make_shared.h191
-rw-r--r--src/components/include/utils/messagemeter.h35
-rw-r--r--src/components/include/utils/semantic_version.h124
-rw-r--r--src/components/include/utils/shared_ptr.h390
-rw-r--r--src/components/include/utils/threads/message_loop_thread.h2
-rw-r--r--src/components/include/utils/typed_enum_print.h (renamed from src/components/dbus/test/dbus_adapter_test.cc)39
-rw-r--r--src/components/interfaces/CMakeLists.txt29
-rw-r--r--src/components/interfaces/HMI_API.xml788
-rw-r--r--src/components/interfaces/Json_HMI_message_specification.txt7
-rw-r--r--src/components/interfaces/MOBILE_API.xml2038
-rw-r--r--src/components/interfaces/QT_HMI_API.xml5517
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_impl.h4
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h4
-rw-r--r--src/components/media_manager/include/media_manager/streamer_adapter.h7
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc12
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc17
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc30
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc39
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h5
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc39
-rw-r--r--src/components/policy/policy_external/.gitignore2
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt34
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt12
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt10
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt8
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt60
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt4
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt8
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote_impl.h6
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h15
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h12
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h32
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h14
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table.h7
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h6
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h1
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml5
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h5
-rw-r--r--src/components/policy/policy_external/include/policy/pt_representation.h2
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h2
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h12
-rw-r--r--src/components/policy/policy_external/include/policy/usage_statistics/counter.h20
-rw-r--r--src/components/policy/policy_external/src/access_remote_impl.cc2
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc34
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc42
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc42
-rw-r--r--src/components/policy/policy_external/src/policy_table.cc2
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc42
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc17
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc18
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc38
-rw-r--r--src/components/policy/policy_external/src/status.cc23
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc8
-rw-r--r--src/components/policy/policy_external/src/usage_statistics/counter.cc15
-rw-r--r--src/components/policy/policy_external/test/counter_test.cc19
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h6
-rw-r--r--src/components/policy/policy_external/test/json/PTU.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU2.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU3.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_without_requestType_field.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json4
-rw-r--r--src/components/policy/policy_external/test/json/ptu2_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/ptu_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/valid_sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc44
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc12
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc38
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc6
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc6
-rw-r--r--src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc8
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc9
-rw-r--r--src/components/policy/policy_external/test/update_status_manager_test.cc6
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt6
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote_impl.h6
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h13
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h11
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h10
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h15
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h6
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h3
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h5
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_representation.h4
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h2
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager.h10
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager_interface.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/usage_statistics/counter.h20
-rw-r--r--src/components/policy/policy_regular/policy_table_interface_ext.xml5
-rw-r--r--src/components/policy/policy_regular/src/access_remote_impl.cc2
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc18
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc4
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc55
-rw-r--r--src/components/policy/policy_regular/src/policy_table.cc2
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc45
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc14
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc38
-rw-r--r--src/components/policy/policy_regular/src/status.cc25
-rw-r--r--src/components/policy/policy_regular/src/update_status_manager.cc7
-rw-r--r--src/components/policy/policy_regular/src/usage_statistics/counter.cc15
-rw-r--r--src/components/policy/policy_regular/test/PTU.json4
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json4
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json4
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json4
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc4
-rw-r--r--src/components/policy/policy_regular/test/counter_test.cc18
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h2
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc52
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json4
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc9
-rw-r--r--src/components/policy/policy_regular/test/update_status_manager_test.cc9
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json4
-rw-r--r--src/components/protocol/src/bson_object_keys.cc6
-rw-r--r--src/components/protocol_handler/CMakeLists.txt1
-rw-r--r--src/components/protocol_handler/include/protocol_handler/handshake_handler.h19
-rw-r--r--src/components/protocol_handler/include/protocol_handler/multiframe_builder.h2
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h146
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h59
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc33
-rw-r--r--src/components/protocol_handler/src/multiframe_builder.cc8
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc852
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc55
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h5
-rw-r--r--src/components/protocol_handler/test/incoming_data_handler_test.cc445
-rw-r--r--src/components/protocol_handler/test/multiframe_builder_test.cc12
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc1255
-rw-r--r--src/components/protocol_handler/test/protocol_header_validator_test.cc8
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h24
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h501
-rw-r--r--src/components/rpc_base/test/CMakeLists.txt13
-rw-r--r--src/components/rpc_base/test/rpc_base_dbus_test.cc682
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_impl.h5
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h6
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc6
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc6
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc9
-rw-r--r--src/components/security_manager/test/security_manager_test.cc6
-rw-r--r--src/components/security_manager/test/ssl_certificate_handshake_test.cc4
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc26
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h40
-rw-r--r--src/components/smart_objects/include/smart_objects/bool_schema_item.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h41
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h185
-rw-r--r--src/components/smart_objects/include/smart_objects/errors.h12
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h54
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h66
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h45
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item_parameter.h8
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h28
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h34
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h29
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc26
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc24
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc49
-rw-r--r--src/components/smart_objects/src/bool_schema_item.cc12
-rw-r--r--src/components/smart_objects/src/number_schema_item.cc8
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc141
-rw-r--r--src/components/smart_objects/src/schema_item.cc23
-rw-r--r--src/components/smart_objects/src/smart_object.cc23
-rw-r--r--src/components/smart_objects/src/smart_schema.cc26
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc32
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc20
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc20
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc96
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc62
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc135
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc36
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc222
-rw-r--r--src/components/smart_objects/test/SmartObjectConvertionTime_test.cc57
-rw-r--r--src/components/smart_objects/test/SmartObjectDraft_test.cc8
-rw-r--r--src/components/smart_objects/test/SmartObjectInvalid_test.cc4
-rw-r--r--src/components/smart_objects/test/SmartObjectStress_test.cc14
-rw-r--r--src/components/smart_objects/test/SmartObjectUnit_test.cc2
-rw-r--r--src/components/smart_objects/test/StringSchemaItem_test.cc78
-rw-r--r--src/components/smart_objects/test/smart_object_performance_test.cc2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h4
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h16
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h2
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h3
-rw-r--r--src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc7
-rw-r--r--src/components/telemetry_monitor/src/application_manager_observer.cc6
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc5
-rw-r--r--src/components/telemetry_monitor/src/protocol_handler_observer.cc10
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc80
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc5
-rw-r--r--src/components/telemetry_monitor/src/transport_manager_observer.cc14
-rw-r--r--src/components/telemetry_monitor/test/application_manager_metric_test.cc49
-rw-r--r--src/components/telemetry_monitor/test/application_manager_observer_test.cc4
-rw-r--r--src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h3
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_metric_test.cc34
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_observer_test.cc14
-rw-r--r--src/components/telemetry_monitor/test/telemetry_monitor_test.cc10
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_metric_test.cc32
-rw-r--r--src/components/transport_manager/CMakeLists.txt21
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h41
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h63
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h196
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h70
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h48
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h25
-rw-r--r--src/components/transport_manager/include/transport_manager/telemetry_observer.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/connection.h3
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h7
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h15
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h9
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h9
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h16
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/common.h4
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device.h2
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc5
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc4
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc4
-rw-r--r--src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc2
-rw-r--r--src/components/transport_manager/src/tcp/network_interface_listener_impl.cc42
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc673
-rw-r--r--src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc38
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc550
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc5
-rw-r--r--src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc2
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc35
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc38
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc21
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc19
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc4
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_connection.cc4
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc21
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt7
-rw-r--r--src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h4
-rw-r--r--src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h34
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h2
-rw-r--r--src/components/transport_manager/test/network_interface_listener_test.cc57
-rw-r--r--src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc567
-rw-r--r--src/components/transport_manager/test/tcp_client_listener_test.cc499
-rw-r--r--src/components/transport_manager/test/tcp_transport_adapter_test.cc71
-rw-r--r--src/components/transport_manager/test/transport_adapter_listener_test.cc13
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc97
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc12
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc42
-rw-r--r--src/components/utils/CMakeLists.txt11
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h10
-rw-r--r--src/components/utils/include/utils/signals.h54
-rw-r--r--src/components/utils/include/utils/timer.h2
-rw-r--r--src/components/utils/src/conditional_variable_boost.cc124
-rw-r--r--src/components/utils/src/conditional_variable_posix.cc149
-rw-r--r--src/components/utils/src/date_time.cc123
-rw-r--r--src/components/utils/src/lock_boost.cc (renamed from src/components/utils/src/lock_posix.cc)114
-rw-r--r--src/components/utils/src/log_message_loop_thread.cc7
-rw-r--r--src/components/utils/src/logger.cc3
-rw-r--r--src/components/utils/src/semantic_version.cc (renamed from src/components/utils/test/atomic_object_test.cc)29
-rw-r--r--src/components/utils/src/signals_posix.cc44
-rw-r--r--src/components/utils/test/async_runner_test.cc10
-rw-r--r--src/components/utils/test/conditional_variable_test.cc5
-rw-r--r--src/components/utils/test/date_time_test.cc331
-rw-r--r--src/components/utils/test/include/utils/mock_signals_posix.h (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_icon_request.cc)59
-rw-r--r--src/components/utils/test/lock_boost_test.cc (renamed from src/components/utils/test/lock_posix_test.cc)36
-rw-r--r--src/components/utils/test/log_message_loop_thread_test.cc2
-rw-r--r--src/components/utils/test/message_queue_test.cc3
-rw-r--r--src/components/utils/test/messagemeter_test.cc42
-rw-r--r--src/components/utils/test/mock_signals_posix.cc (renamed from src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_response.h)68
-rw-r--r--src/components/utils/test/shared_ptr_test.cc542
-rw-r--r--tools/CMakeLists.txt3
-rw-r--r--tools/InterfaceGenerator/MsgVersionGenerate.py34
-rwxr-xr-xtools/InterfaceGenerator/generator/Model.py58
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryBase.py334
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py30
-rwxr-xr-xtools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py10
-rwxr-xr-xtools/InterfaceGenerator/generator/parsers/RPCBase.py152
-rwxr-xr-xtools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py48
-rwxr-xr-xtools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py10
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc78
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h22
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc58
-rw-r--r--tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h22
-rw-r--r--tools/cmake/modules/FindDBus.cmake59
-rw-r--r--tools/cmake/modules/FindQt5DBus.cmake10
-rw-r--r--tools/intergen/GenerateInterfaceLibrary.cmake10
-rw-r--r--tools/intergen/cppgen/CMakeLists.txt2
-rw-r--r--tools/intergen/cppgen/include/cppgen/generator_preferences.h5
-rw-r--r--tools/intergen/cppgen/include/cppgen/message_factory_function.h3
-rw-r--r--tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h88
-rw-r--r--tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc3
-rw-r--r--tools/intergen/cppgen/src/cppgen/declaration_generator.cc38
-rw-r--r--tools/intergen/cppgen/src/cppgen/definition_generator.cc29
-rw-r--r--tools/intergen/cppgen/src/cppgen/generator_preferences.cc9
-rw-r--r--tools/intergen/cppgen/src/cppgen/handler_interface.cc4
-rw-r--r--tools/intergen/cppgen/src/cppgen/message_factory_function.cc6
-rw-r--r--tools/intergen/cppgen/src/cppgen/module_manager.cc6
-rw-r--r--tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc177
-rw-r--r--tools/intergen/test/CMakeLists.txt23
-rw-r--r--tools/intergen/test/generated_interface_dbus_tests.cc127
-rw-r--r--tools/intergen/test/test_hmi_interface.xml1096
-rw-r--r--tools/intergen/tool/intergen.cc7
854 files changed, 24322 insertions, 37929 deletions
diff --git a/.travis.yml b/.travis.yml
index 73bbfbeb2a..7f7df359b4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,9 +24,7 @@ script:
- ./tools/infrastructure/check_style.sh
- mkdir build && cd build
- cmake ../ -DBUILD_TESTS=ON
- - make install && sudo ldconfig
-after_success:
- - make test
+ - make install-3rd_party && make -j `nproc` install && sudo ldconfig && make test
env:
global:
- LC_CTYPE=en_US.UTF-8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97bda27c53..1a180b6cf9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,9 +112,6 @@ if (HMI_ADAPTER_OPTION)
if (${HMI_ADAPTER_OPTION} STREQUAL "MESSAGEBROKER")
message(STATUS "Jenkins integration: selected HMI adapter MESSAGEBROKER")
set (HMIADAPTER "messagebroker")
- elseif (${HMI_ADAPTER_OPTION} STREQUAL "DBUS")
- message(STATUS "Jenkins integration: selected HMI adapter DBUS")
- set (HMIADAPTER "dbus")
endif()
endif()
@@ -238,7 +235,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
set(ARCHIVE_OUTPUT_DIRECTORY ./bin)
-set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wno-deprecated-declarations -Wuninitialized -Wvla")
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla")
if (USE_GOLD_LD)
execute_process(COMMAND ld -v OUTPUT_VARIABLE result)
@@ -381,15 +378,6 @@ if (HMI STREQUAL "web" AND NOT DEFINED HMIADAPTER)
set(HMIADAPTER "messagebroker")
endif()
-if (HMIADAPTER STREQUAL "dbus")
- set(HMI_DBUS_API ON)
- add_definitions(-DDBUS_HMIADAPTER)
- add_definitions(-DHMI_DBUS_API)
-
- find_package(DBus REQUIRED)
- set(DBUS_LIBS_DIRECTORY ${DBUS_LIBRARY_DIRS} PARENT_SCOPE)
- message(${DBUS_INCLUDE_DIRS})
-endif()
if (HMIADAPTER STREQUAL "messagebroker")
set(HMI_JSON_API ON)
add_definitions(-DMESSAGEBROKER_HMIADAPTER)
diff --git a/README.md b/README.md
index e41006cca5..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)
@@ -65,7 +65,6 @@ The dependencies for SDL Core vary based on the configuration. You can change SD
| Flag | Description | Dependencies |
|------|-------------|--------------|
|Web HMI|Use HTML5 HMI|chromium-browser|
-|DBus|Use DBus HMI Adapter|dbus-1-dev|
|EXTENDED_MEDIA_MODE|Support Video and Audio Streaming|Opengl es2, gstreamer1.0*|
|Bluetooth|Enable bluetooth transport adapter|libbluetooth3, libbluetooth-dev, bluez-tools|
|USB|Enable USB transport adapter|libusb-dev|
diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt
index 6f1e3dc353..f207a38c3d 100644
--- a/src/3rd_party/CMakeLists.txt
+++ b/src/3rd_party/CMakeLists.txt
@@ -44,17 +44,14 @@ if(FORCE_3RD_PARTY)
message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.")
else()
set(FORCE_3RD_PARTY_LOGGER ON)
- set(FORCE_3RD_PARTY_DBUS ON)
endif()
endif()
-if(ENABLE_LOG OR HMI_DBUS_API)
+if(ENABLE_LOG)
# --- libexpat
add_subdirectory(expat-2.1.0)
set(EXPAT_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE)
-endif()
-if(ENABLE_LOG)
if(NO_REBUILD_3RD_PARTY_LOGGER)
message(STATUS "Not rebuilding logger.")
else()
@@ -212,34 +209,34 @@ else()
)
endif()
-if (HMIADAPTER STREQUAL "messagebroker")
- find_package(Boost 1.66.0 COMPONENTS system)
- set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
- set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
- SET_PROPERTY(GLOBAL PROPERTY GLOBAL_BOOST_LIBS ${BOOST_LIBS_DIRECTORY})
- set(BOOST_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include )
- if (NOT ${Boost_FOUND})
- message(STATUS "Did not find boost. Downloading and installing boost 1.66")
- set(BOOST_INSTALL_COMMAND ./b2 install)
- if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local")
- set(BOOST_INSTALL_COMMAND sudo ./b2 install)
- endif()
- include(ExternalProject)
- ExternalProject_Add(
- Boost
- URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
- DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
- SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
- CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system --prefix=${3RD_PARTY_INSTALL_PREFIX}
- BUILD_COMMAND ./b2
- INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
- INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
- BUILD_IN_SOURCE true
- )
-
- set(BOOST_INCLUDE_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost)
- set(BOOST_LIB_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost/stage/lib/)
+find_package(Boost 1.66.0 COMPONENTS system thread date_time)
+set(BOOST_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/boost_src)
+set(BOOST_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib)
+SET_PROPERTY(GLOBAL PROPERTY GLOBAL_BOOST_LIBS ${BOOST_LIBS_DIRECTORY})
+set(BOOST_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include )
+if (NOT ${Boost_FOUND})
+ message(STATUS "Did not find boost. Downloading and installing boost 1.66")
+ set(BOOST_INSTALL_COMMAND ./b2 install)
+ if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local")
+ set(BOOST_INSTALL_COMMAND sudo ./b2 install)
endif()
+ include(ExternalProject)
+ ExternalProject_Add(
+ Boost
+ URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
+ DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
+ SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
+ CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time --prefix=${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_COMMAND ./b2
+ INSTALL_COMMAND ${BOOST_INSTALL_COMMAND} --with-system --with-thread --with-date_time --prefix=${3RD_PARTY_INSTALL_PREFIX} > boost_install.log
+ INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX}
+ BUILD_IN_SOURCE true
+ )
+
+ set(BOOST_INCLUDE_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost)
+ set(BOOST_LIB_DIR ${BOOST_ROOT_DIR}/Boost-prefix/src/Boost/stage/lib/)
+else()
+add_custom_target(Boost) # empty target, Boost is already installed
endif()
add_custom_target(install-3rd_party
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index e82d95f904..fe9a6af3f7 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -62,7 +62,6 @@ include_directories(
${POLICY_GLOBAL_INCLUDE_PATH}/
${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/resumption/include
- ${COMPONENTS_DIR}/dbus/include
${CMAKE_BINARY_DIR}/src/components
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
@@ -71,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
@@ -142,7 +151,8 @@ add_executable(${PROJECT} ${SOURCES})
if (HMIADAPTER STREQUAL "messagebroker")
add_dependencies(${PROJECT} Boost)
- list(APPEND LIBRARIES libboost_system.so)
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
endif()
target_link_libraries(${PROJECT} ${LIBRARIES})
@@ -243,3 +253,6 @@ else()
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/appMain/audio.8bit.wav b/src/appMain/audio.8bit.wav
index cebf6cc0e2..7a3f970a21 100644
--- a/src/appMain/audio.8bit.wav
+++ b/src/appMain/audio.8bit.wav
Binary files differ
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 50cb479a74..93292d1023 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,9 +464,341 @@
"rdsDataAvailable": true,
"signalChangeThresholdAvailable": true,
"signalStrengthAvailable": true,
+ "hdRadioEnableAvailable" : true,
+ "siriusxmRadioAvailable" : true,
+ "sisDataAvailable":true,
"stateAvailable": true
}
- ]
+ ],
+ "audioControlCapabilities": [
+ {
+ "moduleName": "audio",
+ "sourceAvailable": true,
+ "volumeAvailable": true,
+ "equalizerAvailable": true,
+ "keepContextAvailable" : true,
+ "equalizerMaxChannelId": 10
+ }
+ ],
+ "seatControlCapabilities": [
+ {
+ "moduleName": "driver_seat",
+ "heatingEnabledAvailable" : true,
+ "coolingEnabledAvailable": true,
+ "heatingLevelAvailable": true,
+ "coolingLevelAvailable": true,
+ "horizontalPositionAvailable": true,
+ "verticalPositionAvailable" : true,
+ "frontVerticalPositionAvailable": true,
+ "backVerticalPositionAvailable": true,
+ "backTiltAngleAvailable": true,
+ "headSupportHorizontalPositionAvailable": true,
+ "headSupportVerticalPositionAvailable" : true,
+ "massageEnabledAvailable": true,
+ "massageModeAvailable": true,
+ "massageCushionFirmnessAvailable": true,
+ "memoryAvailable": true
+ }
+ ],
+ "lightControlCapabilities": {
+ "moduleName": "light",
+ "supportedLights":[
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_HIGH_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_LOW_BEAM",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_PARKING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_DAYTIME_RUNNING_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FRONT_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_FOG_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TAIL_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_BRAKE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_BRAKE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_LEFT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_RIGHT_TURN_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_REGISTRATION_PLATE_LIGHT",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"HIGH_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"LOW_BEAMS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"FOG_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"RUNNING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"PARKING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"BRAKE_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"REAR_REVERSING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"SIDE_MARKER_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"LEFT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"RIGHT_TURN_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"HAZARD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"AMBIENT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"OVERHEAD_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"READING_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"TRUNK_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_FRONT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_REAR_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_LEFT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":true,
+ "name":"EXTERIOR_RIGHT_LIGHTS",
+ "rgbColorSpaceAvailable":true
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_CARGO_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_TRUCK_BED_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"REAR_TRAILER_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"LEFT_SPOT_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"RIGHT_SPOT_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"LEFT_PUDDLE_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":false,
+ "densityAvailable":false,
+ "name":"RIGHT_PUDDLE_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ },
+ {
+ "statusAvailable":true,
+ "densityAvailable":false,
+ "name":"EXTERIOR_ALL_LIGHTS",
+ "rgbColorSpaceAvailable":false
+ }
+ ]
+ },
+ "hmiSettingsControlCapabilities": {
+ "moduleName": "hmiSettings",
+ "distanceUnitAvailable": true,
+ "temperatureUnitAvailable": true,
+ "displayModeUnitAvailable": true
+ }
}
}
},
@@ -550,6 +886,12 @@
"upDownAvailable": true
},
{
+ "name":"PLAY_PAUSE",
+ "shortPressAvailable":true,
+ "longPressAvailable" :true,
+ "upDownAvailable" :true
+ },
+ {
"name": "SEEKLEFT",
"shortPressAvailable": true,
"longPressAvailable": true,
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index 69f4b987f5..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,85 +32,60 @@
#ifndef SRC_APPMAIN_LIFE_CYCLE_H_
#define SRC_APPMAIN_LIFE_CYCLE_H_
-#include <thread>
-#include <unistd.h>
-#include "utils/macro.h"
-#include "utils/shared_ptr.h"
-#include "config_profile/profile.h"
-#include "hmi_message_handler/hmi_message_handler_impl.h"
-#ifdef DBUS_HMIADAPTER
-#include "hmi_message_handler/dbus_message_adapter.h"
-#endif // DBUS_HMIADAPTER
-#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
-#ifdef DBUS_HMIADAPTER
- hmi_message_handler::DBusMessageAdapter* dbus_adapter_;
- std::thread* dbus_adapter_thread_;
-#endif // DBUS_HMIADAPTER
+ /**
+ * @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 e42032a5cb..b87191d937 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,9 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "life_cycle.h"
+#include "appMain/life_cycle_impl.h"
#include "utils/signals.h"
-#include "utils/make_shared.h"
#include "config_profile/profile.h"
#include "application_manager/system_time/system_time_handler_impl.h"
#include "resumption/last_state_impl.h"
@@ -48,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)
@@ -70,10 +71,6 @@ LifeCycle::LifeCycle(const profile::Profile& profile)
#ifdef TELEMETRY_MONITOR
, telemetry_monitor_(NULL)
#endif // TELEMETRY_MONITOR
-#ifdef DBUS_HMIADAPTER
- , dbus_adapter_(NULL)
- , dbus_adapter_thread_(NULL)
-#endif // DBUS_HMIADAPTER
#ifdef MESSAGEBROKER_HMIADAPTER
, mb_adapter_(NULL)
, mb_adapter_thread_(NULL)
@@ -81,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(),
@@ -126,7 +123,7 @@ bool LifeCycle::StartComponents() {
security_manager_ =
new security_manager::SecurityManagerImpl(std::move(system_time_handler));
crypto_manager_ = new security_manager::CryptoManagerImpl(
- utils::MakeShared<security_manager::CryptoManagerSettingsImpl>(
+ std::make_shared<security_manager::CryptoManagerSettingsImpl>(
profile_, app_manager_->GetPolicyHandler().RetrieveCertificate()));
protocol_handler_->AddProtocolObserver(security_manager_);
protocol_handler_->set_security_manager(security_manager_);
@@ -166,15 +163,43 @@ bool LifeCycle::StartComponents() {
// It's important to initialise TM after setting up listener chain
// [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
app_manager_->set_protocol_handler(protocol_handler_);
- transport_manager_->Init(*last_state_);
+ if (transport_manager::E_SUCCESS != transport_manager_->Init(*last_state_)) {
+ LOG4CXX_ERROR(logger_, "Transport manager init failed.");
+ return false;
+ }
// 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());
@@ -189,30 +214,6 @@ bool LifeCycle::InitMessageSystem() {
}
#endif // MESSAGEBROKER_HMIADAPTER
-#ifdef DBUS_HMIADAPTER
-/**
- * Initialize DBus component
- * @return true if success otherwise false.
- */
-bool LifeCycle::InitMessageSystem() {
- dbus_adapter_ = new hmi_message_handler::DBusMessageAdapter(hmi_handler_);
-
- hmi_handler_->AddHMIMessageAdapter(dbus_adapter_);
- if (!dbus_adapter_->Init()) {
- LOG4CXX_FATAL(logger_, "Cannot init DBus service!");
- return false;
- }
-
- dbus_adapter_->SubscribeTo();
-
- LOG4CXX_INFO(logger_, "Start DBusMessageAdapter thread!");
- dbus_adapter_thread_ = new std::thread(
- &hmi_message_handler::DBusMessageAdapter::Run, dbus_adapter_);
-
- return true;
-}
-#endif // DBUS_HMIADAPTER
-
namespace {
void sig_handler(int sig) {
switch (sig) {
@@ -235,16 +236,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_);
@@ -313,22 +314,10 @@ void LifeCycle::StopComponents() {
delete app_manager_;
app_manager_ = NULL;
- LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
+ LOG4CXX_INFO(logger_, "Destroying Low Voltage Signals Handler.");
+ low_voltage_signals_handler_.reset();
-#ifdef DBUS_HMIADAPTER
- if (dbus_adapter_) {
- DCHECK_OR_RETURN_VOID(hmi_handler_);
- hmi_handler_->RemoveHMIMessageAdapter(dbus_adapter_);
- dbus_adapter_->Shutdown();
- if (dbus_adapter_thread_ != NULL) {
- dbus_adapter_thread_->join();
- }
- delete dbus_adapter_;
- dbus_adapter_ = NULL;
- delete dbus_adapter_thread_;
- dbus_adapter_thread_ = NULL;
- }
-#endif // DBUS_HMIADAPTER
+ LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
#ifdef MESSAGEBROKER_HMIADAPTER
if (mb_adapter_) {
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/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 1cf3bf52c1..d503ae34e5 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -141,7 +141,8 @@
"OnDriverDistraction": {
"hmi_levels": ["BACKGROUND",
"FULL",
- "LIMITED"]
+ "LIMITED",
+ "NONE"]
},
"OnEncodedSyncPData": {
"hmi_levels": ["BACKGROUND",
@@ -345,6 +346,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -357,6 +359,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -369,6 +372,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -381,6 +385,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -551,6 +556,12 @@
"FULL",
"LIMITED",
"NONE"]
+ },
+ "OnRCStatus": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"]
}
}
},
@@ -709,7 +720,8 @@
"OnDriverDistraction": {
"hmi_levels": ["BACKGROUND",
"FULL",
- "LIMITED"]
+ "LIMITED",
+ "NONE"]
},
"OnEncodedSyncPData": {
"hmi_levels": ["BACKGROUND",
@@ -2378,4 +2390,3 @@
}
}
}
-
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 aa15b7c5fe..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
@@ -186,10 +192,15 @@ PathToSnapshot = sdl_snapshot.json
AttemptsToOpenPolicyDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMs = 500
+; Whether to use the fullAppID over the short-form appID in policy lookups
+UseFullAppID = true
[TransportManager]
; Listening port form incoming TCP mobile connection
TCPAdapterPort = 12345
+; Name of the network interface that Core will listen on for incoming TCP connection, e.g. eth0.
+; If the name is omitted, Core will listen on all network interfaces by binding to INADDR_ANY.
+TCPAdapterNetworkInterface =
[ProtocolHandler]
; SDL supported protocol version
@@ -264,6 +275,57 @@ AttemptsToOpenResumptionDB = 5
; Timeout between attempts during opening DB in milliseconds
OpenAttemptTimeoutMsResumptionDB = 500
+[TransportRequiredForResumption]
+; This section specifies transport types that are required to trigger resumption for each
+; AppHMIType. App has to be connected through at least one of the transports listed (either as
+; the primary transport or secondary transport) to trigger resumption. If the app is not
+; connected with any of the transports listed, its HMIlevel will be kept in NONE and the state
+; stays in NOT_AUDIBLE.
+; In case an app has multiple AppHMIType, requirements of all of the AppHMITypes are applied.
+;
+; Possible AppHMITypes: Default, Communication, Media, Messaging, Navigation, Information,
+; Social, BackgroundProcess, Testing, System, Projection, RemoteControl,
+; EmptyApp
+; Possible transport types: TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE,
+; IAP_USB, AOA_USB, IAP_BLUETOOTH, SPP_BLUETOOTH
+;
+; The default behavior is to always enable resumption. If an AppHMIType is not listed in this
+; section, resumption is enabled for an app with the AppHMIType.
+; On the other hand, if you want to disable resumption and always keep an app in NONE and
+; NOT_AUDIBLE state after registration, specify an empty value for the AppHMIType.
+;
+; NAVIGATION apps, PROJECTION apps and apps that declare themselves as media apps have a
+; special exception. When these apps do not have any of the transports listed here, they will
+; be still resumed into particular HMIlevel defined in LowBandwidthTransportResumptionLevel
+; section.
+
+;DefaultTransportRequiredForResumption =
+;CommunicationTransportRequiredForResumption =
+;MediaTransportRequiredForResumption =
+;MessagingTransportRequiredForResumption =
+;NavigationTransportRequiredForResumption =
+;InformationTransportRequiredForResumption =
+;SocialTransportRequiredForResumption =
+;BackgroundProcessTransportRequiredForResumption =
+;TestingTransportRequiredForResumption =
+;SystemTransportRequiredForResumption =
+;ProjectionTransportRequiredForResumption =
+;RemoteControlTransportRequiredForResumption =
+; "EmptyAppTransportRequiredForResumption" applies to apps that don't specify any AppHMIType
+;EmptyAppTransportRequiredForResumption =
+
+[LowBandwidthTransportResumptionLevel]
+; The HMI Level that an app will resume to if no high bandwidth connection is active.
+; High bandwidth connections for each app type are defined under TransportRequiredForResumption
+; section.
+; Possible values: NONE, BACKGROUND, LIMITED and FULL
+; this is for NAVIGATION apps
+;NavigationLowBandwidthResumptionLevel =
+; this is for PROJECTION apps
+;ProjectionLowBandwidthResumptionLevel =
+; this is for apps who declare themselves as media apps. (Don't be confused with AppHMIType=MEDIA.)
+;MediaLowBandwidthResumptionLevel =
+
[AppLaunch]
; time in milliseconds started from device connection - after expiring SDL remotely launches all known not-yet-registered apps from this device
AppLaunchWaitTime = 5000
@@ -279,3 +341,25 @@ MaxNumberOfiOSDevice = 10
WaitTimeBetweenApps = 4000
; App Launch on iOS devices SDL feature enabler/disabler
EnableAppLaunchIOS = true
+
+[MultipleTransports]
+; Whether multiple-transports feature is enabled
+;MultipleTransportsEnabled = true
+
+; Comma-separated list of transports that can be used as Secondary Transport for each Primary Transport.
+; Possible values are: WiFi, USB and Bluetooth.
+; Core will not suggest Secondary Transport if the value is empty.
+;SecondaryTransportForBluetooth = WiFi
+;SecondaryTransportForUSB =
+;SecondaryTransportForWiFi =
+
+[ServicesMap]
+; A matrix to specify which service is allowed on which transports. The transports are listed
+; in preferred order. If a transport is not listed, then the service is not allowed
+; to run on the transport.
+; Only video and audio services are configurable.
+; If the entry of a service is completely omitted, the service will be allowed on all transports.
+; Possible values are: IAP_BLUETOOTH, IAP_USB, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_CARPLAY, SPP_BLUETOOTH, AOA_USB and TCP_WIFI.
+; Note: this configuration is applied even if multiple-transports feature is not enabled.
+;AudioServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
+;VideoServiceTransports = TCP_WIFI, IAP_CARPLAY, IAP_USB_HOST_MODE, IAP_USB_DEVICE_MODE, IAP_USB, AOA_USB
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/appMain/test/CMakeLists.txt
index 914bd2ca84..057e1e9869 100644
--- a/src/components/dbus/test/CMakeLists.txt
+++ b/src/appMain/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2018, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,26 +28,19 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/dbus/include/
- ${COMPONENTS_DIR}/dbus/test/include/
+ ${COMPONENTS_DIR}/utils/test/include
)
-#FIXME: exclude some tests
-set (EXCLUDE_PATHS
- dbus_message_controller_test.cc
+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
)
-collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" ${EXCLUDE_PATHS})
-
-set (LIBRARIES
- gmock
- DBus
- formatters
- SmartObjects
+set(LIBRARIES
+ gmock
)
-create_test(test_DBus_test "${SOURCES}" "${LIBRARIES}")
+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/components/dbus/test/include/dbus/mock_subscriber.h b/src/appMain/test/mock_life_cycle.h
index b2a369e371..fc24b26080 100644
--- a/src/components/dbus/test/include/dbus/mock_subscriber.h
+++ b/src/appMain/test/mock_life_cycle.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2014, Ford Motor Company
+* Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,33 +30,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
-#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
+#ifndef SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
+#define SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
-#include <string>
+#include "appMain/life_cycle.h"
+#include "gmock/gmock.h"
-struct DBusConnection;
+namespace main_namespace {
-namespace test {
-namespace components {
-namespace dbus {
-
-class MockSubscriber {
+class MockLifeCycle : public LifeCycle {
public:
- MockSubscriber(const std::string nameService, const std::string path);
- virtual ~MockSubscriber();
- virtual void Receive();
- bool Start();
- void Send(const std::string& message);
-
- private:
- std::string nameService_;
- std::string path_;
- DBusConnection* conn_;
+ 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 dbus
-} // namespace components
-} // namespace test
+} // namespace main_namespace
-#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
+#endif // SRC_APPMAIN_TEST_MOCK_LIFE_CYCLE_H_
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index 4f984bb3a8..f262f201c2 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -91,8 +91,3 @@ add_subdirectory(./media_manager)
if(TELEMETRY_MONITOR)
add_subdirectory(./telemetry_monitor)
endif()
-
-# --- DBus
-if(HMI_DBUS_API)
- add_subdirectory(./dbus)
-endif()
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index b7a6d94503..67a7136a62 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -118,12 +118,6 @@ collect_sources(EVENT_ENGINE_SOURCES "${EVENT_ENGINE_PATHS}")
collect_sources(POLICIES_SOURCES "${POLICIES_PATHS}")
-if (${HMI_JSON_API})
- set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
-endif (${HMI_JSON_API})
-
-set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS})
-
set(EXCLUDE_PATHS
${EVENT_ENGINE_SOURCE_DIR}
${MESSAGE_HELPER_SOURCE_DIR}
diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h
index ee7eca190c..e3231de347 100644
--- a/src/components/application_manager/include/application_manager/app_extension.h
+++ b/src/components/application_manager/include/application_manager/app_extension.h
@@ -33,10 +33,8 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
-#include "utils/shared_ptr.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
}
}
@@ -60,21 +58,21 @@ class AppExtension {
* plugin
*/
virtual void SaveResumptionData(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data) = 0;
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) = 0;
/**
* @brief ProcessResumption Method called by SDL during resumption.
* @param resumption_data list of resumption data
*/
virtual void ProcessResumption(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
resumption_data) = 0;
private:
const AppExtensionUID kUid_;
};
-typedef utils::SharedPtr<AppExtension> AppExtensionPtr;
+typedef std::shared_ptr<AppExtension> AppExtensionPtr;
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
index 9fc85db38c..a10963ad82 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h
@@ -33,11 +33,11 @@
#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace application_manager {
class Application;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
} // namespace application_manager
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
index 1f508eebe5..61f3480f77 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h
@@ -49,7 +49,7 @@ class ResumeCtrl;
namespace app_launch {
// TODO(AK) Use unique pointer
-typedef utils::SharedPtr<timer::Timer> TimerPtr;
+typedef std::shared_ptr<timer::Timer> TimerPtr;
class MultipleAppsLauncherFactoryImpl;
class AppLaunchCtrlImpl : public AppLaunchCtrl {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
index 0d52384018..73e9623b62 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h
@@ -36,7 +36,7 @@
#include <stdint.h>
#include <vector>
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace app_launch {
@@ -59,7 +59,7 @@ struct ApplicationData {
bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_;
}
};
-typedef utils::SharedPtr<ApplicationData> ApplicationDataPtr;
+typedef std::shared_ptr<ApplicationData> ApplicationDataPtr;
/**
* @brief class contains interfaces to AppLaunchDataDB and AppLaunchDataJson
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
index 92d6bbd9ef..ccbf4c7c01 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h
@@ -153,7 +153,7 @@ class AppLaunchDataDB : public AppLaunchDataImpl {
/**
* @brief returns pointer to data base
*/
- std::auto_ptr<utils::dbms::SQLDatabase> db_;
+ std::unique_ptr<utils::dbms::SQLDatabase> db_;
/**
* @brief indicate initializing status of DB
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
index 111ff25ab2..a2b8630bcc 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h
@@ -35,6 +35,8 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch_settings.h"
+#include "utils/macro.h"
+#include <memory>
namespace app_launch {
diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
index 61117e552b..a292b84fc0 100644
--- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
+++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h
@@ -38,6 +38,7 @@
#include "resumption/last_state.h"
#include "utils/lock.h"
#include "utils/macro.h"
+#include <memory>
namespace app_launch {
@@ -141,7 +142,7 @@ class AppLaunchDataJson : public AppLaunchDataImpl {
/**
* @brief lock to protected common data
*/
- mutable sync_primitives::Lock app_launch_json_lock_;
+ mutable sync_primitives::RecursiveLock app_launch_json_lock_;
/**
* @brief ponter to Last State object
diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
index 751e04bada..6285514be9 100644
--- a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h
@@ -3,6 +3,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "connection_handler/connection_handler.h"
#include "utils/timer.h"
+#include <memory>
namespace app_launch {
class AppLaunchCtrlImpl;
@@ -69,7 +70,7 @@ class AppsLauncher {
connection_handler::ConnectionHandler& connection_handler_;
AppsLauncher& parent_;
};
- typedef utils::SharedPtr<Launcher> LauncherPtr;
+ typedef std::shared_ptr<Launcher> LauncherPtr;
typedef std::vector<LauncherPtr> AppLaunchers;
private:
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f1f29471e6..f156654215 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -10,9 +10,39 @@
namespace app_launch {
class AppLaunchCtrlImpl;
-class DeviceAppsLauncherImpl;
+class DeviceAppsLauncher;
class AppsLauncher;
class AppLaunchSettings;
+class Launcher;
+class LauncherGenerator;
+
+// impl class must be defined for unique_ptr in DeviceAppsLauncher
+class DeviceAppsLauncherImpl {
+ public:
+ DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher);
+
+ bool LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch);
+
+ struct LauncherFinder {
+ LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+
+ bool operator()(const std::shared_ptr<Launcher>& launcher) const;
+
+ std::string device_mac_;
+ };
+
+ bool StopLaunchingAppsOnDevice(const std::string& device_mac);
+
+ private:
+ sync_primitives::Lock launchers_lock_;
+ std::vector<std::shared_ptr<Launcher> > free_launchers_;
+ std::vector<std::shared_ptr<Launcher> > works_launchers_;
+ DeviceAppsLauncher& interface_;
+};
+
/**
* @brief The MultipleAppsLauncher struct
* should manage launching applications and gaps between launching application
@@ -36,7 +66,7 @@ class DeviceAppsLauncher {
private:
application_manager::ApplicationManager& app_mngr_;
const AppLaunchSettings& settings_;
- std::auto_ptr<DeviceAppsLauncherImpl> impl_;
+ std::unique_ptr<DeviceAppsLauncherImpl> impl_;
friend class DeviceAppsLauncherImpl;
DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
};
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 0166624ef2..c3a4ecbb30 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -38,7 +38,8 @@
#include <set>
#include <list>
#include <vector>
-#include "utils/shared_ptr.h"
+#include <memory>
+
#include "utils/data_accessor.h"
#include "interfaces/MOBILE_API.h"
#include "connection_handler/device.h"
@@ -46,9 +47,11 @@
#include "application_manager/message.h"
#include "application_manager/hmi_state.h"
#include "application_manager/application_state.h"
+#include "application_manager/help_prompt_manager.h"
#include "protocol_handler/protocol_handler.h"
#include "smart_objects/smart_object.h"
#include "utils/macro.h"
+#include "utils/semantic_version.h"
namespace application_manager {
@@ -113,6 +116,7 @@ class InitialApplicationData {
virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
virtual const mobile_api::Language::eType& language() const = 0;
virtual const mobile_api::Language::eType& ui_language() const = 0;
+ virtual const utils::SemanticVersion& msg_version() const = 0;
virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0;
virtual void set_vr_synonyms(
const smart_objects::SmartObject& vr_synonyms) = 0;
@@ -123,6 +127,7 @@ class InitialApplicationData {
virtual void set_language(const mobile_api::Language::eType& language) = 0;
virtual void set_ui_language(
const mobile_api::Language::eType& ui_language) = 0;
+ virtual void set_msg_version(const utils::SemanticVersion& version) = 0;
};
/*
@@ -551,6 +556,12 @@ class Application : public virtual InitialApplicationData,
const = 0;
virtual const std::string& app_icon_path() const = 0;
virtual connection_handler::DeviceHandle device() const = 0;
+ /**
+ * @brief Returns handle of the device on which secondary transport of this
+ * app is running
+ * @return handle of the device on which secondary transport is running
+ */
+ virtual connection_handler::DeviceHandle secondary_device() const = 0;
/**
* @brief sets true if application has sent TTS GlobalProperties
@@ -586,8 +597,13 @@ 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
+ * @param handle of the device on which secondary transport is running
+ */
+ virtual void set_secondary_device(
+ connection_handler::DeviceHandle secondary_device) = 0;
virtual uint32_t get_grammar_id() const = 0;
virtual void set_grammar_id(uint32_t value) = 0;
@@ -598,6 +614,24 @@ class Application : public virtual InitialApplicationData,
virtual void set_is_resuming(bool is_resuming) = 0;
virtual bool is_resuming() const = 0;
+ /**
+ * @brief Remembers the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ * @param level The HMI level which the app would resume into. Specify
+ * INVALID_ENUM to clear the state.
+ */
+ virtual void set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) = 0;
+ /**
+ * @brief Returns the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ *
+ * A value of INVALID_ENUM indicates that the app does not have deferred
+ * HMI level.
+ * @return HMI level which the app would resume into
+ */
+ virtual mobile_api::HMILevel::eType deferred_resumption_hmi_level() const = 0;
+
virtual bool AddFile(const AppFile& file) = 0;
virtual const AppFilesMap& getAppFiles() const = 0;
@@ -640,6 +674,12 @@ class Application : public virtual InitialApplicationData,
virtual UsageStatistics& usage_report() = 0;
/**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ virtual HelpPromptManager& help_prompt_manager() = 0;
+
+ /**
* @brief SetInitialState sets initial HMI state for application on
* registration
* @param state Hmi state value
@@ -696,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
*
@@ -743,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.
*
@@ -910,8 +946,8 @@ class Application : public virtual InitialApplicationData,
bool is_greyed_out_;
};
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<Application> ApplicationSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
typedef uint32_t ApplicationId;
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
index 8da8dec8f1..8f24f124f9 100644
--- a/src/components/application_manager/include/application_manager/application_data_impl.h
+++ b/src/components/application_manager/include/application_manager/application_data_impl.h
@@ -35,6 +35,7 @@
#include <string>
#include "utils/lock.h"
+#include "utils/semantic_version.h"
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "interfaces/MOBILE_API.h"
@@ -55,6 +56,7 @@ class InitialApplicationDataImpl : public virtual Application {
const smart_objects::SmartObject* ngn_media_screen_name() const;
const mobile_api::Language::eType& language() const;
const mobile_api::Language::eType& ui_language() const;
+ const utils::SemanticVersion& msg_version() const;
void set_app_types(const smart_objects::SmartObject& app_types);
void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms);
@@ -63,6 +65,7 @@ class InitialApplicationDataImpl : public virtual Application {
void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name);
void set_language(const mobile_api::Language::eType& language);
void set_ui_language(const mobile_api::Language::eType& ui_language);
+ void set_msg_version(const utils::SemanticVersion& version);
void set_perform_interaction_layout(
mobile_api::LayoutMode::eType layout) OVERRIDE;
@@ -77,6 +80,7 @@ class InitialApplicationDataImpl : public virtual Application {
mobile_api::Language::eType language_;
mobile_api::Language::eType ui_language_;
mobile_apis::LayoutMode::eType perform_interaction_layout_;
+ utils::SemanticVersion msg_version_;
private:
DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl);
@@ -275,13 +279,13 @@ class DynamicApplicationDataImpl : public virtual Application {
std::string display_layout_;
CommandsMap commands_;
- mutable std::shared_ptr<sync_primitives::Lock> commands_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock> commands_lock_ptr_;
SubMenuMap sub_menu_;
mutable std::shared_ptr<sync_primitives::Lock> sub_menu_lock_ptr_;
ChoiceSetMap choice_set_map_;
mutable std::shared_ptr<sync_primitives::Lock> choice_set_map_lock_ptr_;
PerformChoiceSetMap performinteraction_choice_set_map_;
- mutable std::shared_ptr<sync_primitives::Lock>
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
performinteraction_choice_set_lock_ptr_;
uint32_t is_perform_interaction_active_;
bool is_reset_global_properties_active_;
@@ -291,7 +295,7 @@ class DynamicApplicationDataImpl : public virtual Application {
void SetGlobalProperties(
const smart_objects::SmartObject& param,
void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&));
+ const ns_smart_device_link::ns_smart_objects::SmartObject&));
DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
};
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 496f591a50..f937ebebe1 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -41,18 +41,20 @@
#include <forward_list>
#include <stdint.h>
-#include "utils/date_time.h"
+#include "application_manager/application.h"
#include "application_manager/application_data_impl.h"
#include "application_manager/usage_statistics.h"
+#include "application_manager/help_prompt_manager_impl.h"
#include "application_manager/hmi_state.h"
#include "protocol_handler/protocol_handler.h"
#include "connection_handler/device.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/custom_string.h"
#include "utils/timer.h"
#include "utils/macro.h"
+#include "utils/date_time.h"
namespace usage_statistics {
@@ -89,15 +91,7 @@ class ApplicationImpl : public virtual Application,
const std::string& mac_address,
const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
- utils::SharedPtr<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,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager);
~ApplicationImpl();
@@ -175,6 +169,7 @@ class ApplicationImpl : public virtual Application,
const;
const std::string& app_icon_path() const;
connection_handler::DeviceHandle device() const;
+ connection_handler::DeviceHandle secondary_device() const;
const std::string& mac_address() const OVERRIDE;
const std::string& bundle_id() const OVERRIDE;
void set_bundle_id(const std::string& bundle_id) OVERRIDE;
@@ -191,6 +186,7 @@ class ApplicationImpl : public virtual Application,
bool set_app_icon_path(const std::string& path);
void set_app_allowed(const bool allowed);
void set_device(connection_handler::DeviceHandle device);
+ void set_secondary_device(connection_handler::DeviceHandle secondary_device);
virtual uint32_t get_grammar_id() const;
virtual void set_grammar_id(uint32_t value);
bool is_audio() const OVERRIDE;
@@ -202,6 +198,24 @@ class ApplicationImpl : public virtual Application,
virtual void set_is_resuming(bool is_resuming);
virtual bool is_resuming() const;
+ /**
+ * @brief Remembers the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ * @param level The HMI level which the app would resume into. Specify
+ * INVALID_ENUM to clear the state.
+ */
+ void set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) OVERRIDE;
+ /**
+ * @brief Returns the HMI level which the app would resume into if high-
+ * bandwidth transport were available.
+ *
+ * A value of INVALID_ENUM indicates that the app does not have deferred
+ * HMI level.
+ * @return HMI level which the app would resume into
+ */
+ mobile_api::HMILevel::eType deferred_resumption_hmi_level() const OVERRIDE;
+
bool AddFile(const AppFile& file);
bool UpdateFile(const AppFile& file);
bool DeleteFile(const std::string& file_name);
@@ -247,6 +261,12 @@ class ApplicationImpl : public virtual Application,
UsageStatistics& usage_report();
+ /**
+ * @brief Access to HelpPromptManager interface
+ * @return object for Handling VR help
+ */
+ HelpPromptManager& help_prompt_manager() OVERRIDE;
+
bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
TLimitSource source);
virtual void SubscribeToSoftButtons(int32_t cmd_id,
@@ -325,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
*/
@@ -449,6 +475,7 @@ class ApplicationImpl : public virtual Application,
bool audio_streaming_suspended_;
sync_primitives::Lock video_streaming_suspended_lock_;
sync_primitives::Lock audio_streaming_suspended_lock_;
+ sync_primitives::Lock streaming_stop_lock_;
bool is_app_allowed_;
bool has_been_activated_;
@@ -462,13 +489,16 @@ class ApplicationImpl : public virtual Application,
std::string app_icon_path_;
std::string mac_address_;
connection_handler::DeviceHandle device_id_;
+ connection_handler::DeviceHandle secondary_device_id_;
std::string bundle_id_;
AppFilesMap app_files_;
std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
UsageStatistics usage_report_;
+ HelpPromptManagerImpl help_prompt_manager_impl_;
protocol_handler::MajorProtocolVersion protocol_version_;
bool is_voice_communication_application_;
- sync_primitives::atomic_bool is_resuming_;
+ std::atomic_bool is_resuming_;
+ mobile_api::HMILevel::eType deferred_resumption_hmi_level_;
bool is_hash_changed_during_suspend_;
uint32_t video_stream_retry_number_;
@@ -483,7 +513,7 @@ class ApplicationImpl : public virtual Application,
/**
* @brief Defines number per time in seconds limits
*/
- typedef std::pair<TimevalStruct, uint32_t> TimeToNumberLimit;
+ typedef std::pair<date_time::TimeDuration, uint32_t> TimeToNumberLimit;
/**
* @brief Defines specific command number per time in seconds limits
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 7433a5560f..b169839f23 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
@@ -86,7 +86,7 @@
#endif // TELEMETRY_MONITOR
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "utils/message_queue.h"
#include "utils/prioritized_queue.h"
#include "utils/threads/thread.h"
@@ -118,7 +118,7 @@ typedef std::map<std::string, hmi_apis::Common_TransportType::eType>
DeviceTypes;
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
class ApplicationManagerImpl
: public ApplicationManager,
@@ -181,12 +181,18 @@ 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;
void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) OVERRIDE;
+ const std::shared_ptr<Application> app) OVERRIDE;
+
+ void SendDriverDistractionState(ApplicationSharedPtr application);
ApplicationSharedPtr application(
const std::string& device_id,
@@ -222,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
@@ -319,7 +302,7 @@ class ApplicationManagerImpl
void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
#endif // TELEMETRY_MONITOR
- ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration) OVERRIDE;
/*
* @brief Closes application by id
@@ -363,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;
/**
@@ -388,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
@@ -402,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
@@ -435,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
@@ -473,28 +421,13 @@ class ApplicationManagerImpl
* @return new regular HMI state
*/
HmiStatePtr CreateRegularState(
- utils::SharedPtr<Application> app,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
mobile_apis::VideoStreamingState::eType video_state,
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
@@ -658,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,
@@ -671,6 +600,10 @@ class ApplicationManagerImpl
const int32_t& session_key,
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason) OVERRIDE;
+ void OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) OVERRIDE;
+ void OnSecondaryTransportEndedCallback(const int32_t session_key) OVERRIDE;
/**
* @brief Check if application with specified app_id has NAVIGATION HMI type
@@ -818,6 +751,18 @@ class ApplicationManagerImpl
ApplicationConstSharedPtr application) const;
/**
+ * @brief Checks if required transport for resumption is available
+ *
+ * The required transport can be configured through smartDeviceLink.ini file.
+ *
+ * @param application an instance of the app to check
+ * @return true if the app is connected through one of the required
+ * transports, false otherwise
+ */
+ bool CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const;
+
+ /**
* Getter for resume_controller
* @return Resume Controller
*/
@@ -843,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
*
@@ -908,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;
@@ -1106,6 +1021,8 @@ class ApplicationManagerImpl
StateController& state_controller() OVERRIDE;
const ApplicationManagerSettings& get_settings() const OVERRIDE;
+ std::string GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const OVERRIDE;
virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE;
app_launch::AppLaunchCtrl& app_launch_ctrl() OVERRIDE;
@@ -1140,6 +1057,14 @@ class ApplicationManagerImpl
mobile_apis::AppHMIType::eType StringToAppHMIType(std::string str);
/**
+ * @brief Returns a string representation of AppHMIType
+ * @param type an enum value of AppHMIType
+ * @return string representation of the enum value
+ */
+ const std::string AppHMITypeToString(
+ mobile_apis::AppHMIType::eType type) const;
+
+ /**
* @brief Method compares arrays of app HMI type
* @param from_policy contains app HMI type from policy
* @param from_application contains app HMI type from application
@@ -1164,7 +1089,7 @@ class ApplicationManagerImpl
uint32_t app_count = NULL == app_array ? 0 : app_array->size();
typename ApplicationList::const_iterator it;
for (it = app_list.begin(); it != app_list.end(); ++it) {
- if (!it->valid()) {
+ if (it->use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application not found ");
continue;
}
@@ -1208,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
@@ -1285,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
@@ -1325,14 +1241,6 @@ class ApplicationManagerImpl
void DisallowStreaming(uint32_t app_id);
/**
- * @brief Checks if driver distraction state is valid, creates message
- * and puts it to postponed message.
- * @param application contains registered application.
- */
- void PutDriverDistractionMessageToPostponed(
- ApplicationSharedPtr application) const;
-
- /**
* @brief Types of directories used by Application Manager
*/
enum DirectoryType { TYPE_STORAGE, TYPE_SYSTEM, TYPE_ICONS };
@@ -1396,6 +1304,15 @@ class ApplicationManagerImpl
const std::string& mac_address);
/**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ const std::string GetTransportTypeProfileString(
+ connection_handler::DeviceHandle device_handle) const;
+
+ /**
* @brief Converts BSON object containing video parameters to
* smart object's map object
* @param output the smart object to add video parameters
@@ -1423,7 +1340,8 @@ class ApplicationManagerImpl
ForbiddenApps forbidden_applications;
// Lock for applications list
- mutable std::shared_ptr<sync_primitives::Lock> applications_list_lock_ptr_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ applications_list_lock_ptr_;
mutable std::shared_ptr<sync_primitives::Lock>
apps_to_register_list_lock_ptr_;
mutable sync_primitives::Lock subscribed_way_points_apps_lock_;
@@ -1442,7 +1360,7 @@ class ApplicationManagerImpl
* @brief Map contains applications which
* will send TTS global properties to HMI after timeout
*/
- std::map<uint32_t, TimevalStruct> tts_global_properties_app_list_;
+ std::map<uint32_t, date_time::TimeDuration> tts_global_properties_app_list_;
bool audio_pass_thru_active_;
uint32_t audio_pass_thru_app_id_;
@@ -1452,13 +1370,14 @@ 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_;
hmi_message_handler::HMIMessageHandler* hmi_handler_;
connection_handler::ConnectionHandler* connection_handler_;
- std::auto_ptr<policy::PolicyHandlerInterface> policy_handler_;
+ std::unique_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
request_controller::RequestController request_ctrl_;
std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_;
@@ -1487,7 +1406,7 @@ class ApplicationManagerImpl
static uint32_t corelation_id_;
static const uint32_t max_corelation_id_;
- std::auto_ptr<HMICapabilities> hmi_capabilities_;
+ std::unique_ptr<HMICapabilities> hmi_capabilities_;
// The reason of HU shutdown
mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_;
@@ -1496,7 +1415,7 @@ class ApplicationManagerImpl
* about persistent application data on disk, and save session ID for resuming
* application in case INGITION_OFF or MASTER_RESSET
*/
- std::auto_ptr<resumption::ResumeCtrl> resume_ctrl_;
+ std::unique_ptr<resumption::ResumeCtrl> resume_ctrl_;
HmiInterfacesImpl hmi_interfaces_;
@@ -1509,10 +1428,10 @@ class ApplicationManagerImpl
std::vector<TimerSPtr> timer_pool_;
sync_primitives::Lock timer_pool_lock_;
- mutable sync_primitives::Lock stopping_application_mng_lock_;
+ mutable sync_primitives::RecursiveLock stopping_application_mng_lock_;
StateControllerImpl state_ctrl_;
- std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
- std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchData> app_launch_dto_;
+ std::unique_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
/**
* @brief ReregisterWaitList is list of applications expected to be
@@ -1523,6 +1442,12 @@ class ApplicationManagerImpl
mutable sync_primitives::Lock reregister_wait_list_lock_;
+ // This is a cache to remember DeviceHandle of secondary transports. Only used
+ // during RegisterApplication().
+ typedef std::map<int32_t, connection_handler::DeviceHandle> DeviceMap;
+
+ DeviceMap secondary_transport_devices_cache_;
+
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
@@ -1570,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 ce2706f9a0..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,9 +40,8 @@
#include "utils/macro.h"
namespace application_manager {
-using rpc_service::RPCService;
using policy::PolicyHandlerInterface;
-typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+typedef std::shared_ptr<commands::Command> CommandSharedPtr;
/**
* @brief Factory class for command creation
@@ -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/command_holder.h b/src/components/application_manager/include/application_manager/command_holder.h
index d3171aedbb..8cfe5f0889 100644
--- a/src/components/application_manager/include/application_manager/command_holder.h
+++ b/src/components/application_manager/include/application_manager/command_holder.h
@@ -36,7 +36,6 @@
#include <string>
#include "application_manager/application.h"
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
namespace application_manager {
/**
diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h
index c15506ac75..18a1de7526 100644
--- a/src/components/application_manager/include/application_manager/command_holder_impl.h
+++ b/src/components/application_manager/include/application_manager/command_holder_impl.h
@@ -42,7 +42,7 @@
#include "application_manager/rpc_service.h"
#include "smart_objects/smart_object.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/macro.h"
namespace application_manager {
@@ -99,7 +99,7 @@ class CommandHolderImpl : public CommandHolder {
using AppCommands =
std::map<ApplicationSharedPtr,
- std::vector<utils::SharedPtr<smart_objects::SmartObject> > >;
+ std::vector<std::shared_ptr<smart_objects::SmartObject> > >;
ApplicationManager& app_manager_;
sync_primitives::Lock commands_lock_;
diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h
index 6524799f45..f8ea7db24d 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -34,7 +34,6 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
#include <stdint.h>
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
namespace application_manager {
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..27aa93d1d8 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,
@@ -57,7 +55,7 @@ struct ResponseInfo {
bool is_not_used;
};
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
/**
* @brief MergeInfos merge 2 infos in one string
@@ -191,7 +189,7 @@ class CommandRequestImpl : public CommandImpl,
* @param msg_params HMI request msg params
*/
void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const;
+ const ns_smart::SmartObject& msg_params) const;
/**
* @brief Converts HMI result code to Mobile result code
diff --git a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
index 11cd602b8e..927a45c6a6 100644
--- a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h
@@ -41,7 +41,7 @@ namespace application_manager {
namespace commands {
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
public:
@@ -86,7 +86,7 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
* @param function_id the function id for which response will be sent
*/
void FillCommonParametersOfSO(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message,
+ ns_smart_device_link::ns_smart_objects::SmartObject& message,
const uint32_t correlation_id,
const hmi_apis::FunctionID::eType function_id);
diff --git a/src/components/application_manager/include/application_manager/commands/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
index c8f5e90d4e..aa43d2e6d1 100644
--- a/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/response_to_hmi.h
@@ -42,7 +42,7 @@ namespace application_manager {
namespace commands {
-namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+namespace ns_smart = ns_smart_device_link::ns_smart_objects;
class ResponseToHMI : public CommandImpl {
public:
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
index 4cdbb902de..ed923369ac 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
@@ -118,7 +118,7 @@ class EventDispatcherImpl : public EventDispatcher {
private:
// Members section
sync_primitives::Lock state_lock_;
- sync_primitives::Lock observer_lock_;
+ sync_primitives::RecursiveLock observer_lock_;
EventObserverMap observers_event_;
ObserverVector observers_;
};
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager.h b/src/components/application_manager/include/application_manager/help_prompt_manager.h
new file mode 100644
index 0000000000..a0c34e77d7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager.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_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
+
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+/**
+ * @brief The HelpPromptManager is a mechanism for handling "help" requests
+ * by the user when the application does not provide any or such information.
+ */
+class HelpPromptManager {
+ public:
+ /**
+ * @brief Class destructor
+ */
+ virtual ~HelpPromptManager() {}
+
+ /**
+ * @brief Adds command to constructed values, and sends SetGlobalProperties if
+ * required
+ * @param cmd_id command unique ID
+ * @param command smart object with commands to add
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ virtual void OnVrCommandAdded(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) = 0;
+
+ /**
+ * @brief Removes command from constructed values, and send
+ * SetGlobalProperties if required
+ * @param cmd_id command unique ID
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ virtual void OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) = 0;
+
+ /**
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
+ virtual void OnSetGlobalPropertiesReceived(
+ const smart_objects::SmartObject& msg, const bool is_response) = 0;
+
+ /**
+ * @brief Requests sending type behavior
+ */
+ enum class SendingType { kNoneSend, kSendHelpPrompt, kSendVRHelp, kSendBoth };
+
+ /**
+ * @brief Get current sending type
+ * @return current sending type
+ */
+ virtual SendingType GetSendingType() const = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
new file mode 100644
index 0000000000..42125375e2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h
@@ -0,0 +1,188 @@
+/*
+ * 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_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
+
+#include "application_manager/help_prompt_manager.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "utils/lock.h"
+#include "utils/timer.h"
+
+namespace application_manager {
+
+class Application;
+class ApplicationManager;
+
+/**
+ * @brief The HelpPromptManagerImpl class implemented interface
+ * HelpPromptManager
+ * is a mechanism for handling "help" requests
+ * by the user when the application does not provide any or such information.
+ */
+class HelpPromptManagerImpl : public HelpPromptManager {
+ public:
+ /**
+ * @brief Container for buffering VR help commands
+ */
+ typedef std::pair<uint32_t, smart_objects::SmartObjectSPtr> VRCommandPair;
+ typedef std::vector<VRCommandPair> VRCommandPairs;
+
+ /**
+ * @brief Class constructor
+ * @param app owner for this class
+ */
+ HelpPromptManagerImpl(Application& app, ApplicationManager& app_manager);
+
+ /**
+ * @brief Class destructor
+ */
+ ~HelpPromptManagerImpl();
+
+ /**
+ * @brief Adds command to constructed values, and sends SetGlobalProperties if
+ * required
+ * @param cmd_id command unique ID
+ * @param command smart object with commands to add
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ void OnVrCommandAdded(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) OVERRIDE;
+
+ /**
+ * @brief Removes command from constructed values, and send
+ * SetGlobalProperties if required
+ * @param cmd_id command unique ID
+ * @param is_resumption flag for identifying if command was added during data
+ * resumption process
+ */
+ void OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) OVERRIDE;
+
+ /**
+ * @brief Stop constructing vrHelp and/or helpPrompt if they are present in
+ * message
+ * @param msg containing GlobalProperties
+ * @param is_response determines is the request or response for the for
+ * the SetGlobalPropertiesRequest
+ */
+ void OnSetGlobalPropertiesReceived(const smart_objects::SmartObject& msg,
+ const bool is_response) OVERRIDE;
+
+ /**
+ * @brief Get current sending type
+ * @return current sending type
+ */
+ SendingType GetSendingType() const OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HelpPromptManagerImpl);
+
+ /**
+ * @brief Add new smart object with VR command to the map
+ * @param cmd_id ID of VR command
+ * @param command smart object containing VR command structure
+ * @return true if first kLimitCommand commands was changed after adding
+ * of the current command otherwise returns false
+ */
+ bool AddCommand(const uint32_t cmd_id,
+ const smart_objects::SmartObject& command);
+ /**
+ * @brief Delete VR command from map by its cmd_id
+ * @param cmd_id ID of VR command
+ * @return true if first kLimitCommand commands was changed after deleting
+ * of the current command otherwise returns false
+ */
+ bool DeleteCommand(const uint32_t cmd_id);
+
+ /**
+ * @brief Send TTS request to HMI
+ */
+ void SendTTSRequest();
+
+ /**
+ * @brief Send UI request to HMI
+ */
+ void SendUIRequest();
+
+ /**
+ * @brief Send TTS and UI requests to HMI
+ */
+ void SendBothRequests();
+
+ /**
+ * @brief Send TTS or UI or both Requests
+ */
+ void SendRequests();
+
+ /**
+ * @brief Construct the helpPrompt parameter
+ */
+ void CreatePromptMsg(smart_objects::SmartObject& out_msg_params);
+
+ /**
+ * @brief Construct the vrHelp parameter
+ */
+ void CreateVRMsg(smart_objects::SmartObject& out_msg_params);
+
+ /**
+ * @brief Setting request type to send HMI
+ * @param msg containing request or response for the
+ * SetGlobalPropertiesRequest
+ */
+ void SetSendingType(const smart_objects::SmartObject& msg);
+
+ /**
+ * @brief Get the total count of commands in VRCommand pairs
+ * @param end_element pointer to VRCommandPairs element to which commands
+ * should be counted
+ * @return total count of commands
+ */
+ size_t GetCommandsCount(VRCommandPairs::const_iterator end_element) const;
+
+ Application& app_;
+ ApplicationManager& app_manager_;
+ VRCommandPairs vr_commands_;
+ sync_primitives::Lock vr_commands_lock_;
+ SendingType sending_type_;
+ bool is_tts_send_;
+ bool is_ui_send_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_
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 a22d32920a..4b7779e08c 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -35,8 +35,8 @@
#include <iosfwd>
#include <list>
+#include <memory>
#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
#include "utils/macro.h"
namespace application_manager {
@@ -45,7 +45,7 @@ class HmiState;
class ApplicationManager;
class Application;
-typedef utils::SharedPtr<HmiState> HmiStatePtr;
+typedef std::shared_ptr<HmiState> HmiStatePtr;
/**
* @brief The HmiState class
@@ -81,7 +81,7 @@ class HmiState {
* @param app Application pointer
* @param app_mngr Application manager
*/
- HmiState(utils::SharedPtr<Application> app,
+ HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
/**
@@ -90,26 +90,7 @@ class HmiState {
* @param app_mngr Application manager
* @param state_id HMI state to assign
*/
- HmiState(utils::SharedPtr<Application> app,
- 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,
+ HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id);
@@ -226,7 +207,7 @@ class HmiState {
}
protected:
- utils::SharedPtr<Application> app_;
+ std::shared_ptr<Application> app_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
@@ -272,10 +253,8 @@ class VRHmiState : public HmiState {
public:
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
- VRHmiState(utils::SharedPtr<Application> app,
+ VRHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
-
- DEPRECATED VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
};
/**
@@ -283,11 +262,9 @@ class VRHmiState : public HmiState {
*/
class TTSHmiState : public HmiState {
public:
- TTSHmiState(utils::SharedPtr<Application> app,
+ 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;
};
@@ -298,7 +275,7 @@ class TTSHmiState : public HmiState {
*/
class VideoStreamingHmiState : public HmiState {
public:
- VideoStreamingHmiState(utils::SharedPtr<Application> app,
+ VideoStreamingHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
mobile_apis::VideoStreamingState::eType video_streaming_state()
@@ -311,7 +288,7 @@ class VideoStreamingHmiState : public HmiState {
*/
class NaviStreamingHmiState : public VideoStreamingHmiState {
public:
- NaviStreamingHmiState(utils::SharedPtr<Application> app,
+ NaviStreamingHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr);
mobile_apis::AudioStreamingState::eType audio_streaming_state()
@@ -324,12 +301,9 @@ class NaviStreamingHmiState : public VideoStreamingHmiState {
*/
class PhoneCallHmiState : public HmiState {
public:
- PhoneCallHmiState(utils::SharedPtr<Application> app,
+ 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 {
@@ -343,12 +317,9 @@ class PhoneCallHmiState : public HmiState {
*/
class SafetyModeHmiState : public HmiState {
public:
- SafetyModeHmiState(utils::SharedPtr<Application> app,
+ 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;
@@ -365,11 +336,9 @@ class SafetyModeHmiState : public HmiState {
*/
class DeactivateHMI : public HmiState {
public:
- DeactivateHMI(utils::SharedPtr<Application> app,
+ 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 {
@@ -387,11 +356,9 @@ class DeactivateHMI : public HmiState {
*/
class AudioSource : public HmiState {
public:
- AudioSource(utils::SharedPtr<Application> app,
+ 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 {
@@ -410,11 +377,9 @@ class AudioSource : public HmiState {
*/
class EmbeddedNavi : public HmiState {
public:
- EmbeddedNavi(utils::SharedPtr<Application> app,
+ 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 7ca3e59f09..1c319cf204 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -36,7 +36,6 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
#include "protocol/message_priority.h"
#include "protocol/rpc_type.h"
#include "protocol/common.h"
@@ -89,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);
@@ -126,8 +124,8 @@ class Message {
protocol_handler::MajorProtocolVersion version_;
};
-typedef utils::SharedPtr<application_manager::Message> MobileMessage;
-typedef utils::SharedPtr<application_manager::Message> MessagePtr;
+typedef std::shared_ptr<application_manager::Message> MobileMessage;
+typedef std::shared_ptr<application_manager::Message> MessagePtr;
} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
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 6590098a01..010816808c 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;
@@ -72,7 +73,23 @@ typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData;
class MessageHelper {
public:
/**
- * @brief Creates request for different interfaces(JSON, DBUS)
+ * @brief CreateNotification creates basic mobile notification smart object
+ * @param function_id Notification function ID
+ * @param app_id application to send notification
+ * @return basic mobile notification smart object
+ */
+ static smart_objects::SmartObjectSPtr CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id);
+ /**
+ * @brief CreateHMINotification creates basic hmi notification smart object
+ * @param function_id Notification function ID
+ * @return basic hmi notification smart object
+ */
+ static smart_objects::SmartObjectSPtr CreateHMINotification(
+ hmi_apis::FunctionID::eType function_id);
+
+ /**
+ * @brief Creates request for different interfaces(JSON)
* @param correlation_id unique ID
* @param params Vector of arguments that we need in GetVehicleData request
* (e.g. gps, odometer, fuel_level)
@@ -286,6 +303,24 @@ class MessageHelper {
ApplicationManager& app_mngr);
/*
+ * @brief Create Common.DeviceInfo struct from device handle
+ * @param device_handle device handle of the app
+ * @param session_observer instance of SessionObserver to retrieve device
+ * information
+ * @param policy_handler instance of PolicyHandlerInterface to get the value
+ * of 'isSDLAllowed'
+ * @param app_mngr instance of ApplicationManager
+ * @param output smart object to store created Common.DeviceInfo struct
+ * @return true on success, false otherwise
+ */
+ static bool CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output);
+
+ /*
* @brief Create Common.HMIApplication struct application instance
* @param app : applicaton instace
* @param output smart object to store Common.HMIApplication struct
@@ -313,7 +348,7 @@ class MessageHelper {
bool is_unexpected_disconnect,
ApplicationManager& app_mngr);
- static NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+ static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
@@ -425,7 +460,7 @@ class MessageHelper {
static void SendSystemRequestNotification(
uint32_t connection_key,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& content,
+ ns_smart_device_link::ns_smart_objects::SmartObject& content,
ApplicationManager& app_mngr);
/**
@@ -533,7 +568,7 @@ class MessageHelper {
/**
* @brief Sends UnsubscribeWayPoints request
- * @return true if UnSubscribedWayPoints is send otherwise false
+ * @return true if UnsubscribedWayPoints is send otherwise false
*/
static bool SendUnsubscribedWayPoints(ApplicationManager& app_mngr);
@@ -581,10 +616,9 @@ class MessageHelper {
* @param app current application
* @return verification result
*/
- static mobile_apis::Result::eType VerifyImageApplyPath(
- smart_objects::SmartObject& image,
- ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr);
+ static void ApplyImagePath(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
/*
* @brief Verify image and add image file full path
@@ -601,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.
@@ -629,7 +678,7 @@ class MessageHelper {
* @return returns FALSE if string contains incorrect character or
* string is empty otherwise returns TRUE
*/
- static bool VerifySoftButtonString(const std::string& str);
+ static bool VerifyString(const std::string& str);
static mobile_apis::Result::eType ProcessSoftButtons(
smart_objects::SmartObject& message_params,
diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h
index ad660d0b66..b2ad963f46 100644
--- a/src/components/application_manager/include/application_manager/mobile_message_handler.h
+++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h
@@ -38,7 +38,7 @@
#include "application_manager/message.h"
namespace application_manager {
-typedef utils::SharedPtr<application_manager::Message> MobileMessage;
+typedef std::shared_ptr<application_manager::Message> MobileMessage;
class MobileMessageHandler {
public:
static application_manager::Message* HandleIncomingMessageProtocol(
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
index 8d019784fc..c8f3bcf888 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -206,7 +206,7 @@ class PolicyHandler : public PolicyHandlerInterface,
void add_listener(PolicyHandlerObserver* listener) OVERRIDE;
void remove_listener(PolicyHandlerObserver* listener) OVERRIDE;
- utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager()
+ std::shared_ptr<usage_statistics::StatisticsManager> GetStatisticManager()
const OVERRIDE;
/**
@@ -552,7 +552,7 @@ class PolicyHandler : public PolicyHandlerInterface,
int32_t timespan_seconds) OVERRIDE;
#ifdef BUILD_TESTS
- void SetPolicyManager(utils::SharedPtr<PolicyManager> pm) {
+ void SetPolicyManager(std::shared_ptr<PolicyManager> pm) {
policy_manager_ = pm;
}
#endif // BUILD_TESTS
@@ -732,9 +732,9 @@ class PolicyHandler : public PolicyHandlerInterface,
private:
mutable sync_primitives::RWLock policy_manager_lock_;
- utils::SharedPtr<PolicyManager> policy_manager_;
+ std::shared_ptr<PolicyManager> policy_manager_;
void* dl_handle_;
- utils::SharedPtr<PolicyEventObserver> event_observer_;
+ std::shared_ptr<PolicyEventObserver> event_observer_;
uint32_t last_activated_app_id_;
/**
@@ -756,9 +756,9 @@ class PolicyHandler : public PolicyHandlerInterface,
std::map<std::string, std::string> app_to_device_link_;
// Lock for app to device list
- sync_primitives::Lock app_to_device_link_lock_;
+ sync_primitives::RecursiveLock app_to_device_link_lock_;
- utils::SharedPtr<StatisticManagerImpl> statistic_manager_impl_;
+ std::shared_ptr<StatisticManagerImpl> statistic_manager_impl_;
const PolicySettings& settings_;
application_manager::ApplicationManager& application_manager_;
friend class AppPermissionDelegate;
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h
index c0bae1aac8..ea8d95a92a 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -38,7 +38,7 @@
#include <list>
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/threads/thread.h"
#include "utils/conditional_variable.h"
#include "utils/threads/thread_delegate.h"
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
index 95585279ca..57b6986af0 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -52,7 +52,7 @@ namespace request_controller {
* @brief Typedef for active mobile request
*
*/
-typedef utils::SharedPtr<commands::Command> RequestPtr;
+typedef std::shared_ptr<commands::Command> RequestPtr;
struct RequestInfo {
enum RequestType { RequestNone, MobileRequest, HMIRequest };
@@ -62,7 +62,7 @@ struct RequestInfo {
, app_id_(0)
, requst_type_(RequestNone)
, correlation_id_(0) {
- start_time_ = date_time::DateTime::getCurrentTime();
+ start_time_ = date_time::getCurrentTime();
updateEndTime();
}
virtual ~RequestInfo() {}
@@ -71,14 +71,14 @@ struct RequestInfo {
const RequestType requst_type,
const uint64_t timeout_msec)
: request_(request), timeout_msec_(timeout_msec), correlation_id_(0) {
- start_time_ = date_time::DateTime::getCurrentTime();
+ start_time_ = date_time::getCurrentTime();
updateEndTime();
requst_type_ = requst_type;
}
RequestInfo(RequestPtr request,
const RequestType requst_type,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
void updateEndTime();
@@ -87,11 +87,11 @@ struct RequestInfo {
bool isExpired();
- TimevalStruct start_time() {
+ date_time::TimeDuration start_time() {
return start_time_;
}
- void update_start_time(TimevalStruct start_time) {
+ void update_start_time(date_time::TimeDuration start_time) {
start_time_ = start_time;
}
@@ -103,7 +103,7 @@ struct RequestInfo {
timeout_msec_ = timeout;
}
- TimevalStruct end_time() {
+ date_time::TimeDuration end_time() {
return end_time_;
}
@@ -128,27 +128,27 @@ struct RequestInfo {
protected:
RequestPtr request_;
- TimevalStruct start_time_;
+ date_time::TimeDuration start_time_;
uint64_t timeout_msec_;
- TimevalStruct end_time_;
+ date_time::TimeDuration end_time_;
uint32_t app_id_;
RequestType requst_type_;
uint32_t correlation_id_;
};
-typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
+typedef std::shared_ptr<RequestInfo> RequestInfoPtr;
struct MobileRequestInfo : public RequestInfo {
MobileRequestInfo(RequestPtr request, const uint64_t timeout_msec);
MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
};
struct HMIRequestInfo : public RequestInfo {
HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec);
HMIRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec);
};
@@ -270,13 +270,13 @@ class RequestInfoSet {
* during time scale
*/
struct TimeScale {
- TimeScale(const TimevalStruct& start,
- const TimevalStruct& end,
+ TimeScale(const date_time::TimeDuration& start,
+ const date_time::TimeDuration& end,
const uint32_t& app_id)
: start_(start), end_(end), app_id_(app_id) {}
bool operator()(RequestInfoPtr setEntry) {
- if (!setEntry.valid()) {
+ if (setEntry.use_count() == 0) {
return false;
}
@@ -292,8 +292,8 @@ struct TimeScale {
}
private:
- TimevalStruct start_;
- TimevalStruct end_;
+ date_time::TimeDuration start_;
+ date_time::TimeDuration end_;
uint32_t app_id_;
};
diff --git a/src/components/application_manager/include/application_manager/request_tracker.h b/src/components/application_manager/include/application_manager/request_tracker.h
index 36ab3eaefb..b351e716a7 100644
--- a/src/components/application_manager/include/application_manager/request_tracker.h
+++ b/src/components/application_manager/include/application_manager/request_tracker.h
@@ -85,7 +85,7 @@ class RequestTracker {
const mobile_apis::HMILevel::eType level);
private:
- typedef std::vector<TimevalStruct> RequestAddedAt;
+ typedef std::vector<date_time::TimeDuration> RequestAddedAt;
typedef std::map<ApplicationID, RequestAddedAt> ApplicationsRequestsTracker;
/**
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 0ec58f2419..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,14 +34,14 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_
#include <stdint.h>
-#include "utils/shared_ptr.h"
+#include <time.h>
#include "application_manager/resumption/resumption_data.h"
namespace application_manager {
class ApplicationManager;
class Application;
-typedef utils::SharedPtr<Application> ApplicationSharedPtr;
-typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef std::shared_ptr<Application> ApplicationSharedPtr;
+typedef std::shared_ptr<const Application> ApplicationConstSharedPtr;
}
namespace app_mngr = 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
@@ -158,6 +174,13 @@ class ResumeCtrl {
app_mngr::ApplicationSharedPtr application) = 0;
/**
+ * @brief Retry resumption of an app if it has been disabled or limited
+ * due to absence of high-bandwidth transport.
+ * @param app_id ID of the app to resume
+ */
+ virtual void RetryResumption(const uint32_t app_id) = 0;
+
+ /**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
@@ -263,7 +286,9 @@ class ResumeCtrl {
#ifdef BUILD_TESTS
virtual void set_resumption_storage(
- utils::SharedPtr<ResumptionData> mock_storage) = 0;
+ std::shared_ptr<ResumptionData> mock_storage) = 0;
+
+ virtual bool get_resumption_active() const = 0;
#endif // BUILD_TESTS
};
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 d7ff621c95..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();
@@ -178,6 +190,13 @@ class ResumeCtrlImpl : public ResumeCtrl,
app_mngr::ApplicationSharedPtr application) OVERRIDE;
/**
+ * @brief Retry resumption of an app if it has been disabled or limited
+ * due to absence of high-bandwidth transport.
+ * @param app_id ID of the app to resume
+ */
+ void RetryResumption(const uint32_t app_id) OVERRIDE;
+
+ /**
* @brief Check if there are all files need for resumption
* @param application that is need to be restored
* @return true if it all files exist, otherwise return false
@@ -293,14 +312,30 @@ 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(
- utils::SharedPtr<ResumptionData> mock_storage) OVERRIDE;
+ std::shared_ptr<ResumptionData> mock_storage) OVERRIDE;
+
+ bool get_resumption_active() const OVERRIDE;
#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
@@ -381,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);
@@ -400,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;
@@ -438,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
@@ -500,6 +579,19 @@ class ResumeCtrlImpl : public ResumeCtrl,
const application_manager::ApplicationSharedPtr application) const;
/**
+ * @brief Retrieve the HMI level of the app when high-bandwidth transport
+ *isn't available
+ *
+ * The value is configured through smartDeviceLink.ini file
+ *
+ * @param application an instance of the app
+ * @return HMI level that the app is allowed when high-bandwidth transport
+ *isn't available
+ */
+ mobile_apis::HMILevel::eType GetHmiLevelOnLowBandwidthTransport(
+ app_mngr::ApplicationConstSharedPtr application) const;
+
+ /**
*@brief Mapping applications to time_stamps
* wait for timer to resume HMI Level
*
@@ -513,7 +605,9 @@ class ResumeCtrlImpl : public ResumeCtrl,
bool is_data_saved_;
bool is_suspended_;
time_t launch_time_;
- utils::SharedPtr<ResumptionData> resumption_storage_;
+ 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 bee2bce570..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
@@ -276,7 +282,7 @@ class ResumptionData {
++first;
}
}
- mutable sync_primitives::Lock resumption_lock_;
+ mutable sync_primitives::RecursiveLock resumption_lock_;
const application_manager::ApplicationManager& application_manager_;
};
} // namespace resumption
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/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
index 5e891608c6..cc93e4213c 100644
--- a/src/components/application_manager/include/application_manager/rpc_handler_impl.h
+++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h
@@ -57,26 +57,25 @@
#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+#include "utils/semantic_version.h"
namespace application_manager {
namespace rpc_handler {
namespace impl {
-struct MessageFromMobile : public utils::SharedPtr<Message> {
+struct MessageFromMobile : public std::shared_ptr<Message> {
MessageFromMobile() {}
- explicit MessageFromMobile(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
+ explicit MessageFromMobile(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return (*this)->Priority().OrderingValue();
}
};
-struct MessageFromHmi : public utils::SharedPtr<Message> {
+struct MessageFromHmi : public std::shared_ptr<Message> {
MessageFromHmi() {}
- explicit MessageFromHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
+ explicit MessageFromHmi(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return (*this)->Priority().OrderingValue();
@@ -144,12 +143,23 @@ class RPCHandlerImpl : public RPCHandler,
void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE;
#endif // TELEMETRY_MONITOR
+ /**
+ * @brief Extracts and validates the syncMsgVersion included in
+ * a RegisterAppInterfaceRequest
+ *
+ * @param output - SmartObject Message received from mobile
+ * @param messageVersion - message version to be updated
+ */
+ void GetMessageVersion(
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ utils::SemanticVersion& message_version);
+
private:
- void ProcessMessageFromMobile(const utils::SharedPtr<Message> message);
- void ProcessMessageFromHMI(const utils::SharedPtr<Message> message);
+ void ProcessMessageFromMobile(const std::shared_ptr<Message> message);
+ void ProcessMessageFromHMI(const std::shared_ptr<Message> message);
bool ConvertMessageToSO(const Message& message,
smart_objects::SmartObject& output);
- utils::SharedPtr<Message> ConvertRawMsgToMessage(
+ std::shared_ptr<Message> ConvertRawMsgToMessage(
const ::protocol_handler::RawMessagePtr message);
hmi_apis::HMI_API& hmi_so_factory();
mobile_apis::MOBILE_API& mobile_so_factory();
diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h
index 6f39e11592..1eaeb46255 100644
--- a/src/components/application_manager/include/application_manager/rpc_service_impl.h
+++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h
@@ -58,11 +58,11 @@ namespace rpc_service {
namespace impl {
-struct MessageToMobile : public utils::SharedPtr<Message> {
+struct MessageToMobile : public std::shared_ptr<Message> {
MessageToMobile() : is_final(false) {}
- explicit MessageToMobile(const utils::SharedPtr<Message>& message,
+ explicit MessageToMobile(const std::shared_ptr<Message>& message,
bool final_message)
- : utils::SharedPtr<Message>(message), is_final(final_message) {}
+ : std::shared_ptr<Message>(message), is_final(final_message) {}
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return (*this)->Priority().OrderingValue();
@@ -71,10 +71,10 @@ struct MessageToMobile : public utils::SharedPtr<Message> {
bool is_final;
};
-struct MessageToHmi : public utils::SharedPtr<Message> {
+struct MessageToHmi : public std::shared_ptr<Message> {
MessageToHmi() {}
- explicit MessageToHmi(const utils::SharedPtr<Message>& message)
- : utils::SharedPtr<Message>(message) {}
+ explicit MessageToHmi(const std::shared_ptr<Message>& message)
+ : std::shared_ptr<Message>(message) {}
// PrioritizedQueue requires this method to decide which priority to assign
size_t PriorityOrder() const {
return (*this)->Priority().OrderingValue();
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 80e475a680..6e32853a3d 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
@@ -2,9 +2,6 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
- Copyright (c) 2017 Xevo Inc.
- All rights reserved.
-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -16,7 +13,7 @@
disclaimer in the documentation and/or other materials provided with the
distribution.
- Neither the name of the copyright holders nor the names of their contributors
+ 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.
@@ -54,6 +51,7 @@ extern const char* msg_params;
extern const char* method_name;
extern const char* info;
extern const char* app_id;
+extern const char* full_app_id;
extern const char* bundle_id;
extern const char* app_info;
extern const char* app_launch;
@@ -160,6 +158,7 @@ extern const char* hours;
extern const char* minutes;
extern const char* seconds;
extern const char* update_mode;
+extern const char* audioStreamingIndicator;
extern const char* trigger_source;
extern const char* hmi_level;
extern const char* activate_app_hmi_level;
@@ -218,6 +217,7 @@ extern const char* did_location;
extern const char* app_list;
extern const char* device_list;
extern const char* device_info;
+extern const char* secondary_device_info;
extern const char* name;
extern const char* id;
extern const char* isSDLAllowed;
@@ -260,6 +260,7 @@ extern const char* prndl;
extern const char* tire_pressure;
extern const char* odometer;
extern const char* belt_status;
+extern const char* electronic_park_brake_status;
extern const char* body_information;
extern const char* device_status;
extern const char* driver_braking;
@@ -310,6 +311,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/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h
index 58747fdd6e..99113d6d00 100644
--- a/src/components/application_manager/include/application_manager/state_controller_impl.h
+++ b/src/components/application_manager/include/application_manager/state_controller_impl.h
@@ -420,7 +420,7 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param state_id state id
* @return
*/
- HmiStatePtr CreateHmiState(utils::SharedPtr<Application> app,
+ HmiStatePtr CreateHmiState(std::shared_ptr<Application> app,
HmiState::StateID state_id) const;
/**
diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h
index 20b3aaca5a..49f15165db 100644
--- a/src/components/application_manager/include/application_manager/telemetry_observer.h
+++ b/src/components/application_manager/include/application_manager/telemetry_observer.h
@@ -36,7 +36,7 @@
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "json/json.h"
-#include "utils/shared_ptr.h"
+
#include "utils/date_time.h"
namespace application_manager {
@@ -44,11 +44,11 @@ namespace application_manager {
class AMTelemetryObserver {
public:
struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
- utils::SharedPtr<smart_objects::SmartObject> message;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
+ std::shared_ptr<smart_objects::SmartObject> message;
};
- typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr;
+ typedef std::shared_ptr<MessageMetric> MessageMetricSharedPtr;
virtual void OnMessage(MessageMetricSharedPtr) = 0;
virtual ~AMTelemetryObserver() {}
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
index 886389b05c..6d0b5cd6bd 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -38,7 +38,7 @@
#include "policy/usage_statistics/counter.h"
#include "policy/usage_statistics/app_stopwatch.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "interfaces/MOBILE_API.h"
namespace application_manager {
@@ -47,10 +47,10 @@ class UsageStatistics {
public:
UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager);
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager);
UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
usage_statistics::AppStopwatch* time_in_hmi_state_ptr);
void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level);
void RecordAppRegistrationGuiLanguage(
@@ -66,7 +66,7 @@ class UsageStatistics {
void RecordTLSError();
private:
- std::auto_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
+ std::unique_ptr<usage_statistics::AppStopwatch> time_in_hmi_state_sptr_;
usage_statistics::AppInfo app_registration_language_gui_;
usage_statistics::AppInfo app_registration_language_vui_;
usage_statistics::AppCounter count_of_rejected_rpc_calls_;
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..128c668ee9 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"
@@ -39,15 +39,16 @@ namespace rc_rpc_plugin {
namespace app_mngr = application_manager;
namespace commands {
+
+enum capabilitiesStatus { success, missedLightName, missedParam, readOnly };
+
+typedef std::pair<std::string, capabilitiesStatus> ModuleCapability;
+
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
@@ -85,10 +86,12 @@ class SetInteriorVehicleDataRequest : public RCCommandRequest {
/**
* @brief Method that check if READ_ONLY parameters present
- * @param request_params params from received message
+ * @param request_params params from received message,
+ * @param module_data_capabilities info for notification to mobile
* @return true if present , false - otherwise
*/
- bool AreReadOnlyParamsPresent(const smart_objects::SmartObject& module_data);
+ bool AreReadOnlyParamsPresent(const smart_objects::SmartObject& module_data,
+ ModuleCapability& module_data_capabilities);
/**
* @brief Method that check if all request parameters are READ_ONLY
@@ -99,7 +102,7 @@ class SetInteriorVehicleDataRequest : public RCCommandRequest {
/**
* @brief Method that cuts-off READ_ONLY parameters
- * @param request_params params to handle
+ * @param module_data params to handle
*/
void CutOffReadOnlyParams(smart_objects::SmartObject& module_data);
@@ -118,8 +121,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/sdl_rpc_plugin/src/commands/mobile/set_icon_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
index 514c6ad6d4..8e7ed9c667 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_icon_response.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h
@@ -1,5 +1,4 @@
/*
-
Copyright (c) 2018, Ford Motor Company
All rights reserved.
@@ -31,32 +30,35 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sdl_rpc_plugin/commands/mobile/set_icon_response.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/rpc_service.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
+#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 commands {
+namespace application_manager {
+class ApplicationManager;
+namespace rpc_service {
+class RPCService;
+}
+class HMICapabilities;
+}
-SetIconResponse::SetIconResponse(
- const application_manager::commands::MessageSharedPtr& message,
- ApplicationManager& app_man,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler)
- : CommandResponseImpl(
- message, app_man, rpc_service, hmi_capabilities, policy_handler) {}
+namespace policy {
+class PolicyHandlerInterface;
+}
-SetIconResponse::~SetIconResponse() {}
+namespace rc_rpc_plugin {
-void SetIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
+class ResourceAllocationManager;
+class InteriorDataCache;
+class InteriorDataManager;
- rpc_service_.SendMessageToMobile(message_);
+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_;
+};
}
-
-} // namespace commands
-
-} // namespace application_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/dbus/include/dbus/dbus_message_controller.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
index a4a3718ce3..f12566d14c 100644
--- a/src/components/dbus/include/dbus/dbus_message_controller.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,69 +29,53 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
-
+#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 <map>
-#include "dbus/dbus_adapter.h"
#include "smart_objects/smart_object.h"
-namespace dbus {
+namespace rc_rpc_plugin {
-class DBusMessageController : public DBusAdapter {
+/**
+ * @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 constructs DBus message controller
- * @param sdlServiceName name of service SDL
- * @param sdlObjectPath path of object SDL
- * @param hmiServiceName name of service HMI
- * @param hmiObjectPath path of object HMI
- */
- DBusMessageController(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath);
-
- /**
- * @brief destructs DBus message controller
+ * @brief Add module data to cache
+ * @param module_type module type name
+ * @param module_data data to be cached
*/
- virtual ~DBusMessageController();
+ virtual void Add(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) = 0;
/**
- * @brief subscribes to the DBus signal.
- * @param interface name of interface in HMI
- * @param signal name of signal
+ * @brief Retrieve Get cached data
+ * @param module_type data type to get from cache
+ * @return smart object with cached data, or nulll smart object
*/
- void SubscribeTo(const std::string& interface, const std::string& signal);
+ virtual smart_objects::SmartObject Retrieve(
+ const std::string& module_type) const = 0;
/**
- * @brief Method for receiving thread.
+ * @brief Contains check if data exists in cache
+ * @param module_type module type name to check in cache
+ * @return true if cached, false otherwize
*/
- void* MethodForReceiverThread(void*);
+ virtual bool Contains(const std::string& module_type) const = 0;
/**
- * @brief Main thread loop.
+ * @brief Remove cached data
+ * @param module_type data type to remove from cache
*/
- bool Run();
+ virtual void Remove(const std::string& module_type) = 0;
/**
- * @brief Signal shutdown for thread loop.
+ * @brief Clear clear all cached data
*/
- void Shutdown();
-
- protected:
- /**
- * @brief sends message to core
- * @param obj
- */
- virtual void SendMessageToCore(const smart_objects::SmartObject& obj) = 0;
-
- private:
- bool shutdown_;
+ virtual void Clear() = 0;
};
+} // rc_rpc_plugin
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
+#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..9b16a2c4da
--- /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<date_time::TimeDuration> >
+ 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 05994492c2..e36968fc4b 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,11 +30,13 @@
* 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>
+#include <memory>
+#include "utils/macro.h"
#include "application_manager/app_extension.h"
namespace rc_rpc_plugin {
@@ -67,19 +69,26 @@ 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_;
// AppExtension interface
public:
- void SaveResumptionData(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data) OVERRIDE;
- void ProcessResumption(const NsSmartDeviceLink::NsSmartObjects::SmartObject&
- resumption_data) OVERRIDE;
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
+ void ProcessResumption(
+ const ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
};
-typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
+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 e22f2b64a8..1951af1a24 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,10 +40,24 @@ 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 kStatusAvailable[] = "statusAvailable";
+const char kDensityAvailable[] = "densityAvailable";
+const char kRGBColorSpaceAvailable[] = "rgbColorSpaceAvailable";
+
+// RadioControlCapabilities
+const char kSiriusxmRadioAvailable[] = "siriusxmRadioAvailable";
} // strings
namespace result_codes {
@@ -90,6 +104,7 @@ const char kCode[] = "code";
namespace message_params {
const char kName[] = "name";
+const char kId[] = "id";
// SetInteriorVehicleData request
const char kModuleData[] = "moduleData";
@@ -114,6 +129,11 @@ const char kButtonName[] = "buttonName";
const char kButtonPressMode[] = "buttonPressMode";
// ButtonPress request
+// OnRCStatusNotification
+const char kAllocatedModules[] = "allocatedModules";
+const char kFreeModules[] = "freeModules";
+// OnRCStatusNotification
+
// RdsData struct
const char kPS[] = "PS";
const char kRT[] = "RT";
@@ -136,6 +156,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
@@ -150,11 +171,31 @@ 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 kLightStatus[] = "status";
+const char kLightDensity[] = "density";
+const char kLightColor[] = "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
const char kHMIAppID[] = "appID";
@@ -168,6 +209,10 @@ namespace enums_value {
// ModuleType enum
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
@@ -230,4 +275,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 0dc8b59f8f..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,11 +30,11 @@
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"
-#include "utils/shared_ptr.h"
+
#include "interfaces/HMI_API.h"
#include "application_manager/plugin_manager/rpc_plugin.h"
#include "rc_rpc_plugin/rc_app_extension.h"
@@ -56,6 +56,19 @@ enum eType { FREE = 0, BUSY };
}
/**
+ * Defines triggers for OnRCStatus notification sending
+ */
+namespace NotificationTrigger {
+/**
+ * @brief The eType
+ * APP_REGISTRATION RC app registation event
+ * RC_STATE_CHANGING enabling/disabling RC on HMI event
+ * MODULE_ALLOCATION module allocation/deallocation event
+ */
+enum eType { APP_REGISTRATION = 0, MODULE_ALLOCATION, RC_STATE_CHANGING };
+}
+
+/**
* @brief Resources defines list of resources
*/
typedef std::vector<std::string> Resources;
@@ -141,11 +154,25 @@ class ResourceAllocationManager {
*/
virtual void ResetAllAllocations() = 0;
- virtual RCAppExtensionPtr GetApplicationExtention(
+ /**
+ * @brief Create and send OnRCStatusNotification to mobile and HMI
+ * @param event trigger for notification sending
+ * @param application - app that should receive notification
+ * in case of registration; in cases of RC enabling/disabling
+ * or module allocation - application is just empty shared ptr,
+ * because in these cases all registered RC apps should
+ * receive a notification
+ */
+ virtual void SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
application_manager::ApplicationSharedPtr application) = 0;
+ virtual bool is_rc_enabled() const = 0;
+
+ virtual void set_rc_enabled(const bool value) = 0;
+
virtual ~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 bb875bb180..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,15 +110,29 @@ 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(
+ void SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
application_manager::ApplicationSharedPtr application) FINAL;
+ bool is_rc_enabled() const FINAL;
+
+ void set_rc_enabled(const bool value) FINAL;
+
private:
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+ /**
+ * @brief Create OnRCStatusNotification creates OnRCStatus notification smart
+ * object for mobile application
+ * @param app_id application to send OnRCStatusNotification
+ * @return smart object with mobile OnRCStatusNotification
+ */
+ smart_objects::SmartObjectSPtr CreateOnRCStatusNotificationToMobile(
+ const application_manager::ApplicationSharedPtr app);
+
+ smart_objects::SmartObjectSPtr CreateOnRCStatusNotificationToHmi(
+ const application_manager::ApplicationSharedPtr app);
+
/**
* @brief IsModuleTypeRejected check if current resource was rejected by
* driver for current application
@@ -176,7 +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
@@ -204,7 +217,8 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager {
hmi_apis::Common_RCAccessMode::eType current_access_mode_;
application_manager::ApplicationManager& app_mngr_;
application_manager::rpc_service::RPCService& rpc_service_;
+ bool is_rc_enabled_;
};
} // 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 817223a369..91cb6cb7ee 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,30 +87,9 @@ 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;
- Apps apps = RCRPCPlugin::GetRCApplications(application_manager_);
- for (Apps::iterator it = apps.begin(); it != apps.end(); ++it) {
- application_manager::ApplicationSharedPtr app = *it;
- DCHECK(app);
- application_manager_.ChangeAppsHMILevel(
- app->app_id(), mobile_apis::HMILevel::eType::HMI_NONE);
-
- const RCAppExtensionPtr extension =
- application_manager::AppExtensionPtr::static_pointer_cast<
- RCAppExtension>(app->QueryInterface(RCRPCPlugin::kRCPluginID));
- if (extension) {
- UnsubscribeFromInteriorVehicleDataForAllModules(extension);
- }
- }
+ interior_data_manager_.OnDisablingRC();
}
void RCOnRemoteControlSettingsNotification::Run() {
@@ -131,6 +110,7 @@ void RCOnRemoteControlSettingsNotification::Run() {
hmi_apis::Common_RCAccessMode::eType access_mode =
hmi_apis::Common_RCAccessMode::INVALID_ENUM;
LOG4CXX_DEBUG(logger_, "Allowing RC Functionality");
+ resource_allocation_manager_.set_rc_enabled(true);
if ((*message_)[app_mngr::strings::msg_params].keyExists(
message_params::kAccessMode)) {
access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>(
@@ -150,6 +130,7 @@ void RCOnRemoteControlSettingsNotification::Run() {
LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality");
DisallowRCFunctionality();
resource_allocation_manager_.ResetAllAllocations();
+ resource_allocation_manager_.set_rc_enabled(false);
}
}
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..5ce047071c 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() {}
@@ -182,7 +173,7 @@ void ButtonPressRequest::Execute() {
LOG4CXX_AUTO_TRACE(logger_);
const char* button_name;
- NsSmartDeviceLink::NsSmartObjects::
+ ns_smart_device_link::ns_smart_objects::
EnumConversionHelper<mobile_apis::ButtonName::eType>::EnumToCString(
static_cast<mobile_apis::ButtonName::eType>(
(*message_)[app_mngr::strings::msg_params]
@@ -290,7 +281,7 @@ std::string ButtonPressRequest::ModuleType() {
(*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
.asUInt());
const char* str;
- const bool ok = NsSmartDeviceLink::NsSmartObjects::EnumConversionHelper<
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
return ok ? str : "unknown";
}
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 38f94637c2..93e37b95a7 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,40 +48,31 @@ 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_);
- if (enums_value::kRadio == module_type &&
- !rc_capabilities.keyExists(strings::kradioControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Radio control capabilities not present");
- return false;
- }
- if (enums_value::kClimate == module_type &&
- !rc_capabilities.keyExists(strings::kclimateControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Climate control capabilities not present");
- return false;
+ const auto& mapping = RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ const auto& module_list = RCHelpers::GetModulesList();
+ bool is_module_type_valid = false;
+ for (const auto& module : module_list) {
+ if (module == module_type) {
+ if (rc_capabilities.keyExists(mapping(module))) {
+ is_module_type_valid = true;
+ break;
+ }
+ }
}
-
- return true;
+ 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();
@@ -91,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(
@@ -142,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);
@@ -150,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(),
@@ -159,7 +248,7 @@ void GetInteriorVehicleDataRequest::on_event(
GetInteriorVehicleDataRequest::~GetInteriorVehicleDataRequest() {}
void GetInteriorVehicleDataRequest::ProccessSubscription(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_response) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject& hmi_response) {
LOG4CXX_AUTO_TRACE(logger_);
const bool is_subscribe_present_in_request =
@@ -176,10 +265,9 @@ 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::
+ ns_smart_device_link::ns_smart_objects::
EnumConversionHelper<mobile_apis::ModuleType::eType>::EnumToCString(
static_cast<mobile_apis::ModuleType::eType>(
hmi_response[app_mngr::strings::msg_params]
@@ -256,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());
@@ -283,7 +370,7 @@ std::string GetInteriorVehicleDataRequest::ModuleType() {
(*message_)[app_mngr::strings::msg_params][message_params::kModuleType]
.asUInt());
const char* str;
- const bool ok = NsSmartDeviceLink::NsSmartObjects::EnumConversionHelper<
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
return ok ? str : "unknown";
}
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 dfe2feb622..37890b7979 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,9 +79,7 @@ void OnInteriorVehicleDataNotification::Run() {
DCHECK(*it);
application_manager::Application& app = **it;
- RCAppExtensionPtr extension =
- application_manager::AppExtensionPtr::static_pointer_cast<
- RCAppExtension>(app.QueryInterface(RCRPCPlugin::kRCPluginID));
+ const auto extension = RCHelpers::GetRCExtension(app);
DCHECK(extension);
LOG4CXX_TRACE(logger_,
"Check subscription for "
@@ -92,7 +99,7 @@ std::string OnInteriorVehicleDataNotification::ModuleType() {
[message_params::kModuleData][message_params::kModuleType]
.asUInt());
const char* str;
- const bool ok = NsSmartDeviceLink::NsSmartObjects::EnumConversionHelper<
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
return ok ? str : "unknown";
}
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 160915f347..88df9d8382 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
@@ -32,6 +32,8 @@
#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"
@@ -56,10 +58,23 @@ 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);
+ } else if (enums_value::kLight == module_type) {
+ module_ro_params.push_back(kLightStatus);
}
+
return module_ro_params;
}
+const std::map<std::string, std::string> GetLightCapabilitiesMapping() {
+ std::map<std::string, std::string> mapping = {
+ {message_params::kId, strings::kName},
+ {message_params::kLightStatus, strings::kStatusAvailable},
+ {message_params::kLightDensity, strings::kDensityAvailable},
+ {message_params::kLightColor, strings::kRGBColorSpaceAvailable}};
+ return mapping;
+}
+
const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
std::map<std::string, std::string> mapping;
// climate
@@ -73,6 +88,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";
@@ -81,10 +100,42 @@ 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";
+ mapping["coolingEnabled"] = "coolingEnabledAvailable";
+ mapping["heatingLevel"] = "heatingLevelAvailable";
+ mapping["coolingLevel"] = "coolingLevelAvailable";
+ mapping["horizontalPosition"] = "horizontalPositionAvailable";
+ mapping["verticalPosition"] = "verticalPositionAvailable";
+ mapping["frontVerticalPosition"] = "frontVerticalPositionAvailable";
+ mapping["backVerticalPosition"] = "backVerticalPositionAvailable";
+ mapping["backTiltAngle"] = "backTiltAngleAvailable";
+ mapping["headSupportHorizontalPosition"] =
+ "headSupportHorizontalPositionAvailable";
+ mapping["headSupportVerticalPosition"] =
+ "headSupportVerticalPositionAvailable";
+ mapping["massageEnabled"] = "massageEnabledAvailable";
+ 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;
}
@@ -94,81 +145,292 @@ 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() {}
-bool CheckControlDataByCapabilities(
- const smart_objects::SmartObject& module_caps,
+const std::string LightName(const smart_objects::SmartObject& light_name) {
+ const char* name;
+ const bool ok = ns_smart_device_link::ns_smart_objects::
+ EnumConversionHelper<mobile_apis::LightName::eType>::EnumToCString(
+ static_cast<mobile_apis::LightName::eType>(light_name.asUInt()),
+ &name);
+ return ok ? name : "unknown";
+}
+
+/**
+ * @brief Check whether the parameter exist in capabilities
+ * @param smart object of capabilities
+ * @param mapping - map of module data and capabilities
+ * @param request_parameter - string
+ * @param switched_off_result - ref of mobile_apis::Result
+ * @return success if parameter exist in capabilities missedParam otherwise
+ */
+capabilitiesStatus GetItemCapability(
+ const smart_objects::SmartObject& capabilities,
+ const std::map<std::string, std::string>& mapping,
+ const std::string& request_parameter,
+ const mobile_apis::Result::eType& switched_off_result) {
+ const auto it = mapping.find(request_parameter);
+
+ if (it == mapping.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Parameter " << request_parameter
+ << " doesn't exist in capabilities.");
+ return capabilitiesStatus::missedParam;
+ }
+
+ const std::string& caps_key = it->second;
+
+ LOG4CXX_DEBUG(logger_,
+ "Checking request parameter "
+ << request_parameter
+ << " with capabilities. Appropriate key is " << caps_key);
+
+ if (!capabilities.keyExists(caps_key)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability " << caps_key
+ << " is missed in RemoteControl capabilities");
+ return capabilitiesStatus::missedParam;
+ }
+
+ if (!capabilities[caps_key].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is switched off in RemoteControl capabilities");
+ capabilitiesStatus status = capabilitiesStatus::missedParam;
+ if (mobile_apis::Result::READ_ONLY == switched_off_result) {
+ status = capabilitiesStatus::readOnly;
+ }
+ return status;
+ }
+
+ return capabilitiesStatus::success;
+}
+
+/**
+ * @brief Check whether the cpabilities for light allowed
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetLightDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> mapping = GetLightCapabilitiesMapping();
+
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
+ const std::string& request_parameter = it->first;
+
+ if (message_params::kId == request_parameter) {
+ continue;
+ }
+
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities,
+ mapping,
+ request_parameter,
+ mobile_apis::Result::READ_ONLY);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair(message_params::kLightState,
+ status_item_capability);
+ }
+ }
+
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether the light name exists in capabilities
+ * @param smart object of capabilities_status
+ * @param smart object of light_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetLightNameCapabilities(
+ 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 GetLightDataCapabilities(so, light_data);
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "There is no such light name in capabilities");
+ return std::make_pair(message_params::kLightState,
+ capabilitiesStatus::missedLightName);
+}
+
+/**
+ * @brief Check whether the exists light data related to correspondent
+ * capabilities
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetControlDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
std::map<std::string, std::string> mapping =
GetModuleDataToCapabilitiesMapping();
- auto it = control_data.map_begin();
- for (; it != control_data.map_end(); ++it) {
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
const std::string& request_parameter = it->first;
- const std::string& caps_key = mapping[request_parameter];
- const smart_objects::SmartObject& capabilities_status = module_caps[0];
- 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 "
- << caps_key
- << " is missed in RemoteControl capabilities");
- return false;
+ if (message_params::kId == request_parameter) {
+ continue;
}
- if (!capabilities_status[caps_key].asBool()) {
- LOG4CXX_DEBUG(logger_,
- "Capability "
- << caps_key
- << " is switched off in RemoteControl capabilities");
- return false;
+ if (message_params::kLightState == request_parameter) {
+ auto light_data = control_data[request_parameter].asArray()->begin();
+ ModuleCapability light_capability =
+ std::make_pair("", capabilitiesStatus::success);
+
+ for (; light_data != control_data[request_parameter].asArray()->end();
+ ++light_data) {
+ light_capability = GetLightNameCapabilities(
+ capabilities[strings::kSupportedLights], *light_data);
+
+ if (capabilitiesStatus::success != light_capability.second) {
+ return light_capability;
+ }
+ }
+
+ return light_capability;
+ }
+
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities[0],
+ mapping,
+ request_parameter,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair("", status_item_capability);
}
}
- return true;
+
+ return std::make_pair("", capabilitiesStatus::success);
}
-bool CheckIfModuleDataExistInCapabilities(
+/**
+ * @brief Check whether the exists hmi data related to correspondent
+ * capabilities
+ * @param smart object of capabilities
+ * @param smart object of control_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetHmiControlDataCapabilities(
+ const smart_objects::SmartObject& capabilities,
+ const smart_objects::SmartObject& control_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::map<std::string, std::string> mapping =
+ GetModuleDataToCapabilitiesMapping();
+
+ for (auto it = control_data.map_begin(); it != control_data.map_end(); ++it) {
+ const capabilitiesStatus status_item_capability =
+ GetItemCapability(capabilities,
+ mapping,
+ it->first,
+ mobile_apis::Result::UNSUPPORTED_RESOURCE);
+
+ if (capabilitiesStatus::success != status_item_capability) {
+ return std::make_pair("", status_item_capability);
+ }
+ }
+
+ return std::make_pair("", capabilitiesStatus::success);
+}
+
+/**
+ * @brief Check whether rc module data capabilities are presented
+ * @param smart object of rc_capabilities
+ * @param smart object of module_data
+ * @return pair of state and capability status - ModuleCapability
+ */
+ModuleCapability GetModuleDataCapabilities(
const smart_objects::SmartObject& rc_capabilities,
const smart_objects::SmartObject& module_data) {
LOG4CXX_AUTO_TRACE(logger_);
- bool is_radio_data_valid = true;
- bool is_climate_data_valid = true;
- if (module_data.keyExists(message_params::kRadioControlData)) {
- if (!rc_capabilities.keyExists(strings::kradioControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Radio control capabilities not present");
- return false;
+
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& get_module_data_key = RCHelpers::GetModuleTypeToDataMapping();
+ const auto& get_capabilities_key =
+ RCHelpers::GetModuleTypeToCapabilitiesMapping();
+ ModuleCapability module_data_capabilities =
+ std::make_pair("", capabilitiesStatus::missedParam);
+
+ 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 module_data_capabilities;
+ }
+ const smart_objects::SmartObject& caps =
+ rc_capabilities[capabilities_key];
+
+ if (message_params::kHmiSettingsControlData == module_data_key) {
+ module_data_capabilities =
+ GetHmiControlDataCapabilities(caps, module_data[module_data_key]);
+ } else {
+ module_data_capabilities =
+ GetControlDataCapabilities(caps, module_data[module_data_key]);
+ }
}
- const smart_objects::SmartObject& radio_caps =
- rc_capabilities[strings::kradioControlCapabilities];
- is_radio_data_valid = CheckControlDataByCapabilities(
- radio_caps, module_data[strings::kRadioControlData]);
}
- if (module_data.keyExists(message_params::kClimateControlData)) {
- if (!rc_capabilities.keyExists(strings::kclimateControlCapabilities)) {
- LOG4CXX_DEBUG(logger_, " Climate control capabilities not present");
- return false;
+
+ return module_data_capabilities;
+}
+
+bool isModuleTypeAndDataMatch(const std::string& module_type,
+ const smart_objects::SmartObject& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const auto& all_module_types = RCHelpers::GetModulesList();
+ const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping();
+ bool module_type_and_data_match = false;
+ for (const auto& type : all_module_types) {
+ if (type == module_type) {
+ module_type_and_data_match = module_data.keyExists(data_mapping(type));
+ break;
}
- const smart_objects::SmartObject& climate_caps =
- rc_capabilities[strings::kclimateControlCapabilities];
- is_climate_data_valid = CheckControlDataByCapabilities(
- climate_caps, module_data[strings::kClimateControlData]);
}
+ return module_type_and_data_match;
+}
+
+mobile_apis::Result::eType PrepareResultCodeAndInfo(
+ const ModuleCapability module_data_capabilities, std::string& info) {
+ mobile_apis::Result::eType result_code =
+ mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ if (message_params::kLightState == module_data_capabilities.first) {
+ switch (module_data_capabilities.second) {
+ case capabilitiesStatus::missedLightName:
+ info = "The requested LightName is not supported by the vehicle.";
+ break;
+ case capabilitiesStatus::missedParam:
+ info =
+ "The requested parameter of the given LightName is not supported "
+ "by the vehicle.";
+ break;
+ case capabilitiesStatus::readOnly:
+ info = "The requested parameter is read-only.";
+ result_code = mobile_apis::Result::READ_ONLY;
+ break;
+ default:
+ break;
+ }
- return is_radio_data_valid && is_climate_data_valid;
+ } else {
+ info = "Accessing not supported module data.";
+ }
+ return result_code;
+ LOG4CXX_WARN(logger_, info);
}
void SetInteriorVehicleDataRequest::Execute() {
@@ -177,30 +439,26 @@ void SetInteriorVehicleDataRequest::Execute() {
smart_objects::SmartObject& module_data =
(*message_)[app_mngr::strings::msg_params][message_params::kModuleData];
const std::string module_type = ModuleType();
- bool module_type_and_data_match = true;
- if (enums_value::kRadio == module_type) {
- module_type_and_data_match =
- !(module_data.keyExists(message_params::kClimateControlData));
- }
-
- if (enums_value::kClimate == module_type) {
- module_type_and_data_match =
- !(module_data.keyExists(message_params::kRadioControlData));
- }
-
- if (module_type_and_data_match) {
+ if (isModuleTypeAndDataMatch(module_type, module_data)) {
const smart_objects::SmartObject* rc_capabilities =
hmi_capabilities_.rc_capability();
- if (rc_capabilities &&
- !CheckIfModuleDataExistInCapabilities(*rc_capabilities, module_data)) {
- LOG4CXX_WARN(logger_, "Accessing not supported module data");
- SetResourceState(ModuleType(), ResourceState::FREE);
- SendResponse(false,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- "Accessing not supported module data");
- return;
+ ModuleCapability module_data_capabilities;
+
+ if (rc_capabilities) {
+ module_data_capabilities =
+ GetModuleDataCapabilities(*rc_capabilities, module_data);
+
+ if (capabilitiesStatus::success != module_data_capabilities.second) {
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ std::string info;
+ mobile_apis::Result::eType result =
+ PrepareResultCodeAndInfo(module_data_capabilities, info);
+ SendResponse(false, result, info.c_str());
+ return;
+ }
}
+
if (AreAllParamsReadOnly(module_data)) {
LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!");
SetResourceState(ModuleType(), ResourceState::FREE);
@@ -209,11 +467,27 @@ void SetInteriorVehicleDataRequest::Execute() {
"All request params in module type are READ ONLY!");
return;
}
- if (AreReadOnlyParamsPresent(module_data)) {
+
+ module_data_capabilities = std::make_pair("", capabilitiesStatus::success);
+
+ if (AreReadOnlyParamsPresent(module_data, module_data_capabilities)) {
LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters");
+
+ if (enums_value::kLight == module_data_capabilities.first &&
+ capabilitiesStatus::success != module_data_capabilities.second) {
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(
+ false,
+ mobile_apis::Result::READ_ONLY,
+ "The LightStatus enum passed is READ ONLY and cannot be written.");
+ return;
+ }
+
LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... ");
+
CutOffReadOnlyParams(module_data);
}
+
application_manager_.RemoveHMIFakeParameters(message_);
app_mngr::ApplicationSharedPtr app =
@@ -221,6 +495,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);
@@ -256,6 +544,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);
@@ -265,13 +558,43 @@ void SetInteriorVehicleDataRequest::on_event(
const smart_objects::SmartObject& SetInteriorVehicleDataRequest::ControlData(
const smart_objects::SmartObject& module_data) {
- const std::string module = ModuleType();
+ const std::string module_type = ModuleType();
- if (enums_value::kRadio == module) {
- return module_data[message_params::kRadioControlData];
- } else {
- return module_data[message_params::kClimateControlData];
+ 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(
@@ -286,21 +609,95 @@ bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
return false;
}
}
+
+ LOG4CXX_DEBUG(logger_, "All params are ReadOnly");
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. ChannelName = "
+ << (*it)[message_params::kChannelName].asString());
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool CheckReadOnlyParamsForLight(
+ const smart_objects::SmartObject& module_type_params) {
+ if (module_type_params.keyExists(message_params::kLightState)) {
+ const auto& light_state = module_type_params[message_params::kLightState];
+ auto it = light_state.asArray()->begin();
+
+ for (; it != light_state.asArray()->end(); ++it) {
+ if (it->keyExists(message_params::kLightStatus)) {
+ const mobile_apis::LightStatus::eType light_status =
+ static_cast<mobile_apis::LightStatus::eType>(
+ (*it)[message_params::kLightStatus].asUInt());
+
+ if (helpers::Compare<mobile_apis::LightStatus::eType,
+ helpers::EQ,
+ helpers::ONE>(light_status,
+ mobile_apis::LightStatus::RAMP_UP,
+ mobile_apis::LightStatus::RAMP_DOWN,
+ mobile_apis::LightStatus::UNKNOWN,
+ mobile_apis::LightStatus::INVALID)) {
+ LOG4CXX_DEBUG(logger_,
+ "READ ONLY parameter. Status = "
+ << (*it)[message_params::kLightStatus].asInt());
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent(
- const smart_objects::SmartObject& module_data) {
+ const smart_objects::SmartObject& module_data,
+ ModuleCapability& module_data_capabilities) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& module_type_params =
ControlData(module_data);
+ const std::string module_type = ModuleType();
+
+ if (enums_value::kAudio == module_type) {
+ return CheckReadOnlyParamsForAudio(module_type_params);
+ }
+
+ if (enums_value::kLight == module_type) {
+ const bool result = CheckReadOnlyParamsForLight(module_type_params);
+
+ if (result) {
+ module_data_capabilities =
+ std::make_pair(module_type, capabilitiesStatus::readOnly);
+ }
+
+ return result;
+ }
+
+ const std::vector<std::string> ro_params =
+ GetModuleReadOnlyParams(module_type);
auto it = module_type_params.map_begin();
- std::vector<std::string> ro_params = GetModuleReadOnlyParams(ModuleType());
+
for (; it != module_type_params.map_end(); ++it) {
if (helpers::in_range(ro_params, it->first)) {
return true;
}
}
+
return false;
}
@@ -316,10 +713,26 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
if (module_type_params.keyExists(it)) {
if (enums_value::kClimate == module_type) {
module_data[message_params::kClimateControlData].erase(it);
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
} else if (enums_value::kRadio == module_type) {
module_data[message_params::kRadioControlData].erase(it);
- LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
+ } else {
+ continue;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it);
+ }
+ }
+
+ 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);
}
}
}
@@ -332,7 +745,7 @@ std::string SetInteriorVehicleDataRequest::ModuleType() {
[message_params::kModuleData][message_params::kModuleType]
.asUInt());
const char* str;
- const bool ok = NsSmartDeviceLink::NsSmartObjects::EnumConversionHelper<
+ const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper<
mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str);
return ok ? str : "unknown";
}
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 4f968dd2d8..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);
@@ -140,6 +134,14 @@ void RCCommandRequest::Run() {
SendResponse(false, mobile_apis::Result::DISALLOWED, "");
return;
}
+ if (!resource_allocation_manager_.is_rc_enabled()) {
+ LOG4CXX_WARN(logger_, "Remote control is disabled by user");
+ SetResourceState(ModuleType(), ResourceState::FREE);
+ SendResponse(false,
+ mobile_apis::Result::USER_DISALLOWED,
+ "Remote control is disabled by user");
+ return;
+ }
if (CheckDriverConsent()) {
if (AcquireResources()) {
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..0c42f6e3de
--- /dev/null
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc
@@ -0,0 +1,158 @@
+#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::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::MILLISECONDS_IN_SECOND;
+ auto lest_that_time_frame_ago = [time_frame](date_time::TimeDuration time) {
+ auto span = date_time::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..5282da8d83 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
@@ -59,10 +59,15 @@ bool RCAppExtension::IsSubscibedToInteriorVehicleData(
}
void RCAppExtension::SaveResumptionData(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data) {}
+ ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) {}
void RCAppExtension::ProcessResumption(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data) {}
+ const ns_smart_device_link::ns_smart_objects::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 36377c620b..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,9 +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(
@@ -44,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;
}
@@ -72,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(
@@ -90,15 +98,20 @@ void RCRPCPlugin::OnApplicationEvent(
}
switch (event) {
case plugins::kApplicationRegistered: {
- application->AddExtension(new RCAppExtension(kRCPluginID));
+ application->AddExtension(
+ std::shared_ptr<RCAppExtension>(new RCAppExtension(kRCPluginID)));
+ resource_allocation_manager_->SendOnRCStatusNotifications(
+ NotificationTrigger::APP_REGISTRATION, application);
break;
}
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:
@@ -125,4 +138,4 @@ RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications(
extern "C" application_manager::plugin_manager::RPCPlugin* Create() {
return new rc_rpc_plugin::RCRPCPlugin();
-}
+} // namespace rc_rpc_plugin
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 c2962863e3..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,12 +36,12 @@
#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"
-#include "utils/make_shared.h"
namespace rc_rpc_plugin {
@@ -52,7 +52,8 @@ ResourceAllocationManagerImpl::ResourceAllocationManagerImpl(
application_manager::rpc_service::RPCService& rpc_service)
: current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW)
, app_mngr_(app_mngr)
- , rpc_service_(rpc_service) {}
+ , rpc_service_(rpc_service)
+ , is_rc_enabled_(true) {}
ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {}
@@ -166,57 +167,147 @@ 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(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
}
}
}
-RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention(
- application_manager::ApplicationSharedPtr application) {
+template <typename EnumType>
+EnumType StringToEnum(const std::string& str) {
+ using smart_objects::EnumConversionHelper;
+ EnumType val;
+ EnumConversionHelper<EnumType>::StringToEnum(str, &val);
+ return val;
+}
+
+void ConstructOnRCStatusNotificationParams(
+ smart_objects::SmartObject& msg_params,
+ const std::map<std::string, uint32_t>& allocated_resources,
+ const std::vector<std::string>& supported_resources,
+ const uint32_t app_id) {
+ namespace strings = application_manager::strings;
+ namespace message_params = rc_rpc_plugin::message_params;
+ using smart_objects::SmartObject;
+ using smart_objects::SmartType_Map;
+ using smart_objects::SmartType_Array;
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;
+ auto modules_inserter = [](SmartObject& result_modules) {
+ return [&result_modules](const std::string& module_name) {
+ smart_objects::SmartObject module_data =
+ SmartObject(smart_objects::SmartType_Map);
+ auto module_type =
+ StringToEnum<mobile_apis::ModuleType::eType>(module_name);
+ module_data[message_params::kModuleType] = module_type;
+ result_modules.asArray()->push_back(module_data);
+ };
+ };
+ SmartObject allocated_modules = SmartObject(SmartType_Array);
+ for (const auto& module : allocated_resources) {
+ if (module.second == app_id) {
+ modules_inserter(allocated_modules)(module.first);
+ }
+ }
+ SmartObject free_modules = SmartObject(SmartType_Array);
+ for (auto& module : supported_resources) {
+ if (allocated_resources.find(module) == allocated_resources.end()) {
+ modules_inserter(free_modules)(module);
+ }
}
- rc_app_extension =
- application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
- app_extension);
-
- return rc_app_extension;
+ msg_params[message_params::kAllocatedModules] = allocated_modules;
+ msg_params[message_params::kFreeModules] = free_modules;
}
-void ResourceAllocationManagerImpl::RemoveAppsSubscriptions(const Apps& apps) {
+smart_objects::SmartObjectSPtr
+ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToMobile(
+ const application_manager::ApplicationSharedPtr app) {
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();
- }
+ using application_manager::MessageHelper;
+ auto msg_to_mobile = MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::OnRCStatusID, app->app_id());
+ auto& msg_params = (*msg_to_mobile)[application_manager::strings::msg_params];
+ if (is_rc_enabled()) {
+ ConstructOnRCStatusNotificationParams(msg_params,
+ allocated_resources_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
+ } else {
+ msg_params[message_params::kAllocatedModules] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[message_params::kFreeModules] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
}
+ return msg_to_mobile;
+}
+
+smart_objects::SmartObjectSPtr
+ResourceAllocationManagerImpl::CreateOnRCStatusNotificationToHmi(
+ const application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using application_manager::MessageHelper;
+ 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_,
+ RCHelpers::GetModulesList(),
+ app->app_id());
+ msg_params[application_manager::strings::app_id] = app->hmi_app_id();
+ return msg_to_hmi;
}
void ResourceAllocationManagerImpl::SetResourceAquired(
const std::string& module_type, const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
allocated_resources_[module_type] = app_id;
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+}
+
+void ResourceAllocationManagerImpl::SendOnRCStatusNotifications(
+ NotificationTrigger::eType event,
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr msg_to_mobile;
+ smart_objects::SmartObjectSPtr msg_to_hmi;
+ if (NotificationTrigger::APP_REGISTRATION == event) {
+ DCHECK(application);
+ msg_to_mobile = CreateOnRCStatusNotificationToMobile(application);
+ (*msg_to_mobile)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = is_rc_enabled();
+ rpc_service_.SendMessageToMobile(msg_to_mobile);
+ } else {
+ auto rc_apps = RCRPCPlugin::GetRCApplications(app_mngr_);
+ for (const auto& rc_app : rc_apps) {
+ msg_to_mobile = CreateOnRCStatusNotificationToMobile(rc_app);
+ (*msg_to_mobile)[application_manager::strings::msg_params]
+ [message_params::kAllowed] = is_rc_enabled();
+ rpc_service_.SendMessageToMobile(msg_to_mobile);
+ msg_to_hmi = CreateOnRCStatusNotificationToHmi(rc_app);
+ rpc_service_.SendMessageToHMI(msg_to_hmi);
+ }
+ }
+}
+
+bool ResourceAllocationManagerImpl::is_rc_enabled() const {
+ return is_rc_enabled_;
+}
+
+void ResourceAllocationManagerImpl::set_rc_enabled(const bool value) {
+ is_rc_enabled_ = value;
+ SendOnRCStatusNotifications(
+ NotificationTrigger::RC_STATE_CHANGING,
+ std::shared_ptr<application_manager::Application>());
}
void ResourceAllocationManagerImpl::SetResourceFree(
@@ -372,10 +463,11 @@ void ResourceAllocationManagerImpl::OnApplicationEvent(
for (; acquired_modules.end() != module; ++module) {
ReleaseResource(*module, application->app_id());
}
-
- Apps app_list;
- app_list.push_back(application);
- RemoveAppsSubscriptions(app_list);
+ if (!acquired_modules.empty()) {
+ SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+ }
}
}
@@ -392,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 a66ab107be..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)
@@ -53,6 +54,7 @@ file(GLOB SOURCES
set(LIBRARIES
RCRpcPluginStaticLib
ApplicationManager
+ connectionHandler
SmartObjects
ProtocolHandler
MessageHelper
@@ -71,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 5098f6472e..59d038a790 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,12 +37,12 @@
#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"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
@@ -78,9 +78,9 @@ class ButtonPressRequestTest
public:
ButtonPressRequestTest()
: rc_capabilities_(smart_objects::SmartType_Map)
- , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , mock_app_(std::make_shared<NiceMock<MockApplication> >())
, rc_app_extention_(
- utils::MakeShared<rc_rpc_plugin::RCAppExtension>(kModuleId)) {}
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(kModuleId)) {}
smart_objects::SmartObject ButtonCapability(
const mobile_apis::ButtonName::eType button_name) {
@@ -117,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_));
@@ -130,6 +130,8 @@ class ButtonPressRequestTest
CheckHMIType(kPolicyAppId,
mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
nullptr)).WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
}
MessageSharedPtr CreateBasicMessage() {
@@ -145,32 +147,37 @@ class ButtonPressRequestTest
}
template <class Command>
- application_manager::SharedPtr<Command> CreateRCCommand(
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return ::utils::MakeShared<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_;
- utils::SharedPtr<MockApplication> mock_app_;
- utils::SharedPtr<rc_rpc_plugin::RCAppExtension> rc_app_extention_;
+ std::shared_ptr<MockApplication> mock_app_;
+ std::shared_ptr<rc_rpc_plugin::RCAppExtension> rc_app_extention_;
test::components::policy_test::MockPolicyHandlerInterface
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,
Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
@@ -193,8 +200,8 @@ TEST_F(ButtonPressRequestTest,
.WillOnce(Return(true));
// Act
- application_manager::SharedPtr<rc_rpc_plugin::commands::ButtonPressRequest>
- command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
mobile_message);
ASSERT_TRUE(command->Init());
command->Run();
@@ -205,7 +212,7 @@ TEST_F(
Execute_ButtonNameDoesNotMatchModuleType_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO;
msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
@@ -232,8 +239,8 @@ TEST_F(
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
// Act
- application_manager::SharedPtr<rc_rpc_plugin::commands::ButtonPressRequest>
- command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
mobile_message);
ASSERT_TRUE(command->Init());
command->Run();
@@ -242,7 +249,7 @@ TEST_F(
TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
@@ -250,7 +257,7 @@ TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
mobile_apis::ButtonPressMode::SHORT;
MessageSharedPtr hmi_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
(*hmi_message)[application_manager::strings::msg_params];
hmi_apis::Common_Result::eType response_code =
hmi_apis::Common_Result::SUCCESS;
@@ -271,8 +278,8 @@ TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
application_manager::event_engine::Event event(
hmi_apis::FunctionID::Buttons_ButtonPress);
event.set_smart_object(*hmi_message);
- application_manager::SharedPtr<rc_rpc_plugin::commands::ButtonPressRequest>
- command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
mobile_message);
command->on_event(event);
}
@@ -281,7 +288,7 @@ TEST_F(ButtonPressRequestTest,
OnEvent_ReadOnlyParamFromHMI_ExpectFalseSentToMobile) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE;
msg_params[message_params::kButtonName] = mobile_apis::ButtonName::AC;
@@ -289,7 +296,7 @@ TEST_F(ButtonPressRequestTest,
mobile_apis::ButtonPressMode::SHORT;
MessageSharedPtr hmi_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
(*hmi_message)[application_manager::strings::params];
hmi_apis::Common_Result::eType response_code =
hmi_apis::Common_Result::READ_ONLY;
@@ -310,8 +317,8 @@ TEST_F(ButtonPressRequestTest,
application_manager::event_engine::Event event(
hmi_apis::FunctionID::Buttons_ButtonPress);
event.set_smart_object(*hmi_message);
- application_manager::SharedPtr<rc_rpc_plugin::commands::ButtonPressRequest>
- command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
+ std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command =
+ CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>(
mobile_message);
command->on_event(event);
}
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 7074bfb9c5..25dad2dc04 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,13 +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 "utils/shared_ptr.h"
-#include "utils/make_shared.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;
@@ -52,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;
@@ -66,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 {
@@ -76,163 +85,509 @@ class GetInteriorVehicleDataRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
GetInteriorVehicleDataRequestTest()
- : mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(utils::MakeShared<RCAppExtension>(kModuleId)) {
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , 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>
- application_manager::SharedPtr<Command> CreateRCCommand(
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return ::utils::MakeShared<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_;
- utils::SharedPtr<MockApplication> mock_app_;
- utils::SharedPtr<RCAppExtension> rc_app_extention_;
+ 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();
- application_manager::SharedPtr<
+ (*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));
+ (*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_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::RC_GetInteriorVehicleData))).Times(0);
EXPECT_CALL(
mock_rpc_service_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _))
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
.WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
- application_manager::SharedPtr<
- rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command =
- CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>(
- mobile_message);
+
+ // 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();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_msg_params =
- (*hmi_message)[application_manager::strings::msg_params];
+ MessageSharedPtr hmi_response = CreateBasicMessage();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_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);
- application_manager::SharedPtr<
+ 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();
+ ns_smart_device_link::ns_smart_objects::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();
+ ns_smart_device_link::ns_smart_objects::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();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& hmi_msg_params =
- (*hmi_message)[application_manager::strings::params];
- hmi_apis::Common_Result::eType 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;
+ 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(false));
+ .WillOnce(Return(true));
+ // Act
application_manager::event_engine::Event event(
hmi_apis::FunctionID::RC_GetInteriorVehicleData);
event.set_smart_object(*hmi_message);
- application_manager::SharedPtr<
+ 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();
+ ns_smart_device_link::ns_smart_objects::SmartObject& hmi_msg_params =
+ (*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::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(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_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);
+ 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 78d20c6b13..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,74 +69,83 @@ class OnInteriorVehicleDataNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
OnInteriorVehicleDataNotificationTest()
- : mock_app_(utils::MakeShared<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>
- application_manager::SharedPtr<Command> CreateRCCommand(
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return ::utils::MakeShared<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:
- utils::SharedPtr<MockApplication> mock_app_;
+ 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 =
- utils::MakeShared<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
- application_manager::SharedPtr<
- rc_rpc_plugin::commands::OnInteriorVehicleDataNotification> command =
- CreateRCCommand<
+ std::shared_ptr<rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>
+ command = CreateRCCommand<
rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>(
mobile_message);
command->Run();
+
// Assertions
- ASSERT_TRUE(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 f3ac768a4e..b95725e0b4 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"
@@ -67,7 +69,7 @@ class RCOnRemoteControlSettingsNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
RCOnRemoteControlSettingsNotificationTest()
- : mock_app_(utils::MakeShared<NiceMock<MockApplication> >()) {}
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >()) {}
MessageSharedPtr CreateBasicMessage() {
MessageSharedPtr message = CreateMessage();
(*message)[application_manager::strings::params]
@@ -85,21 +87,26 @@ class RCOnRemoteControlSettingsNotificationTest
}
template <class Command>
- application_manager::SharedPtr<Command> CreateRCCommand(
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return ::utils::MakeShared<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:
- utils::SharedPtr<MockApplication> mock_app_;
+ 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,
@@ -116,7 +123,7 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest,
EXPECT_CALL(mock_allocation_manager_,
SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER));
// Act
- application_manager::SharedPtr<
+ std::shared_ptr<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
CreateRCCommand<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
@@ -132,25 +139,11 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest,
(*mobile_message)[application_manager::strings::msg_params]
[message_params::kAllowed] = false;
- ApplicationSet app_set = {mock_app_};
-
- 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 =
- utils::MakeShared<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));
-
EXPECT_CALL(mock_allocation_manager_, ResetAllAllocations());
+ EXPECT_CALL(mock_interior_data_manager_, OnDisablingRC());
// Act
- application_manager::SharedPtr<
+ std::shared_ptr<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command =
CreateRCCommand<
rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>(
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 8fad1aef60..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"
@@ -53,7 +55,6 @@
#include "interfaces/MOBILE_API.h"
#include "include/test/protocol_handler/mock_protocol_handler.h"
#include "test/application_manager/mock_application_manager_settings.h"
-#include "utils/make_shared.h"
using ::testing::_;
using ::testing::Return;
@@ -62,7 +63,6 @@ using ::testing::NiceMock;
using ::testing::SaveArg;
using ::testing::Mock;
using ::testing::NiceMock;
-using ::utils::SharedPtr;
namespace am = ::application_manager;
using am::ApplicationSet;
using am::commands::MessageSharedPtr;
@@ -99,17 +99,17 @@ class RCGetInteriorVehicleDataConsentTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
RCGetInteriorVehicleDataConsentTest()
- : mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ : 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)
- , rc_app_extention_(utils::MakeShared<RCAppExtension>(kPluginID))
+ , 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(
- utils::MakeShared<NiceMock<MockRPCPluginManager> >())
+ std::make_shared<NiceMock<MockRPCPluginManager> >())
, rpc_plugin(mock_rpc_plugin)
, optional_mock_rpc_plugin(mock_rpc_plugin) {
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
@@ -121,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())
@@ -141,18 +143,21 @@ class RCGetInteriorVehicleDataConsentTest
.WillByDefault(Return(rpc_plugin));
ON_CALL(mock_allocation_manager_, IsResourceFree(kResource))
.WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
}
template <class Command>
- application_manager::SharedPtr<Command> CreateRCCommand(
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return ::utils::MakeShared<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() {
@@ -168,20 +173,24 @@ class RCGetInteriorVehicleDataConsentTest
}
protected:
- utils::SharedPtr<MockApplication> mock_app_;
+ std::shared_ptr<MockApplication> mock_app_;
MockRequestControlerSettings mock_request_controler;
MockProtocolHandler mock_protocol_handler;
MockHMIMessageHandler mock_hmi_handler;
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;
- utils::SharedPtr<RCAppExtension> rc_app_extention_;
- utils::SharedPtr<am::plugin_manager::MockRPCPluginManager>
+ am::rpc_service::RPCServiceImpl rpc_service_;
+ std::shared_ptr<RCAppExtension> rc_app_extention_;
+ std::shared_ptr<am::plugin_manager::MockRPCPluginManager>
mock_rpc_plugin_manager;
utils::Optional<RPCPlugin> rpc_plugin;
utils::Optional<MockRPCPlugin> optional_mock_rpc_plugin;
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 68985e5f94..47e1c9a389 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"
@@ -64,8 +66,8 @@ class SetInteriorVehicleDataRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
SetInteriorVehicleDataRequestTest()
- : mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
- , rc_app_extention_(utils::MakeShared<RCAppExtension>(kModuleId)) {}
+ : mock_app_(std::make_shared<NiceMock<MockApplication> >())
+ , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId)) {}
void SetUp() OVERRIDE {
ON_CALL(app_mngr_, hmi_interfaces())
@@ -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));
@@ -89,6 +91,8 @@ class SetInteriorVehicleDataRequestTest
CheckHMIType(kPolicyAppId,
mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
nullptr)).WillByDefault(Return(true));
+ ON_CALL(mock_allocation_manager_, is_rc_enabled())
+ .WillByDefault(Return(true));
}
MessageSharedPtr CreateBasicMessage() {
@@ -104,29 +108,34 @@ class SetInteriorVehicleDataRequestTest
}
template <class Command>
- application_manager::SharedPtr<Command> CreateRCCommand(
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateRCCommand(MessageSharedPtr& msg) {
InitCommand(kDefaultTimeout_);
- return ::utils::MakeShared<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_;
- utils::SharedPtr<MockApplication> mock_app_;
- utils::SharedPtr<RCAppExtension> rc_app_extention_;
+ 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_;
};
TEST_F(SetInteriorVehicleDataRequestTest,
Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleData][message_params::kModuleType] =
mobile_apis::ModuleType::CLIMATE;
@@ -145,7 +154,7 @@ TEST_F(SetInteriorVehicleDataRequestTest,
mobile_apis::Result::READ_ONLY),
application_manager::commands::Command::SOURCE_SDL));
// Act
- application_manager::SharedPtr<
+ std::shared_ptr<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
@@ -158,7 +167,7 @@ TEST_F(
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleData][message_params::kModuleType] =
mobile_apis::ModuleType::RADIO;
@@ -184,7 +193,7 @@ TEST_F(
application_manager::commands::Command::SOURCE_SDL));
// Act
- application_manager::SharedPtr<
+ std::shared_ptr<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
@@ -196,7 +205,7 @@ TEST_F(
Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
// Arrange
MessageSharedPtr mobile_message = CreateBasicMessage();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& msg_params =
+ ns_smart_device_link::ns_smart_objects::SmartObject& msg_params =
(*mobile_message)[application_manager::strings::msg_params];
msg_params[message_params::kModuleData][message_params::kModuleType] =
mobile_apis::ModuleType::RADIO;
@@ -215,7 +224,7 @@ TEST_F(
application_manager::commands::Command::SOURCE_SDL));
// Act
- application_manager::SharedPtr<
+ std::shared_ptr<
rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command =
CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>(
mobile_message);
diff --git a/src/components/dbus/include/dbus/message_descriptions.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
index a9e7a5e141..45465f96b0 100644
--- a/src/components/dbus/include/dbus/message_descriptions.h
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_interior_data_cache.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,45 +29,26 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
-#include <stdint.h>
-#include <stdlib.h>
-#include "interfaces/HMI_API.h"
+#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_
-namespace ford_message_descriptions {
+#include <string>
+#include "gmock/gmock.h"
+#include "rc_rpc_plugin/interior_data_cache.h"
-enum ParameterType { Integer, Boolean, Float, String, Struct, Enum, Array };
+namespace rc_rpc_plugin_test {
-struct ParameterDescription {
- const char* name;
- const ParameterType type;
- const bool obligatory; // TODO (dchmerev@luxoft.com): rename to 'mandatory'
- // as in HMI API description
+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());
};
-struct ArrayDescription {
- const ParameterDescription base;
- const ParameterDescription* element;
- const char* element_dbus_signature;
-};
-
-struct StructDescription {
- const ParameterDescription base;
- const ParameterDescription** parameters;
-};
-
-struct MessageDescription {
- const char* interface;
- const char* name;
- const hmi_apis::messageType::eType message_type;
- const hmi_apis::FunctionID::eType function_id;
- const ParameterDescription** parameters;
-};
-
-extern const MessageDescription* message_descriptions[];
-
-} // namespace ford_message_descriptions
+} // namespace rc_rpc_plugin_test
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
+#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 fb9326209c..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,12 +61,14 @@ 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,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_CONST_METHOD0(is_rc_enabled, bool());
+ MOCK_METHOD1(set_rc_enabled, void(const bool value));
};
} // 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 26840a1b33..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
@@ -34,12 +34,11 @@
#include "rc_rpc_plugin/resource_allocation_manager_impl.h"
#include "rc_rpc_plugin/rc_rpc_plugin.h"
+#include "rc_rpc_plugin/rc_module_constants.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_rpc_service.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
@@ -69,8 +68,10 @@ const std::string kModuleType2 = "RADIO";
const int32_t kConnectionKey = 5;
const int32_t kCorrelationId = 5;
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 = 6u;
}
namespace rc_rpc_plugin_test {
@@ -80,17 +81,19 @@ using namespace rc_rpc_plugin;
class RAManagerTest : public ::testing::Test {
public:
RAManagerTest()
- : message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
+ : message_(std::make_shared<Message>(MessagePriority::FromServiceType(
protocol_handler::ServiceType::kRpc)))
- , mock_app_1_(utils::MakeShared<NiceMock<MockApplication> >())
- , mock_app_2_(utils::MakeShared<NiceMock<MockApplication> >())
+ , mock_app_1_(std::make_shared<NiceMock<MockApplication> >())
+ , mock_app_2_(std::make_shared<NiceMock<MockApplication> >())
, apps_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, apps_da_(apps_, apps_lock_ptr_) {
ON_CALL(mock_app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(mock_policy_handler_));
auto plugin_id = rc_rpc_plugin::RCRPCPlugin::kRCPluginID;
- app_ext_ptr_ = utils::MakeShared<rc_rpc_plugin::RCAppExtension>(plugin_id);
+ app_ext_ptr_ = std::make_shared<rc_rpc_plugin::RCAppExtension>(plugin_id);
ON_CALL(*mock_app_1_, app_id()).WillByDefault(Return(kAppId1));
+
+ OnRCStatusNotificationExpectations();
}
void CheckResultWithHMILevelAndAccessMode(
@@ -99,6 +102,8 @@ class RAManagerTest : public ::testing::Test {
const rc_rpc_plugin::AcquireResult::eType expected_result,
const hmi_apis::Common_RCAccessMode::eType access_mode);
+ void OnRCStatusNotificationExpectations();
+
protected:
NiceMock<MockApplicationManager> mock_app_mngr_;
NiceMock<MockRPCService> mock_rpc_service_;
@@ -107,8 +112,8 @@ class RAManagerTest : public ::testing::Test {
application_manager::MessagePtr message_;
application_manager::AppExtensionPtr app_ext_ptr_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_1_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_2_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_1_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_2_;
application_manager::ApplicationSet apps_;
std::shared_ptr<sync_primitives::Lock> apps_lock_ptr_;
DataAccessor<application_manager::ApplicationSet> apps_da_;
@@ -134,6 +139,15 @@ void RAManagerTest::CheckResultWithHMILevelAndAccessMode(
EXPECT_EQ(expected_result, ra_manager.AcquireResource(kModuleType1, kAppId2));
}
+void RAManagerTest::OnRCStatusNotificationExpectations() {
+ ON_CALL(mock_app_mngr_, application(kAppId1))
+ .WillByDefault(Return(mock_app_1_));
+ ON_CALL(*mock_app_1_, QueryInterface(rc_rpc_plugin::RCRPCPlugin::kRCPluginID))
+ .WillByDefault(Return(app_ext_ptr_));
+ apps_.insert(mock_app_1_);
+ ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(apps_da_));
+}
+
TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) {
// Arrange
EXPECT_CALL(mock_app_mngr_, application(kAppId1))
@@ -147,8 +161,6 @@ TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) {
TEST_F(RAManagerTest,
AcquireResource_AppRegisteredAnyHmiLevelResourceFree_Expect_Allowed) {
// Arrange
- EXPECT_CALL(mock_app_mngr_, application(kAppId1))
- .WillOnce(Return(mock_app_1_));
ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
// Act & Assert
EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
@@ -258,13 +270,6 @@ TEST_F(RAManagerTest, AppExit_ReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId1))
.WillRepeatedly(Return(mock_app_1_));
- RCAppExtensionPtr rc_extention_ptr =
- utils::MakeShared<RCAppExtension>(application_manager::AppExtensionUID(
- rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
-
- EXPECT_CALL(*mock_app_1_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
ra_manager.AcquireResource(kModuleType1, kAppId1));
@@ -293,13 +298,6 @@ TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId2))
.WillRepeatedly(Return(mock_app_2_));
- RCAppExtensionPtr rc_extention_ptr =
- utils::MakeShared<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));
@@ -320,15 +318,9 @@ TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
RCAppExtensionPtr rc_extention_ptr =
- utils::MakeShared<RCAppExtension>(application_manager::AppExtensionUID(
+ std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
- EXPECT_CALL(*mock_app_1_, QueryInterface(_))
- .WillOnce(Return(rc_extention_ptr));
-
- EXPECT_CALL(mock_app_mngr_, application(kAppId1))
- .WillRepeatedly(Return(mock_app_1_));
-
EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
ra_manager.AcquireResource(kModuleType1, kAppId1));
@@ -359,13 +351,6 @@ TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
EXPECT_CALL(mock_app_mngr_, application(kAppId1))
.WillRepeatedly(Return(mock_app_2_));
- RCAppExtensionPtr rc_extention_ptr =
- utils::MakeShared<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));
@@ -403,7 +388,7 @@ TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da));
RCAppExtensionPtr rc_extention_ptr =
- utils::MakeShared<RCAppExtension>(application_manager::AppExtensionUID(
+ std::make_shared<RCAppExtension>(application_manager::AppExtensionUID(
rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID))
@@ -433,7 +418,7 @@ TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
.WillRepeatedly(Return(mock_app_1_));
RCAppExtensionPtr rc_extention_ptr =
- utils::MakeShared<rc_rpc_plugin::RCAppExtension>(
+ std::make_shared<rc_rpc_plugin::RCAppExtension>(
application_manager::AppExtensionUID(
rc_rpc_plugin::RCRPCPlugin::kRCPluginID));
@@ -505,4 +490,179 @@ TEST_F(RAManagerTest, GetAccessMode_ExpectedSameAsHadSet) {
ra_manager.GetAccessMode());
}
+TEST_F(RAManagerTest, OnRCStatus_AppRegistation_RC_allowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(NotificationTrigger::APP_REGISTRATION,
+ mock_app_1_);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_AppRegistation_RC_disallowed) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ra_manager.set_rc_enabled(false);
+
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)).Times(0);
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(NotificationTrigger::APP_REGISTRATION,
+ mock_app_1_);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), false);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ 0u);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_RCStateChanging_RC_disabling) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.set_rc_enabled(false);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), false);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_RCStateChanging_RC_enabling) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.set_rc_enabled(true);
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 0u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
+TEST_F(RAManagerTest, OnRCStatus_ModuleAllocation) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_app_mngr_, mock_rpc_service_);
+
+ ON_CALL((*mock_app_1_), is_remote_control_supported())
+ .WillByDefault(Return(true));
+ ON_CALL((*mock_app_1_), hmi_app_id()).WillByDefault(Return(kHMIAppId1));
+
+ EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ application_manager::commands::MessageSharedPtr message_to_mob;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false))
+ .WillOnce(SaveArg<0>(&message_to_mob));
+
+ application_manager::commands::MessageSharedPtr message_to_hmi;
+ EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&message_to_hmi));
+
+ // Act
+ ra_manager.SendOnRCStatusNotifications(
+ NotificationTrigger::MODULE_ALLOCATION,
+ std::shared_ptr<application_manager::Application>());
+
+ auto msg_to_mob_params =
+ (*message_to_mob)[application_manager::strings::msg_params];
+ auto msg_to_hmi_params =
+ (*message_to_hmi)[application_manager::strings::msg_params];
+ // Assert
+ EXPECT_EQ(msg_to_mob_params[message_params::kAllowed].asBool(), true);
+ EXPECT_EQ(
+ msg_to_mob_params[message_params::kAllocatedModules].asArray()->size(),
+ 1u);
+ EXPECT_EQ(msg_to_mob_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules - 1u);
+ EXPECT_EQ(
+ msg_to_hmi_params[message_params::kAllocatedModules].asArray()->size(),
+ 1u);
+ EXPECT_EQ(msg_to_hmi_params[message_params::kFreeModules].asArray()->size(),
+ kSizeOfModules - 1u);
+ EXPECT_EQ(msg_to_hmi_params[application_manager::strings::app_id].asInt(),
+ kHMIAppId1);
+}
+
} // namespace rc_rpc_plugin
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
index 6061858e5c..f20386a246 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h
@@ -43,31 +43,31 @@ namespace commands {
/**
* @brief NaviSubscribeWayPointsRequest command class
**/
-class NaviUnSubscribeWayPointsRequest
+class NaviUnsubscribeWayPointsRequest
: public app_mngr::commands::RequestToHMI {
public:
/**
- * @brief NaviUnSubscribeWayPointsRequest class constructor
+ * @brief NaviUnsubscribeWayPointsRequest class constructor
*
* @param message Incoming SmartObject message
**/
- NaviUnSubscribeWayPointsRequest(
+ NaviUnsubscribeWayPointsRequest(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
app_mngr::HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handle);
/**
- * @brief NaviUnSubscribeWayPointsRequest class destructor
+ * @brief NaviUnsubscribeWayPointsRequest class destructor
**/
- virtual ~NaviUnSubscribeWayPointsRequest();
+ virtual ~NaviUnsubscribeWayPointsRequest();
/**
* @brief Execute command
**/
virtual void Run() OVERRIDE;
private:
- DISALLOW_COPY_AND_ASSIGN(NaviUnSubscribeWayPointsRequest);
+ DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsRequest);
};
} // namespace commands
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
index 3a02228b8b..ec4f4eb963 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h
@@ -41,13 +41,13 @@ namespace app_mngr = application_manager;
namespace commands {
/**
- * @brief NaviUnSubscribeWaypoints command class
+ * @brief NaviUnsubscribeWaypoints command class
**/
class NaviUnsubscribeWayPointsResponse
: public app_mngr::commands::ResponseFromHMI {
public:
/**
- * @brief NaviUnSubscribeWaypoints class constructor
+ * @brief NaviUnsubscribeWaypoints class constructor
*
* @param message Incoming SmartObject message
**/
@@ -59,7 +59,7 @@ class NaviUnsubscribeWayPointsResponse
policy::PolicyHandlerInterface& policy_handle);
/**
- * @brief NaviUnSubscribeWaypoints class destructor
+ * @brief NaviUnsubscribeWaypoints class destructor
**/
virtual ~NaviUnsubscribeWayPointsResponse();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_request.h
deleted file mode 100644
index 84c275ec5a..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_request.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
-
-#include "application_manager/commands/request_to_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief UISetIconRequest command class
- **/
-class UISetIconRequest : public app_mngr::commands::RequestToHMI {
- public:
- /**
- * @brief UISetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetIconRequest(const app_mngr::commands::MessageSharedPtr& message,
- app_mngr::ApplicationManager& application_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handle);
-
- /**
- * @brief UISetIconRequest class destructor
- **/
- virtual ~UISetIconRequest();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetIconRequest);
-};
-
-} // namespace commands
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_request_template.h
deleted file mode 100644
index 0c3c63c32c..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_request_template.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/request_to_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 subscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VIGetVehicleDataRequestTemplate
- : public app_mngr::commands::RequestToHMI {
- public:
- /**
- * @brief VIGetVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataRequestTemplate(
- 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)
- : RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_response_template.h
deleted file mode 100644
index e28c55ba12..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_response_template.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-namespace commands {
-
-/**
- * @brief VIGetVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VIGetVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VIGetVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIGetVehicleDataResponseTemplate(
- 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)
- : ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_request_template.h
deleted file mode 100644
index b74d013a82..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/request_to_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-namespace commands {
-
-/**
- * @brief VISubscriveVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 subscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VISubscribeVehicleDataRequestTemplate
- : public app_mngr::commands::RequestToHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataRequestTemplate(
- 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)
- : RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_response_template.h
deleted file mode 100644
index 42dba56345..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-namespace commands {
-/**
- * @brief VISubscriveVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VISubscribeVehicleDataResponseTemplate(
- 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)
- : ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
deleted file mode 100644
index 2cb5d622b1..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/request_to_hmi.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-namespace commands {
-
-/**
- * @brief VIUnsubscriveVehicleDataRequestTemplate command class
- *
- * Template class for sending 1 unsubscribe thin request
- **/
-template <event_engine::Event::EventID eventID>
-class VIUnsubscribeVehicleDataRequestTemplate
- : public app_mngr::commands::RequestToHMI {
- public:
- /**
- * @brief VIUnsubscriveVehicleDataRequestTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataRequestTemplate(
- 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)
- : RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
- /**
- * @brief Execute command with sending DBus thin request to HMI
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- SendRequest();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequestTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
deleted file mode 100644
index 6138aa59fb..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-
-#include "application_manager/event_engine/event.h"
-#include "application_manager/commands/response_from_hmi.h"
-#include "application_manager/application_manager.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-namespace commands {
-
-/**
- * @brief VIUnsubscriveVehicleDataResponseTemplate command class
- **/
-template <event_engine::Event::EventID eventID>
-class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
- public:
- /**
- * @brief VISubscriveVehicleDataResponseTemplate class constructor
- *
- * @param message Incoming SmartObject message
- **/
- VIUnsubscribeVehicleDataResponseTemplate(
- 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)
- : ResponseFromHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
- /**
- * @brief Execute command
- **/
- virtual void Run() {
- LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(eventID);
- event.set_smart_object(*message_);
- event.raise(application_manager_.event_dispatcher());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
index 285b0b10db..4564858845 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h
@@ -128,6 +128,7 @@ class CreateInteractionChoiceSetRequest
int32_t choice_set_id_;
size_t expected_chs_count_;
size_t received_chs_count_;
+ bool should_send_warnings;
/**
* @brief Flag for stop sending VR commands to HMI, in case one of responses
@@ -142,7 +143,7 @@ class CreateInteractionChoiceSetRequest
volatile bool is_timed_out_;
sync_primitives::Lock is_timed_out_lock_;
- sync_primitives::Lock vr_commands_lock_;
+ sync_primitives::RecursiveLock vr_commands_lock_;
/*
* @brief Sends VR AddCommand request to HMI
*
@@ -220,8 +221,8 @@ class CreateInteractionChoiceSetRequest
* otherwise FALSE
*/
bool compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice2);
/*
* @brief Checks VR synonyms ignoring differences in case.
@@ -233,8 +234,8 @@ class CreateInteractionChoiceSetRequest
* otherwise FALSE
*/
static bool compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str2);
/**
* @brief Checks choice set params(menuName, tertiaryText, ...)
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/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
index 7a8abaaad6..674de4731a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h
@@ -83,20 +83,12 @@ class SetGlobalPropertiesRequest
bool Init() FINAL;
private:
- // Verify correctness VrHelptitle value
- static bool ValidateVRHelpTitle(
- const smart_objects::SmartObject* const vr_help_so_ptr);
-
// prepare UI sending data (VrHelps, Menus, Keyboard) to SmartObject
static void PrepareUIRequestVRHelpData(
const app_mngr::ApplicationSharedPtr app,
const smart_objects::SmartObject& msg_params,
smart_objects::SmartObject& out_params);
- static bool PrepareUIRequestDefaultVRHelpData(
- const app_mngr::ApplicationSharedPtr app,
- smart_objects::SmartObject& out_params);
-
static void PrepareUIRequestMenuAndKeyboardData(
const app_mngr::ApplicationSharedPtr app,
const smart_objects::SmartObject& msg_params,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_request.h
deleted file mode 100644
index f994f06ca3..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_request.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-
- 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
-
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/application_manager.h"
-#include "utils/macro.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief SetIconRequest command class
- **/
-class SetIconRequest : public app_mngr::commands::CommandRequestImpl {
- public:
- /**
- * @brief Contains information about the type of image
- */
- typedef enum { STATIC = 0, DYNAMIC } ImageType;
-
- /**
- * @brief SetIconRequest class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetIconRequest(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);
-
- /**
- * @brief SetIconRequest class destructor
- **/
- virtual ~SetIconRequest();
-
- /**
- * @brief Interface method that is called whenever new event received
- *
- * @param event The received event
- */
- void on_event(const app_mngr::event_engine::Event& event);
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetIconRequest);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_response.h
deleted file mode 100644
index c83ea3607a..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_icon_response.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-
- 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_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
-
-#include "application_manager/commands/command_response_impl.h"
-#include "application_manager/application_manager.h"
-#include "utils/macro.h"
-
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
-
-namespace commands {
-
-/**
- * @brief SetIconResponse command class
- **/
-class SetIconResponse : public app_mngr::commands::CommandResponseImpl {
- public:
- /**
- * @brief SetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- SetIconResponse(const app_mngr::commands::MessageSharedPtr& message,
- app_mngr::ApplicationManager& app_man,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler);
-
- /**
- * @brief SetIconResponse class destructor
- **/
- virtual ~SetIconResponse();
-
- /**
- * @brief Execute command
- **/
- virtual void Run();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SetIconResponse);
-};
-
-} // namespace commands
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
index b7b87f8b51..fe14f5c7eb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h
@@ -40,13 +40,13 @@ namespace app_mngr = application_manager;
namespace commands {
-class UnSubscribeWayPointsRequest
+class UnsubscribeWayPointsRequest
: public app_mngr::commands::CommandRequestImpl {
public:
/**
- * \brief UnSubscribeWayPointsRequest class constructor
+ * \brief UnsubscribeWayPointsRequest class constructor
**/
- UnSubscribeWayPointsRequest(
+ UnsubscribeWayPointsRequest(
const app_mngr::commands::MessageSharedPtr& message,
app_mngr::ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
@@ -54,9 +54,9 @@ class UnSubscribeWayPointsRequest
policy::PolicyHandlerInterface& policy_handler);
/**
- * \brief UnSubscribeWayPointsRequest class destructor
+ * \brief UnsubscribeWayPointsRequest class destructor
**/
- ~UnSubscribeWayPointsRequest();
+ ~UnsubscribeWayPointsRequest();
/**
* @brief Execute command
@@ -76,7 +76,7 @@ class UnSubscribeWayPointsRequest
bool Init() FINAL;
private:
- DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest);
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsRequest);
};
} // commands
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
index 52b95d3fa3..ae375e4087 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc
@@ -188,7 +188,7 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
ApplicationSharedPtr app =
application_manager_.application(app_id_to_send_to);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"There is no registered application with "
"connection key '"
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
index 3d2370d55b..a9698d36ab 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc
@@ -63,7 +63,10 @@ AudioStartStreamRequest::AudioStartStreamRequest(
<< "; retry_number_ = " << retry_number_);
}
-AudioStartStreamRequest::~AudioStartStreamRequest() {}
+AudioStartStreamRequest::~AudioStartStreamRequest() {
+ // see comment in NaviStartStreamRequest
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_StartAudioStream);
+}
void AudioStartStreamRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
index e44d89f93a..f3d971acba 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
@@ -63,7 +63,11 @@ NaviStartStreamRequest::NaviStartStreamRequest(
<< "; retry_number_ = " << retry_number_);
}
-NaviStartStreamRequest::~NaviStartStreamRequest() {}
+NaviStartStreamRequest::~NaviStartStreamRequest() {
+ // unsubscribe_from_all_events() in EventObserver's destructor isn't enough;
+ // we must unsubscribe before this NaviStartStreamRequest instance is removed
+ unsubscribe_from_event(hmi_apis::FunctionID::Navigation_StartStream);
+}
void NaviStartStreamRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
index e7d416bc61..ec22c93d8f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc
@@ -37,7 +37,7 @@ using namespace application_manager;
namespace commands {
-NaviUnSubscribeWayPointsRequest::NaviUnSubscribeWayPointsRequest(
+NaviUnsubscribeWayPointsRequest::NaviUnsubscribeWayPointsRequest(
const application_manager::commands::MessageSharedPtr& message,
ApplicationManager& application_manager,
rpc_service::RPCService& rpc_service,
@@ -49,9 +49,9 @@ NaviUnSubscribeWayPointsRequest::NaviUnSubscribeWayPointsRequest(
hmi_capabilities,
policy_handle) {}
-NaviUnSubscribeWayPointsRequest::~NaviUnSubscribeWayPointsRequest() {}
+NaviUnsubscribeWayPointsRequest::~NaviUnsubscribeWayPointsRequest() {}
-void NaviUnSubscribeWayPointsRequest::Run() {
+void NaviUnsubscribeWayPointsRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
SendRequest();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
index 839c16ca08..cf83c48a5a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc
@@ -40,7 +40,6 @@
#include <string>
#include "policy/policy_types.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
namespace {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
index 16ca48a2d4..a5fb9b206e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc
@@ -37,7 +37,6 @@
#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
-#include "utils/make_shared.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -115,7 +114,7 @@ void OnDriverDistractionNotification::Run() {
application_manager_.set_driver_distraction_state(state);
smart_objects::SmartObjectSPtr on_driver_distraction =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
if (!on_driver_distraction) {
LOG4CXX_ERROR(logger_, "NULL pointer");
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
index 9131bf7392..9d250d288e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc
@@ -109,7 +109,8 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
(*message)[strings::params][strings::message_type] =
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
index d2a149bf94..681390fbf4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc
@@ -67,7 +67,7 @@ void OnExitApplicationNotification::Run() {
uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
ApplicationSharedPtr app_impl = application_manager_.application(app_id);
- if (!(app_impl.valid())) {
+ if (app_impl.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application does not exist");
return;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
index cfb860a1c7..d795896764 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
@@ -91,7 +91,7 @@ void OnSystemRequestNotification::Run() {
app = application_manager_.application(selected_app_id);
}
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"No valid application found to forward OnSystemRequest.");
return;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
index 4b3d303089..d538878dc8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc
@@ -97,7 +97,7 @@ void RCIsReadyRequest::onTimeOut() {
}
void RCIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::RC_GetCapabilities, application_manager_));
rpc_service_.ManageHMICommand(get_capabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
index 32d3cba48a..c7e2c0c4cb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc
@@ -94,18 +94,18 @@ void TTSIsReadyRequest::onTimeOut() {
}
void TTSIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
+ std::shared_ptr<smart_objects::SmartObject> get_language(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage,
application_manager_));
HMICapabilities& hmi_capabilities = hmi_capabilities_;
hmi_capabilities.set_handle_response_for(*get_language);
rpc_service_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::TTS_GetSupportedLanguages,
application_manager_));
rpc_service_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_));
rpc_service_.ManageHMICommand(get_capabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
index 3b2c77f16e..2eab211690 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc
@@ -93,18 +93,18 @@ void UIIsReadyRequest::onTimeOut() {
}
void UIIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
+ std::shared_ptr<smart_objects::SmartObject> get_language(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage,
application_manager_));
HMICapabilities& hmi_capabilities = hmi_capabilities_;
hmi_capabilities.set_handle_response_for(*get_language);
rpc_service_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::UI_GetSupportedLanguages,
application_manager_));
rpc_service_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::UI_GetCapabilities, application_manager_));
rpc_service_.ManageHMICommand(get_capabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
index dcf7f35e90..22afb03945 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc
@@ -93,18 +93,18 @@ void VRIsReadyRequest::onTimeOut() {
}
void VRIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_language(
+ std::shared_ptr<smart_objects::SmartObject> get_language(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,
application_manager_));
HMICapabilities& hmi_capabilities = hmi_capabilities_;
hmi_capabilities.set_handle_response_for(*get_language);
rpc_service_.ManageHMICommand(get_language);
- utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ std::shared_ptr<smart_objects::SmartObject> get_all_languages(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VR_GetSupportedLanguages,
application_manager_));
rpc_service_.ManageHMICommand(get_all_languages);
- utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> get_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VR_GetCapabilities, application_manager_));
rpc_service_.ManageHMICommand(get_capabilities);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
index d1cb9763d9..155f819761 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc
@@ -96,7 +96,7 @@ void AddCommandRequest::Run() {
app,
application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(
logger_, "MessageHelper::VerifyImage return " << verification_result);
SendResponse(false, verification_result);
@@ -320,9 +320,10 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
return;
}
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
smart_objects::SmartObject msg_param(smart_objects::SmartType_Map);
- msg_param[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
+ msg_param[strings::cmd_id] = cmd_id;
msg_param[strings::app_id] = application->app_id();
switch (event.id()) {
@@ -458,8 +459,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
- application->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
+ application->RemoveCommand(cmd_id);
result = false;
LOG4CXX_DEBUG(logger_, "Result " << result);
}
@@ -474,8 +474,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
- application->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
+ application->RemoveCommand(cmd_id);
result = false;
LOG4CXX_DEBUG(logger_, "Result " << result);
}
@@ -501,7 +500,10 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
result = false;
}
- if (!result) {
+ if (result) {
+ application->help_prompt_manager().OnVrCommandAdded(
+ cmd_id, (*message_)[strings::msg_params], false);
+ } else {
RemoveCommand();
}
@@ -590,18 +592,18 @@ const std::string AddCommandRequest::GenerateMobileResponseInfo() {
void AddCommandRequest::RemoveCommand() {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "No application associated with session key");
return;
}
+ const uint32_t cmd_id =
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt();
smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] =
- (*message_)[strings::msg_params][strings::cmd_id];
+ msg_params[strings::cmd_id] = cmd_id;
msg_params[strings::app_id] = app->app_id();
- app->RemoveCommand(
- (*message_)[strings::msg_params][strings::cmd_id].asUInt());
+ app->RemoveCommand(cmd_id);
if (BothSend() && !(is_vr_received_ || is_ui_received_)) {
// in case we have send bth UI and VR and no one respond
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
index 3dcc414f9e..183b445326 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
@@ -76,7 +76,7 @@ void AddSubMenuRequest::Run() {
verification_result = MessageHelper::VerifyImage(
received_msg_params[strings::menu_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(
logger_, "MessageHelper::VerifyImage return " << verification_result);
SendResponse(false, verification_result);
@@ -117,10 +117,7 @@ void AddSubMenuRequest::Run() {
msg_params[strings::menu_params][strings::menu_name] =
received_msg_params[strings::menu_name];
msg_params[strings::app_id] = app->app_id();
-
- if (mobile_apis::Result::SUCCESS == verification_result) {
- msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
- }
+ msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
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 7451ea7905..cd1f95b93c 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
@@ -42,11 +42,13 @@
#include "utils/gen_hash.h"
#include "utils/helpers.h"
-namespace sdl_rpc_plugin {
-using namespace application_manager;
+const char* kInvalidImageWarningInfo = "Requested image(s) not found.";
+namespace sdl_rpc_plugin {
namespace commands {
+using namespace application_manager;
+
CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
const application_manager::commands::MessageSharedPtr& message,
ApplicationManager& application_manager,
@@ -62,8 +64,7 @@ CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
, expected_chs_count_(0)
, received_chs_count_(0)
, error_from_hmi_(false)
- , is_timed_out_(false)
- , vr_commands_lock_(true) {}
+ , is_timed_out_(false) {}
CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -79,6 +80,7 @@ void CreateInteractionChoiceSetRequest::Run() {
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
}
+ should_send_warnings = false;
for (uint32_t i = 0;
i < (*message_)[strings::msg_params][strings::choice_set].length();
++i) {
@@ -105,6 +107,10 @@ void CreateInteractionChoiceSetRequest::Run() {
LOG4CXX_ERROR(logger_, "Image verification failed.");
SendResponse(false, Result::INVALID_DATA);
return;
+ } else if (verification_result_image == Result::WARNINGS ||
+ verification_result_secondary_image == Result::WARNINGS) {
+ should_send_warnings = true;
+ break;
}
}
@@ -124,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(
@@ -149,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;
@@ -171,14 +197,17 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
}
bool CreateInteractionChoiceSetRequest::compareSynonyms(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject& choice1,
+ const ns_smart_device_link::ns_smart_objects::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(),
@@ -198,8 +227,8 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms(
}
bool CreateInteractionChoiceSetRequest::compareStr(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str1,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& str2) {
return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray());
}
@@ -436,7 +465,9 @@ void CreateInteractionChoiceSetRequest::DeleteChoices() {
void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
LOG4CXX_AUTO_TRACE(logger_);
- if (!error_from_hmi_) {
+ if (!error_from_hmi_ && should_send_warnings) {
+ SendResponse(true, mobile_apis::Result::WARNINGS, kInvalidImageWarningInfo);
+ } else if (!error_from_hmi_) {
SendResponse(true, mobile_apis::Result::SUCCESS);
} else {
DeleteChoices();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
index bbe787a123..38069c341e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc
@@ -198,7 +198,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
}
smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- const int32_t cmd_id = msg_params[strings::cmd_id].asInt();
+ const uint32_t cmd_id = msg_params[strings::cmd_id].asUInt();
smart_objects::SmartObject* command = application->FindCommand(cmd_id);
@@ -213,7 +213,8 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
std::string info;
const bool result = PrepareResponseParameters(result_code, info);
if (result) {
- application->RemoveCommand(msg_params[strings::cmd_id].asInt());
+ application->RemoveCommand(cmd_id);
+ application->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
}
SendResponse(
result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
index 38113afcc2..9a01163702 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc
@@ -134,9 +134,11 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands(
(*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
+ const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt();
msg_params[strings::app_id] = app->app_id();
- msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
- app->RemoveCommand((*it->second)[strings::cmd_id].asInt());
+ msg_params[strings::cmd_id] = cmd_id;
+ app->RemoveCommand(cmd_id);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false);
it = commands.begin(); // Can not relay on
// iterators after erase was called
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
index eef2750376..b0715225e4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc
@@ -41,7 +41,7 @@ using namespace application_manager;
namespace commands {
void GenericResponse::Run() {
- /*NsSmartDeviceLink::NsSmartObjects::SmartObject response;
+ /*ns_smart_device_link::ns_smart_objects::SmartObject response;
response[strings::params][strings::correlation_id] =
(*message_)[strings::params][strings::correlation_id];
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
index 0dda8b3277..aeb53a115e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc
@@ -149,7 +149,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
}
smart_objects::SmartObjectSPtr on_btn_event =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
if (!on_btn_event) {
LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer");
@@ -161,8 +161,16 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
(*on_btn_event)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
- (*on_btn_event)[strings::msg_params][strings::button_name] =
- (*message_)[strings::msg_params][hmi_response::button_name];
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() <= utils::version_4_5) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
+
+ (*on_btn_event)[strings::msg_params][strings::button_name] = btn_id;
(*on_btn_event)[strings::msg_params][strings::button_event_mode] =
(*message_)[strings::msg_params][hmi_response::button_mode];
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
index 06ff29134c..56a87da305 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc
@@ -35,6 +35,7 @@
#include "application_manager/application_impl.h"
#include "interfaces/MOBILE_API.h"
+#include "utils/semantic_version.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -138,7 +139,7 @@ void OnButtonPressNotification::Run() {
}
// if "appID" is present, send it to named app only if its FULL or
// LIMITED
- if (app.valid()) {
+ if (app.use_count() != 0) {
if (app->app_id() == subscribed_app->app_id()) {
SendButtonPress(subscribed_app);
}
@@ -156,7 +157,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
}
smart_objects::SmartObjectSPtr on_btn_press =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
if (!on_btn_press) {
LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer");
@@ -168,8 +169,16 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
(*on_btn_press)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
- (*on_btn_press)[strings::msg_params][strings::button_name] =
- (*message_)[strings::msg_params][hmi_response::button_name];
+ mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE &&
+ app->msg_version() <= utils::version_4_5) {
+ btn_id = mobile_apis::ButtonName::OK;
+ }
+
+ (*on_btn_press)[strings::msg_params][strings::button_name] = btn_id;
(*on_btn_press)[strings::msg_params][strings::button_press_mode] =
(*message_)[strings::msg_params][hmi_response::button_mode];
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
index a495423bce..6b5838e40a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc
@@ -61,7 +61,7 @@ void OnHMIStatusNotification::Run() {
(*message_)[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist");
return;
}
@@ -78,17 +78,8 @@ void OnHMIStatusNotification::Run() {
mobile_apis::HMILevel::eType hmi_level =
static_cast<mobile_apis::HMILevel::eType>(
(*message_)[strings::msg_params][strings::hmi_level].asInt());
- if ((mobile_apis::HMILevel::HMI_BACKGROUND == hmi_level) ||
- (mobile_apis::HMILevel::HMI_NONE == hmi_level)) {
- if (!(app->tts_properties_in_none())) {
- app->set_tts_properties_in_none(true);
- LOG4CXX_INFO(logger_,
- "OnHMIStatusNotification::Send TTS GlobalProperties"
- " with empty array to HMI");
- MessageHelper::SendTTSGlobalProperties(app, false, application_manager_);
- }
- } else if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
- (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
+ if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
+ (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
if (!(app->tts_properties_in_full())) {
app->set_tts_properties_in_full(true);
LOG4CXX_INFO(logger_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
index 45caedfc2e..c4ee22afed 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc
@@ -60,7 +60,7 @@ void OnHMIStatusNotificationFromMobile::Run() {
static_cast<int32_t>(application_manager::MessageType::kNotification);
ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(
logger_, "OnHMIStatusNotificationFromMobile application doesn't exist");
return;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
index 2065c0b52d..04b52f29e1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc
@@ -82,7 +82,7 @@ void OnKeyBoardInputNotification::Run() {
}
}
- if (app_to_notify.valid()) {
+ if (app_to_notify.use_count() != 0) {
(*message_)[strings::params][strings::connection_key] =
app_to_notify->app_id();
SendNotification();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
index 419024f9b0..b78e541f17 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -68,7 +68,7 @@ void OnSystemRequestNotification::Run() {
ApplicationSharedPtr app = application_manager_.application(connection_key());
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_,
"Application with connection key " << connection_key()
<< " is not registered.");
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 8710f3c3d6..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
@@ -165,7 +165,7 @@ void PerformInteractionRequest::Run() {
}
if (msg_params.keyExists(strings::vr_help)) {
- if (mobile_apis::Result::SUCCESS !=
+ if (mobile_apis::Result::INVALID_DATA ==
MessageHelper::VerifyImageVrHelpItems(
msg_params[strings::vr_help], app, application_manager_)) {
LOG4CXX_ERROR(logger_,
@@ -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;
@@ -343,27 +345,31 @@ bool PerformInteractionRequest::ProcessVRResponse(
return false;
}
- if (Common_Result::SUCCESS == vr_result_code_ &&
- InteractionMode::MANUAL_ONLY == interaction_mode_) {
- LOG4CXX_DEBUG(logger_,
- "VR response SUCCESS in MANUAL_ONLY mode "
- << "Wait for UI response");
- // in case MANUAL_ONLY mode VR.PI SUCCESS just return
- return false;
- }
-
const SmartObject& hmi_msg_params = message[strings::msg_params];
if (hmi_msg_params.keyExists(strings::choice_id)) {
- const int choise_id = hmi_msg_params[strings::choice_id].asInt();
- if (!CheckChoiceIDFromResponse(app, choise_id)) {
+ const int choice_id = hmi_msg_params[strings::choice_id].asInt();
+ if (!CheckChoiceIDFromResponse(app, choice_id)) {
LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
TerminatePerformInteraction();
SendResponse(
false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
return true;
}
- msg_params[strings::choice_id] = choise_id;
+ msg_params[strings::choice_id] = choice_id;
}
+
+ const bool is_vr_result_success = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::SUCCESS, Common_Result::WARNINGS);
+
+ if (is_vr_result_success &&
+ InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ LOG4CXX_DEBUG(logger_,
+ "VR response is successfull in MANUAL_ONLY mode "
+ << "Wait for UI response");
+ // in case MANUAL_ONLY mode VR.PI SUCCESS just return
+ return false;
+ }
+
return false;
}
@@ -401,19 +407,19 @@ void PerformInteractionRequest::ProcessUIResponse(
ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
if (result) {
- if (is_pi_warning) {
- ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
- ui_info_ = message[strings::msg_params][strings::info].asString();
- if (message.keyExists(strings::params) &&
- message[strings::params].keyExists(strings::data)) {
- msg_params = message[strings::params][strings::data];
- }
- } else if (is_pi_unsupported) {
+ if (is_pi_unsupported) {
ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
ui_info_ = message[strings::msg_params][strings::info].asString();
- } else if (message.keyExists(strings::msg_params)) {
- msg_params = message[strings::msg_params];
+ } else {
+ if (message.keyExists(strings::msg_params)) {
+ msg_params = message[strings::msg_params];
+ }
+ if (is_pi_warning) {
+ ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
+ ui_info_ = message[strings::msg_params][strings::info].asString();
+ }
}
+
// result code must be GENERIC_ERROR in case wrong choice_id
if (msg_params.keyExists(strings::choice_id)) {
if (!CheckChoiceIDFromResponse(app,
@@ -538,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++] =
@@ -746,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];
@@ -942,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,
@@ -958,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];
@@ -969,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 18fe00b54a..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) << ")");
@@ -301,7 +300,8 @@ void PutFileRequest::Run() {
void PutFileRequest::SendOnPutFileNotification() {
LOG4CXX_INFO(logger_, "SendOnPutFileNotification");
smart_objects::SmartObjectSPtr notification =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
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 ea353c8d90..9cfd4f33b5 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
@@ -38,7 +38,6 @@
#include <map>
#include <string.h>
-#include <utils/make_shared.h>
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_impl.h"
@@ -229,9 +228,6 @@ void RegisterAppInterfaceRequest::Run() {
return;
}
- const std::string mobile_app_id =
- (*message_)[strings::msg_params][strings::app_id].asString();
-
ApplicationSharedPtr application =
application_manager_.application(connection_key());
@@ -239,18 +235,31 @@ void RegisterAppInterfaceRequest::Run() {
SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
return;
}
+ // cache the original app ID (for legacy behavior)
+ const std::string policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
- const std::string policy_app_id = msg_params[strings::app_id].asString();
- std::string new_policy_app_id = policy_app_id;
- std::transform(policy_app_id.begin(),
- policy_app_id.end(),
- new_policy_app_id.begin(),
+ // transform app IDs to lowercase for usage in policy checks later
+ const std::string app_id_short = msg_params[strings::app_id].asString();
+ std::string new_app_id_short = app_id_short;
+ std::transform(app_id_short.begin(),
+ app_id_short.end(),
+ new_app_id_short.begin(),
::tolower);
- (*message_)[strings::msg_params][strings::app_id] = new_policy_app_id;
-
+ (*message_)[strings::msg_params][strings::app_id] = new_app_id_short;
+ // If full ID is present, shift that to lowercase too
+ if (msg_params.keyExists(strings::full_app_id)) {
+ const std::string app_id_full = msg_params[strings::full_app_id].asString();
+ std::string new_app_id_full = app_id_full;
+ std::transform(app_id_full.begin(),
+ app_id_full.end(),
+ new_app_id_full.begin(),
+ ::tolower);
+ (*message_)[strings::msg_params][strings::full_app_id] = new_app_id_full;
+ }
if (application_manager_.IsApplicationForbidden(connection_key(),
policy_app_id)) {
SendResponse(false, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS);
@@ -294,12 +303,50 @@ void RegisterAppInterfaceRequest::Run() {
return;
}
+ uint16_t major =
+ msg_params[strings::sync_msg_version][strings::major_version].asUInt();
+ uint16_t minor =
+ msg_params[strings::sync_msg_version][strings::minor_version].asUInt();
+ uint16_t patch = 0;
+ // Check if patch exists since it is not mandatory.
+ if (msg_params[strings::sync_msg_version].keyExists(strings::patch_version)) {
+ patch =
+ msg_params[strings::sync_msg_version][strings::patch_version].asUInt();
+ }
+
+ utils::SemanticVersion mobile_version(major, minor, patch);
+ utils::SemanticVersion min_module_version(
+ minimum_major_version, minimum_minor_version, minimum_patch_version);
+
+ if (mobile_version < min_module_version) {
+ LOG4CXX_WARN(logger_,
+ "Application RPC Version does not meet minimum requirement");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ }
+
application = application_manager_.RegisterApplication(message_);
if (!application) {
LOG4CXX_ERROR(logger_, "Application hasn't been registered!");
return;
}
+
+ // Version negotiation
+ utils::SemanticVersion ver_4_5(4, 5, 0);
+ utils::SemanticVersion module_version(
+ major_version, minor_version, patch_version);
+ if (mobile_version <= ver_4_5) {
+ // Mobile versioning did not exist for
+ // versions 4.5 and prior.
+ application->set_msg_version(ver_4_5);
+ } else if (mobile_version < module_version) {
+ // Use mobile RPC version as negotiated version
+ application->set_msg_version(mobile_version);
+ } else {
+ // Use module version as negotiated version
+ application->set_msg_version(module_version);
+ }
+
// For resuming application need to restore hmi_app_id from resumeCtrl
resumption::ResumeCtrl& resumer = application_manager_.resume_controller();
const std::string& device_mac = application->mac_address();
@@ -411,6 +458,7 @@ void RegisterAppInterfaceRequest::Run() {
smart_objects::SmartObjectSPtr so =
GetLockScreenIconUrlNotification(connection_key(), application);
rpc_service_.ManageMobileCommand(so, SOURCE_SDL);
+ application_manager_.SendDriverDistractionState(application);
}
smart_objects::SmartObjectSPtr
@@ -418,7 +466,7 @@ RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification(
const uint32_t connection_key, ApplicationSharedPtr app) {
DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr());
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
mobile_apis::FunctionID::OnSystemRequestID;
@@ -585,12 +633,14 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
return;
}
+ utils::SemanticVersion negotiated_version = application->msg_version();
+
response_params[strings::sync_msg_version][strings::major_version] =
- major_version; // From generated file interfaces/generated_msg_version.h
+ negotiated_version.major_version_;
response_params[strings::sync_msg_version][strings::minor_version] =
- minor_version; // From generated file interfaces/generated_msg_version.h
+ negotiated_version.minor_version_;
response_params[strings::sync_msg_version][strings::patch_version] =
- patch_version; // From generated file interfaces/generated_msg_version.h
+ negotiated_version.patch_version_;
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
@@ -795,11 +845,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,
@@ -837,7 +882,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
bool resumption,
bool need_restore_vr) {
using namespace smart_objects;
- SmartObjectSPtr notification = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map);
if (!notification) {
LOG4CXX_ERROR(logger_, "Failed to create smart object");
return;
@@ -938,31 +983,27 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI(
application[strings::request_subtype] = SmartObject(SmartType_Array);
}
- application[strings::device_info] = SmartObject(SmartType_Map);
- smart_objects::SmartObject& device_info = application[strings::device_info];
const protocol_handler::SessionObserver& session_observer =
application_manager_.connection_handler().get_session_observer();
- std::string device_name;
- std::string mac_address;
- std::string transport_type;
- const connection_handler::DeviceHandle handle = application_impl.device();
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- handle, &device_name, NULL, &mac_address, &transport_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device " << handle);
- }
- device_info[strings::name] = device_name;
- device_info[strings::id] = mac_address;
-
- const policy::DeviceConsent device_consent =
- GetPolicyHandler().GetUserConsentForDevice(mac_address);
- device_info[strings::isSDLAllowed] =
- policy::DeviceConsent::kDeviceAllowed == device_consent;
-
- device_info[strings::transport_type] =
- application_manager_.GetDeviceTransportType(transport_type);
+ application[strings::device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& device_info = application[strings::device_info];
+ MessageHelper::CreateDeviceInfo(application_impl.device(),
+ session_observer,
+ GetPolicyHandler(),
+ application_manager_,
+ &device_info);
+
+ if (application_impl.secondary_device() != 0) {
+ application[strings::secondary_device_info] = SmartObject(SmartType_Map);
+ smart_objects::SmartObject& secondary_device_info =
+ application[strings::secondary_device_info];
+ MessageHelper::CreateDeviceInfo(application_impl.secondary_device(),
+ session_observer,
+ GetPolicyHandler(),
+ application_manager_,
+ &secondary_device_info);
+ }
const smart_objects::SmartObject* day_color_scheme =
application_impl.day_color_scheme();
@@ -1041,7 +1082,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
policy::StringArray app_hmi_types;
const std::string mobile_app_id =
- message[strings::msg_params][strings::app_id].asString();
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
const bool init_result = GetPolicyHandler().GetInitialAppData(
mobile_app_id, &app_nicknames, &app_hmi_types);
@@ -1145,8 +1186,8 @@ void RegisterAppInterfaceRequest::FillDeviceInfo(
bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
LOG4CXX_AUTO_TRACE(logger_);
- const custom_string::CustomString mobile_app_id =
- (*message_)[strings::msg_params][strings::app_id].asCustomString();
+ const custom_string::CustomString mobile_app_id(
+ application_manager_.GetCorrectMobileIDFromMessage(message_));
const ApplicationSet& applications =
application_manager_.applications().GetData();
@@ -1288,6 +1329,17 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
}
}
+ if (application_manager_.get_settings().use_full_app_id()) {
+ if ((*message_)[strings::msg_params].keyExists(strings::full_app_id)) {
+ str =
+ (*message_)[strings::msg_params][strings::full_app_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
+ return true;
+ }
+ }
+ }
+
return false;
}
@@ -1320,10 +1372,8 @@ void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
}
bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
- const smart_objects::SmartObject& msg_params =
- (*message_)[strings::msg_params];
-
- const std::string& policy_app_id = msg_params[strings::app_id].asString();
+ const std::string& policy_app_id =
+ application_manager_.GetCorrectMobileIDFromMessage(message_);
LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
index 73b38823d8..31eb738357 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc
@@ -60,6 +60,40 @@ void RegisterAppInterfaceResponse::Run() {
}
}
+ application_manager::ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+
+ if (app && app->msg_version() <= utils::version_4_5 &&
+ app->is_media_application() &&
+ (*message_)[strings::msg_params].keyExists(
+ hmi_response::button_capabilities)) {
+ const smart_objects::SmartObject& button_caps =
+ (*message_)[strings::msg_params][hmi_response::button_capabilities];
+ auto it = button_caps.asArray()->begin();
+ auto ok_btn_it = it;
+ bool ok_btn_exists = false;
+ bool play_pause_btn_exists = false;
+ for (; it != button_caps.asArray()->end(); ++it) {
+ smart_objects::SmartObject& so = *it;
+ int64_t current_id = so[strings::name].asInt();
+ if (current_id == -1) {
+ continue;
+ }
+ const mobile_apis::ButtonName::eType current_button =
+ static_cast<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == mobile_apis::ButtonName::PLAY_PAUSE) {
+ play_pause_btn_exists = true;
+ so[strings::name] = mobile_apis::ButtonName::OK;
+ } else if (current_button == mobile_apis::ButtonName::OK) {
+ ok_btn_exists = true;
+ ok_btn_it = it;
+ }
+ }
+ if (ok_btn_exists && play_pause_btn_exists) {
+ button_caps.asArray()->erase(ok_btn_it);
+ }
+ }
+
SendResponse(success, result_code, last_message);
if (mobile_apis::Result::SUCCESS != result_code) {
@@ -68,16 +102,14 @@ void RegisterAppInterfaceResponse::Run() {
// Add registered application to the policy db right after response sent to
// mobile to be able to check all other API according to app permissions
- application_manager::ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
+ if (!app) {
LOG4CXX_ERROR(logger_,
"Application with connection key " << connection_key()
<< " is not registered.");
return;
}
- SetHeartBeatTimeout(connection_key(), application->policy_app_id());
+ SetHeartBeatTimeout(connection_key(), app->policy_app_id());
}
void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
index ab8de5923a..2719d0674d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc
@@ -124,7 +124,7 @@ void SendLocationRequest::Run() {
(*message_)[strings::msg_params][strings::location_image],
app,
application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
SendResponse(false, verification_result);
return;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
index 3cb57c90e8..e6332d85c8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc
@@ -259,7 +259,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) {
ApplicationSharedPtr app =
application_manager_.application(connection_key());
- if (!message_.valid() || !app.valid()) {
+ if ((message_.use_count() == 0) || (app.use_count() == 0)) {
LOG4CXX_ERROR(logger_, "NULL pointer.");
return;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
index 90ec06025e..0c217b6b4f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc
@@ -95,7 +95,7 @@ void SetGlobalPropertiesRequest::Run() {
(*message_)[strings::msg_params][strings::menu_icon],
app,
application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(
logger_, "MessageHelper::VerifyImage return " << verification_result);
SendResponse(false, verification_result);
@@ -104,7 +104,7 @@ void SetGlobalPropertiesRequest::Run() {
}
// Check for image file(s) in vrHelpItem
if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
- if (mobile_apis::Result::SUCCESS !=
+ if (mobile_apis::Result::INVALID_DATA ==
MessageHelper::VerifyImageVrHelpItems(
(*message_)[strings::msg_params][strings::vr_help],
app,
@@ -162,6 +162,9 @@ void SetGlobalPropertiesRequest::Run() {
params[strings::app_id] = app->app_id();
SendUIRequest(params, true);
+
+ auto& help_prompt_manager = app->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
} else {
LOG4CXX_DEBUG(logger_, "VRHelp params does not present");
DCHECK_OR_RETURN_VOID(!is_vr_help_title_present && !is_vr_help_present);
@@ -169,15 +172,6 @@ void SetGlobalPropertiesRequest::Run() {
smart_objects::SmartObject params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- if (ValidateVRHelpTitle(app->vr_help_title())) {
- LOG4CXX_DEBUG(logger_, "App already contains VRHelp data");
- } else {
- if (!PrepareUIRequestDefaultVRHelpData(app, params)) {
- LOG4CXX_ERROR(logger_, "default VRHElp data could not be generated");
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
- }
PrepareUIRequestMenuAndKeyboardData(app, msg_params, params);
// Preparing data
@@ -247,6 +241,9 @@ void SetGlobalPropertiesRequest::Run() {
params[strings::app_id] = app->app_id();
SendTTSRequest(params, true);
+
+ auto& help_prompt_manager = app->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(params, false);
}
}
@@ -276,6 +273,9 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
using namespace helpers;
const smart_objects::SmartObject& message = event.smart_object();
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetGlobalProperties: {
LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
@@ -284,6 +284,10 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, ui_response_info_);
+ if (application.use_count() != 0) {
+ auto& help_prompt_manager = application->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(message, true);
+ }
break;
}
case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
@@ -293,6 +297,10 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
GetInfo(message, tts_response_info_);
+ if (application.use_count() != 0) {
+ auto& help_prompt_manager = application->help_prompt_manager();
+ help_prompt_manager.OnSetGlobalPropertiesReceived(message, true);
+ }
break;
}
default: {
@@ -309,10 +317,6 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
std::string response_info;
const bool result = PrepareResponseParameters(result_code, response_info);
- // TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
SendResponse(result,
result_code,
response_info.empty() ? NULL : response_info.c_str(),
@@ -356,17 +360,6 @@ bool SetGlobalPropertiesRequest::PrepareResponseParameters(
return result;
}
-bool SetGlobalPropertiesRequest::ValidateVRHelpTitle(
- const smart_objects::SmartObject* const vr_help_so_ptr) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (vr_help_so_ptr) {
- const std::string& vr_help = vr_help_so_ptr->asString();
- LOG4CXX_TRACE(logger_, "App contains vr_help_title: \"" << vr_help << '"');
- return !vr_help.empty();
- }
- return false;
-}
-
void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData(
const ApplicationSharedPtr app,
const smart_objects::SmartObject& msg_params,
@@ -381,41 +374,6 @@ void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData(
out_params[strings::vr_help] = (*app->vr_help());
}
-bool SetGlobalPropertiesRequest::PrepareUIRequestDefaultVRHelpData(
- const ApplicationSharedPtr app, smart_objects::SmartObject& out_params) {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK_OR_RETURN(app, false);
-
- LOG4CXX_DEBUG(logger_, "Generate default VRHelp data");
- const DataAccessor<CommandsMap> accessor = app->commands_map();
- const CommandsMap& cmdMap = accessor.GetData();
-
- int32_t index = 0;
- smart_objects::SmartObject vr_help_items;
- for (CommandsMap::const_iterator command_it = cmdMap.begin();
- cmdMap.end() != command_it;
- ++command_it) {
- const smart_objects::SmartObject& command = *command_it->second;
- if (!command.keyExists(strings::vr_commands)) {
- LOG4CXX_ERROR(logger_, "VR synonyms are empty");
- return false;
- }
- // use only first
- vr_help_items[index][strings::position] = (index + 1);
- vr_help_items[index++][strings::text] =
- (*command_it->second)[strings::vr_commands][0];
- }
-
- app->set_vr_help_title(smart_objects::SmartObject(app->name()));
-
- out_params[strings::vr_help_title] = (*app->vr_help_title());
- if (vr_help_items.length() > 0) {
- app->set_vr_help(vr_help_items);
- out_params[strings::vr_help] = (*app->vr_help());
- }
- return true;
-}
-
void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData(
const ApplicationSharedPtr app,
const smart_objects::SmartObject& msg_params,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_icon_request.cc
deleted file mode 100644
index 54c202f7b0..0000000000
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_icon_request.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-
- 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 "sdl_rpc_plugin/commands/mobile/set_icon_request.h"
-#include "application_manager/application_manager.h"
-#include "application_manager/application_impl.h"
-#include "config_profile/profile.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-SetIconRequest::SetIconRequest(
- const application_manager::commands::MessageSharedPtr& message,
- ApplicationManager& application_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler) {}
-
-SetIconRequest::~SetIconRequest() {}
-
-void SetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app = application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += app->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (!file_system::FileExists(full_file_path)) {
- LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::sync_file_name] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- // Panasonic requres unchanged path value without encoded special characters
- const std::string full_file_path_for_hmi =
- file_system::ConvertPathForURL(full_file_path);
-
- msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
-
- // TODO(VS): research why is image_type hardcoded
- msg_params[strings::sync_file_name][strings::image_type] =
- static_cast<int32_t>(SetIconRequest::ImageType::DYNAMIC);
-
- // for further use in on_event function
- (*message_)[strings::msg_params][strings::sync_file_name] =
- msg_params[strings::sync_file_name];
- StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
-}
-
-void SetIconRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- if (result) {
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- const std::string path =
- (*message_)[strings::msg_params][strings::sync_file_name]
- [strings::value].asString();
- app->set_app_icon_path(path);
-
- LOG4CXX_INFO(logger_,
- "Icon path was set to '" << app->app_icon_path() << "'");
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
index c2eb067e18..3b2936e6cd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc
@@ -105,7 +105,7 @@ void ShowConstantTBTRequest::Run() {
if (msg_params.keyExists(strings::turn_icon)) {
verification_result = MessageHelper::VerifyImage(
msg_params[strings::turn_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
SendResponse(false, verification_result);
return;
@@ -115,7 +115,7 @@ void ShowConstantTBTRequest::Run() {
if (msg_params.keyExists(strings::next_turn_icon)) {
verification_result = MessageHelper::VerifyImage(
msg_params[strings::next_turn_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
SendResponse(false, verification_result);
return;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
index 80a28b288c..e0c3e1da9a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc
@@ -143,7 +143,7 @@ void ShowRequest::Run() {
(*message_)[strings::msg_params][strings::graphic],
app,
application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(logger_, "Image verification failed.");
SendResponse(false, verification_result);
return;
@@ -155,7 +155,7 @@ void ShowRequest::Run() {
(*message_)[strings::msg_params][strings::secondary_graphic],
app,
application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(logger_, "Image verification failed.");
SendResponse(false, verification_result);
return;
@@ -276,7 +276,7 @@ void ShowRequest::Run() {
SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
app_mngr::commands::MessageSharedPtr persistentData =
- new smart_objects::SmartObject(msg_params);
+ std::make_shared<smart_objects::SmartObject>(msg_params);
app->set_show_command(*persistentData);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
index 908a251962..85cb26321b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc
@@ -32,6 +32,7 @@
*/
#include "sdl_rpc_plugin/commands/mobile/subscribe_button_request.h"
+#include "utils/semantic_version.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -65,7 +66,7 @@ void SubscribeButtonRequest::Run() {
return;
}
- const mobile_apis::ButtonName::eType btn_id =
+ mobile_apis::ButtonName::eType btn_id =
static_cast<mobile_apis::ButtonName::eType>(
(*message_)[str::msg_params][str::button_name].asInt());
@@ -76,7 +77,20 @@ void SubscribeButtonRequest::Run() {
return;
}
- if (!CheckHMICapabilities(btn_id)) {
+ if (app->msg_version() <= utils::version_4_5 &&
+ btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
+ bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
+ bool play_pause_supported =
+ CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE);
+ if (play_pause_supported) {
+ LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE");
+ btn_id = mobile_apis::ButtonName::PLAY_PAUSE;
+ (*message_)[str::msg_params][str::button_name] = btn_id;
+ } else if (!ok_supported) {
+ LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ }
+ } else if (!CheckHMICapabilities(btn_id)) {
LOG4CXX_ERROR(logger_,
"Subscribe on button "
<< btn_id << " isn't allowed by HMI capabilities");
@@ -105,7 +119,8 @@ bool SubscribeButtonRequest::Init() {
bool SubscribeButtonRequest::IsSubscriptionAllowed(
ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
if (!app->is_media_application() &&
- ((mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
+ ((mobile_apis::ButtonName::PLAY_PAUSE == btn_id) ||
+ (mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
(mobile_apis::ButtonName::SEEKRIGHT == btn_id) ||
(mobile_apis::ButtonName::TUNEUP == btn_id) ||
(mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
index 62eb2d59c5..cea00a9d5e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc
@@ -452,7 +452,7 @@ void SystemRequest::Run() {
ApplicationSharedPtr application =
application_manager_.application(connection_key());
- if (!(application.valid())) {
+ if (application.use_count() == 0) {
LOG4CXX_ERROR(logger_, "NULL pointer");
SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
return;
@@ -589,7 +589,7 @@ void SystemRequest::Run() {
SendResponse(true, mobile_apis::Result::SUCCESS);
return;
} else if (mobile_apis::RequestType::QUERY_APPS == request_type) {
- using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+ using namespace ns_smart_device_link::ns_json_handler::formatters;
smart_objects::SmartObject sm_object;
Json::Reader reader;
@@ -655,7 +655,7 @@ void SystemRequest::on_event(const event_engine::Event& event) {
ApplicationSharedPtr application =
application_manager_.application(connection_key());
- if (!(application.valid())) {
+ if (application.use_count() == 0) {
LOG4CXX_ERROR(logger_, "NULL pointer");
return;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
index 6537f0e7b2..ccfaef54cb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc
@@ -34,6 +34,7 @@
#include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h"
#include "application_manager/application_impl.h"
+#include "utils/semantic_version.h"
namespace sdl_rpc_plugin {
using namespace application_manager;
@@ -67,11 +68,24 @@ void UnsubscribeButtonRequest::Run() {
return;
}
- const mobile_apis::ButtonName::eType btn_id =
+ mobile_apis::ButtonName::eType btn_id =
static_cast<mobile_apis::ButtonName::eType>(
(*message_)[str::msg_params][str::button_name].asInt());
- if (!CheckHMICapabilities(btn_id)) {
+ if (app->msg_version() <= utils::version_4_5 &&
+ btn_id == mobile_apis::ButtonName::OK && app->is_media_application()) {
+ bool ok_supported = CheckHMICapabilities(mobile_apis::ButtonName::OK);
+ bool play_pause_supported =
+ CheckHMICapabilities(mobile_apis::ButtonName::PLAY_PAUSE);
+ if (play_pause_supported) {
+ LOG4CXX_DEBUG(logger_, "Converting Legacy OK button to PLAY_PAUSE");
+ btn_id = mobile_apis::ButtonName::PLAY_PAUSE;
+ (*message_)[str::msg_params][str::button_name] = btn_id;
+ } else if (!ok_supported) {
+ LOG4CXX_ERROR(logger_, "OK button isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ }
+ } else if (!CheckHMICapabilities(btn_id)) {
LOG4CXX_ERROR(logger_,
"Button " << btn_id << " isn't allowed by HMI capabilities");
SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
index 0d0836878f..40bb1ddfc9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc
@@ -39,7 +39,7 @@ using namespace application_manager;
namespace commands {
-UnSubscribeWayPointsRequest::UnSubscribeWayPointsRequest(
+UnsubscribeWayPointsRequest::UnsubscribeWayPointsRequest(
const application_manager::commands::MessageSharedPtr& message,
ApplicationManager& application_manager,
app_mngr::rpc_service::RPCService& rpc_service,
@@ -51,9 +51,9 @@ UnSubscribeWayPointsRequest::UnSubscribeWayPointsRequest(
hmi_capabilities,
policy_handler) {}
-UnSubscribeWayPointsRequest::~UnSubscribeWayPointsRequest() {}
+UnsubscribeWayPointsRequest::~UnsubscribeWayPointsRequest() {}
-void UnSubscribeWayPointsRequest::Run() {
+void UnsubscribeWayPointsRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager_.application(connection_key());
@@ -76,13 +76,13 @@ void UnSubscribeWayPointsRequest::Run() {
hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
}
-void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
+void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application_manager_.application(connection_key());
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
- LOG4CXX_INFO(logger_, "Received Navigation_UnSubscribeWayPoints event");
+ LOG4CXX_INFO(logger_, "Received Navigation_UnsubscribeWayPoints event");
EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
@@ -107,7 +107,7 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
}
}
-bool UnSubscribeWayPointsRequest::Init() {
+bool UnsubscribeWayPointsRequest::Init() {
hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
return true;
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
index 69379135b5..c04ad34f5f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc
@@ -100,7 +100,7 @@ void UpdateTurnListRequest::Run() {
((*message_)[strings::msg_params][strings::turn_list]);
for (uint32_t i = 0; i < turn_list_array.length(); ++i) {
if ((turn_list_array[i].keyExists(strings::turn_icon)) &&
- (mobile_apis::Result::SUCCESS !=
+ (mobile_apis::Result::INVALID_DATA ==
MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon],
app,
application_manager_))) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
index 83edb76264..7065c7cf7d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc
@@ -158,36 +158,6 @@
#include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h"
#endif // EXTERNAL_PROPRIETARY_MODE
-#ifdef HMI_DBUS_API
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_request_template.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_get_vehicle_data_response_template.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_request_template.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_subscribe_vehicle_data_response_template.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h"
-#include "sdl_rpc_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h"
-#endif // #ifdef HMI_DBUS_API
-
#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h"
@@ -603,229 +573,6 @@ CommandCreator& HMICommandFactory::get_creator_factory(
? factory.GetCreator<commands::UIIsReadyRequest>()
: factory.GetCreator<commands::UIIsReadyResponse>();
}
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetGpsData: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetGpsData> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetGpsData> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetSpeed: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSpeed> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetSpeed> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetRpm: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehitcleInfo_GetRpm> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetRpm> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetFuelLevelState> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetInstantFuelConsumption> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetInstantFuelConsumption> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetExternalTemperature> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetExternalTemperature> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetPrndl: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetPrndl> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetPrndl> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetVin: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetVin> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetVin> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetTirePressure> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetOdometer> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetOdometer> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetBodyInformation> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetDeviceStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetDriverBraking> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetWiperStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetHeadLampStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetEngineTorque> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetAccPedalPosition> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetAccPedalPosition> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetSteeringWheelAngle> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetSteeringWheelAngle> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetAirbagStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetEmergencyEvent> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetClusterModeStatus> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_GetClusterModeStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_GetMyKey: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::VIGetVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetMyKey> >()
- : factory
- .GetCreator<commands::VIGetVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_GetMyKey> >();
- }
-#endif // #ifdef HMI_DBUS_API
case hmi_apis::FunctionID::Navigation_IsReady: {
return hmi_apis::messageType::request == message_type
? factory.GetCreator<commands::NaviIsReadyRequest>()
@@ -860,7 +607,7 @@ CommandCreator& HMICommandFactory::get_creator_factory(
case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
return hmi_apis::messageType::request == message_type
? factory
- .GetCreator<commands::NaviUnSubscribeWayPointsRequest>()
+ .GetCreator<commands::NaviUnsubscribeWayPointsRequest>()
: factory.GetCreator<
commands::NaviUnsubscribeWayPointsResponse>();
}
@@ -955,610 +702,6 @@ CommandCreator& HMICommandFactory::get_creator_factory(
return factory
.GetCreator<commands::hmi::OnButtonSubscriptionNotification>();
}
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeSpeed> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeFuelLevel> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeFuelLevel> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeFuelLevel_State> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeFuelLevel_State> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeInstantFuelConsumption> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeInstantFuelConsumption> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeExternalTemperature> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeExternalTemperature> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribePrndl> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeTirePressure> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeTirePressure> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeOdometer> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeOdometer> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeBeltStatus> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeBeltStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeBodyInformation> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeBodyInformation> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeDeviceStatus> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeDeviceStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeDriverBraking> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeDriverBraking> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeWiperStatus> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeWiperStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeHeadLampStatus> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeHeadLampStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeEngineTorque> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeEngineTorque> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeAccPedalPosition> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeAccPedalPosition> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeSteeringWheelAngle> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeSteeringWheelAngle> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeECallInfo> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeECallInfo> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeAirbagStatus> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeAirbagStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeEmergencyEvent> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeEmergencyEvent> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeClusterModeStatus> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeClusterModeStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VISubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey> >()
- : factory.GetCreator<
- commands::VISubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_SubscribeMyKey> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator <
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeGps> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeSpeed> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeSpeed> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeRpm> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeFuelLevel> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeFuelLevel> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeFuelLevel_State> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeFuelLevel_State> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeInstantFuelConsumption> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeInstantFuelConsumption> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeExternalTemperature> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeExternalTemperature> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribePrndl> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribePrndl> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeVin> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeTirePressure> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeTirePressure> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeOdometer> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeOdometer> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeBeltStatus> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeBeltStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeBodyInformation> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeBodyInformation> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeDeviceStatus> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeDeviceStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeDriverBraking> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeDriverBraking> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeWiperStatus> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeWiperStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeHeadLampStatus> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeHeadLampStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeEngineTorque> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeEngineTorque> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeAccPedalPosition> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeAccPedalPosition> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeSteeringWheelAngle> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeSteeringWheelAngle> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeECallInfo> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeECallInfo> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeAirbagStatus> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeAirbagStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeEmergencyEvent> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeEmergencyEvent> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<
- commands::VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeClusterModeStatus> >()
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeClusterModeStatus> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: {
- return hmi_apis::messageType::request == message_type
- ? factory.GetCreator<commands::>(
- VIUnsubscribeVehicleDataRequestTemplate<
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>)
- : factory.GetCreator<
- commands::VIUnsubscribeVehicleDataResponseTemplate<
- hmi_apis::FunctionID::
- VehicleInfo_UnsubscribeMyKey> >();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnGpsData: {
- return factory.GetCreator<commands::OnVIGpsDataNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnSpeed: {
- return factory.GetCreator<commands::OnVISpeedNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnRpm: {
- return factory.GetCreator<commands::OnVIRpmNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: {
- return factory.GetCreator<commands::OnVifuelLevelNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: {
- return factory.GetCreator<commands::OnVifuelLevelStateNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: {
- return factory
- .GetCreator<commands::OnVIInstantFuelConsumptionNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: {
- return factory
- .GetCreator<commands::OnVIExternalTemperatureNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnVin: {
- return factory.GetCreator<commands::OnVIVinNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnPrndl: {
- return factory.GetCreator<commands::OnVIPrndlNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: {
- return factory.GetCreator<commands::OnVITirePressureNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnOdometer: {
- return factory.GetCreator<commands::OnVIOdometerNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: {
- return factory.GetCreator<commands::OnVIBeltStatusNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: {
- return factory.GetCreator<commands::OnVIBodyInformationNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: {
- return factory.GetCreator<commands::OnVIDeviceStatusNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: {
- return factory.GetCreator<commands::OnVIDriverBrakingNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: {
- return factory.GetCreator<commands::OnVIWiperStatusNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: {
- return factory.GetCreator<commands::OnVIHeadLampStatusNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: {
- return factory.GetCreator<commands::OnVIEngineTorqueNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: {
- return factory.GetCreator<commands::OnVIAccPedalPositionNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: {
- return factory.GetCreator<commands::OnVISteeringWheelAngleNotification>();
- }
- case hmi_apis::FunctionID::VehicleInfo_OnMyKey: {
- return factory.GetCreator<commands::OnVIMyKeyNotification>();
- }
-#endif // #ifdef HMI_DBUS_API
case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
return factory.GetCreator<commands::OnNaviTBTClientStateNotification>();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
index d27161ff77..5207c7e432 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
@@ -125,7 +125,6 @@
#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h"
#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h"
#include "interfaces/MOBILE_API.h"
-#include "utils/make_shared.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace sdl_rpc_plugin {
@@ -264,7 +263,7 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
}
case mobile_apis::FunctionID::GetWayPointsID: {
return mobile_api::messageType::request == message_type
- ? factory.GetCreator<commands::ShowConstantTBTRequest>()
+ ? factory.GetCreator<commands::GetWayPointsRequest>()
: factory.GetCreator<commands::GetWayPointsResponse>();
}
case mobile_apis::FunctionID::SubscribeWayPointsID: {
@@ -274,8 +273,8 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
}
case mobile_apis::FunctionID::UnsubscribeWayPointsID: {
return mobile_api::messageType::request == message_type
- ? factory.GetCreator<commands::ShowConstantTBTRequest>()
- : factory.GetCreator<commands::ShowConstantTBTResponse>();
+ ? factory.GetCreator<commands::UnsubscribeWayPointsRequest>()
+ : factory.GetCreator<commands::UnsubscribeWayPointsResponse>();
}
case mobile_apis::FunctionID::GetSystemCapabilityID: {
return mobile_api::messageType::request == message_type
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/activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
index 8cb5e97891..50b7aae42a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc
@@ -32,7 +32,6 @@
#include "gtest/gtest.h"
#include "hmi/activate_app_request.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/commands_test.h"
@@ -45,7 +44,7 @@ namespace hmi_commands_test {
namespace activate_app_request {
using ::testing::_;
-using ::utils::SharedPtr;
+
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using am::commands::MessageSharedPtr;
@@ -54,8 +53,8 @@ using am::commands::CommandImpl;
using ::test::components::application_manager_test::MockApplication;
-typedef SharedPtr<MockApplication> MockAppPtr;
-typedef ::utils::SharedPtr<ActivateAppRequest> ActivateAppRequestPtr;
+typedef std::shared_ptr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<ActivateAppRequest> ActivateAppRequestPtr;
MATCHER_P(CheckMessage, level, "") {
return level ==
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
index d43d70b5ca..a5707488dd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc
@@ -32,7 +32,7 @@
#include "gtest/gtest.h"
#include "hmi/add_statistics_info_notification.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -58,7 +58,7 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-typedef ::utils::SharedPtr<AddStatisticsInfoNotification> NotificationPtr;
+typedef std::shared_ptr<AddStatisticsInfoNotification> NotificationPtr;
namespace {
const uint32_t kStatisticType = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
index 4b7fb0fc09..a2fcf8f605 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc
@@ -32,7 +32,7 @@
#include "gtest/gtest.h"
#include "hmi/allow_all_apps_response.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_impl.h"
#include "application_manager/commands/commands_test.h"
@@ -49,7 +49,7 @@ using sdl_rpc_plugin::commands::AllowAllAppsResponse;
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-typedef ::utils::SharedPtr<AllowAllAppsResponse> ResponsePtr;
+typedef std::shared_ptr<AllowAllAppsResponse> ResponsePtr;
namespace {
const bool kResponseIsAllowed = true;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
index 3681bf01b6..2ce400542a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc
@@ -32,7 +32,7 @@
#include "gtest/gtest.h"
#include "hmi/allow_app_response.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -55,7 +55,7 @@ const uint32_t kConnectionKey = 1u;
const bool kIsResponseAllowed = true;
}
-typedef ::utils::SharedPtr<AllowAppResponse> ResponsePtr;
+typedef std::shared_ptr<AllowAppResponse> ResponsePtr;
class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
index 78fec997e9..a3f0ab6933 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc
@@ -33,7 +33,7 @@
#include "hmi/basic_communication_get_system_time_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/command_request_test.h"
#include "protocol_handler/mock_protocol_handler.h"
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
index 930e024b4b..6ed15bebeb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc
@@ -32,7 +32,7 @@
#include "gtest/gtest.h"
#include "hmi/button_get_capabilities_response.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -51,7 +51,7 @@ using ::testing::NiceMock;
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-typedef ::utils::SharedPtr<ButtonGetCapabilitiesResponse> ResponsePtr;
+typedef std::shared_ptr<ButtonGetCapabilitiesResponse> ResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
index 1bae77bb30..6914a4ca7e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
@@ -49,13 +49,12 @@ namespace commands_test {
namespace hmi_commands_test {
namespace close_popup_response {
-using ::utils::SharedPtr;
namespace am = ::application_manager;
using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::ClosePopupResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
index 2374609774..a6497ca6e1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -223,28 +223,6 @@
#include "hmi/on_tts_reset_timeout_notification.h"
#include "hmi/dial_number_request.h"
#include "hmi/dial_number_response.h"
-#include "hmi/on_vi_gps_data_notification.h"
-#include "hmi/on_vi_speed_notification.h"
-#include "hmi/on_vi_rpm_notification.h"
-#include "hmi/on_vi_fuel_level_notification.h"
-#include "hmi/on_vi_fuel_level_state_notification.h"
-#include "hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "hmi/on_vi_external_temperature_notification.h"
-#include "hmi/on_vi_vin_notification.h"
-#include "hmi/on_vi_prndl_notification.h"
-#include "hmi/on_vi_tire_pressure_notification.h"
-#include "hmi/on_vi_odometer_notification.h"
-#include "hmi/on_vi_belt_status_notification.h"
-#include "hmi/on_vi_body_information_notification.h"
-#include "hmi/on_vi_device_status_notification.h"
-#include "hmi/on_vi_driver_braking_notification.h"
-#include "hmi/on_vi_wiper_status_notification.h"
-#include "hmi/on_vi_head_lamp_status_notification.h"
-#include "hmi/on_vi_engine_torque_notification.h"
-#include "hmi/on_vi_acc_pedal_position_notification.h"
-#include "hmi/on_vi_steering_wheel_angle_notification.h"
-#include "hmi/on_vi_my_key_notification.h"
-#include "hmi/ui_set_icon_request.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -444,7 +422,7 @@ typedef Types<commands::NaviIsReadyResponse,
commands::NaviSubscribeWayPointsResponse,
commands::NaviSubscribeWayPointsRequest,
commands::NaviUnsubscribeWayPointsResponse,
- commands::NaviUnSubscribeWayPointsRequest,
+ commands::NaviUnsubscribeWayPointsRequest,
commands::ButtonGetCapabilitiesResponse,
commands::ButtonGetCapabilitiesRequest,
commands::OnAllowSDLFunctionalityNotification,
@@ -515,28 +493,7 @@ typedef Types<commands::hmi::OnButtonEventNotification,
commands::OnVRLanguageChangeNotification,
commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
-typedef Types<commands::OnVIGpsDataNotification,
- commands::OnVISpeedNotification,
- commands::OnVIRpmNotification,
- commands::OnVIFuelLevelNotification,
- commands::OnVIFuelLevelStateNotification,
- commands::OnVIInstantFuelConsumptionNotification,
- commands::OnVIExternalTemperatureNotification,
- commands::OnVIVinNotification,
- commands::OnVIPrndlNotification,
- commands::OnVITirePressureNotification,
- commands::OnVIOdometerNotification,
- commands::OnVIBeltStatusNotification,
- commands::OnVIBodyInformationNotification,
- commands::OnVIDeviceStatusNotification,
- commands::OnVIDriverBrakingNotification,
- commands::OnVIWiperStatusNotification,
- commands::OnVIHeadLampStatusNotification,
- commands::OnVIEngineTorqueNotification,
- commands::OnVIAccPedalPositionNotification,
- commands::OnVISteeringWheelAngleNotification,
- commands::OnVIMyKeyNotification,
- commands::AllowAllAppsRequest,
+typedef Types<commands::AllowAllAppsRequest,
commands::AllowAllAppsResponse,
commands::AllowAppRequest,
commands::AllowAppResponse> HMICommandsListFifth;
@@ -548,30 +505,30 @@ TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth);
TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
index 6262e1dd8a..4cbe7305ea 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -49,14 +49,13 @@ namespace commands_test {
namespace hmi_commands_test {
namespace get_system_info_request {
-using ::utils::SharedPtr;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using am::commands::RequestToHMI;
using sdl_rpc_plugin::commands::GetSystemInfoRequest;
using am::commands::CommandImpl;
-typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
index 3a68264e2a..6908e21053 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/application.h"
@@ -52,7 +51,6 @@ namespace hmi_commands_test {
namespace get_system_info_response {
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
@@ -62,7 +60,7 @@ using sdl_rpc_plugin::commands::GetSystemInfoResponse;
using sdl_rpc_plugin::commands::SystemInfo;
using am::commands::CommandImpl;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
index 05169e5067..339a749909 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
@@ -52,14 +51,13 @@ namespace get_urls_response {
using ::testing::_;
using ::testing::Return;
-using ::utils::SharedPtr;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using sdl_rpc_plugin::commands::GetUrlsResponse;
using am::commands::ResponseToHMI;
using am::commands::CommandImpl;
-typedef SharedPtr<ResponseToHMI> ResponseToHMIPtr;
+typedef std::shared_ptr<ResponseToHMI> ResponseToHMIPtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
index 7788cb2ebe..2191900750 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "application_manager/message.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -58,7 +57,6 @@ namespace get_urls {
using namespace hmi_apis;
using namespace policy;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
using ::testing::_;
using ::testing::SetArgReferee;
@@ -71,7 +69,7 @@ using am::commands::CommandImpl;
using policy::PolicyHandler;
using policy_test::MockPolicyHandlerInterface;
-typedef SharedPtr<RequestFromHMI> RequestFromHMIPtr;
+typedef std::shared_ptr<RequestFromHMI> RequestFromHMIPtr;
namespace {
const uint32_t kInvalidAppId_ = 0u;
@@ -92,7 +90,7 @@ class GetUrlsTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
GetUrlsTest() {
command_msg_ =
- CreateMessage(NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ CreateMessage(ns_smart_device_link::ns_smart_objects::SmartType_Map);
(*command_msg_)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
(*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
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 b498d07d99..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
@@ -35,34 +35,12 @@
#include <vector>
#include "gtest/gtest.h"
#include "application_manager/commands/commands_test.h"
-
#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h"
-#include "sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h"
#include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h"
@@ -111,8 +89,7 @@
#include "utils/lock.h"
#include "utils/data_accessor.h"
#include "utils/signals.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -147,7 +124,6 @@ using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
using ::testing::InSequence;
-using ::utils::SharedPtr;
using ::smart_objects::SmartObject;
using ::application_manager::commands::MessageSharedPtr;
using ::test::components::application_manager_test::MockApplicationManager;
@@ -160,7 +136,7 @@ using ::application_manager::MockMessageHelper;
using namespace sdl_rpc_plugin::commands;
using namespace am::commands;
-typedef SharedPtr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<MockApplication> MockAppPtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
@@ -312,12 +288,6 @@ void sig_handler(int sig) {
} // namespace
template <class Command>
-class HMIOnViNotifications : public commands_test::CommandsTest<kIsNice> {
- public:
- typedef Command CommandType;
-};
-
-template <class Command>
class HMIOnNotificationsListToHMI
: public commands_test::CommandsTest<kIsNice> {
public:
@@ -375,7 +345,7 @@ TYPED_TEST_CASE(HMIOnNotificationsEventDispatcher,
TYPED_TEST(HMIOnNotificationsListToHMI, CommandsSendNotificationToHmi) {
MessageSharedPtr message =
commands_test::CommandsTest<kIsNice>::CreateMessage();
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>(message);
EXPECT_CALL(commands_test::CommandsTest<kIsNice>::mock_rpc_service_,
SendMessageToHMI(_));
@@ -393,7 +363,7 @@ TYPED_TEST(HMIOnNotificationsEventDispatcher,
int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
MessageSharedPtr message =
commands_test::CommandsTest<kIsNice>::CreateMessage();
- utils::SharedPtr<typename TestFixture::CommandType::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType::CommandType> command =
this->template CreateCommand<
typename TestFixture::CommandType::CommandType>(message);
EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
@@ -408,7 +378,7 @@ TYPED_TEST(HMIOnNotificationsEventDispatcher,
// notifications(SendNotificationToMobile)
TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnButtonEventNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -421,7 +391,7 @@ TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) {
TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnNaviTBTClientStateNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -435,7 +405,7 @@ TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) {
TEST_F(HMICommandsNotificationsTest,
OnNaviWayPointChangeSendNotificationToMobile) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnNaviWayPointChangeNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -448,7 +418,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnUICommandNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -465,7 +435,7 @@ TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) {
TEST_F(HMICommandsNotificationsTest,
OnUIKeyBoardInputSendNotificationToMobile) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnUIKeyBoardInputNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -478,7 +448,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnUITouchEventNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -493,7 +463,7 @@ TEST_F(HMICommandsNotificationsTest,
OnAppRegisteredNotificationSendNotificationToHmi) {
int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAppRegisteredNotification>(message);
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
EXPECT_CALL(app_mngr_, event_dispatcher());
@@ -515,7 +485,7 @@ TEST_F(HMICommandsNotificationsTest,
OnAppUnregisteredNotificationEventDispatcher) {
int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAppUnregisteredNotification>(message);
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_));
EXPECT_CALL(app_mngr_, event_dispatcher());
@@ -536,7 +506,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnButtonPressNotification>(message);
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL));
@@ -553,7 +523,7 @@ TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnReadyNotification>(message);
EXPECT_CALL(app_mngr_, OnHMIStartedCooperation());
@@ -568,7 +538,7 @@ TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
TEST_F(HMICommandsNotificationsTest,
OnIgnitionCycleOverNotificationPolicyHandler) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnIgnitionCycleOverNotification>(message);
EXPECT_CALL(mock_policy_handler_, OnIgnitionCycleOver());
@@ -577,7 +547,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command = CreateCommand<OnPolicyUpdate>(message);
+ std::shared_ptr<Command> command = CreateCommand<OnPolicyUpdate>(message);
EXPECT_CALL(mock_policy_handler_, OnPTExchangeNeeded());
command->Run();
@@ -594,7 +564,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
(*message)[am::strings::msg_params][am::hmi_notification::policyfile] = kFile;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnReceivedPolicyUpdate>(message);
EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(kFile, data));
@@ -606,7 +576,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest,
OnReceivePolicyUpdateNotification_UNSUCCESS) {
MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnReceivedPolicyUpdate>(message);
EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(_, _)).Times(0);
@@ -624,7 +594,7 @@ TEST_F(HMICommandsNotificationsTest,
smart_objects::SmartObject hmi_application_temp(smart_objects::SmartType_Map);
applications[0] = hmi_application_temp;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAppPermissionConsentNotification>(message);
int32_t connection_id = -1;
@@ -646,11 +616,11 @@ TEST_F(HMICommandsNotificationsTest,
smart_objects::SmartObject(smart_objects::SmartType_Array);
smart_objects::SmartObjectSPtr consented_function =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*message)[am::strings::msg_params]["consentedFunctions"][0] =
*consented_function;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAppPermissionConsentNotification>(message);
int32_t connection_id = -1;
@@ -680,14 +650,14 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params]["source"] = "test_content_source";
smart_objects::SmartObjectSPtr consented_function =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*consented_function)["allowed"] = true;
(*consented_function)[am::strings::id] = 999;
(*consented_function)[am::strings::name] = "test_group_alias";
(*message)[am::strings::msg_params]["consentedFunctions"][0] =
*consented_function;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAppPermissionConsentNotification>(message);
int32_t connection_id = -1;
@@ -721,14 +691,14 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params]["source"] = "test_content_source";
smart_objects::SmartObjectSPtr consented_function =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*consented_function)["allowed"] = false;
(*consented_function)[am::strings::id] = 999;
(*consented_function)[am::strings::name] = "test_group_alias";
(*message)[am::strings::msg_params]["consentedFunctions"][0] =
*consented_function;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAppPermissionConsentNotification>(message);
int32_t connection_id = -1;
@@ -759,7 +729,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::hmi_notification::error] =
hmi_apis::Common_SystemError::SYNC_REBOOTED;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemErrorNotification>(message);
int32_t code = hmi_apis::Common_SystemError::INVALID_ENUM;
@@ -775,7 +745,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLangCode;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemInfoChangedNotification>(message);
EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_));
@@ -788,7 +758,7 @@ TEST_F(HMICommandsNotificationsTest,
const std::string kDeviceId = "";
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAllowSDLFunctionalityNotification>(message);
bool value = false;
@@ -806,7 +776,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
(*message)[am::strings::msg_params]["device"]["id"] = kDeviceId;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnAllowSDLFunctionalityNotification>(message);
bool value;
@@ -823,7 +793,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params]["deviceState"] =
hmi_apis::Common_DeviceState::INVALID_ENUM;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnDeviceStateChangedNotification>(message);
EXPECT_CALL(mock_policy_handler_, RemoveDevice(_)).Times(0);
@@ -839,7 +809,7 @@ TEST_F(HMICommandsNotificationsTest,
hmi_apis::Common_DeviceState::UNPAIRED;
(*message)[am::strings::msg_params]["deviceInternalId"] = device_id;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnDeviceStateChangedNotification>(message);
EXPECT_CALL(mock_policy_handler_, RemoveDevice(_));
@@ -854,7 +824,7 @@ TEST_F(HMICommandsNotificationsTest,
hmi_apis::Common_DeviceState::UNPAIRED;
(*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnDeviceStateChangedNotification>(message);
std::string device_id = "default_id";
@@ -874,7 +844,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
(*message)[am::strings::msg_params]["deviceId"]["id"] = id;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnDeviceStateChangedNotification>(message);
std::string device_id = "default_id";
@@ -891,7 +861,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::hmi_request::reason] =
hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitAllApplicationsNotification>(message);
#if defined(OS_POSIX)
am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason;
@@ -902,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);
@@ -933,7 +903,7 @@ TEST_F(HMICommandsNotificationsTest,
for (; it_reason != reason_list.end(); ++it_reason, ++it_mob_reason) {
(*message)[am::strings::msg_params][am::hmi_request::reason] = *it_reason;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitAllApplicationsNotification>(message);
#if defined(OS_POSIX)
am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
@@ -944,7 +914,7 @@ TEST_F(HMICommandsNotificationsTest,
SubscribeForSignal();
command->Run();
- utils::WaitTerminationSignals(sig_handler);
+ utils::Signals::WaitTerminationSignals(sig_handler);
#endif
}
}
@@ -955,7 +925,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::hmi_request::reason] =
hmi_apis::Common_ApplicationsCloseReason::SUSPEND;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitAllApplicationsNotification>(message);
MessageSharedPtr ethalon_message =
@@ -997,7 +967,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::hmi_request::reason] =
hmi_apis::Common_ApplicationsCloseReason::INVALID_ENUM;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitAllApplicationsNotification>(message);
EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0);
@@ -1012,7 +982,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*notification)[am::strings::params][am::strings::function_id] =
static_cast<int32_t>(
mobile_apis::FunctionID::OnAppInterfaceUnregisteredID);
@@ -1040,7 +1010,7 @@ TEST_F(HMICommandsNotificationsTest,
for (; it_reason != reason_list.end(); ++it_reason, ++it_mobile_reason) {
(*message)[am::strings::msg_params][am::strings::reason] = *it_reason;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
(*notification)[am::strings::msg_params][am::strings::reason] =
@@ -1071,7 +1041,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::strings::reason] =
hmi_apis::Common_ApplicationExitReason::INVALID_ENUM;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
@@ -1091,7 +1061,7 @@ TEST_F(HMICommandsNotificationsTest, OnExitApplicationNotificationInvalidApp) {
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
am::ApplicationSharedPtr invalid_app;
@@ -1109,7 +1079,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
(*message)[am::strings::msg_params][am::strings::reason] =
hmi_apis::Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
@@ -1131,7 +1101,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
(*message)[am::strings::msg_params][am::strings::reason] =
hmi_apis::Common_ApplicationExitReason::USER_EXIT;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_;
EXPECT_CALL(app_mngr_, GetPluginManager())
@@ -1158,7 +1128,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::cmd_id] = cmd_id;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRCommandNotification>(message);
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
@@ -1180,7 +1150,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRCommandNotification>(message);
am::ApplicationSharedPtr invalid_app;
@@ -1199,7 +1169,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRCommandNotification>(message);
EXPECT_CALL(app_mngr_, application(_)).Times(0);
@@ -1216,7 +1186,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRCommandNotification>(message);
am::ApplicationSharedPtr invalid_app;
@@ -1237,7 +1207,7 @@ TEST_F(HMICommandsNotificationsTest,
int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRCommandNotification>(message);
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
@@ -1263,7 +1233,7 @@ TEST_F(HMICommandsNotificationsTest,
(*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
(*message)[am::strings::msg_params][am::strings::function_id] =
mobile_apis::FunctionID::eType::OnCommandID;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRCommandNotification>(message);
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
@@ -1290,7 +1260,7 @@ TEST_F(HMICommandsNotificationsTest, OnVRLanguageChangeNotificationEmptyData) {
const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRLanguageChangeNotification>(message);
EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
@@ -1308,7 +1278,7 @@ TEST_F(HMICommandsNotificationsTest,
const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRLanguageChangeNotification>(message);
application_set_.insert(app_);
@@ -1341,12 +1311,12 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] =
mobile_apis::Language::EN_US;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnVRLanguageChangeNotification>(message);
application_set_.insert(app_);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*notification)[am::strings::params][am::strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
(*notification)[am::strings::params][am::strings::message_type] =
@@ -1394,7 +1364,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest, OnStartDeviceDiscoveryRun) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnStartDeviceDiscovery>(message);
EXPECT_CALL(app_mngr_, StartDevicesDiscovery());
command->Run();
@@ -1405,7 +1375,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::device_info]
[am::strings::id] = "2014";
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnDeviceChosenNotification>(message);
EXPECT_CALL(app_mngr_,
ConnectToDevice(
@@ -1417,7 +1387,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest,
OnDeviceChosenNotificationDeviceInfoNotExists) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnDeviceChosenNotification>(message);
EXPECT_CALL(app_mngr_, ConnectToDevice(_)).Times(0);
command->Run();
@@ -1438,7 +1408,7 @@ TEST_F(HMICommandsNotificationsTest,
for (; it != system_context_list.end(); ++it) {
(*message)[am::strings::msg_params][am::hmi_notification::system_context] =
*it;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemContextNotification>(message);
EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_));
EXPECT_CALL(app_mngr_, state_controller())
@@ -1453,7 +1423,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::system_context] =
am::mobile_api::SystemContext::SYSCTXT_VRSESSION;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemContextNotification>(message);
ApplicationSharedPtr invalid_app;
EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(invalid_app));
@@ -1466,7 +1436,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::system_context] =
am::mobile_api::SystemContext::INVALID_ENUM;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemContextNotification>(message);
EXPECT_CALL(app_mngr_, active_application()).Times(0);
EXPECT_CALL(app_mngr_, application(_)).Times(0);
@@ -1487,7 +1457,7 @@ TEST_F(HMICommandsNotificationsTest,
for (; it != system_context_list.end(); ++it) {
(*message)[am::strings::msg_params][am::hmi_notification::system_context] =
*it;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemContextNotification>(message);
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
EXPECT_CALL(app_mngr_, state_controller())
@@ -1502,7 +1472,7 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::system_context] =
am::mobile_api::SystemContext::SYSCTXT_ALERT;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemContextNotification>(message);
EXPECT_CALL(app_mngr_, application(_)).Times(0);
EXPECT_CALL(app_mngr_, state_controller()).Times(0);
@@ -1513,7 +1483,7 @@ TEST_F(HMICommandsNotificationsTest,
OnSystemRequestNotificationAppIdExistsAndValidApp) {
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemRequestNotification>(message);
EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
@@ -1547,7 +1517,7 @@ TEST_F(HMICommandsNotificationsTest,
OnSystemRequestNotificationAppIdExistsAndInvalidApp) {
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemRequestNotification>(message);
ApplicationSharedPtr invalid_app;
EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
@@ -1562,7 +1532,7 @@ TEST_F(HMICommandsNotificationsTest,
TEST_F(HMICommandsNotificationsTest,
OnSystemRequestNotificationAppIdDoesntExistsAndValidApp) {
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemRequestNotification>(message);
EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
@@ -1598,7 +1568,7 @@ TEST_F(HMICommandsNotificationsTest,
OnSystemRequestNotificationAppIdDoesntExistsAndNullAppId) {
const uint32_t kNullApppId = 0u;
MessageSharedPtr message = CreateMessage();
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnSystemRequestNotification>(message);
EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
@@ -1612,7 +1582,7 @@ TEST_F(HMICommandsNotificationsTest, OnTTSLanguageChangeNotificationEmptyData) {
const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnTTSLanguageChangeNotification>(message);
EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
@@ -1631,7 +1601,7 @@ TEST_F(HMICommandsNotificationsTest,
const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnTTSLanguageChangeNotification>(message);
application_set_.insert(app_);
@@ -1665,12 +1635,12 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] =
mobile_apis::Language::EN_US;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnTTSLanguageChangeNotification>(message);
application_set_.insert(app_);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*notification)[am::strings::params][am::strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
(*notification)[am::strings::params][am::strings::message_type] =
@@ -1717,7 +1687,7 @@ TEST_F(HMICommandsNotificationsTest, OnUILanguageChangeNotificationEmptyData) {
const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnUILanguageChangeNotification>(message);
EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
@@ -1735,7 +1705,7 @@ TEST_F(HMICommandsNotificationsTest,
const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] = kLang;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnUILanguageChangeNotification>(message);
application_set_.insert(app_);
@@ -1768,12 +1738,12 @@ TEST_F(HMICommandsNotificationsTest,
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::strings::language] =
mobile_apis::Language::EN_US;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<OnUILanguageChangeNotification>(message);
application_set_.insert(app_);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*notification)[am::strings::params][am::strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
(*notification)[am::strings::params][am::strings::message_type] =
@@ -1820,7 +1790,7 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::state] = state;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnDriverDistractionNotification>(message);
EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
@@ -1836,7 +1806,7 @@ TEST_F(HMICommandsNotificationsTest,
hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::hmi_notification::state] = state;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnDriverDistractionNotification>(message);
ApplicationSharedPtr invalid_app;
@@ -1852,7 +1822,7 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) {
hmi_apis::Common_DriverDistractionState::DD_ON;
MessageSharedPtr message = CreateMessage();
(*message)[am::strings::msg_params][am::mobile_notification::state] = state;
- utils::SharedPtr<Command> command =
+ std::shared_ptr<Command> command =
CreateCommand<hmi::OnDriverDistractionNotification>(message);
application_set_.insert(app_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
index 7759dace96..8164f957cb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -50,14 +49,13 @@ namespace mixing_audio_supported_request {
using ::testing::_;
using ::testing::Return;
-using ::utils::SharedPtr;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using am::commands::RequestToHMI;
using sdl_rpc_plugin::commands::MixingAudioSupportedRequest;
using am::commands::CommandImpl;
-typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
+typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
index 9c8c30f493..aa651c2dca 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
@@ -56,7 +55,6 @@ namespace mixing_audio_supported_response {
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
-using ::utils::SharedPtr;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using sdl_rpc_plugin::commands::MixingAudioSupportedResponse;
@@ -65,7 +63,7 @@ using am::commands::CommandImpl;
using am::HMICapabilities;
namespace hmi_response = ::application_manager::hmi_response;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
index 69cb04f073..d8454bb98e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -35,7 +35,7 @@
#include "hmi/navi_audio_start_stream_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -76,7 +76,7 @@ class AudioStartStreamRequestTest
std::pair<uint32_t, int32_t> start_stream_retry_amount_;
MessageSharedPtr msg_;
- SharedPtr<AudioStartStreamRequest> command_;
+ std::shared_ptr<AudioStartStreamRequest> command_;
};
TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
index 49145d1644..1a03ecf523 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc
@@ -33,7 +33,7 @@
#include "hmi/navi_is_ready_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -62,7 +62,7 @@ const hmi_apis::FunctionID::eType kEventID =
hmi_apis::FunctionID::Navigation_IsReady;
} // namespace
-typedef SharedPtr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
+typedef std::shared_ptr<NaviIsReadyRequest> NaviIsReadyRequestPtr;
class NaviIsReadyRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
index 3bcea20be7..23f01fac3f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc
@@ -46,16 +46,15 @@ namespace components {
namespace commands_test {
namespace hmi_commands_test {
namespace navi_is_ready_responce {
-
namespace am = ::application_manager;
namespace commands = sdl_rpc_plugin::commands;
using ::testing::ReturnRef;
-using ::utils::SharedPtr;
+
using application_manager::commands::ResponseFromHMI;
using test::components::event_engine_test::MockEventDispatcher;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
class NaviIsReadyResponseTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
index c7287c024a..3110a11fd8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc
@@ -35,7 +35,7 @@
#include "hmi/navi_set_video_config_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -65,7 +65,7 @@ const hmi_apis::FunctionID::eType kEventID =
hmi_apis::FunctionID::Navigation_SetVideoConfig;
} // namespace
-typedef SharedPtr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr;
+typedef std::shared_ptr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr;
class NaviSetVideoConfigRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
index 6469966ca2..06fa61db29 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc
@@ -44,7 +44,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace navi_set_video_config_response {
-using utils::SharedPtr;
using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse;
using test::components::event_engine_test::MockEventDispatcher;
using testing::_;
@@ -61,7 +60,7 @@ class NaviSetVideoConfigResponseTest
TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<NaviSetVideoConfigResponse> command(
+ std::shared_ptr<NaviSetVideoConfigResponse> command(
CreateCommand<NaviSetVideoConfigResponse>(msg));
MockEventDispatcher mock_event_dispatcher;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
index 6700aa68ab..a7f50504fb 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc
@@ -35,7 +35,7 @@
#include "hmi/navi_start_stream_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -75,7 +75,7 @@ class NaviStartStreamRequestTest
std::pair<uint32_t, int32_t> start_stream_retry_amount_;
MessageSharedPtr msg_;
- SharedPtr<NaviStartStreamRequest> command_;
+ std::shared_ptr<NaviStartStreamRequest> command_;
};
TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
index 0ef903224b..e4a79997fd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc
@@ -34,7 +34,7 @@
#include "hmi/navi_audio_stop_stream_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -72,7 +72,7 @@ class NaviStopStreamRequestsTest
}
MessageSharedPtr msg_;
- SharedPtr<Command> command_;
+ std::shared_ptr<Command> command_;
};
typedef testing::Types<commands::AudioStopStreamRequest,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
index 60a7b01612..fc3899e861 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -36,9 +36,7 @@
#include "gtest/gtest.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
-#include "utils/shared_ptr.h"
#include "utils/lock.h"
-#include "utils/make_shared.h"
#include "utils/data_accessor.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application.h"
@@ -56,14 +54,12 @@ namespace on_driver_distraction_notification {
using ::testing::_;
using ::testing::Return;
using ::testing::Eq;
-using ::utils::SharedPtr;
-
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification;
using namespace am::commands;
-typedef ::utils::SharedPtr<OnDriverDistractionNotification> NotificationPtr;
+typedef std::shared_ptr<OnDriverDistractionNotification> NotificationPtr;
class HMIOnDriverDistractionNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
index bbd5920f9f..8e62c1a409 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -33,7 +33,7 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/mock_hmi_capabilities.h"
@@ -48,7 +48,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace rc_get_capabilities_response {
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = am::strings;
@@ -56,7 +55,7 @@ namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
+typedef std::shared_ptr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
index 41acf67116..030db2f424 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc
@@ -33,7 +33,7 @@
#include "hmi/rc_is_ready_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -57,7 +57,7 @@ using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::RCIsReadyRequest;
using am::event_engine::Event;
-typedef SharedPtr<RCIsReadyRequest> RCIsReadyRequestPtr;
+typedef std::shared_ptr<RCIsReadyRequest> RCIsReadyRequestPtr;
class RCIsReadyRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
index e07a0c1538..a1a8c1c87e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_hmi_capabilities.h"
@@ -48,7 +48,7 @@ namespace hmi_commands_test {
namespace rc_is_ready_response {
using ::testing::Return;
-using ::utils::SharedPtr;
+
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
@@ -56,7 +56,7 @@ namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::RCIsReadyResponse;
using test::components::event_engine_test::MockEventDispatcher;
-typedef SharedPtr<RCIsReadyResponse> RCIsReadyResponsePtr;
+typedef std::shared_ptr<RCIsReadyResponse> RCIsReadyResponsePtr;
class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
index c5b0c2ba24..0b1f2df491 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc
@@ -33,7 +33,6 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/test/include/application_manager/commands/commands_test.h"
@@ -50,14 +49,12 @@ using ::testing::_;
using ::testing::Return;
using ::testing::SaveArg;
using ::testing::DoAll;
-
-using ::utils::SharedPtr;
using ::test::components::event_engine_test::MockEventDispatcher;
namespace am = ::application_manager;
using application_manager::commands::ResponseFromHMI;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
@@ -97,7 +94,7 @@ TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
MessageSharedPtr dummy_msg_params = CreateMessage();
command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
- ASSERT_TRUE(result_msg);
+ ASSERT_TRUE((bool)result_msg);
const application_manager::MessageType received_message_tipe =
static_cast<application_manager::MessageType>(
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
index c21791e913..38cbc7b069 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -134,7 +134,7 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
EXPECT_CALL(app_mngr_, state_controller())
@@ -154,7 +154,7 @@ TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
(*msg)[strings::msg_params][strings::function_id] =
hmi_apis::FunctionID::SDL_ActivateApp;
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
EXPECT_CALL(app_mngr_, state_controller())
@@ -176,7 +176,7 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -222,7 +222,7 @@ TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
EXPECT_CALL(app_mngr_, application(kAppID))
@@ -237,7 +237,7 @@ TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -263,7 +263,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -301,7 +301,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -322,7 +322,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -362,7 +362,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -395,7 +395,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MockAppPtr mock_app(CreateMockApp());
@@ -431,7 +431,7 @@ TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
SetCorrelationAndAppID(msg);
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true));
@@ -443,7 +443,7 @@ TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
MessageSharedPtr event_msg = CreateMessage();
(*event_msg)[strings::params][strings::correlation_id] = kCorrelationID;
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>());
Event event(hmi_apis::FunctionID::INVALID_ENUM);
@@ -458,7 +458,7 @@ TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) {
(*event_msg)[strings::msg_params][strings::application][strings::app_id] =
kAppID;
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>());
Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
@@ -474,7 +474,7 @@ TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) {
TEST_F(SDLActivateAppRequestTest, OnEvent_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- SharedPtr<SDLActivateAppRequest> command(
+ std::shared_ptr<SDLActivateAppRequest> command(
CreateCommand<SDLActivateAppRequest>(msg));
MessageSharedPtr event_msg = CreateMessage();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
index 716c818269..bca316bcfa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -47,13 +46,12 @@ namespace commands_test {
namespace hmi_commands_test {
namespace sdl_activate_app_response {
-using ::utils::SharedPtr;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using sdl_rpc_plugin::commands::SDLActivateAppResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
+typedef std::shared_ptr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
index e5f9845b74..262ac5fc7d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
@@ -82,7 +82,7 @@ TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) {
EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
.WillOnce(Return(mock_app_));
- SharedPtr<SDLGetListOfPermissionsRequest> command(
+ std::shared_ptr<SDLGetListOfPermissionsRequest> command(
CreateCommand<SDLGetListOfPermissionsRequest>(msg));
EXPECT_CALL(mock_policy_handler_,
@@ -95,7 +95,7 @@ TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary);
(*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- SharedPtr<SDLGetListOfPermissionsRequest> command(
+ std::shared_ptr<SDLGetListOfPermissionsRequest> command(
CreateCommand<SDLGetListOfPermissionsRequest>(msg));
EXPECT_CALL(mock_policy_handler_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
index 7cfd7e49e2..fca8ed840f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc
@@ -64,7 +64,7 @@ TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::correlation_id] = kCorrelationID;
- SharedPtr<SDLGetStatusUpdateRequest> command(
+ std::shared_ptr<SDLGetStatusUpdateRequest> command(
CreateCommand<SDLGetStatusUpdateRequest>(msg));
EXPECT_CALL(mock_policy_handler_, OnGetStatusUpdate(kCorrelationID));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
index 0ec40f896a..b040f8ea40 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
@@ -99,7 +99,7 @@ TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) {
(*msg)[strings::msg_params][strings::language] = kLanguage;
- SharedPtr<SDLGetUserFriendlyMessageRequest> command(
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
@@ -123,7 +123,7 @@ TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageNotSet_SUCCESS) {
(*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
(*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
- SharedPtr<SDLGetUserFriendlyMessageRequest> command(
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
@@ -144,7 +144,7 @@ TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_NoMsgCodes_Canceled) {
(*msg)[strings::params][strings::correlation_id] = kCorrelationID;
(*msg)[strings::msg_params][strings::app_id] = kAppID;
- SharedPtr<SDLGetUserFriendlyMessageRequest> command(
+ std::shared_ptr<SDLGetUserFriendlyMessageRequest> command(
CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
index d25c9b41e8..581913d3a5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc
@@ -62,7 +62,8 @@ TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList);
TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
// Current implementation always return `true`
EXPECT_TRUE(command->Init());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
index e47009583f..5c42d265c7 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc
@@ -31,7 +31,6 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -50,8 +49,6 @@ using ::testing::_;
using ::testing::Types;
using ::testing::NotNull;
using ::testing::NiceMock;
-
-using ::utils::SharedPtr;
namespace commands = ::application_manager::commands;
using commands::MessageSharedPtr;
using ::application_manager::event_engine::EventObserver;
@@ -67,7 +64,7 @@ class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<commands::RequestFromHMI> command(
+ std::shared_ptr<commands::RequestFromHMI> command(
CreateCommand<commands::RequestFromHMI>());
application_manager::event_engine::Event event(
hmi_apis::FunctionID::BasicCommunication_ActivateApp);
@@ -79,7 +76,7 @@ TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
}
TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
- SharedPtr<commands::RequestFromHMI> command(
+ std::shared_ptr<commands::RequestFromHMI> command(
CreateCommand<commands::RequestFromHMI>());
const bool success = false;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
index c24cfc48db..599c7e50f2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -31,7 +31,6 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -104,7 +103,6 @@
#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h"
#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h"
#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h"
-#include "sdl_rpc_plugin/commands/hmi/ui_set_icon_request.h"
#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h"
#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h"
@@ -119,9 +117,6 @@ namespace simple_requests_to_hmi_test {
using ::testing::_;
using ::testing::Types;
using ::testing::NotNull;
-
-using ::utils::SharedPtr;
-
namespace am_commands = application_manager::commands;
using am_commands::MessageSharedPtr;
using event_engine_test::MockEventDispatcher;
@@ -129,7 +124,7 @@ using event_engine_test::MockEventDispatcher;
class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<am_commands::RequestToHMI> command(
+ std::shared_ptr<am_commands::RequestToHMI> command(
CreateCommand<am_commands::RequestToHMI>());
// Current implementation always return `true`
@@ -139,7 +134,7 @@ TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
}
TEST_F(RequestToHMITest, SendRequest_SUCCESS) {
- SharedPtr<am_commands::RequestToHMI> command(
+ std::shared_ptr<am_commands::RequestToHMI> command(
CreateCommand<am_commands::RequestToHMI>());
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
@@ -194,7 +189,7 @@ typedef Types<sdl_rpc_plugin::commands::hmi::DialNumberRequest,
sdl_rpc_plugin::commands::BasicCommunicationSystemRequest,
sdl_rpc_plugin::commands::ButtonGetCapabilitiesRequest,
sdl_rpc_plugin::commands::NaviSendLocationRequest,
- sdl_rpc_plugin::commands::NaviUnSubscribeWayPointsRequest,
+ sdl_rpc_plugin::commands::NaviUnsubscribeWayPointsRequest,
sdl_rpc_plugin::commands::NaviUpdateTurnListRequest,
sdl_rpc_plugin::commands::NaviShowConstantTBTRequest,
sdl_rpc_plugin::commands::NaviStopStreamRequest,
@@ -235,7 +230,8 @@ TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3);
TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
@@ -245,7 +241,8 @@ TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
command->Run();
@@ -254,7 +251,8 @@ TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
command->Run();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
index 229f48b5e1..4a86fa9458 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -33,7 +33,6 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -108,8 +107,6 @@ using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::Types;
using ::testing::Eq;
-
-using ::utils::SharedPtr;
using ::test::components::event_engine_test::MockEventDispatcher;
namespace am = ::application_manager;
@@ -244,7 +241,8 @@ TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandData CommandData;
typedef typename CommandData::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
EXPECT_CALL(this->event_dispatcher_,
raise_event(EventIdIsEqualTo(CommandData::kEventId)));
@@ -255,7 +253,8 @@ TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
command->Run();
}
@@ -277,7 +276,7 @@ class NotificationFromHMITest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<application_manager::commands::NotificationFromHMI> command(
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
CreateCommand<application_manager::commands::NotificationFromHMI>());
// Current implementation always return `true`
EXPECT_TRUE(command->Init());
@@ -290,7 +289,7 @@ TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) {
(*command_msg)[am::strings::params][am::strings::message_type] =
static_cast<int32_t>(am::MessageType::kNotification);
- SharedPtr<application_manager::commands::NotificationFromHMI> command(
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
CreateCommand<application_manager::commands::NotificationFromHMI>());
EXPECT_CALL(
mock_rpc_service_,
@@ -303,7 +302,7 @@ TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) {
TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) {
MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
(*command_msg)[am::strings::msg_params] = 0;
- SharedPtr<application_manager::commands::NotificationFromHMI> command(
+ std::shared_ptr<application_manager::commands::NotificationFromHMI> command(
CreateCommand<application_manager::commands::NotificationFromHMI>(
command_msg));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
index ef8978c34c..643e21d818 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc
@@ -31,7 +31,6 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command.h"
@@ -51,8 +50,6 @@ namespace simple_response_to_hmi_test {
using ::testing::_;
using ::testing::Types;
using ::testing::NotNull;
-using ::utils::SharedPtr;
-
namespace commands = sdl_rpc_plugin::commands;
using application_manager::commands::MessageSharedPtr;
@@ -73,7 +70,8 @@ TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
typedef typename TestFixture::CommandType CommandType;
- SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ std::shared_ptr<CommandType> command =
+ this->template CreateCommand<CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull()));
command->Run();
@@ -82,7 +80,7 @@ TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<application_manager::commands::ResponseToHMI> command(
+ std::shared_ptr<application_manager::commands::ResponseToHMI> command(
CreateCommand<application_manager::commands::ResponseToHMI>());
// Current implementation always return `true`
@@ -91,7 +89,7 @@ TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
}
TEST_F(ResponseToHMITest, Run_SUCCESS) {
- SharedPtr<application_manager::commands::ResponseToHMI> command(
+ std::shared_ptr<application_manager::commands::ResponseToHMI> command(
CreateCommand<application_manager::commands::ResponseToHMI>());
EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull()));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
index afc18114de..bc9d262e6d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc
@@ -47,7 +47,7 @@ namespace tts_get_capabilities_response {
using application_manager::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::TTSGetCapabilitiesResponse;
using test::components::application_manager_test::MockHMICapabilities;
-using utils::SharedPtr;
+
using testing::_;
namespace strings = ::application_manager::strings;
@@ -71,7 +71,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) {
EXPECT_CALL(mock_hmi_capabilities_,
set_prerecorded_speech(SmartObject(kText)));
- SharedPtr<TTSGetCapabilitiesResponse> command(
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
CreateCommand<TTSGetCapabilitiesResponse>(msg));
command->Run();
@@ -85,7 +85,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) {
set_speech_capabilities(SmartObject(kText)));
EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
- SharedPtr<TTSGetCapabilitiesResponse> command(
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
CreateCommand<TTSGetCapabilitiesResponse>(msg));
command->Run();
@@ -100,7 +100,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) {
EXPECT_CALL(mock_hmi_capabilities_,
set_prerecorded_speech(SmartObject(kText)));
- SharedPtr<TTSGetCapabilitiesResponse> command(
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
CreateCommand<TTSGetCapabilitiesResponse>(msg));
command->Run();
@@ -112,7 +112,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) {
EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
- SharedPtr<TTSGetCapabilitiesResponse> command(
+ std::shared_ptr<TTSGetCapabilitiesResponse> command(
CreateCommand<TTSGetCapabilitiesResponse>(msg));
command->Run();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
index 5f2fe1beda..0d22500f48 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc
@@ -44,7 +44,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace tts_get_language_response {
-using utils::SharedPtr;
using sdl_rpc_plugin::commands::TTSGetLanguageResponse;
using test::components::application_manager_test::MockHMICapabilities;
using test::components::event_engine_test::MockEventDispatcher;
@@ -66,7 +65,7 @@ TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::msg_params][hmi_response::language] = kLanguage;
- SharedPtr<TTSGetLanguageResponse> command(
+ std::shared_ptr<TTSGetLanguageResponse> command(
CreateCommand<TTSGetLanguageResponse>(msg));
EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(kLanguage));
@@ -82,7 +81,7 @@ TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<TTSGetLanguageResponse> command(
+ std::shared_ptr<TTSGetLanguageResponse> command(
CreateCommand<TTSGetLanguageResponse>(msg));
EXPECT_CALL(mock_hmi_capabilities_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
index 2672062aab..417b8e1898 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -54,7 +53,6 @@ namespace tts_get_supported_languages_response {
using ::testing::_;
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
@@ -63,7 +61,7 @@ using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::TTSGetSupportedLanguagesResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
index d6d74d18bd..2fae8a6819 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -55,7 +54,6 @@ namespace tts_is_ready_response {
using ::testing::_;
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
@@ -65,7 +63,7 @@ using sdl_rpc_plugin::commands::TTSIsReadyResponse;
using am::commands::CommandImpl;
using test::components::event_engine_test::MockEventDispatcher;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
index 8dbc09fc4f..31e4860d4a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc
@@ -33,8 +33,6 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "smart_objects/smart_object.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/mock_hmi_capabilities.h"
@@ -49,7 +47,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace ui_get_capabilities_response {
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = am::strings;
@@ -58,7 +55,7 @@ using application_manager::commands::ResponseFromHMI;
using sdl_rpc_plugin::commands::UIGetCapabilitiesResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
index 285024ed40..de69c5de5c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc
@@ -44,7 +44,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace ui_get_language_response {
-using utils::SharedPtr;
using sdl_rpc_plugin::commands::UIGetLanguageResponse;
using test::components::event_engine_test::MockEventDispatcher;
using testing::_;
@@ -70,7 +69,7 @@ TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::msg_params][hmi_response::language] = kLanguage;
- SharedPtr<UIGetLanguageResponse> command(
+ std::shared_ptr<UIGetLanguageResponse> command(
CreateCommand<UIGetLanguageResponse>(msg));
EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(kLanguage));
@@ -86,7 +85,7 @@ TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<UIGetLanguageResponse> command(
+ std::shared_ptr<UIGetLanguageResponse> command(
CreateCommand<UIGetLanguageResponse>(msg));
EXPECT_CALL(mock_hmi_capabilities_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
index 021ef4fdb6..5626e2b0ee 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/application.h"
@@ -51,14 +50,13 @@ namespace hmi_commands_test {
namespace ui_get_supported_languages_response {
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::UIGetSupportedLanguagesResponse;
-typedef SharedPtr<UIGetSupportedLanguagesResponse>
+typedef std::shared_ptr<UIGetSupportedLanguagesResponse>
UIGetSupportedLanguagesResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
index b8fc839f12..fe0d8a8470 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc
@@ -33,7 +33,7 @@
#include "hmi/ui_is_ready_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -60,7 +60,7 @@ using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::UIIsReadyRequest;
using am::event_engine::Event;
-typedef SharedPtr<UIIsReadyRequest> UIIsReadyRequestPtr;
+typedef std::shared_ptr<UIIsReadyRequest> UIIsReadyRequestPtr;
class UIIsReadyRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
index 6817c5ef0e..cccdbdc44d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_hmi_capabilities.h"
@@ -48,7 +47,6 @@ namespace hmi_commands_test {
namespace ui_is_ready_response {
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
@@ -56,7 +54,7 @@ namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::UIIsReadyResponse;
using test::components::event_engine_test::MockEventDispatcher;
-typedef SharedPtr<UIIsReadyResponse> UIIsReadyResponsePtr;
+typedef std::shared_ptr<UIIsReadyResponse> UIIsReadyResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
index 2ce7d9e8f0..c566702998 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc
@@ -33,7 +33,6 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "interfaces/HMI_API.h"
#include "application_manager/smart_object_keys.h"
@@ -54,7 +53,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace update_device_list_request {
-using ::utils::SharedPtr;
using testing::_;
using testing::ReturnRef;
using testing::Return;
@@ -68,7 +66,7 @@ using am::event_engine::Event;
using sdl_rpc_plugin::commands::UpdateDeviceListRequest;
using am::commands::CommandImpl;
-typedef SharedPtr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
+typedef std::shared_ptr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
index 2b079a21e0..af3b9bebf6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -48,14 +47,13 @@ namespace commands_test {
namespace hmi_commands_test {
namespace update_sdl_request {
-using ::utils::SharedPtr;
using ::testing::ReturnRef;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using sdl_rpc_plugin::commands::UpdateSDLRequest;
-typedef SharedPtr<UpdateSDLRequest> UpdateSDLRequestPtr;
+typedef std::shared_ptr<UpdateSDLRequest> UpdateSDLRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
index 0035637605..93c49724ce 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -47,13 +46,12 @@ namespace commands_test {
namespace hmi_commands_test {
namespace update_sdl_response {
-using ::utils::SharedPtr;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
using sdl_rpc_plugin::commands::UpdateSDLResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<UpdateSDLResponse> UpdateSDLResponsePtr;
+typedef std::shared_ptr<UpdateSDLResponse> UpdateSDLResponsePtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
index 0163fdd1d1..15d38d4ef3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc
@@ -33,7 +33,6 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/mock_hmi_capabilities.h"
@@ -48,7 +47,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace vr_get_capabilities_response {
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = am::strings;
@@ -56,7 +54,7 @@ namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse;
using am::commands::CommandImpl;
-typedef SharedPtr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
+typedef std::shared_ptr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
index 845324925f..05ed186963 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc
@@ -44,7 +44,6 @@ namespace commands_test {
namespace hmi_commands_test {
namespace vr_get_language_response {
-using utils::SharedPtr;
using sdl_rpc_plugin::commands::VRGetLanguageResponse;
using test::components::event_engine_test::MockEventDispatcher;
using testing::_;
@@ -70,7 +69,7 @@ TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::msg_params][hmi_response::language] = kLanguage;
- SharedPtr<VRGetLanguageResponse> command(
+ std::shared_ptr<VRGetLanguageResponse> command(
CreateCommand<VRGetLanguageResponse>(msg));
EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(kLanguage));
@@ -86,7 +85,7 @@ TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<VRGetLanguageResponse> command(
+ std::shared_ptr<VRGetLanguageResponse> command(
CreateCommand<VRGetLanguageResponse>(msg));
EXPECT_CALL(mock_hmi_capabilities_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
index 0ac0d8e118..56b11ad440 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/application.h"
@@ -51,14 +50,13 @@ namespace hmi_commands_test {
namespace vr_get_supported_languages_response {
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::VRGetSupportedLanguagesResponse;
-typedef SharedPtr<VRGetSupportedLanguagesResponse>
+typedef std::shared_ptr<VRGetSupportedLanguagesResponse>
VRGetSupportedLanguagesResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
index 1ec0adb5e0..5aa00e0264 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc
@@ -33,7 +33,7 @@
#include "hmi/vr_is_ready_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -57,7 +57,7 @@ using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::VRIsReadyRequest;
using am::event_engine::Event;
-typedef SharedPtr<VRIsReadyRequest> VRIsReadyRequestPtr;
+typedef std::shared_ptr<VRIsReadyRequest> VRIsReadyRequestPtr;
class VRIsReadyRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
index 452679e189..0e56f5b483 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_hmi_capabilities.h"
@@ -48,7 +47,6 @@ namespace hmi_commands_test {
namespace vr_is_ready_response {
using ::testing::Return;
-using ::utils::SharedPtr;
using ::testing::NiceMock;
namespace am = ::application_manager;
namespace strings = ::application_manager::strings;
@@ -56,7 +54,7 @@ namespace hmi_response = am::hmi_response;
using sdl_rpc_plugin::commands::VRIsReadyResponse;
using test::components::event_engine_test::MockEventDispatcher;
-typedef SharedPtr<VRIsReadyResponse> VRIsReadyResponsePtr;
+typedef std::shared_ptr<VRIsReadyResponse> VRIsReadyResponsePtr;
class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
index 0067be3f1b..7c99b5f2b8 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc
@@ -31,15 +31,16 @@
*/
#include <stdint.h>
+#include <memory>
#include <string>
#include <set>
#include "mobile/add_command_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "utils/helpers.h"
-#include "utils/make_shared.h"
+
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/commands/command_request_test.h"
@@ -49,6 +50,7 @@
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
namespace test {
namespace components {
@@ -57,16 +59,16 @@ namespace mobile_commands_test {
namespace add_command_request {
namespace am = application_manager;
+namespace am_test = application_manager_test;
using am::commands::CommandImpl;
using am::ApplicationManager;
using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using ::testing::_;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::InSequence;
using sdl_rpc_plugin::commands::AddCommandRequest;
-using NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr;
+using ns_smart_device_link::ns_smart_objects::SmartObjectSPtr;
using ::test::components::application_manager_test::MockApplication;
using am::event_engine::EventObserver;
using namespace smart_objects;
@@ -104,6 +106,8 @@ class AddCommandRequestTest
: msg_(CreateMessage())
, default_app_name_("test_default_app_name_")
, lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
, mock_app_(CreateMockApp()) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(mock_app_));
@@ -178,7 +182,7 @@ class AddCommandRequestTest
EXPECT_CALL(*mock_app_, commands_map())
.WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
commands_map, lock_ptr_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
.WillOnce(Return(so_ptr_.get()));
{
@@ -194,7 +198,7 @@ class AddCommandRequestTest
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
Event event(incoming_cmd);
@@ -206,7 +210,7 @@ class AddCommandRequestTest
ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
.WillOnce(Return(true));
- SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
(*response)[strings::msg_params][strings::info] = "info";
EXPECT_CALL(
mock_message_helper_,
@@ -217,8 +221,8 @@ class AddCommandRequestTest
mock_rpc_service_,
ManageMobileCommand(response,
am::commands::Command::CommandSource::SOURCE_SDL));
- utils::SharedPtr<CommandRequestImpl> base_class_request =
- static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr);
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
base_class_request->onTimeOut();
}
@@ -226,6 +230,7 @@ class AddCommandRequestTest
SmartObjectSPtr so_ptr_;
const utils::custom_string::CustomString default_app_name_;
std::shared_ptr<sync_primitives::Lock> lock_ptr_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
MockAppPtr mock_app_;
};
@@ -238,7 +243,7 @@ TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) {
mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -253,7 +258,27 @@ TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_WARNINGS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_ptr_)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -279,7 +304,7 @@ TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -298,7 +323,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -324,7 +349,7 @@ TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg);
request_ptr->Run();
}
@@ -335,13 +360,13 @@ TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) {
SmartObject& image = msg_params[cmd_icon];
EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -366,7 +391,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -393,7 +418,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -416,14 +441,14 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(*mock_app_, commands_map())
.WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
commands_map, lock_ptr_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
.WillOnce(Return(so_ptr_.get()));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -439,7 +464,7 @@ TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg);
request_ptr->Run();
}
@@ -461,7 +486,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(*mock_app_, commands_map())
.WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
commands_map, lock_ptr_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
.WillOnce(Return(so_ptr_.get()));
{
@@ -477,7 +502,7 @@ TEST_F(AddCommandRequestTest,
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -499,7 +524,7 @@ TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
.WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
}
@@ -524,7 +549,13 @@ TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
.WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
request_ptr->on_event(event);
@@ -549,7 +580,13 @@ TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
.WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
request_ptr->on_event(event);
@@ -580,7 +617,7 @@ TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(command_msg);
request_ptr->Run();
request_ptr->on_event(event_ui);
@@ -589,7 +626,7 @@ TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
Event event(hmi_apis::FunctionID::INVALID_ENUM);
request_ptr->on_event(event);
@@ -602,7 +639,7 @@ TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) {
Event event(hmi_apis::FunctionID::UI_AddCommand);
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->on_event(event);
}
@@ -624,7 +661,7 @@ TEST_F(AddCommandRequestTest,
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
.WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
@@ -665,7 +702,12 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::WARNINGS), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, _, false));
+
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
@@ -703,7 +745,7 @@ TEST_F(
}
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
@@ -748,7 +790,7 @@ TEST_F(
}
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
@@ -791,7 +833,7 @@ TEST_F(
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
.WillOnce(Return(true));
}
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
@@ -840,7 +882,7 @@ TEST_F(
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
.WillOnce(Return(true));
}
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
@@ -881,7 +923,7 @@ TEST_F(
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
.WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
EXPECT_CALL(mock_hmi_interfaces_,
@@ -918,7 +960,7 @@ TEST_F(
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
.WillOnce(Return(true));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
EXPECT_CALL(mock_hmi_interfaces_,
@@ -966,7 +1008,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
@@ -1014,7 +1056,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
@@ -1041,7 +1083,7 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(ApplicationSharedPtr()));
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
- SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
(*response)[strings::msg_params][strings::info] = "info";
EXPECT_CALL(
mock_message_helper_,
@@ -1050,8 +1092,8 @@ TEST_F(AddCommandRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
response, am::commands::Command::CommandSource::SOURCE_SDL));
- utils::SharedPtr<CommandRequestImpl> base_class_request =
- static_cast<utils::SharedPtr<CommandRequestImpl> >(
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(
CreateCommand<AddCommandRequest>(msg_));
base_class_request->onTimeOut();
}
@@ -1072,7 +1114,7 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
EXPECT_CALL(*mock_app_, commands_map())
.WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
commands_map, lock_ptr_)));
- so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ so_ptr_ = std::make_shared<SmartObject>(SmartType_Map);
EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
.WillOnce(Return(so_ptr_.get()));
{
@@ -1087,11 +1129,11 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
.WillOnce(Return(true));
}
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
- utils::SharedPtr<AddCommandRequest> request_ptr =
+ std::shared_ptr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg_);
request_ptr->Run();
EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
- SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map);
(*response)[strings::msg_params][strings::info] = "info";
EXPECT_CALL(
mock_message_helper_,
@@ -1100,8 +1142,8 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
response, am::commands::Command::CommandSource::SOURCE_SDL));
- utils::SharedPtr<CommandRequestImpl> base_class_request =
- static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr);
+ std::shared_ptr<CommandRequestImpl> base_class_request =
+ static_cast<std::shared_ptr<CommandRequestImpl> >(request_ptr);
base_class_request->onTimeOut();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
index 9fad021c3e..ecaa436529 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc
@@ -57,7 +57,7 @@ using am::event_engine::Event;
using ::testing::_;
using ::testing::Return;
-typedef SharedPtr<AddSubMenuRequest> AddSubMenuPtr;
+typedef std::shared_ptr<AddSubMenuRequest> AddSubMenuPtr;
namespace {
const uint32_t kConnectionKey = 2u;
@@ -98,7 +98,7 @@ TEST_F(AddSubMenuRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
- utils::SharedPtr<AddSubMenuRequest> request_ptr =
+ std::shared_ptr<AddSubMenuRequest> request_ptr =
CreateCommand<AddSubMenuRequest>(msg);
request_ptr->Run();
@@ -110,7 +110,7 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
(*msg)[am::strings::msg_params][am::strings::menu_id] = menu_id;
- utils::SharedPtr<AddSubMenuRequest> command =
+ std::shared_ptr<AddSubMenuRequest> command =
CreateCommand<AddSubMenuRequest>(msg);
ON_CALL(app_mngr_, application(kConnectionKey))
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
index ac870e7001..7d2dd0b2c2 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -64,7 +64,7 @@ using sdl_rpc_plugin::commands::AlertManeuverRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-typedef SharedPtr<AlertManeuverRequest> CommandPtr;
+typedef std::shared_ptr<AlertManeuverRequest> CommandPtr;
class AlertManeuverRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
@@ -80,7 +80,7 @@ class AlertManeuverRequestTest
am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
event.set_smart_object(*response);
- utils::SharedPtr<AlertManeuverRequest> command =
+ std::shared_ptr<AlertManeuverRequest> command =
CreateCommand<AlertManeuverRequest>(response);
MockAppPtr mock_app(CreateMockApp());
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
index 5835cbff81..e32cc2b335 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc
@@ -56,14 +56,13 @@ using sdl_rpc_plugin::commands::AlertRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using ::utils::SharedPtr;
using am::event_engine::Event;
using policy_test::MockPolicyHandlerInterface;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-typedef SharedPtr<AlertRequest> CommandPtr;
+typedef std::shared_ptr<AlertRequest> CommandPtr;
namespace {
const int32_t kCommandId = 1;
@@ -192,7 +191,7 @@ TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
- utils::SharedPtr<AlertRequest> command = CreateCommand<AlertRequest>();
+ std::shared_ptr<AlertRequest> command = CreateCommand<AlertRequest>();
EXPECT_CALL(
mock_message_helper_,
@@ -223,7 +222,7 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
(*command_msg)[am::strings::msg_params][am::strings::menu_params]
[am::strings::menu_name] = "menu_name";
- utils::SharedPtr<AlertRequest> command =
+ std::shared_ptr<AlertRequest> command =
CreateCommand<AlertRequest>(command_msg);
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
index 3d6a345ced..58755c8b36 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc
@@ -37,9 +37,7 @@
#include "mobile/change_registration_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
#include "utils/custom_string.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_request_test.h"
@@ -66,7 +64,6 @@ using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
using ::testing::_;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SetArgPointee;
@@ -149,7 +146,7 @@ class ChangeRegistrationRequestTest
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- utils::SharedPtr<ChangeRegistrationRequest> command =
+ std::shared_ptr<ChangeRegistrationRequest> command =
CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
@@ -279,7 +276,7 @@ typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
TEST_F(ChangeRegistrationRequestTest,
OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- utils::SharedPtr<ChangeRegistrationRequest> command =
+ std::shared_ptr<ChangeRegistrationRequest> command =
CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
am::ApplicationSet application_set;
@@ -367,7 +364,7 @@ TEST_F(ChangeRegistrationRequestTest,
TEST_F(ChangeRegistrationRequestTest,
OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- utils::SharedPtr<ChangeRegistrationRequest> command =
+ std::shared_ptr<ChangeRegistrationRequest> command =
CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
@@ -472,7 +469,7 @@ TEST_F(ChangeRegistrationRequestTest,
OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- utils::SharedPtr<ChangeRegistrationRequest> command =
+ std::shared_ptr<ChangeRegistrationRequest> command =
CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
am::ApplicationSet application_set;
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 10ffbded09..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
@@ -38,9 +38,7 @@
#include "mobile/create_interaction_choice_set_response.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/commands/command_request_test.h"
@@ -65,7 +63,6 @@ using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
using ::testing::_;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::AtLeast;
@@ -77,9 +74,9 @@ namespace custom_str = utils::custom_string;
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-typedef SharedPtr<CreateInteractionChoiceSetRequest>
+typedef std::shared_ptr<CreateInteractionChoiceSetRequest>
CreateInteractionChoiceSetRequestPtr;
-typedef SharedPtr<CreateInteractionChoiceSetResponse>
+typedef std::shared_ptr<CreateInteractionChoiceSetResponse>
CreateInteractionChoiceSetResponsePtr;
typedef NiceMock<
@@ -171,7 +168,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
am::mobile_api::Result::GENERIC_ERROR;
(*msg_vr)[strings::msg_params][strings::success] = false;
- utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
+ std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
CreateCommand<CreateInteractionChoiceSetRequest>();
MockAppPtr mock_app = CreateMockApp();
@@ -202,8 +199,10 @@ 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;
- utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
+ std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr =
CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
@@ -234,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;
@@ -439,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())
@@ -484,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);
@@ -526,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())
@@ -560,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())
@@ -595,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())
@@ -643,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())
@@ -685,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())
@@ -726,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));
@@ -799,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/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
index ac8803c2ca..a87d172923 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc
@@ -36,7 +36,7 @@
#include "mobile/delete_command_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -44,6 +44,7 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/event_engine/event.h"
namespace test {
@@ -56,13 +57,14 @@ using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
namespace am = ::application_manager;
+namespace am_test = application_manager_test;
using sdl_rpc_plugin::commands::DeleteCommandRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
using am::MockMessageHelper;
using am::MockHmiInterfaces;
-typedef SharedPtr<DeleteCommandRequest> DeleteCommandPtr;
+typedef std::shared_ptr<DeleteCommandRequest> DeleteCommandPtr;
namespace {
const int32_t kCommandId = 1;
@@ -74,7 +76,10 @@ const uint32_t kConnectionKey = 2u;
class DeleteCommandRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- DeleteCommandRequestTest() : mock_app_(CreateMockApp()) {}
+ DeleteCommandRequestTest()
+ : mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
+ , mock_app_(CreateMockApp()) {}
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
@@ -132,6 +137,7 @@ class DeleteCommandRequestTest
}
NiceMock<MockHmiInterfaces> hmi_interfaces_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
MockAppPtr mock_app_;
};
@@ -188,6 +194,11 @@ TEST_F(DeleteCommandRequestTest,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandDeleted(kCommandId, false));
+
command->on_event(event_vr);
ResultCommandExpectations(vr_command_result, "VR is not supported by system");
@@ -241,10 +252,15 @@ TEST_F(DeleteCommandRequestTest,
EXPECT_CALL(*app, UpdateHash());
+ EXPECT_CALL(*app, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandDeleted(kCommandId, false));
+
MessageSharedPtr result_msg(
CatchMobileCommandResult(CallOnEvent(*command, event_ui)));
- ASSERT_TRUE(result_msg);
+ ASSERT_TRUE((bool)result_msg);
ResultCommandExpectations(result_msg, "UI is not supported by system");
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
index 5cc9dcf543..0ed7a92fa4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc
@@ -39,7 +39,7 @@
#include "mobile/delete_file_response.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "utils/file_system.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -77,8 +77,8 @@ using am::commands::MessageSharedPtr;
using am::event_engine::Event;
using am::MockMessageHelper;
-typedef SharedPtr<DeleteFileRequest> DeleteFileRequestPtr;
-typedef SharedPtr<DeleteFileResponse> DeleteFileResponsePtr;
+typedef std::shared_ptr<DeleteFileRequest> DeleteFileRequestPtr;
+typedef std::shared_ptr<DeleteFileResponse> DeleteFileResponsePtr;
typedef NiceMock<
::test::components::application_manager_test::MockHMICapabilities>
MockHMICapabilities;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
index b2daef9cd2..43c30809e5 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -37,7 +37,7 @@
#include "mobile/delete_interaction_choice_set_response.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -63,9 +63,9 @@ using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-typedef SharedPtr<DeleteInteractionChoiceSetRequest>
+typedef std::shared_ptr<DeleteInteractionChoiceSetRequest>
DeleteInteractionChoiceSetRequestPtr;
-typedef SharedPtr<DeleteInteractionChoiceSetResponse>
+typedef std::shared_ptr<DeleteInteractionChoiceSetResponse>
DeleteInteractionChoiceSetResponsePtr;
MATCHER_P(CheckMessageSuccess, success, "") {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
index 7a187c46d1..f1c44f86ac 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc
@@ -43,6 +43,7 @@
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_help_prompt_manager.h"
namespace test {
namespace components {
@@ -55,6 +56,7 @@ using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::InSequence;
namespace am = ::application_manager;
+namespace am_test = application_manager_test;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
using am::MockHmiInterfaces;
@@ -63,8 +65,8 @@ using am::MockMessageHelper;
using sdl_rpc_plugin::commands::DeleteSubMenuRequest;
using sdl_rpc_plugin::commands::DeleteSubMenuResponse;
-typedef SharedPtr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
-typedef SharedPtr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
+typedef std::shared_ptr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
+typedef std::shared_ptr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
MATCHER_P(CheckMessageResultCode, result_code, "") {
return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
@@ -99,6 +101,8 @@ class DeleteSubMenuRequestTest
, accessor_(commands_map_, commands_lock_)
, message_(CreateMessage())
, command_(CreateCommand<DeleteSubMenuRequest>(message_))
+ , mock_help_prompt_manager_(
+ std::make_shared<am_test::MockHelpPromptManager>())
, app_(CreateMockApp()) {}
am::CommandsMap commands_map_;
@@ -107,6 +111,7 @@ class DeleteSubMenuRequestTest
MessageSharedPtr message_;
DeleteSubMenuRequestPtr command_;
+ std::shared_ptr<am_test::MockHelpPromptManager> mock_help_prompt_manager_;
MockAppPtr app_;
};
@@ -118,7 +123,7 @@ TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) {
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
(*msg)[am::strings::msg_params][am::strings::menu_id] = 10u;
- utils::SharedPtr<DeleteSubMenuRequest> command =
+ std::shared_ptr<DeleteSubMenuRequest> command =
CreateCommand<DeleteSubMenuRequest>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -276,6 +281,9 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
EXPECT_CALL(*app_, RemoveCommand(_)).WillOnce(DeleteCommand(&commands_map_));
+ EXPECT_CALL(*app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_));
+ EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandDeleted(kCmdId, false));
EXPECT_CALL(
mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
@@ -287,6 +295,7 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
am::commands::Command::SOURCE_SDL));
EXPECT_CALL(*app_, UpdateHash());
+
DeleteSubMenuRequestPtr command =
CreateCommand<DeleteSubMenuRequest>(message_);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
index bf689629b4..5d6c6dc89e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc
@@ -35,7 +35,7 @@
#include <vector>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -61,7 +61,7 @@ using sdl_rpc_plugin::commands::DialNumberRequest;
using am::event_engine::Event;
namespace mobile_result = mobile_apis::Result;
-typedef SharedPtr<DialNumberRequest> DialNumberRequestPtr;
+typedef std::shared_ptr<DialNumberRequest> DialNumberRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
@@ -139,48 +139,45 @@ TEST_F(DialNumberRequestTest, Run_SUCCESS) {
}
TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- // MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- // (*command_msg)[am::strings::params][am::strings::connection_key] =
- // kConnectionKey;
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
- // DialNumberRequestPtr
- // command(CreateCommand<DialNumberRequest>(command_msg));
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
- // MockAppPtr app(CreateMockApp());
- // EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
- // Event event(hmi_apis::FunctionID::INVALID_ENUM);
- // EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
- // command->on_event(event);
+ command->on_event(event);
}
TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
- // MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- // (*event_msg)[am::strings::params][am::hmi_response::code] =
- // mobile_apis::Result::SUCCESS;
- // (*event_msg)[am::strings::params][am::strings::info] = "test_info";
-
- // Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
- // event.set_smart_object(*event_msg);
-
- // MockAppPtr app(CreateMockApp());
- // EXPECT_CALL(app_mngr_, application(kConnectionKey))
- // .WillRepeatedly(Return(app));
- // ON_CALL(app_mngr_,
- // GetRPCService()).WillByDefault(ReturnRef(mock_rpc_service_));
- // EXPECT_CALL(
- // mock_rpc_service_,
- // ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- // _));
-
- // MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- // (*command_msg)[am::strings::params][am::strings::connection_key] =
- // kConnectionKey;
-
- // DialNumberRequestPtr
- // command(CreateCommand<DialNumberRequest>(command_msg));
- // command->on_event(event);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::strings::info] = "test_info";
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+ ON_CALL(app_mngr_, GetRPCService())
+ .WillByDefault(ReturnRef(mock_rpc_service_));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
+ command->on_event(event);
}
} // namespace dial_number_request
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
index a8afe4007f..8589cbb6be 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -282,7 +282,7 @@ typedef Types<commands::OnWayPointChangeNotification,
commands::UnsubscribeButtonRequest,
commands::UnsubscribeButtonResponse> MobileCommandsListSecond;
-typedef Types<commands::UnSubscribeWayPointsRequest,
+typedef Types<commands::UnsubscribeWayPointsRequest,
commands::UnsubscribeWayPointsResponse,
commands::UpdateTurnListRequest,
commands::UpdateTurnListResponse> MobileCommandsListThird;
@@ -292,18 +292,18 @@ TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
- utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
UNUSED(command);
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
index 567f46e4ea..304cf13ffd 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc
@@ -60,7 +60,7 @@ using sdl_rpc_plugin::commands::EndAudioPassThruRequest;
using am::event_engine::Event;
using am::MockMessageHelper;
-typedef SharedPtr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
+typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
class EndAudioPassThruRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
index 0239f3c7d7..09a3336a10 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc
@@ -31,7 +31,7 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
#include "application_manager/application.h"
@@ -58,7 +58,7 @@ using sdl_rpc_plugin::commands::GetWayPointsRequest;
using application_manager::MockMessageHelper;
using application_manager::MockHmiInterfaces;
-typedef SharedPtr<GetWayPointsRequest> CommandPtr;
+typedef std::shared_ptr<GetWayPointsRequest> CommandPtr;
typedef mobile_apis::Result::eType MobileResult;
typedef hmi_apis::Common_Result::eType HmiResult;
@@ -75,7 +75,7 @@ class GetWayPointsRequestTest
GetWayPointsRequestTest() : mock_app_(CreateMockApp()) {}
void SetUp() OVERRIDE {
- message_ = utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map);
+ message_ = std::make_shared<SmartObject>(::smart_objects::SmartType_Map);
(*message_)[am::strings::msg_params] =
::smart_objects::SmartObject(::smart_objects::SmartType_Map);
@@ -85,7 +85,7 @@ class GetWayPointsRequestTest
MockAppPtr mock_app_;
MessageSharedPtr message_;
- utils::SharedPtr<GetWayPointsRequest> command_sptr_;
+ std::shared_ptr<GetWayPointsRequest> command_sptr_;
};
class GetWayPointsRequestOnEventTest
@@ -133,7 +133,7 @@ TEST_F(GetWayPointsRequestTest,
(*message_)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
- utils::SharedPtr<am::Application> null_application_sptr;
+ std::shared_ptr<am::Application> null_application_sptr;
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(null_application_sptr));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
index f9fd31f99a..3fcc4225f3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -69,10 +69,10 @@ class ListFilesRequestTest
};
TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
@@ -83,7 +83,7 @@ TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
MockAppPtr app(CreateMockApp());
- SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
ON_CALL(*app, hmi_level())
@@ -108,7 +108,7 @@ TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) {
TEST_F(ListFilesRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
- SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+ std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
EXPECT_CALL(app_mngr_, get_settings())
.WillRepeatedly(ReturnRef(app_mngr_settings_));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
index d2e86f0103..a0e41cf728 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc
@@ -34,7 +34,6 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -60,8 +59,6 @@ using sdl_rpc_plugin::commands::mobile::OnButtonPressNotification;
using ::testing::_;
using ::testing::Types;
using ::testing::Return;
-
-using ::utils::SharedPtr;
using am::commands::MessageSharedPtr;
namespace {
@@ -131,7 +128,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
(*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
mobile_apis::ButtonName::CUSTOM_BUTTON;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
command->Run();
@@ -148,7 +145,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
mobile_apis::ButtonName::CUSTOM_BUTTON;
(*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
@@ -170,7 +167,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
(*notification_msg)[am::strings::msg_params]
[am::hmi_response::custom_button_id] = kCustomButtonId;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
EXPECT_CALL(this->app_mngr_, application(kAppId))
@@ -192,7 +189,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
(*notification_msg)[am::strings::msg_params]
[am::hmi_response::custom_button_id] = kCustomButtonId;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
@@ -216,7 +213,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
(*notification_msg)[am::strings::msg_params]
[am::hmi_response::custom_button_id] = kCustomButtonId;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
@@ -241,7 +238,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) {
(*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
kButtonName;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
const std::vector<ApplicationSharedPtr> empty_subscribed_apps_list;
@@ -260,7 +257,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) {
(*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
kButtonName;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
@@ -286,7 +283,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
(*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
kButtonName;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
@@ -312,7 +309,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
(*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
kButtonName;
- SharedPtr<Notification> command(
+ std::shared_ptr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
index 9e12303f23..2fd6f6137d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -55,7 +55,7 @@ using ::testing::Return;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::OnCommandNotification;
-typedef ::utils::SharedPtr<OnCommandNotification> CommandPtr;
+typedef std::shared_ptr<OnCommandNotification> CommandPtr;
namespace {
const uint32_t kAppId = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
index 86df3cdab6..1d6711e36f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc
@@ -63,7 +63,7 @@ TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
- SharedPtr<OnHashChangeNotification> command =
+ std::shared_ptr<OnHashChangeNotification> command =
CreateCommand<OnHashChangeNotification>(msg);
std::string return_string = "1234";
@@ -93,7 +93,7 @@ TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
- SharedPtr<OnHashChangeNotification> command =
+ std::shared_ptr<OnHashChangeNotification> command =
CreateCommand<OnHashChangeNotification>(msg);
std::string return_string;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
index 43e01c5a3d..333c204d57 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
@@ -78,7 +78,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
Run_CurrentStateForeground_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -106,7 +106,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
TEST_F(OnHMIStatusNotificationFromMobileTest, Run_InvalidApp_NoNotification) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -132,7 +132,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
Run_CurrentStateNotForeground_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -161,7 +161,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
Run_ProtocolVersionKV3_NoNotification) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -190,7 +190,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
Run_AppNotRequestedBeforeAndKV3_NoNotification) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -218,7 +218,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
Run_AppNotRequestedBefore_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -249,7 +249,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
Run_AnotherForegroundSDLApp_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotificationFromMobile> command =
+ std::shared_ptr<OnHMIStatusNotificationFromMobile> command =
CreateCommand<OnHMIStatusNotificationFromMobile>(msg);
MockAppPtr mock_app = CreateMockApp();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
index 034fff73d7..ba3b1e8f1d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc
@@ -85,7 +85,7 @@ class OnHMIStatusNotificationTest
TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotification> command =
+ std::shared_ptr<OnHMIStatusNotification> command =
CreateCommand<OnHMIStatusNotification>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -104,7 +104,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::INVALID_ENUM);
- SharedPtr<OnHMIStatusNotification> command =
+ std::shared_ptr<OnHMIStatusNotification> command =
CreateCommand<OnHMIStatusNotification>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -118,49 +118,10 @@ TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) {
VerifySendNotificationData(msg);
}
-TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndFalseProperties_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
- SetSendNotificationExpectations(msg);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(false));
- EXPECT_CALL(*mock_app, set_tts_properties_in_none(true));
- EXPECT_CALL(mock_message_helper_, SendTTSGlobalProperties(_, false, _));
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
-TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndTrueProperties_SUCCESS) {
- MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND);
-
- SharedPtr<OnHMIStatusNotification> command =
- CreateCommand<OnHMIStatusNotification>(msg);
-
- MockAppPtr mock_app = CreateMockApp();
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(true));
-
- SetSendNotificationExpectations(msg);
-
- command->Run();
-
- VerifySendNotificationData(msg);
-}
-
TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotification> command =
+ std::shared_ptr<OnHMIStatusNotification> command =
CreateCommand<OnHMIStatusNotification>(msg);
MockAppPtr mock_app = CreateMockApp();
@@ -182,7 +143,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) {
TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL);
- SharedPtr<OnHMIStatusNotification> command =
+ std::shared_ptr<OnHMIStatusNotification> command =
CreateCommand<OnHMIStatusNotification>(msg);
MockAppPtr mock_app = CreateMockApp();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
index ebfc2256ac..04f88e2b13 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc
@@ -79,8 +79,8 @@ class OnKeyBoardInputNotificationTest
(*msg)[strings::params][strings::protocol_version].asInt());
}
- MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
- app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
+ MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set);
MockAppPtr app(CreateMockApp());
app_set->insert(app);
EXPECT_CALL(app_mngr_, applications())
@@ -88,14 +88,14 @@ class OnKeyBoardInputNotificationTest
return app;
}
- SharedPtr<ApplicationSet> app_set_;
+ std::shared_ptr<ApplicationSet> app_set_;
std::shared_ptr<sync_primitives::Lock> lock_;
};
TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<OnKeyBoardInputNotification> command =
+ std::shared_ptr<OnKeyBoardInputNotification> command =
CreateCommand<OnKeyBoardInputNotification>(msg);
MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
@@ -119,7 +119,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<OnKeyBoardInputNotification> command =
+ std::shared_ptr<OnKeyBoardInputNotification> command =
CreateCommand<OnKeyBoardInputNotification>(msg);
MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
@@ -144,7 +144,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) {
TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<OnKeyBoardInputNotification> command =
+ std::shared_ptr<OnKeyBoardInputNotification> command =
CreateCommand<OnKeyBoardInputNotification>(msg);
MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
index d6e1b2fe52..4981301e07 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc
@@ -88,7 +88,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
(*msg)[strings::msg_params][strings::request_type] = request_type;
- SharedPtr<OnSystemRequestNotification> command =
+ std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -128,7 +128,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
(*msg)[strings::msg_params][strings::request_type] = request_type;
- SharedPtr<OnSystemRequestNotification> command =
+ std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -162,7 +162,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
(*msg)[strings::msg_params][strings::request_type] = request_type;
- SharedPtr<OnSystemRequestNotification> command =
+ std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -185,7 +185,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
(*msg)[strings::params][strings::connection_key] = kConnectionKey;
(*msg)[strings::msg_params][strings::request_type] = request_type;
- SharedPtr<OnSystemRequestNotification> command =
+ std::shared_ptr<OnSystemRequestNotification> command =
CreateCommand<OnSystemRequestNotification>(msg);
EXPECT_CALL(app_mngr_, application(kConnectionKey))
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
index 14939a433d..3d989db478 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -35,7 +35,7 @@
#include "gtest/gtest.h"
#include "mobile/on_tbt_client_state_notification.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -56,7 +56,7 @@ using ::testing::Return;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::OnTBTClientStateNotification;
-typedef ::utils::SharedPtr<OnTBTClientStateNotification> NotificationPtr;
+typedef std::shared_ptr<OnTBTClientStateNotification> NotificationPtr;
namespace {
const uint32_t kAppId = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
index 4576637d8d..f69dd5da2e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc
@@ -35,7 +35,7 @@
#include "gtest/gtest.h"
#include "mobile/on_touch_event_notification.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -56,7 +56,7 @@ using ::testing::Return;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::mobile::OnTouchEventNotification;
-typedef ::utils::SharedPtr<OnTouchEventNotification> NotificationPtr;
+typedef std::shared_ptr<OnTouchEventNotification> NotificationPtr;
namespace {
const uint32_t kAppId = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
index e0b7ab3b38..97a290e792 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc
@@ -35,7 +35,7 @@
#include "gtest/gtest.h"
#include "mobile/on_way_point_change_notification.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -56,7 +56,7 @@ using ::testing::Return;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::OnWayPointChangeNotification;
-typedef ::utils::SharedPtr<OnWayPointChangeNotification> NotificationPtr;
+typedef std::shared_ptr<OnWayPointChangeNotification> NotificationPtr;
namespace {
const uint32_t kAppId = 1u;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
index f06a642e3b..f51f1aa655 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -55,7 +55,6 @@ using sdl_rpc_plugin::commands::PerformAudioPassThruRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -80,7 +79,7 @@ class PerformAudioPassThruRequestTest
public:
PerformAudioPassThruRequestTest()
: mock_app_(CreateMockApp())
- , message_(utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map))
+ , message_(std::make_shared<SmartObject>(::smart_objects::SmartType_Map))
, msg_params_((*message_)[am::strings::msg_params]) {}
MessageSharedPtr CreateFullParamsUISO() {
@@ -151,7 +150,7 @@ class PerformAudioPassThruRequestTest
MockAppPtr mock_app_;
MessageSharedPtr message_;
::smart_objects::SmartObject& msg_params_;
- utils::SharedPtr<PerformAudioPassThruRequest> command_sptr_;
+ std::shared_ptr<PerformAudioPassThruRequest> command_sptr_;
MockAppPtr application_sptr_;
};
@@ -162,10 +161,10 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
(*msg_ui)[am::strings::msg_params][am::strings::success] = false;
MessageSharedPtr message =
- utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map);
+ std::make_shared<SmartObject>(::smart_objects::SmartType_Map);
(*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- utils::SharedPtr<PerformAudioPassThruRequest> command =
+ std::shared_ptr<PerformAudioPassThruRequest> command =
CreateCommand<PerformAudioPassThruRequest>(message);
uint32_t app_id = kConnectionKey;
@@ -209,7 +208,7 @@ TEST_F(PerformAudioPassThruRequestTest,
EXPECT_CALL(*application_sptr_, hmi_level())
.WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
- utils::SharedPtr<PerformAudioPassThruRequest> command =
+ std::shared_ptr<PerformAudioPassThruRequest> command =
CreateCommand<PerformAudioPassThruRequest>(mobile_request);
ON_CALL(mock_hmi_interfaces_,
@@ -271,7 +270,7 @@ TEST_F(PerformAudioPassThruRequestTest,
TEST_F(PerformAudioPassThruRequestTest,
Run_InvalidApp_ApplicationNotRegisteredResponce) {
- utils::SharedPtr<am::Application> null_application_sptr;
+ std::shared_ptr<am::Application> null_application_sptr;
EXPECT_CALL(app_mngr_, application(_))
.WillOnce(Return(null_application_sptr));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
index 2ffe9195b6..3b68d3ea72 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc
@@ -37,9 +37,7 @@
#include "mobile/perform_interaction_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/commands/command_request_test.h"
@@ -63,7 +61,6 @@ using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
using ::testing::_;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
using sdl_rpc_plugin::commands::PerformInteractionRequest;
@@ -113,7 +110,7 @@ TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) {
MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map);
(*request_msg)[strings::msg_params][strings::interaction_mode] =
mobile_apis::InteractionMode::BOTH;
- utils::SharedPtr<PerformInteractionRequest> command =
+ std::shared_ptr<PerformInteractionRequest> command =
CreateCommand<PerformInteractionRequest>(request_msg);
MockAppPtr mock_app;
@@ -156,7 +153,7 @@ TEST_F(PerformInteractionRequestTest,
(*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
(*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
mobile_apis::InteractionMode::VR_ONLY;
- utils::SharedPtr<PerformInteractionRequest> command =
+ std::shared_ptr<PerformInteractionRequest> command =
CreateCommand<PerformInteractionRequest>(msg_from_mobile);
command->Init();
@@ -210,7 +207,7 @@ TEST_F(PerformInteractionRequestTest,
(*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey;
(*msg_from_mobile)[strings::msg_params][strings::interaction_mode] =
mobile_apis::InteractionMode::VR_ONLY;
- utils::SharedPtr<PerformInteractionRequest> command =
+ std::shared_ptr<PerformInteractionRequest> command =
CreateCommand<PerformInteractionRequest>(msg_from_mobile);
ON_CALL(mock_hmi_interfaces_,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
index c5feeeba25..df4f69f0d0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
@@ -42,7 +42,6 @@
#include "mobile/put_file_response.h"
#include "mobile/put_file_request.h"
-#include "utils/make_shared.h"
#include "utils/file_system.h"
#include "smart_objects/smart_object.h"
#include "interfaces/MOBILE_API.h"
@@ -68,8 +67,8 @@ using sdl_rpc_plugin::commands::PutFileResponse;
using am::commands::MessageSharedPtr;
using policy_test::MockPolicyHandlerInterface;
-typedef SharedPtr<PutFileRequest> PutFileRequestPtr;
-typedef SharedPtr<PutFileResponse> PutFileResponsePtr;
+typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr;
+typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr;
namespace {
const uint32_t kConnectionKey = 1u;
@@ -131,7 +130,7 @@ class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> {
}
MessageSharedPtr message_;
- SharedPtr<PutFileResponse> command_sptr_;
+ std::shared_ptr<PutFileResponse> command_sptr_;
};
TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
@@ -140,7 +139,7 @@ TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
message_ref[am::strings::params][am::strings::connection_key] =
kConnectionKey;
- utils::SharedPtr<am::Application> null_application_sptr;
+ std::shared_ptr<am::Application> null_application_sptr;
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(null_application_sptr));
EXPECT_CALL(
@@ -158,8 +157,8 @@ TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) {
kConnectionKey;
message_ref[am::strings::msg_params][am::strings::success] = true;
- utils::SharedPtr<am::Application> application_sptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<am::Application> application_sptr =
+ std::make_shared<MockApplication>();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(application_sptr));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
index 8b21ceff17..7dab16fe35 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc
@@ -36,7 +36,6 @@
#include "gtest/gtest.h"
#include "mobile/register_app_interface_request.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -56,6 +55,7 @@
#include "utils/custom_string.h"
#include "utils/lock.h"
#include "utils/macro.h"
+#include "utils/semantic_version.h"
namespace test {
namespace components {
@@ -70,7 +70,6 @@ using ::testing::DoAll;
namespace am = ::application_manager;
-using ::utils::SharedPtr;
using am::commands::MessageSharedPtr;
using sdl_rpc_plugin::commands::RegisterAppInterfaceRequest;
@@ -82,8 +81,10 @@ const mobile_apis::Language::eType kMobileLanguage =
mobile_apis::Language::EN_US;
const std::string kMacAddress = "test_mac_address";
const std::string kAppId = "test_app_id";
+const std::string kFullAppId = "test_app_id_long";
const std::string kDummyString = "test_string";
const std::vector<uint32_t> kDummyDiagModes;
+const utils::SemanticVersion mock_semantic_version(1, 0, 0);
} // namespace
class RegisterAppInterfaceRequestTest
@@ -112,11 +113,18 @@ class RegisterAppInterfaceRequestTest
void InitBasicMessage() {
(*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
(*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*msg_)[am::strings::msg_params][am::strings::full_app_id] = kFullAppId;
(*msg_)[am::strings::msg_params][am::strings::app_name] = app_name_;
(*msg_)[am::strings::msg_params][am::strings::language_desired] =
kHmiLanguage;
(*msg_)[am::strings::msg_params]
[am::strings::hmi_display_language_desired] = kHmiLanguage;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::major_version] = 4;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::minor_version] = 0;
+ (*msg_)[am::strings::msg_params][am::strings::sync_msg_version]
+ [am::strings::patch_version] = 0;
}
MockAppPtr CreateBasicMockedApp() {
@@ -127,6 +135,8 @@ class RegisterAppInterfaceRequestTest
ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
return mock_app;
}
@@ -143,6 +153,8 @@ class RegisterAppInterfaceRequestTest
}
void InitGetters() {
+ ON_CALL(app_mngr_, GetCorrectMobileIDFromMessage(msg_))
+ .WillByDefault(Return(kAppId));
ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(true));
ON_CALL(app_mngr_, resume_controller())
.WillByDefault(ReturnRef(mock_resume_crt_));
@@ -217,15 +229,14 @@ class RegisterAppInterfaceRequestTest
ManageHMICommand(HMIResultCodeIs(
hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0);
- EXPECT_CALL(
- app_mngr_,
- OnApplicationSwitched(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app)));
+ EXPECT_CALL(app_mngr_,
+ OnApplicationSwitched(
+ std::static_pointer_cast<application_manager::Application>(
+ mock_app)));
}
MessageSharedPtr msg_;
- SharedPtr<RegisterAppInterfaceRequest> command_;
+ std::shared_ptr<RegisterAppInterfaceRequest> command_;
const utils::custom_string::CustomString app_name_;
std::shared_ptr<sync_primitives::Lock> lock_ptr_;
@@ -279,11 +290,12 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
.WillByDefault(Return(true));
policy::StatusNotifier notify_upd_manager =
- utils::MakeShared<utils::CallNothing>();
+ std::make_shared<utils::CallNothing>();
ON_CALL(mock_policy_handler_, AddApplication(_, _))
.WillByDefault(Return(notify_upd_manager));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
+
EXPECT_CALL(mock_rpc_service_,
ManageHMICommand(HMIResultCodeIs(
hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
@@ -295,6 +307,7 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
command_->Run();
}
@@ -376,7 +389,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
.WillByDefault(Return(true));
policy::StatusNotifier notify_upd_manager =
- utils::MakeShared<utils::CallNothing>();
+ std::make_shared<utils::CallNothing>();
ON_CALL(mock_policy_handler_, AddApplication(_, _))
.WillByDefault(Return(notify_upd_manager));
@@ -408,6 +421,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.Times(2);
+ EXPECT_CALL(app_mngr_, SendDriverDistractionState(_));
command_->Run();
}
@@ -432,8 +446,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
EXPECT_CALL(
mock_resume_crt_,
CheckApplicationHash(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
+ std::static_pointer_cast<application_manager::Application>(mock_app),
request_hash_id)).WillOnce(Return(true));
EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0);
@@ -467,15 +480,13 @@ TEST_F(RegisterAppInterfaceRequestTest,
EXPECT_CALL(
mock_resume_crt_,
CheckApplicationHash(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
+ std::static_pointer_cast<application_manager::Application>(mock_app),
request_hash_id)).WillOnce(Return(false));
EXPECT_CALL(
mock_application_helper_,
RecallApplicationData(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
+ std::static_pointer_cast<application_manager::Application>(mock_app),
_));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
@@ -504,8 +515,7 @@ TEST_F(RegisterAppInterfaceRequestTest,
EXPECT_CALL(
mock_application_helper_,
RecallApplicationData(
- MockAppPtr::static_pointer_cast<application_manager::Application>(
- mock_app),
+ std::static_pointer_cast<application_manager::Application>(mock_app),
_));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
index 4cdf4f8858..0e3cd685fa 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc
@@ -38,8 +38,6 @@
#include "mobile/reset_global_properties_response.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "smart_objects/smart_object.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
@@ -69,8 +67,9 @@ using am::commands::MessageSharedPtr;
using am::event_engine::Event;
using am::MockMessageHelper;
-typedef SharedPtr<ResetGlobalPropertiesRequest> ResetGlobalPropertiesRequestPtr;
-typedef SharedPtr<ResetGlobalPropertiesResponse>
+typedef std::shared_ptr<ResetGlobalPropertiesRequest>
+ ResetGlobalPropertiesRequestPtr;
+typedef std::shared_ptr<ResetGlobalPropertiesResponse>
ResetGlobalPropertiesResponsePtr;
namespace {
@@ -219,7 +218,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
smart_objects::SmartObjectSPtr vr_help =
- ::utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
.WillOnce(Return(vr_help));
@@ -232,7 +231,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
set_menu_title(msg_params[am::hmi_request::menu_title]));
const smart_objects::SmartObjectSPtr so_help_prompt =
- ::utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(so_help_prompt.get()));
EXPECT_CALL(*mock_app_, timeout_prompt())
@@ -271,7 +270,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
smart_objects::SmartObjectSPtr vr_help =
- ::utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
.WillOnce(Return(vr_help));
@@ -310,7 +309,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
*prompt = "prompt";
EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
@@ -368,7 +367,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
hmi_apis::FunctionID::UI_SetGlobalProperties)))
.WillOnce(Return(true));
smart_objects::SmartObjectSPtr vr_help =
- ::utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
.WillOnce(Return(vr_help));
@@ -406,7 +405,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
*prompt = "prompt";
EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
@@ -439,7 +438,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
// TTS doesn't respond, so timeout should send generic error
smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*response)[am::strings::msg_params][am::strings::result_code] =
mobile_apis::Result::GENERIC_ERROR;
EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
@@ -471,7 +470,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
*prompt = "prompt";
EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
@@ -501,7 +500,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
// UI doesn't respond, so timeout should send generic error
smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*response)[am::strings::msg_params][am::strings::result_code] =
mobile_apis::Result::GENERIC_ERROR;
EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
@@ -535,7 +534,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
smart_objects::SmartObjectSPtr prompt =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
*prompt = "prompt";
EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
@@ -555,7 +554,7 @@ TEST_F(ResetGlobalPropertiesRequestTest,
// TTS and UI don't respond, so timeout should send generic error
std::string info = "TTS, UI component does not respond";
smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*response)[am::strings::msg_params][am::strings::result_code] =
mobile_apis::Result::GENERIC_ERROR;
EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
index f550043414..cf25a82972 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc
@@ -61,7 +61,6 @@ using sdl_rpc_plugin::commands::ScrollableMessageRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Eq;
using ::testing::Ref;
@@ -116,7 +115,7 @@ class ScrollableMessageRequestTest
MockAppPtr mock_app_;
MessageSharedPtr msg_;
- SharedPtr<ScrollableMessageRequest> command_;
+ std::shared_ptr<ScrollableMessageRequest> command_;
};
typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities;
@@ -125,7 +124,7 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_ui = CreateFullParamsUISO();
(*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- utils::SharedPtr<ScrollableMessageRequest> command =
+ std::shared_ptr<ScrollableMessageRequest> command =
CreateCommand<ScrollableMessageRequest>(msg_ui);
MockAppPtr mock_app = CreateMockApp();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
index c0c44922e3..6c7127e48c 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc
@@ -57,8 +57,8 @@ using sdl_rpc_plugin::commands::SendHapticDataRequest;
using sdl_rpc_plugin::commands::SendHapticDataResponse;
using am::commands::MessageSharedPtr;
-typedef SharedPtr<SendHapticDataRequest> SendHapticDataRequestPtr;
-typedef SharedPtr<SendHapticDataResponse> SendHapticDataResponsePtr;
+typedef std::shared_ptr<SendHapticDataRequest> SendHapticDataRequestPtr;
+typedef std::shared_ptr<SendHapticDataResponse> SendHapticDataResponsePtr;
namespace {
const uint32_t kConnectionKey = 1u;
@@ -91,7 +91,7 @@ class SendHapticDataResponseTest
}
MessageSharedPtr message_;
- SharedPtr<SendHapticDataResponse> command_sptr_;
+ std::shared_ptr<SendHapticDataResponse> command_sptr_;
};
TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
index d0072f6288..4f44293fc9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc
@@ -36,7 +36,7 @@
#include "mobile/send_location_request.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_message_helper.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/command_request_test.h"
namespace test {
@@ -50,7 +50,7 @@ using sdl_rpc_plugin::commands::SendLocationRequest;
using application_manager::MockMessageHelper;
using test::components::application_manager_test::MockHMICapabilities;
using smart_objects::SmartObject;
-using utils::SharedPtr;
+
using testing::_;
using testing::Return;
using testing::ReturnRef;
@@ -95,11 +95,11 @@ class SendLocationRequestTest
}
};
- typedef SharedPtr<UnwrappedSendLocationRequest> CommandSPrt;
+ typedef std::shared_ptr<UnwrappedSendLocationRequest> CommandSPrt;
SendLocationRequestTest() {
mock_app_ = CreateMockApp();
- disp_cap_ = utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ disp_cap_ = std::make_shared<SmartObject>(smart_objects::SmartType_Map);
message_ = CreateMessage();
command_ = CreateCommand<UnwrappedSendLocationRequest>(message_);
}
@@ -158,7 +158,7 @@ class SendLocationRequestTest
}
MockAppPtr mock_app_;
- SharedPtr<SmartObject> disp_cap_;
+ std::shared_ptr<SmartObject> disp_cap_;
MessageSharedPtr message_;
CommandSPrt command_;
};
@@ -315,6 +315,21 @@ TEST_F(SendLocationRequestTest, Run_LocationImageValid_Success) {
command_->Run();
}
+TEST_F(SendLocationRequestTest, Run_LocationImageValid_Warnings) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "notavailable";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ FinishSetup();
+ command_->Run();
+}
+
TEST_F(SendLocationRequestTest, Run_LocationImageInvalid_Cancelled) {
InitialSetup(message_);
(*message_)[strings::msg_params][strings::location_image] =
@@ -325,8 +340,8 @@ TEST_F(SendLocationRequestTest, Run_LocationImageInvalid_Cancelled) {
mock_message_helper_,
VerifyImage(
(*message_)[strings::msg_params][strings::location_image], _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
- FinishSetupCancelled(mobile_apis::Result::ABORTED);
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
command_->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
index e1612dbacb..d8d1faca47 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc
@@ -60,7 +60,6 @@ using am::MockMessageHelper;
using am::MockHmiInterfaces;
using test::components::protocol_handler_test::MockProtocolHandler;
using test::components::protocol_handler_test::MockProtocolHandlerSettings;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -110,7 +109,7 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
ON_CALL(app_mngr_settings_, app_icons_folder())
.WillByDefault(ReturnRef(dir_path));
- utils::SharedPtr<SetAppIconRequest> req_vr =
+ std::shared_ptr<SetAppIconRequest> req_vr =
CreateCommand<SetAppIconRequest>(msg_vr);
MockAppPtr mock_app = CreateMockApp();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
index 0758fb32f4..cd6af1512d 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc
@@ -57,12 +57,11 @@ using sdl_rpc_plugin::commands::SetDisplayLayoutRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-typedef ::utils::SharedPtr<SetDisplayLayoutRequest> CommandPtr;
+typedef std::shared_ptr<SetDisplayLayoutRequest> CommandPtr;
namespace {
const uint32_t kAppId = 1u;
@@ -132,7 +131,7 @@ TEST_F(SetDisplayLayoutRequestTest,
MessageSharedPtr msg_ui = CreateFullParamsUISO();
(*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- utils::SharedPtr<SetDisplayLayoutRequest> command =
+ std::shared_ptr<SetDisplayLayoutRequest> command =
CreateCommand<SetDisplayLayoutRequest>(msg_ui);
MockAppPtr mock_app = CreateMockApp();
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
index 5d31f48970..03aa5d85a1 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc
@@ -31,6 +31,7 @@
*/
#include <stdint.h>
+#include <memory>
#include <string>
#include <set>
@@ -39,6 +40,7 @@
#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
@@ -57,7 +59,6 @@ using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
using am::CommandsMap;
using utils::custom_string::CustomString;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -76,7 +77,11 @@ class SetGlobalPropertiesRequestTest
public:
SetGlobalPropertiesRequestTest()
: lock_ptr_(std::make_shared<sync_primitives::Lock>())
- , mock_app_(CreateMockApp()) {}
+ , mock_app_(CreateMockApp()) {
+ mock_help_prompt_manager_ =
+ std::shared_ptr<application_manager_test::MockHelpPromptManager>(
+ new application_manager_test::MockHelpPromptManager());
+ }
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -121,8 +126,9 @@ class SetGlobalPropertiesRequestTest
.WillOnce(Return(mock_app_));
}
- void OnEventUISetupHelper(MessageSharedPtr msg,
- SharedPtr<SetGlobalPropertiesRequest> command) {
+ void OnEventUISetupHelper(
+ MessageSharedPtr msg,
+ std::shared_ptr<SetGlobalPropertiesRequest> command) {
SmartObject vr_help_title("yes");
SmartObject vr_help_array(smart_objects::SmartType_Array);
VRArraySetupHelper(msg, vr_help_title, vr_help_array);
@@ -140,11 +146,17 @@ class SetGlobalPropertiesRequestTest
EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
command->Run();
}
- void OnEventTTSSetupHelper(MessageSharedPtr msg,
- SharedPtr<SetGlobalPropertiesRequest> command) {
+ void OnEventTTSSetupHelper(
+ MessageSharedPtr msg,
+ std::shared_ptr<SetGlobalPropertiesRequest> command) {
SmartObject help_prompt(smart_objects::SmartType_Array);
help_prompt[0][am::strings::text] = "Help_Prompt_One";
(*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
@@ -162,14 +174,17 @@ class SetGlobalPropertiesRequestTest
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_,
RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
command->Run();
}
@@ -252,6 +267,8 @@ class SetGlobalPropertiesRequestTest
}
std::shared_ptr<sync_primitives::Lock> lock_ptr_;
MockAppPtr mock_app_;
+ std::shared_ptr<application_manager_test::MockHelpPromptManager>
+ mock_help_prompt_manager_;
};
TEST_F(SetGlobalPropertiesRequestTest,
@@ -260,7 +277,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
(*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] =
"vr_command";
- utils::SharedPtr<SetGlobalPropertiesRequest> command =
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
CreateCommand<SetGlobalPropertiesRequest>(msg_vr);
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
@@ -293,6 +310,12 @@ TEST_F(SetGlobalPropertiesRequestTest,
ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
.WillByDefault(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false)).Times(2);
+
EXPECT_CALL(
mock_message_helper_,
VerifyTtsFiles(
@@ -312,6 +335,9 @@ TEST_F(SetGlobalPropertiesRequestTest,
event_vr.set_smart_object(*msg_vr);
command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
command->on_event(event_vr);
MessageSharedPtr ui_command_result;
@@ -319,6 +345,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
.WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
command->on_event(event);
@@ -334,11 +362,17 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) {
am::event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
event.set_smart_object(*response);
- utils::SharedPtr<SetGlobalPropertiesRequest> command =
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
CreateCommand<SetGlobalPropertiesRequest>(response);
MockAppPtr mock_app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
EXPECT_CALL(
mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::CommandSource::SOURCE_SDL))
@@ -361,12 +395,15 @@ TEST_F(SetGlobalPropertiesRequestTest,
am::event_engine::Event event_ui(
hmi_apis::FunctionID::UI_SetGlobalProperties);
event_tts.set_smart_object(*response);
- utils::SharedPtr<SetGlobalPropertiesRequest> command =
+ std::shared_ptr<SetGlobalPropertiesRequest> command =
CreateCommand<SetGlobalPropertiesRequest>(response);
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get()));
+
MessageSharedPtr response_to_mobile;
EXPECT_CALL(
mock_rpc_service_,
@@ -374,6 +411,9 @@ TEST_F(SetGlobalPropertiesRequestTest,
.WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
command->Run();
+
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true)).Times(2);
command->on_event(event_ui);
command->on_event(event_tts);
@@ -389,7 +429,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
EXPECT_CALL(
mock_hmi_interfaces_,
@@ -441,7 +481,109 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_VRWithMenuAndKeyboard_Menu_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::WARNINGS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_VR_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::WARNINGS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -452,7 +594,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) {
SmartObject vr_help_title("yes");
(*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
SmartObject menu_icon(smart_objects::SmartType_Map);
- menu_icon[am::strings::value] = "1";
+ menu_icon[am::strings::value] = " 1";
(*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -460,10 +602,8 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) {
EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
.WillOnce((Return(mobile_apis::Result::ABORTED)));
EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
EmptyExpectationsSetupHelper();
-
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -477,15 +617,28 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) {
(*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
SmartObject vr_help_array(smart_objects::SmartType_Array);
VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
.WillOnce((Return(mobile_apis::Result::SUCCESS)));
EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
.WillOnce((Return(mobile_apis::Result::ABORTED)));
- EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -509,7 +662,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) {
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -530,7 +683,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) {
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -547,7 +700,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) {
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -568,7 +721,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) {
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -586,8 +739,6 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) {
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("Menu_Title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
@@ -601,7 +752,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -617,23 +768,11 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRCouldNotGenerate_INVALID_DATA) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject* vr_help_title = NULL;
- CommandsMap commands_map;
- SmartObject empty_msg(smart_objects::SmartType_Map);
- commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &empty_msg));
- DataAccessor<CommandsMap> accessor(commands_map, lock_ptr_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(vr_help_title));
- EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
- EXPECT_CALL(
- mock_rpc_service_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
- am::commands::Command::SOURCE_SDL));
command->Run();
}
@@ -648,17 +787,6 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) {
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title(smart_objects::SmartType_Null);
- EXPECT_CALL(*mock_app_, vr_help_title())
- .WillOnce(Return(&vr_help_title))
- .WillOnce(Return(&vr_help_title));
-
- CommandsMap commands_map;
- DataAccessor<CommandsMap> accessor(commands_map, lock_ptr_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- const CustomString name("name");
- EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
- EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
EXPECT_CALL(*mock_app_, set_keyboard_props(_));
@@ -672,7 +800,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -688,23 +816,6 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) {
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title(smart_objects::SmartType_Null);
- EXPECT_CALL(*mock_app_, vr_help_title())
- .Times(2)
- .WillRepeatedly(Return(&vr_help_title));
-
- CommandsMap commands_map;
- SmartObject command_text(smart_objects::SmartType_Map);
- commands_map[0] = &command_text;
- (*commands_map[0])[am::strings::vr_commands] = SmartObject("one");
- DataAccessor<CommandsMap> accessor(commands_map, lock_ptr_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
- EXPECT_CALL(*mock_app_, set_vr_help(_));
- const CustomString name("name");
- EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
- EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
- SmartObject vr_help_array(smart_objects::SmartType_Array);
- EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
@@ -717,7 +828,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -731,25 +842,14 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
- EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title(smart_objects::SmartType_Null);
- EXPECT_CALL(*mock_app_, vr_help_title())
- .Times(2)
- .WillRepeatedly(Return(&vr_help_title));
-
- CommandsMap commands_map;
- DataAccessor<CommandsMap> accessor(commands_map, lock_ptr_);
- EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
+
SmartObject vr_help_array(smart_objects::SmartType_Array);
vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
vr_help_array[0][am::strings::text] = kText;
vr_help_array[0][am::strings::position] = kPosition;
SmartObject vr_synonyms(smart_objects::SmartType_Array);
vr_synonyms[0] = vr_help_array;
- const CustomString name("name");
- EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
- EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
@@ -761,7 +861,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) {
ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -784,8 +884,6 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
@@ -800,7 +898,12 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -818,8 +921,6 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
EXPECT_CALL(*mock_app_, set_timeout_prompt(_)).Times(0);
@@ -832,7 +933,11 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -850,8 +955,6 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
- SmartObject vr_help_title("title");
- EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
EXPECT_CALL(*mock_app_, set_help_prompt(_)).Times(0);
EXPECT_CALL(*mock_app_, help_prompt()).Times(0);
EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
@@ -864,7 +967,11 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -881,7 +988,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) {
EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -897,7 +1004,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) {
ExpectVerifyImageVrHelpUnsuccess();
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -915,7 +1022,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) {
ExpectVerifyImageVrHelpSuccess(vr_help);
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -934,7 +1041,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) {
ExpectVerifyImageVrHelpSuccess(vr_help);
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -952,7 +1059,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) {
ExpectVerifyImageSuccess(menu_icon);
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -969,7 +1076,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) {
ExpectVerifyImageVrHelpUnsuccess();
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -989,7 +1096,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
ExpectVerifyImageVrHelpUnsuccess();
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -1009,7 +1116,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
ExpectVerifyImageVrHelpUnsuccess();
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ExpectInvalidData();
@@ -1023,7 +1130,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) {
ExpectVerifyImageVrHelpUnsuccess();
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -1037,7 +1144,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) {
EmptyExpectationsSetupHelper();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
command->Run();
@@ -1049,12 +1156,17 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
hmi_apis::Common_Result::SUCCESS;
(*msg)[am::strings::params][am::hmi_response::code] = response_code;
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
event.set_smart_object(*msg);
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
command->on_event(event);
}
@@ -1072,7 +1184,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
OnEventUISetupHelper(msg, command);
@@ -1082,6 +1194,9 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
+
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
@@ -1097,7 +1212,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
hmi_apis::Common_Result::WARNINGS;
(*msg)[am::strings::params][am::hmi_response::code] = response_code;
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
ON_CALL(
mock_hmi_interfaces_,
@@ -1114,6 +1229,8 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
event.set_smart_object(*msg);
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
EXPECT_CALL(mock_rpc_service_,
@@ -1135,7 +1252,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) {
ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
OnEventUISetupHelper(msg, command);
@@ -1156,10 +1273,10 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) {
TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
Event event(hmi_apis::FunctionID::TTS_Stopped);
@@ -1181,7 +1298,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
OnEventTTSSetupHelper(msg, command);
@@ -1190,6 +1307,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(_, am::commands::Command::SOURCE_SDL))
.WillOnce(Return(true));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -1213,7 +1332,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- SharedPtr<SetGlobalPropertiesRequest> command(
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
CreateCommand<SetGlobalPropertiesRequest>(msg));
OnEventTTSSetupHelper(msg, command);
@@ -1221,6 +1340,9 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+
MessageSharedPtr ui_command_result;
EXPECT_CALL(
mock_rpc_service_,
@@ -1229,6 +1351,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, true));
Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
event.set_smart_object(*msg);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
index 9d2dd996bc..a69d3d741b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc
@@ -59,8 +59,9 @@ using ::testing::Return;
using ::testing::ReturnRef;
namespace UpdateMode = mobile_apis::UpdateMode;
+namespace AudioStreamingIndicator = mobile_apis::AudioStreamingIndicator;
-typedef SharedPtr<SetMediaClockRequest> SetMediaClockRequestPtr;
+typedef std::shared_ptr<SetMediaClockRequest> SetMediaClockRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
@@ -116,7 +117,7 @@ TEST_F(SetMediaClockRequestTest,
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- utils::SharedPtr<SetMediaClockRequest> command =
+ std::shared_ptr<SetMediaClockRequest> command =
CreateCommand<SetMediaClockRequest>(msg);
MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
@@ -159,8 +160,10 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
kMinutes;
(*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY;
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -195,8 +198,10 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) {
kHours;
(*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY;
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -231,8 +236,10 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) {
kHours;
(*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY_PAUSE;
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
ExpectationsSetupHelper(true);
@@ -254,8 +261,10 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) {
kMinutes;
(*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] =
+ AudioStreamingIndicator::PLAY_PAUSE;
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -273,7 +282,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) {
(*msg)[am::strings::msg_params][am::strings::update_mode] =
UpdateMode::COUNTDOWN;
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
ExpectationsSetupHelper(true);
@@ -284,7 +293,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) {
TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
ExpectationsSetupHelper(true);
@@ -295,7 +304,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) {
TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
ExpectationsSetupHelper(false);
@@ -306,7 +315,7 @@ TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) {
TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -332,7 +341,7 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) {
Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
event.set_smart_object(*msg);
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
command->on_event(event);
}
@@ -340,7 +349,7 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) {
TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<SetMediaClockRequest> command(
+ std::shared_ptr<SetMediaClockRequest> command(
CreateCommand<SetMediaClockRequest>(msg));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
Event event(hmi_apis::FunctionID::UI_Slider);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
index 9d5497d4a7..4725af4671 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc
@@ -31,6 +31,7 @@
*/
#include <stdint.h>
+#include <memory>
#include <string>
#include <set>
@@ -57,7 +58,6 @@ using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
using test::components::policy_test::MockPolicyHandlerInterface;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -211,7 +211,7 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
(*msg_vr)[am::strings::msg_params][am::strings::menu_params]
[am::strings::menu_name] = "menu_name";
- utils::SharedPtr<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr);
+ std::shared_ptr<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr);
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(kConnectionKey))
@@ -257,7 +257,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
msg_params[am::strings::soft_buttons] = "Soft_Buttons";
(*msg)[am::strings::msg_params] = msg_params;
SmartObject creation_msg_params(msg_params);
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -284,7 +284,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
SmartObject msg_params(smart_objects::SmartType_Map);
msg_params[am::strings::soft_buttons] = "";
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -309,7 +309,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
msg_params[am::strings::soft_buttons] = "Soft_Buttons";
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -336,7 +336,7 @@ TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
msg_params[am::strings::graphic] = graphic;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -354,6 +354,33 @@ TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
command->Run();
}
+TEST_F(ShowRequestTest, Run_Graphic_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
@@ -363,12 +390,12 @@ TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
msg_params[am::strings::graphic] = graphic;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
@@ -386,7 +413,7 @@ TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
msg_params[am::strings::graphic] = graphic;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -409,7 +436,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
msg_params[am::strings::secondary_graphic] = graphic;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -426,6 +453,32 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
command->Run();
}
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WARNINGS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
@@ -435,12 +488,12 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
msg_params[am::strings::secondary_graphic] = graphic;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
- .WillOnce(Return(mobile_apis::Result::ABORTED));
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
EXPECT_CALL(*mock_app_, app_id()).Times(0);
@@ -459,7 +512,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
msg_params[am::strings::secondary_graphic] = graphic;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -476,7 +529,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_1";
TestSetupHelper(msg,
@@ -489,7 +542,7 @@ TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) {
TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_1\\n";
TestSetupHelperWrongSyntax(msg,
@@ -502,7 +555,7 @@ TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) {
TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_2";
TestSetupHelper(msg,
@@ -514,7 +567,7 @@ TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) {
TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_2\\n";
TestSetupHelperWrongSyntax(msg,
@@ -526,7 +579,7 @@ TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) {
TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_3";
TestSetupHelper(msg,
@@ -538,7 +591,7 @@ TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) {
TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_3\\n";
TestSetupHelperWrongSyntax(msg,
@@ -550,7 +603,7 @@ TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) {
TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_4";
TestSetupHelper(msg,
@@ -562,7 +615,7 @@ TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) {
TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_4\\n";
TestSetupHelperWrongSyntax(msg,
@@ -574,7 +627,7 @@ TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) {
TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_1";
const size_t num_tags = 1;
@@ -590,7 +643,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) {
TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_1";
const size_t num_tags = 5;
@@ -610,7 +663,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) {
TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_2";
const size_t num_tags = 1;
@@ -626,7 +679,7 @@ TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) {
TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_3";
const size_t num_tags = 1;
@@ -642,7 +695,7 @@ TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) {
TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_4";
const size_t num_tags = 1;
@@ -658,7 +711,7 @@ TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) {
TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Main_Field_1";
const size_t num_tags = 1;
@@ -700,7 +753,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Media_Clock";
TestSetupHelper(msg,
@@ -712,7 +765,7 @@ TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) {
TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Media_Clock\\n";
TestSetupHelperWrongSyntax(msg,
@@ -724,7 +777,7 @@ TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) {
TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Media_Track";
TestSetupHelper(msg,
@@ -736,7 +789,7 @@ TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) {
TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Media_Track\\n";
TestSetupHelperWrongSyntax(msg,
@@ -748,7 +801,7 @@ TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) {
TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Status_Bar";
TestSetupHelper(
@@ -759,7 +812,7 @@ TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) {
TEST_F(ShowRequestTest, Run_StatusBar_WrongSyntax) {
MessageSharedPtr msg = CreateMessage();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
text_field_ = "Status_Bar\\n";
TestSetupHelperWrongSyntax(
@@ -773,7 +826,7 @@ TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) {
msg_params[am::strings::alignment] = "Alignment";
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -797,7 +850,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) {
msg_params[am::strings::custom_presets] = custom_presets;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -820,7 +873,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
msg_params[am::strings::custom_presets] = custom_presets;
(*msg)[am::strings::msg_params] = msg_params;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -836,7 +889,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(MockAppPtr()));
@@ -851,7 +904,7 @@ TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
MessageSharedPtr msg = CreateMsgParams();
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app_));
@@ -869,7 +922,7 @@ TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
hmi_apis::Common_Result::eType::SUCCESS;
(*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(mock_rpc_service_,
ManageMobileCommand(
MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _));
@@ -889,7 +942,7 @@ TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) {
(*msg)[am::strings::params][am::hmi_response::message] = "Response Info";
(*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
Event event(hmi_apis::FunctionID::UI_Show);
@@ -905,7 +958,7 @@ TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
(*msg)[am::strings::params][am::hmi_response::code] =
mobile_apis::Result::SUCCESS;
- SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
Event event(hmi_apis::FunctionID::UI_Alert);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
index dcdda55b1c..d96a9d7643 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/mock_message_helper.h"
@@ -85,7 +85,7 @@ MATCHER(CheckNotificationMessage, "") {
TYPED_TEST_CASE(MobileNotificationCommandsTest, NotificationCommandsList);
TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) {
- ::utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
EXPECT_CALL(this->mock_rpc_service_,
SendMessageToMobile(CheckNotificationMessage(), _));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
index cf1f7c6711..bbd39874e0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc
@@ -35,7 +35,7 @@
#include "gtest/gtest.h"
#include "utils/helpers.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
#include "mobile/delete_command_response.h"
@@ -125,7 +125,7 @@ typedef Types<commands::ListFilesResponse,
TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
- ::utils::SharedPtr<typename TestFixture::CommandType> command =
+ std::shared_ptr<typename TestFixture::CommandType> command =
this->template CreateCommand<typename TestFixture::CommandType>();
EXPECT_CALL(this->mock_rpc_service_, SendMessageToMobile(NotNull(), _));
command->Run();
@@ -154,7 +154,7 @@ MATCHER_P2(CheckMessageParams, success, result, "") {
TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- SharedPtr<commands::GenericResponse> command(
+ std::shared_ptr<commands::GenericResponse> command(
CreateCommand<commands::GenericResponse>(command_msg));
EXPECT_CALL(
@@ -175,7 +175,7 @@ TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
- SharedPtr<commands::ScrollableMessageResponse> command(
+ std::shared_ptr<commands::ScrollableMessageResponse> command(
CreateCommand<commands::ScrollableMessageResponse>(message));
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
index a039581284..be14aebc8f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc
@@ -57,12 +57,11 @@ using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
using policy_test::MockPolicyHandlerInterface;
-using ::utils::SharedPtr;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-typedef SharedPtr<SliderRequest> CommandPtr;
+typedef std::shared_ptr<SliderRequest> CommandPtr;
namespace {
const int32_t kCommandId = 1;
@@ -140,8 +139,7 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_ui = CreateFullParamsUISO();
(*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- utils::SharedPtr<SliderRequest> command =
- CreateCommand<SliderRequest>(msg_ui);
+ std::shared_ptr<SliderRequest> command = CreateCommand<SliderRequest>(msg_ui);
MockAppPtr mock_app = CreateMockApp();
ON_CALL(app_mngr_, application(kConnectionKey))
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
index ab086de0e6..9eb23eeee3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc
@@ -34,14 +34,14 @@
#include <string>
#include "gtest/gtest.h"
#include "mobile/speak_request.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
+
#include "utils/helpers.h"
-#include "utils/make_shared.h"
+
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/application.h"
@@ -68,13 +68,13 @@ using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
using ::testing::_;
-using ::utils::SharedPtr;
+
using ::testing::Return;
using ::testing::ReturnRef;
using sdl_rpc_plugin::commands::SpeakRequest;
using ::test::components::application_manager_test::MockApplication;
-typedef SharedPtr<SpeakRequest> CommandPtr;
+typedef std::shared_ptr<SpeakRequest> CommandPtr;
namespace {
const uint32_t kAppId = 10u;
@@ -92,7 +92,7 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
const mobile_apis::Result::eType mobile_response,
const am::HmiInterfaces::InterfaceState state,
const bool success) {
- utils::SharedPtr<SpeakRequest> command =
+ std::shared_ptr<SpeakRequest> command =
CreateCommand<SpeakRequest>(request_);
(*response_)[strings::params][hmi_response::code] = hmi_response;
@@ -129,8 +129,7 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
};
TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) {
- utils::SharedPtr<SpeakRequest> command =
- CreateCommand<SpeakRequest>(request_);
+ std::shared_ptr<SpeakRequest> command = CreateCommand<SpeakRequest>(request_);
(*response_)[strings::params][hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
index 17c4db36bc..0196b59b79 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -61,7 +61,7 @@ namespace am = ::application_manager;
using sdl_rpc_plugin::commands::SubscribeButtonRequest;
using am::commands::MessageSharedPtr;
-typedef SharedPtr<SubscribeButtonRequest> CommandPtr;
+typedef std::shared_ptr<SubscribeButtonRequest> CommandPtr;
class SubscribeButtonRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
@@ -73,12 +73,14 @@ class SubscribeButtonRequestTest
};
typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities;
+const utils::SemanticVersion mock_semantic_version(5, 0, 0);
+const utils::SemanticVersion mock_semantic_version_4_5(4, 5, 0);
TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
CommandPtr command(CreateCommand<SubscribeButtonRequest>());
ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
@@ -110,6 +112,9 @@ TEST_F(SubscribeButtonRequestTest, Run_UiIsNotSupported_UNSUCCESS) {
MockAppPtr app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(false));
+
ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
.WillByDefault(Return(false));
@@ -130,6 +135,7 @@ TEST_F(SubscribeButtonRequestTest, Run_IsSubscribedToButton_UNSUCCESS) {
MockAppPtr app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
@@ -160,6 +166,54 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version()).WillByDefault(ReturnRef(mock_semantic_version));
+ ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
+
+ ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillByDefault(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+
+ ON_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillByDefault(Return(button_caps_ptr.get()));
+
+ ON_CALL(*app, IsSubscribedToButton(_)).WillByDefault(Return(false));
+
+ MessageSharedPtr hmi_result_msg;
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true)));
+
+ MessageSharedPtr mobile_result_msg;
+ EXPECT_CALL(this->mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&mobile_result_msg), Return(true)));
+ ASSERT_TRUE(command->Init());
+ command->Run();
+
+ EXPECT_EQ(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*hmi_result_msg)[am::strings::params][am::strings::function_id]
+ .asInt()));
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS,
+ static_cast<mobile_apis::Result::eType>(
+ (*mobile_result_msg)[am::strings::msg_params]
+ [am::strings::result_code].asInt()));
+}
+
+TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Version_4_5) {
+ const mobile_apis::ButtonName::eType kButtonName =
+ mobile_apis::ButtonName::OK;
+
+ MessageSharedPtr msg(CreateMessage());
+ (*msg)[am::strings::msg_params][am::strings::button_name] = kButtonName;
+ CommandPtr command(CreateCommand<SubscribeButtonRequest>(msg));
+
+ MockAppPtr app(CreateMockApp());
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+ ON_CALL(*app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version_4_5));
ON_CALL(*app, is_media_application()).WillByDefault(Return(true));
ON_CALL(mock_hmi_capabilities_, is_ui_cooperating())
@@ -167,6 +221,8 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
(*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonName;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::PLAY_PAUSE;
ON_CALL(mock_hmi_capabilities_, button_capabilities())
.WillByDefault(Return(button_caps_ptr.get()));
@@ -189,6 +245,11 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
(*hmi_result_msg)[am::strings::params][am::strings::function_id]
.asInt()));
+ EXPECT_EQ(hmi_apis::Common_ButtonName::PLAY_PAUSE,
+ static_cast<hmi_apis::Common_ButtonName::eType>(
+ (*hmi_result_msg)[am::strings::msg_params][am::strings::name]
+ .asInt()));
+
EXPECT_EQ(mobile_apis::Result::SUCCESS,
static_cast<mobile_apis::Result::eType>(
(*mobile_result_msg)[am::strings::msg_params]
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
index e944c3eb39..d08c13b3f3 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -31,7 +31,7 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -61,7 +61,7 @@ namespace am = ::application_manager;
using sdl_rpc_plugin::commands::SubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
-typedef SharedPtr<SubscribeWayPointsRequest> CommandPtr;
+typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr;
class SubscribeWayPointsRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
index 7214e0eea4..9e6bc8f505 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc
@@ -58,7 +58,7 @@ using am::MockHmiInterfaces;
using am::event_engine::Event;
using am::MessageType;
using policy_test::MockPolicyHandlerInterface;
-using ::utils::SharedPtr;
+
using ::testing::_;
using ::testing::DoAll;
using ::testing::Return;
@@ -126,7 +126,7 @@ TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) {
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
- SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
command->Run();
}
@@ -163,7 +163,7 @@ TEST_F(SystemRequestTest,
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_))
.WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
- SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
ASSERT_TRUE(command->Init());
command->Run();
@@ -203,7 +203,7 @@ TEST_F(
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
- SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
ASSERT_TRUE(command->Init());
command->Run();
}
@@ -224,7 +224,7 @@ TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) {
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0);
- SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
ASSERT_TRUE(command->Init());
command->Run();
}
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
index 1c4df3a463..771374348b 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
@@ -54,7 +54,7 @@ using ::testing::_;
using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest;
using am::commands::MessageSharedPtr;
-typedef ::utils::SharedPtr<UnregisterAppInterfaceRequest> CommandPtr;
+typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr;
class UnregisterAppInterfaceRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {};
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
index 439e94b94f..d6bef42794 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc
@@ -2,7 +2,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
@@ -23,11 +23,13 @@ using ::testing::_;
using sdl_rpc_plugin::commands::UnsubscribeButtonRequest;
using am::commands::MessageSharedPtr;
-typedef ::utils::SharedPtr<UnsubscribeButtonRequest> CommandPtr;
+typedef std::shared_ptr<UnsubscribeButtonRequest> CommandPtr;
namespace {
const uint32_t kConnectionKey = 1u;
const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
+const utils::SemanticVersion mock_semantic_version(5, 0, 0);
+const utils::SemanticVersion mock_semantic_version_4_5(4, 5, 0);
} // namespace
class UnsubscribeButtonRequestTest
@@ -73,6 +75,8 @@ TEST_F(UnsubscribeButtonRequestTest,
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
.WillOnce(Return(false));
@@ -94,6 +98,8 @@ TEST_F(UnsubscribeButtonRequestTest,
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
.WillOnce(Return(true));
@@ -128,6 +134,8 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version));
EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
.WillOnce(Return(true));
@@ -143,6 +151,49 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
command->Run();
}
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS_Version_4_5) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] =
+ mobile_apis::ButtonName::OK;
+
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillRepeatedly(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::OK;
+ (*button_caps_ptr)[1][am::hmi_response::button_name] =
+ mobile_apis::ButtonName::PLAY_PAUSE;
+
+ EXPECT_CALL(mock_hmi_capabilities_, button_capabilities())
+ .WillRepeatedly(Return(button_caps_ptr.get()));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+ ON_CALL(*mock_app, msg_version())
+ .WillByDefault(ReturnRef(mock_semantic_version_4_5));
+ ON_CALL(*mock_app, is_media_application()).WillByDefault(Return(true));
+
+ EXPECT_CALL(*mock_app,
+ UnsubscribeFromButton(mobile_apis::ButtonName::PLAY_PAUSE))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_rpc_service_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)));
+ EXPECT_CALL(
+ mock_rpc_service_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ EXPECT_CALL(*mock_app, UpdateHash());
+ command->Init();
+ command->Run();
+}
+
} // namespace unsubscribe_button_request
} // namespace mobile_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
index a6e1eb0518..f345d719c6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc
@@ -36,7 +36,7 @@
#include "gtest/gtest.h"
#include "mobile/unsubscribe_way_points_request.h"
#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -59,7 +59,7 @@ namespace mobile_result = mobile_apis::Result;
using ::testing::_;
using ::testing::Return;
-using sdl_rpc_plugin::commands::UnSubscribeWayPointsRequest;
+using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
namespace {
@@ -67,21 +67,21 @@ const uint32_t kConnectionKey = 3u;
const uint32_t kAppId = 5u;
} // namespace
-class UnSubscribeWayPointsRequestTest
+class UnsubscribeWayPointsRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- UnSubscribeWayPointsRequestTest()
+ UnsubscribeWayPointsRequestTest()
: command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<UnSubscribeWayPointsRequest>(command_msg_)) {
+ , command_(CreateCommand<UnsubscribeWayPointsRequest>(command_msg_)) {
(*command_msg_)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
}
MessageSharedPtr command_msg_;
- ::utils::SharedPtr<UnSubscribeWayPointsRequest> command_;
+ std::shared_ptr<UnsubscribeWayPointsRequest> command_;
};
-TEST_F(UnSubscribeWayPointsRequestTest,
+TEST_F(UnsubscribeWayPointsRequestTest,
Run_ApplicationIsNotRegistered_UNSUCCESS) {
EXPECT_CALL(app_mngr_, application(_))
.WillOnce(Return(ApplicationSharedPtr()));
@@ -94,7 +94,7 @@ TEST_F(UnSubscribeWayPointsRequestTest,
command_->Run();
}
-TEST_F(UnSubscribeWayPointsRequestTest,
+TEST_F(UnsubscribeWayPointsRequestTest,
Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -112,7 +112,7 @@ TEST_F(UnSubscribeWayPointsRequestTest,
command_->Run();
}
-TEST_F(UnSubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
+TEST_F(UnsubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
@@ -129,7 +129,7 @@ TEST_F(UnSubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
command_->Run();
}
-TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+TEST_F(UnsubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
@@ -140,8 +140,8 @@ TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
command_->on_event(event);
}
-TEST_F(UnSubscribeWayPointsRequestTest,
- OnEvent_ReceivedNavigationUnSubscribeWayPointsEvent_SUCCESS) {
+TEST_F(UnsubscribeWayPointsRequestTest,
+ OnEvent_ReceivedNavigationUnsubscribeWayPointsEvent_SUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(mock_app));
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
index d1f59bb3a4..78fca8681a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc
@@ -36,7 +36,7 @@
#include "gtest/gtest.h"
#include "mobile/update_turn_list_request.h"
#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -88,7 +88,7 @@ class UpdateTurnListRequestTest
}
MessageSharedPtr command_msg_;
- ::utils::SharedPtr<UpdateTurnListRequest> command_;
+ std::shared_ptr<UpdateTurnListRequest> command_;
};
TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
@@ -214,7 +214,67 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) {
SubscribeApplicationToSoftButton(_, _, kFunctionId));
MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
- ASSERT_TRUE(result_msg);
+ ASSERT_TRUE((bool)result_msg);
+ EXPECT_EQ(
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ ASSERT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ .keyExists(am::hmi_request::navi_text));
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_name));
+ EXPECT_EQ(
+ hmi_apis::Common_TextFieldName::turnText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_name]
+ .asInt());
+
+ EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text].keyExists(
+ am::hmi_request::field_text));
+ EXPECT_EQ(
+ kNavigationText,
+ (*result_msg)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::hmi_request::navi_text][am::hmi_request::field_text]
+ .asString());
+}
+
+TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) {
+ const std::string kNavigationText = "valid_navigation_text";
+
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::navigation_text] = kNavigationText;
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon][am::strings::value] =
+ "valid_turn_icon";
+ (*command_msg_)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*command_msg_)[am::strings::msg_params],
+ Eq(mock_app),
+ Ref(mock_policy_handler_),
+ Ref(app_mngr_)))
+ .WillOnce(Return(mobile_result::SUCCESS));
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0]
+ [am::strings::turn_icon],
+ Eq(mock_app),
+ Ref(app_mngr_))).WillOnce(Return(mobile_result::WARNINGS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(_, _, kFunctionId));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ ASSERT_TRUE(result_msg != nullptr);
EXPECT_EQ(
hmi_apis::FunctionID::Navigation_UpdateTurnList,
(*result_msg)[am::strings::params][am::strings::function_id].asInt());
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
index 17ae1ffd09..04a131da8f 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h
@@ -73,22 +73,6 @@ class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl {
protected:
virtual void on_event(const app_mngr::event_engine::Event& event);
-#ifdef HMI_DBUS_API
- private:
- void SendRequestsToHmi(const int32_t app_id);
-
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
};
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 d324d5ca24..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
@@ -87,20 +87,6 @@ class SubscribeVehicleDataRequest
*/
bool Init() FINAL;
-#ifdef HMI_DBUS_API
- private:
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
private:
/**
* @brief Checks, if any app is subscribed for particular VI parameter
@@ -127,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/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
index 5730048b85..e04d1fb97a 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -84,20 +84,6 @@ class UnsubscribeVehicleDataRequest
*/
bool Init() FINAL;
-#ifdef HMI_DBUS_API
- private:
- struct HmiRequest {
- hmi_apis::Common_Result::eType status;
- bool complete;
- smart_objects::SmartObject value;
- const char* str;
- hmi_apis::FunctionID::eType func_id;
- };
-
- typedef std::vector<HmiRequest> HmiRequests;
- HmiRequests hmi_requests_;
-#endif // #ifdef HMI_DBUS_API
-
private:
/**
* @brief Checks, if any app is subscribed for particular VI parameter
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
index f7e6ae7887..ead6af841f 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h
@@ -99,8 +99,8 @@ class VehicleInfoAppExtension : public app_mngr::AppExtension {
* @brief SaveResumptionData saves vehicle info data
* @param resumption_data plase to store resumption data
*/
- void SaveResumptionData(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data) OVERRIDE;
+ void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data) OVERRIDE;
/**
* @brief ProcessResumption load resumtion data back to plugin during
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
index 3401849861..04bcc435ba 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc
@@ -100,7 +100,7 @@ void VIIsReadyRequest::onTimeOut() {
}
void VIIsReadyRequest::SendMessageToHMI() {
- utils::SharedPtr<smart_objects::SmartObject> get_type(
+ std::shared_ptr<smart_objects::SmartObject> get_type(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
application_manager_));
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
index 7c7a5e61f7..87a9ace377 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc
@@ -46,176 +46,6 @@ namespace commands {
namespace str = strings;
-#ifdef HMI_DBUS_API
-GetVehicleDataRequest::GetVehicleDataRequest(
- const application_manager::commands::MessageSharedPtr& message,
- ApplicationManager& application_manager,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message, application_manager) {}
-
-GetVehicleDataRequest::~GetVehicleDataRequest() {}
-
-void GetVehicleDataRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- int32_t app_id =
- (*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = application_manager_.application(app_id);
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const VehicleData& vehicle_data = MessageHelper::vehicle_data();
- VehicleData::const_iterator it = vehicle_data.begin();
-
- for (; vehicle_data.end() != it; ++it) {
- if (true == (*message_)[str::msg_params].keyExists(it->first) &&
- true == (*message_)[str::msg_params][it->first].asBool()) {
- SendRequestsToHmi(app->app_id());
- return;
- }
- }
-
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
-}
-
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps},
- {hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed},
- {hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm},
- {hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- str::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- str::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- str::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin},
- {hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl},
- {hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer},
- {hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- str::body_information},
- {hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status},
- {hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- str::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- str::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- str::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key},
-};
-}
-
-void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) {
- smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
- msg_params[strings::app_id] = app_id;
-
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[str::msg_params].keyExists(sr.str) &&
- true == (*message_)[str::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
-
- LOG4CXX_INFO(logger_,
- hmi_requests_.size() << " requests are going to be sent to HMI");
-
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- SendHMIRequest(it->func_id, &msg_params, true);
- }
-}
-
-void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event " << event.id());
-
- const smart_objects::SmartObject& message = event.smart_object();
-
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[str::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
-
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
-
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
- const char* info = NULL;
- std::string error_message;
- if (true == message[strings::params].keyExists(strings::error_msg)) {
- error_message = message[strings::params][strings::error_msg].asString();
- info = error_message.c_str();
- }
- SendResponse(any_arg_success, status, info, &response_params);
- }
-}
-#else
GetVehicleDataRequest::GetVehicleDataRequest(
const application_manager::commands::MessageSharedPtr& message,
ApplicationManager& application_manager,
@@ -312,8 +142,6 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
}
}
-#endif // #ifdef HMI_DBUS_API
-
} // namespace commands
} // namespace application_manager
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 27716855a2..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
@@ -1,26 +1,19 @@
/*
-
Copyright (c) 2018, Ford Motor Company
All rights reserved.
-
Copyright (c) 2018, Livio, Inc.
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
@@ -59,59 +52,6 @@ SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {}
-#ifdef HMI_DBUS_API
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
-};
-}
-#endif // #ifdef HMI_DBUS_API
-
void SubscribeVehicleDataRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -140,33 +80,10 @@ void SubscribeVehicleDataRequest::Run() {
return;
}
-#ifdef HMI_DBUS_API
- // Generate list of subrequests
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[strings::msg_params].keyExists(sr.str) &&
- true == (*message_)[strings::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
- LOG4CXX_DEBUG(
- logger_, hmi_requests_.size() << " requests are going to be sent to HMI");
-
- // Send subrequests
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it)
- SendHMIRequest(it->func_id, &msg_params, true);
-#else
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
&msg_params,
true);
-#endif // #ifdef HMI_DBUS_API
}
void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
@@ -188,64 +105,6 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
return;
}
-#ifdef HMI_DBUS_API
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[strings::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
-
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
- LOG4CXX_DEBUG(logger_, "All HMI requests are complete");
- const bool result = any_arg_success;
- SendResponse(any_arg_success, status, NULL, &response_params);
- if (result) {
- app->UpdateHash();
- }
- }
-#else
-
hmi_apis::Common_Result::eType hmi_result =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -288,7 +147,6 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
result_code,
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
-#endif // #ifdef HMI_DBUS_API
}
bool SubscribeVehicleDataRequest::Init() {
@@ -376,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/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
index de419894c5..d0152ea0c3 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -60,60 +60,6 @@ UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {}
-#ifdef HMI_DBUS_API
-namespace {
-struct Subrequest {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-Subrequest subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key},
-};
-}
-#endif // #ifdef HMI_DBUS_API
-
void UnsubscribeVehicleDataRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -226,33 +172,10 @@ void UnsubscribeVehicleDataRequest::Run() {
return;
}
-#ifdef HMI_DBUS_API
- // Generate list of subrequests
- for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
- const Subrequest& sr = subrequests[i];
- if (true == (*message_)[strings::msg_params].keyExists(sr.str) &&
- true == (*message_)[strings::msg_params][sr.str].asBool()) {
- HmiRequest hmi_request;
- hmi_request.str = sr.str;
- hmi_request.func_id = sr.func_id;
- hmi_request.complete = false;
- hmi_requests_.push_back(hmi_request);
- }
- }
- LOG4CXX_INFO(logger_,
- hmi_requests_.size() << " requests are going to be sent to HMI");
-
- // Send subrequests
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it)
- SendHMIRequest(it->func_id, &msg_params, true);
-#else
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
&msg_params,
true);
-#endif // #ifdef HMI_DBUS_API
}
void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
@@ -275,65 +198,6 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
return;
}
-#ifdef HMI_DBUS_API
- for (HmiRequests::iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- HmiRequest& hmi_request = *it;
- if (hmi_request.func_id == event.id()) {
- hmi_request.status = static_cast<hmi_apis::Common_Result::eType>(
- message[strings::params][hmi_response::code].asInt());
- if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
- hmi_request.value = message[strings::msg_params][hmi_request.str];
- hmi_request.complete = true;
- break;
- }
- }
- bool all_complete = true;
- bool any_arg_success = false;
- mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- if (!it->complete) {
- all_complete = false;
- break;
- }
- if (hmi_apis::Common_Result::SUCCESS != it->status) {
- if (mobile_api::Result::SUCCESS == status) {
- status = static_cast<mobile_apis::Result::eType>(it->status);
- } else if (status !=
- static_cast<mobile_apis::Result::eType>(it->status)) {
- status = mobile_api::Result::eType::GENERIC_ERROR;
- }
- LOG4CXX_TRACE(logger_,
- "Status from HMI: " << it->status
- << ", so response status become "
- << status);
- } else {
- any_arg_success = true;
- }
- }
- if (all_complete) {
- smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
- if (any_arg_success) {
- for (HmiRequests::const_iterator it = hmi_requests_.begin();
- it != hmi_requests_.end();
- ++it) {
- response_params[it->str] = it->value;
- }
- }
-
- LOG4CXX_INFO(logger_, "All HMI requests are complete");
- if (true == any_arg_success) {
- SetAllowedToTerminate(false);
- }
- SendResponse(any_arg_success, status, NULL, &response_params);
- if (true == any_arg_success) {
- app->UpdateHash();
- }
- }
-#else
hmi_apis::Common_Result::eType hmi_result =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -369,7 +233,6 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
application_manager_.TerminateRequest(
connection_key(), correlation_id(), function_id());
}
-#endif // #ifdef HMI_DBUS_API
}
bool UnsubscribeVehicleDataRequest::Init() {
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
index ed4755a818..3b1d411841 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc
@@ -118,8 +118,7 @@ VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension(
DCHECK(ext_ptr);
DCHECK(dynamic_cast<VehicleInfoAppExtension*>(ext_ptr.get()));
auto vi_app_extension =
- application_manager::AppExtensionPtr::static_pointer_cast<
- VehicleInfoAppExtension>(ext_ptr);
+ std::static_pointer_cast<VehicleInfoAppExtension>(ext_ptr);
DCHECK(vi_app_extension);
return *vi_app_extension;
}
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/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
index 7b94d22312..bd8eb1920d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc
@@ -74,7 +74,8 @@ void VehicleInfoPlugin::OnApplicationEvent(
plugins::ApplicationEvent event,
app_mngr::ApplicationSharedPtr application) {
if (plugins::ApplicationEvent::kApplicationRegistered == event) {
- application->AddExtension(new VehicleInfoAppExtension(*this, *application));
+ application->AddExtension(
+ std::make_shared<VehicleInfoAppExtension>(*this, *application));
}
}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
index ddfc8e8a55..0508f0cdd6 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc
@@ -35,7 +35,7 @@
#include <vector>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -65,7 +65,7 @@ using vehicle_info_plugin::commands::VIGetVehicleDataResponse;
using am::event_engine::Event;
using test::components::event_engine_test::MockEventDispatcher;
-typedef SharedPtr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
+typedef std::shared_ptr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
index d0093f45cf..d4477d5d5f 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc
@@ -33,7 +33,7 @@
#include "hmi/vi_is_ready_request.h"
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/command_request_test.h"
@@ -59,7 +59,7 @@ using am::commands::MessageSharedPtr;
using vehicle_info_plugin::commands::VIIsReadyRequest;
using am::event_engine::Event;
-typedef SharedPtr<VIIsReadyRequest> VIIsReadyRequestPtr;
+typedef std::shared_ptr<VIIsReadyRequest> VIIsReadyRequestPtr;
class VIIsReadyRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
index 3f684cae3f..9cdf60b1ea 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc
@@ -35,7 +35,7 @@
#include <vector>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -63,7 +63,7 @@ using vehicle_info_plugin::commands::DiagnosticMessageRequest;
using am::event_engine::Event;
namespace mobile_result = mobile_apis::Result;
-typedef SharedPtr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
+typedef std::shared_ptr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
index 9719d3ceed..4473a36c63 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc
@@ -35,7 +35,7 @@
#include <vector>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -64,7 +64,7 @@ using am::MockMessageHelper;
using testing::Mock;
namespace mobile_result = mobile_apis::Result;
-typedef SharedPtr<GetDTCsRequest> GetDTCsRequestPtr;
+typedef std::shared_ptr<GetDTCsRequest> GetDTCsRequestPtr;
class GetDTCsRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
index d8e4c3d075..a88d362968 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -35,7 +35,7 @@
#include <vector>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -63,7 +63,7 @@ using vehicle_info_plugin::commands::GetVehicleDataRequest;
using am::event_engine::Event;
namespace mobile_result = mobile_apis::Result;
-typedef SharedPtr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
+typedef std::shared_ptr<GetVehicleDataRequest> GetVehicleDataRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
@@ -92,10 +92,6 @@ class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest {
using GetVehicleDataRequest::on_event;
};
-#ifdef HMI_DBUS_API
-// HMI_DBUS_API currently not supported
-#else
-
TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
GetVehicleDataRequestPtr command(CreateCommand<GetVehicleDataRequest>());
@@ -164,7 +160,7 @@ TEST_F(GetVehicleDataRequestTest,
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
- SharedPtr<UnwrappedGetVehicleDataRequest> command(
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
const am::VehicleData kEmptyVehicleData;
@@ -216,7 +212,7 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
- SharedPtr<UnwrappedGetVehicleDataRequest> command(
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
Event event(hmi_apis::FunctionID::INVALID_ENUM);
@@ -236,7 +232,7 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
- SharedPtr<UnwrappedGetVehicleDataRequest> command(
+ std::shared_ptr<UnwrappedGetVehicleDataRequest> command(
CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
@@ -253,8 +249,6 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
command->on_event(event);
}
-#endif // HMI_DBUS_API
-
} // namespace get_vehicle_data_request
} // namespace mobile_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
index 3cc5af575e..1e8a289637 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -36,7 +36,7 @@
#include "gtest/gtest.h"
#include "mobile/on_vehicle_data_notification.h"
-#include "utils/shared_ptr.h"
+
#include "utils/custom_string.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -61,7 +61,7 @@ using ::testing::ReturnRef;
using am::commands::MessageSharedPtr;
using vehicle_info_plugin::commands::OnVehicleDataNotification;
-typedef ::utils::SharedPtr<OnVehicleDataNotification> NotificationPtr;
+typedef std::shared_ptr<OnVehicleDataNotification> NotificationPtr;
namespace {
const uint32_t kAppId = 1u;
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
index 7cdeb2541c..c0a07fb57c 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
@@ -62,14 +62,13 @@ namespace am = ::application_manager;
using vehicle_info_plugin::commands::ReadDIDRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using ::utils::SharedPtr;
class ReadDIDRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {};
TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
Event event(Event::EventID::INVALID_ENUM);
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0);
command->on_event(event);
}
@@ -77,7 +76,7 @@ TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
Event event(Event::EventID::VehicleInfo_ReadDID);
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
const hmi_apis::Common_Result::eType hmi_response_code =
hmi_apis::Common_Result::SUCCESS;
@@ -99,10 +98,10 @@ TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
}
TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
ON_CALL(app_mngr_, application(_))
- .WillByDefault(Return(SharedPtr<am::Application>()));
+ .WillByDefault(Return(std::shared_ptr<am::Application>()));
MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED,
@@ -112,7 +111,7 @@ TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
}
TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) {
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
MockAppPtr app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
@@ -128,7 +127,7 @@ TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) {
TEST_F(ReadDIDRequestTest, Run_EmptyDidLocation_UNSUCCESS) {
MockAppPtr app(CreateMockApp());
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
@@ -145,7 +144,7 @@ TEST_F(ReadDIDRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
(*msg)[am::strings::msg_params][am::strings::did_location]["SomeData"] = 0;
- SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg));
+ std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg));
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
index 369a37e388..323334de2d 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
@@ -56,7 +56,7 @@ using ::testing::_;
using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest;
using am::commands::MessageSharedPtr;
-typedef ::utils::SharedPtr<UnsubscribeVehicleDataRequest> CommandPtr;
+typedef std::shared_ptr<UnsubscribeVehicleDataRequest> CommandPtr;
namespace {
const uint32_t kConnectionKey = 1u;
@@ -71,7 +71,7 @@ class UnsubscribeVehicleRequestTest
UnsubscribeVehicleRequestTest()
: mock_app_(CreateMockApp())
, vi_app_extension_ptr_(
- utils::MakeShared<vehicle_info_plugin::VehicleInfoAppExtension>(
+ std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>(
vi_plugin_, *mock_app_))
, app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
index bed9cffeb2..a0d4699de8 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc
@@ -34,7 +34,7 @@
#include <stdint.h>
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "application_manager/commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
@@ -66,10 +66,10 @@ MATCHER_P(ResultCodeIs, result_code, "") {
TEST_F(UnsubscribeVehicleResponseTest,
Run_SendFalseResponseToMobile_SendInvalidEnum) {
MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
(*command_msg)[am::strings::msg_params][am::strings::success] = false;
- ::utils::SharedPtr<UnsubscribeVehicleDataResponse> command =
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
EXPECT_CALL(
@@ -81,9 +81,9 @@ TEST_F(UnsubscribeVehicleResponseTest,
TEST_F(UnsubscribeVehicleResponseTest,
Run_SendSuccessfulResponseToMobile_SUCCESS) {
MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
(*command_msg)[am::strings::msg_params][am::strings::success] = true;
- ::utils::SharedPtr<UnsubscribeVehicleDataResponse> command =
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
EXPECT_CALL(
@@ -95,13 +95,13 @@ TEST_F(UnsubscribeVehicleResponseTest,
TEST_F(UnsubscribeVehicleResponseTest,
Run_SendResponseToMobile_SendCodeToMobile) {
MessageSharedPtr command_msg =
- ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
(*command_msg)[am::strings::msg_params][am::strings::success] = true;
mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS;
(*command_msg)[am::strings::msg_params][am::strings::result_code] =
result_type;
- ::utils::SharedPtr<UnsubscribeVehicleDataResponse> command =
+ std::shared_ptr<UnsubscribeVehicleDataResponse> command =
CreateCommand<UnsubscribeVehicleDataResponse>(command_msg);
command->Run();
diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
index 481635d8e6..8df3d436bd 100644
--- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
@@ -38,7 +38,6 @@
#include "connection_handler/connection_handler.h"
#include "application_manager/application.h"
#include "utils/timer_task_impl.h"
-#include "utils/make_shared.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -60,7 +59,7 @@ void AppLaunchCtrlImpl::OnAppRegistered(
const application_manager::Application& app) {
LOG4CXX_AUTO_TRACE(logger_);
// TODO (AKutsan) : get device mac
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
app.policy_app_id(), app.bundle_id(), app.mac_address());
apps_launcher_.OnLaunched(app_data);
app_launch_data_.AddApplicationData(*app_data);
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
index f3adfc749b..393b01c952 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc
@@ -37,7 +37,6 @@
#include "application_manager/app_launch/app_launch_sql_queries.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/message_helper.h"
-#include "utils/make_shared.h"
namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
@@ -276,7 +275,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataDB::GetAppDataByDevMac(
const std::string device_mac = query.GetString(device_mac_index);
const std::string mobile_app_id = query.GetString(application_id_index);
const std::string bundle_id = query.GetString(bundle_id_index);
- dev_apps.push_back(utils::MakeShared<ApplicationData>(
+ dev_apps.push_back(std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac));
} while (query.Next());
LOG4CXX_DEBUG(logger_, "All application data has been successfully loaded");
@@ -384,7 +383,7 @@ bool AppLaunchDataDB::WriteDb() {
utils::dbms::SQLDatabase* AppLaunchDataDB::db() const {
#ifdef __QNX__
- std::auto_ptr<utils::dbms::SQLDatabase> db_qnx(
+ std::unique_ptr<utils::dbms::SQLDatabase> db_qnx(
new utils::dbms::SQLDatabase(kDatabaseName));
db_qnx.get()->Open();
return db_qnx.get();
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
index 7599dcccb3..d3e3b7d445 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
@@ -33,7 +33,7 @@
#include "application_manager/app_launch/app_launch_data_json.h"
#include "application_manager/smart_object_keys.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "utils/date_time.h"
#include "json/json.h"
@@ -43,9 +43,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
AppLaunchDataJson::AppLaunchDataJson(const AppLaunchSettings& settings,
resumption::LastState& last_state)
- : AppLaunchDataImpl(settings)
- , app_launch_json_lock_(true)
- , last_state_(last_state) {}
+ : AppLaunchDataImpl(settings), last_state_(last_state) {}
AppLaunchDataJson::~AppLaunchDataJson() {}
@@ -133,7 +131,7 @@ bool AppLaunchDataJson::RefreshAppSessionTime(const ApplicationData& app_data) {
if (index != NotFound) {
if (json_data_list.empty() == false) {
json_data_list[index][strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ static_cast<Json::Value::UInt64>(getSecs(getCurrentTime()));
retVal = true;
}
}
@@ -152,7 +150,7 @@ bool AppLaunchDataJson::AddNewAppData(const ApplicationData& app_data) {
json_app_data[strings::app_id] = app_data.mobile_app_id_;
json_app_data[strings::bundle_id] = app_data.bundle_id_;
json_app_data[strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(DateTime::getCurrentTime().tv_sec);
+ static_cast<Json::Value::UInt64>(getSecs(getCurrentTime()));
LOG4CXX_DEBUG(logger_,
"New application data saved. Detatils device_id: "
@@ -185,7 +183,7 @@ std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac(
if (deviceMac == dev_mac) {
dev_apps.push_back(
- utils::MakeShared<ApplicationData>(appID, bundleID, deviceMac));
+ std::make_shared<ApplicationData>(appID, bundleID, deviceMac));
}
}
}
diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc
index bf3ce1e0a9..f3851482c1 100644
--- a/src/components/application_manager/src/app_launch/apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/apps_launcher.cc
@@ -1,6 +1,6 @@
#include <algorithm>
#include "application_manager/app_launch/apps_launcher.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include <iostream>
@@ -15,7 +15,7 @@ struct LauncherGenerator {
, app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
, app_launch_retry_wait_time_(app_launch_retry_wait_time) {}
AppsLauncher::LauncherPtr operator()() {
- return utils::MakeShared<AppsLauncher::Launcher>(
+ return std::make_shared<AppsLauncher::Launcher>(
apps_laucnher_,
connection_handler_,
app_launch_max_retry_attempt_,
diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
index 0eb9245cf8..a4468d87bc 100644
--- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
@@ -6,8 +6,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/app_launch/apps_launcher.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/timer.h"
#include "utils/timer_task_impl.h"
#include <iostream>
@@ -16,7 +15,7 @@ namespace app_launch {
CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch")
typedef std::pair<std::string, std::vector<ApplicationDataPtr> > AppsOnDevice;
-typedef utils::SharedPtr<AppsOnDevice> AppsOnDevicePtr;
+typedef std::shared_ptr<AppsOnDevice> AppsOnDevicePtr;
class Launcher {
public:
@@ -61,7 +60,7 @@ class Launcher {
} else {
LOG4CXX_DEBUG(logger_,
"All Apps on " << apps_on_device_->first
- << " posponed launched");
+ << " postponed launched");
device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first);
}
}
@@ -95,7 +94,7 @@ class Launcher {
AppsOnDevicePtr apps_on_device_;
};
-typedef utils::SharedPtr<Launcher> LauncherPtr;
+typedef std::shared_ptr<Launcher> LauncherPtr;
typedef std::vector<LauncherPtr> Launchers;
struct LauncherGenerator {
@@ -107,8 +106,7 @@ struct LauncherGenerator {
, apps_launcher_(apps_launcher) {}
LauncherPtr operator()() const {
- return utils::MakeShared<Launcher>(
- resume_ctrl_, interface_, apps_launcher_);
+ return std::make_shared<Launcher>(resume_ctrl_, interface_, apps_launcher_);
}
resumption::ResumeCtrl& resume_ctrl_;
@@ -116,71 +114,59 @@ struct LauncherGenerator {
AppsLauncher& apps_launcher_;
};
-class DeviceAppsLauncherImpl {
- public:
- DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
- AppsLauncher& apps_launcher)
- : interface_(interface) {
- sync_primitives::AutoLock lock(launchers_lock_);
- LauncherGenerator generate(
- interface.app_mngr_.resume_controller(), interface, apps_launcher);
- free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
- std::generate_n(std::back_inserter(free_launchers_),
- interface.settings_.max_number_of_ios_device(),
- generate);
- }
-
- bool LaunchAppsOnDevice(
- const std::string& device_mac,
- const std::vector<ApplicationDataPtr>& applications_to_launch) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "On Device " << device_mac << " will be launched "
- << applications_to_launch.size() << " apps");
- AppsOnDevicePtr apps_on_device =
- utils::MakeShared<AppsOnDevice>(device_mac, applications_to_launch);
- sync_primitives::AutoLock lock(launchers_lock_);
- DCHECK_OR_RETURN(!free_launchers_.empty(), false)
- const Launchers::iterator it = free_launchers_.begin();
- LauncherPtr launcher = *it;
- works_launchers_.push_back(launcher);
- free_launchers_.erase(it);
- launcher->Start(apps_on_device);
- return true;
- }
+// DeviceAppsLauncherImpl member function definitions
+DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface,
+ AppsLauncher& apps_launcher)
+ : interface_(interface) {
+ sync_primitives::AutoLock lock(launchers_lock_);
+ LauncherGenerator generate(
+ interface.app_mngr_.resume_controller(), interface, apps_launcher);
+ free_launchers_.reserve(interface.settings_.max_number_of_ios_device());
+ std::generate_n(std::back_inserter(free_launchers_),
+ interface.settings_.max_number_of_ios_device(),
+ generate);
+}
- struct LauncherFinder {
- LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {}
+bool DeviceAppsLauncherImpl::LauncherFinder::operator()(
+ const std::shared_ptr<Launcher>& launcher) const {
+ return device_mac_ == launcher->apps_on_device_->first;
+}
- bool operator()(const LauncherPtr& launcher) const {
- return device_mac_ == launcher->apps_on_device_->first;
- }
+bool DeviceAppsLauncherImpl::LaunchAppsOnDevice(
+ const std::string& device_mac,
+ const std::vector<ApplicationDataPtr>& applications_to_launch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "On Device " << device_mac << " will be launched "
+ << applications_to_launch.size() << " apps");
+ AppsOnDevicePtr apps_on_device =
+ std::make_shared<AppsOnDevice>(device_mac, applications_to_launch);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ DCHECK_OR_RETURN(!free_launchers_.empty(), false)
+ const Launchers::iterator it = free_launchers_.begin();
+ LauncherPtr launcher = *it;
+ works_launchers_.push_back(launcher);
+ free_launchers_.erase(it);
+ launcher->Start(apps_on_device);
+ return true;
+}
- std::string device_mac_;
- };
-
- bool StopLaunchingAppsOnDevice(const std::string& device_mac) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock lock(launchers_lock_);
- const Launchers::iterator it = std::find_if(works_launchers_.begin(),
- works_launchers_.end(),
- LauncherFinder(device_mac));
- if (it == works_launchers_.end()) {
- return false;
- }
- LauncherPtr launcher = *it;
- launcher->Clear();
- free_launchers_.push_back(launcher);
- works_launchers_.erase(it);
- return true;
+bool DeviceAppsLauncherImpl::StopLaunchingAppsOnDevice(
+ const std::string& device_mac) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(launchers_lock_);
+ const Launchers::iterator it = std::find_if(works_launchers_.begin(),
+ works_launchers_.end(),
+ LauncherFinder(device_mac));
+ if (it == works_launchers_.end()) {
+ return false;
}
-
- private:
- sync_primitives::Lock launchers_lock_;
- Launchers free_launchers_;
- Launchers works_launchers_;
- DeviceAppsLauncher& interface_;
-};
+ LauncherPtr launcher = *it;
+ launcher->Clear();
+ free_launchers_.push_back(launcher);
+ works_launchers_.erase(it);
+ return true;
+}
bool DeviceAppsLauncher::LaunchAppsOnDevice(
const std::string& device_mac,
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
index f271b7ff6a..0636748977 100644
--- a/src/components/application_manager/src/application_data_impl.cc
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -103,6 +103,10 @@ const mobile_api::Language::eType& InitialApplicationDataImpl::ui_language()
return ui_language_;
}
+const utils::SemanticVersion& InitialApplicationDataImpl::msg_version() const {
+ return msg_version_;
+}
+
void InitialApplicationDataImpl::set_app_types(
const smart_objects::SmartObject& app_types) {
if (app_types_) {
@@ -153,6 +157,11 @@ void InitialApplicationDataImpl::set_ui_language(
ui_language_ = ui_language;
}
+void InitialApplicationDataImpl::set_msg_version(
+ const utils::SemanticVersion& version) {
+ msg_version_ = version;
+}
+
void InitialApplicationDataImpl::set_perform_interaction_layout(
mobile_apis::LayoutMode::eType layout) {
perform_interaction_layout_ = layout;
@@ -178,13 +187,14 @@ DynamicApplicationDataImpl::DynamicApplicationDataImpl()
, night_color_scheme_(NULL)
, display_layout_("")
, commands_()
- , commands_lock_ptr_(new sync_primitives::Lock(true))
+ , commands_lock_ptr_(std::make_shared<sync_primitives::RecursiveLock>())
, sub_menu_()
, sub_menu_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, choice_set_map_()
, choice_set_map_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, performinteraction_choice_set_map_()
- , performinteraction_choice_set_lock_ptr_(new sync_primitives::Lock(true))
+ , performinteraction_choice_set_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, is_perform_interaction_active_(false)
, is_reset_global_properties_active_(false)
, perform_interaction_mode_(-1) {}
@@ -460,7 +470,7 @@ void DynamicApplicationDataImpl::set_display_layout(const std::string& layout) {
void DynamicApplicationDataImpl::SetGlobalProperties(
const smart_objects::SmartObject& param,
void (DynamicApplicationData::*callback)(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject&)) {
smart_objects::SmartType so_type = param.getType();
if (so_type != smart_objects::SmartType::SmartType_Invalid &&
so_type != smart_objects::SmartType::SmartType_Null) {
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 3242dace4d..1168d94245 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -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
@@ -41,8 +41,7 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/gen_hash.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
@@ -83,8 +82,8 @@ void SwitchApplicationParameters(ApplicationSharedPtr app,
const size_t device_id,
const std::string& mac_address) {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<ApplicationImpl> application =
- ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app);
+ std::shared_ptr<ApplicationImpl> application =
+ std::dynamic_pointer_cast<ApplicationImpl>(app);
DCHECK_OR_RETURN_VOID(application);
application->app_id_ = app_id;
application->device_id_ = device_id;
@@ -97,7 +96,7 @@ ApplicationImpl::ApplicationImpl(
const std::string& mac_address,
const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager)
: grammar_id_(0)
, hmi_app_id_(0)
@@ -124,11 +123,14 @@ ApplicationImpl::ApplicationImpl(
, list_files_in_none_count_(0)
, mac_address_(mac_address)
, device_id_(device_id)
+ , secondary_device_id_(0)
, usage_report_(mobile_app_id, statistics_manager)
+ , help_prompt_manager_impl_(*this, application_manager)
, protocol_version_(
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)
, is_voice_communication_application_(false)
, is_resuming_(false)
+ , deferred_resumption_hmi_level_(mobile_api::HMILevel::eType::INVALID_ENUM)
, is_hash_changed_during_suspend_(false)
, video_stream_retry_number_(0)
, audio_stream_retry_number_(0)
@@ -144,9 +146,9 @@ ApplicationImpl::ApplicationImpl(
, button_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, application_manager_(application_manager) {
cmd_number_to_time_limits_[mobile_apis::FunctionID::ReadDIDID] = {
- date_time::DateTime::getCurrentTime(), 0};
+ date_time::getCurrentTime(), 0};
cmd_number_to_time_limits_[mobile_apis::FunctionID::GetVehicleDataID] = {
- date_time::DateTime::getCurrentTime(), 0};
+ date_time::getCurrentTime(), 0};
set_mobile_app_id(mobile_app_id);
set_name(app_name);
@@ -312,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);
}
@@ -389,6 +398,10 @@ connection_handler::DeviceHandle ApplicationImpl::device() const {
return device_id_;
}
+connection_handler::DeviceHandle ApplicationImpl::secondary_device() const {
+ return secondary_device_id_;
+}
+
const std::string& ApplicationImpl::mac_address() const {
return mac_address_;
}
@@ -502,6 +515,9 @@ void ApplicationImpl::StopStreamingForce(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // see the comment in StopStreaming()
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
SuspendStreaming(service_type);
if (service_type == ServiceType::kMobileNav) {
@@ -516,6 +532,12 @@ void ApplicationImpl::StopStreaming(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // since WakeUpStreaming() is called from another thread, it is possible that
+ // the stream will be restarted after we call SuspendStreaming() and before
+ // we call StopXxxStreaming(). To avoid such timing issue, make sure that
+ // we run SuspendStreaming() and StopXxxStreaming() atomically.
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
SuspendStreaming(service_type);
if (service_type == ServiceType::kMobileNav && video_streaming_approved()) {
@@ -566,6 +588,10 @@ void ApplicationImpl::WakeUpStreaming(
using namespace protocol_handler;
LOG4CXX_AUTO_TRACE(logger_);
+ // See the comment in StopStreaming(). Also, please make sure that we acquire
+ // streaming_stop_lock_ then xxx_streaming_suspended_lock_ in this order!
+ sync_primitives::AutoLock lock(streaming_stop_lock_);
+
if (ServiceType::kMobileNav == service_type) {
sync_primitives::AutoLock lock(video_streaming_suspended_lock_);
if (video_streaming_suspended_) {
@@ -645,8 +671,9 @@ 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;
}
uint32_t ApplicationImpl::get_grammar_id() const {
@@ -694,6 +721,16 @@ bool ApplicationImpl::is_resuming() const {
return is_resuming_;
}
+void ApplicationImpl::set_deferred_resumption_hmi_level(
+ mobile_api::HMILevel::eType level) {
+ deferred_resumption_hmi_level_ = level;
+}
+
+mobile_api::HMILevel::eType ApplicationImpl::deferred_resumption_hmi_level()
+ const {
+ return deferred_resumption_hmi_level_;
+}
+
bool ApplicationImpl::AddFile(const AppFile& file) {
if (app_files_.count(file.file_name) == 0) {
LOG4CXX_INFO(logger_,
@@ -763,9 +800,13 @@ UsageStatistics& ApplicationImpl::usage_report() {
return usage_report_;
}
+HelpPromptManager& ApplicationImpl::help_prompt_manager() {
+ return help_prompt_manager_impl_;
+}
+
bool ApplicationImpl::AreCommandLimitsExceeded(
mobile_apis::FunctionID::eType cmd_id, TLimitSource source) {
- TimevalStruct current = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current = date_time::getCurrentTime();
switch (source) {
// In case of config file values there is COMMON limitations for number of
// commands per certain time in seconds, i.e. 5 requests per 10 seconds with
@@ -797,13 +838,14 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
LOG4CXX_INFO(logger_,
"Time Info: "
- << "\n Current: " << current.tv_sec << "\n Limit: ("
- << limit.first.tv_sec << "," << limit.second
- << ")"
- "\n frequency_restrictions: ("
+ << "\n Current: " << date_time::getSecs(current)
+ << "\n Limit: (" << date_time::getSecs(limit.first)
+ << "," << limit.second << ")"
+ "\n frequency_restrictions: ("
<< frequency_restrictions.first << ","
<< frequency_restrictions.second << ")");
- if (current.tv_sec < limit.first.tv_sec + frequency_restrictions.second) {
+ if (date_time::getSecs(current) <
+ date_time::getSecs(limit.first) + frequency_restrictions.second) {
if (limit.second < frequency_restrictions.first) {
++limit.second;
return false;
@@ -845,7 +887,8 @@ bool ApplicationImpl::AreCommandLimitsExceeded(
TimeToNumberLimit& limit = it->second;
// Checking even limitation for command
- if (static_cast<uint32_t>(current.tv_sec - limit.first.tv_sec) <
+ if (static_cast<uint32_t>(date_time::getSecs(current) -
+ date_time::getSecs(limit.first)) <
minute / cmd_limit) {
return true;
}
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 35deddfc8d..3f877895ef 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -65,7 +65,6 @@
#include "utils/threads/thread.h"
#include "utils/file_system.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
#include "utils/timer_task_impl.h"
#include "smart_objects/enum_schema_item.h"
#include "interfaces/HMI_API_schema.h"
@@ -93,7 +92,13 @@ DeviceTypes devicesType = {
hmi_apis::Common_TransportType::BLUETOOTH),
std::make_pair(std::string("BLUETOOTH_IOS"),
hmi_apis::Common_TransportType::BLUETOOTH),
- std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI)};
+ std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI),
+ std::make_pair(std::string("USB_IOS_HOST_MODE"),
+ hmi_apis::Common_TransportType::USB_IOS),
+ std::make_pair(std::string("USB_IOS_DEVICE_MODE"),
+ hmi_apis::Common_TransportType::USB_IOS),
+ std::make_pair(std::string("CARPLAY_WIRELESS_IOS"),
+ hmi_apis::Common_TransportType::WIFI)};
}
/**
@@ -128,21 +133,21 @@ bool policy_app_id_comparator(const std::string& policy_app_id,
uint32_t ApplicationManagerImpl::corelation_id_ = 0;
const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
ApplicationManagerImpl::ApplicationManagerImpl(
const ApplicationManagerSettings& am_settings,
const policy::PolicySettings& policy_settings)
: settings_(am_settings)
- , applications_list_lock_ptr_(std::make_shared<sync_primitives::Lock>(true))
+ , applications_list_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, apps_to_register_list_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, audio_pass_thru_active_(false)
, audio_pass_thru_app_id_(0)
- , driver_distraction_state_(
- hmi_apis::Common_DriverDistractionState::INVALID_ENUM)
+ , driver_distraction_state_(hmi_apis::Common_DriverDistractionState::DD_OFF)
, is_vr_session_strated_(false)
, hmi_cooperating_(false)
, is_all_apps_allowed_(true)
@@ -160,7 +165,6 @@ ApplicationManagerImpl::ApplicationManagerImpl(
, resume_ctrl_(new resumption::ResumeCtrlImpl(*this))
, navi_close_app_timeout_(am_settings.stop_streaming_timeout())
, navi_end_stream_timeout_(am_settings.stop_streaming_timeout())
- , stopping_application_mng_lock_(true)
, state_ctrl_(*this)
, application_list_update_timer_(
"AM ListUpdater",
@@ -173,7 +177,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"},
@@ -181,7 +185,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
{TYPE_ICONS, "Icons"}};
sync_primitives::AutoLock lock(timer_pool_lock_);
- TimerSPtr clearing_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr clearing_timer(std::make_shared<timer::Timer>(
"ClearTimerPoolTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::ClearTimerPool)));
@@ -222,6 +226,8 @@ ApplicationManagerImpl::~ApplicationManagerImpl() {
navi_app_to_stop_.clear();
navi_app_to_end_stream_.clear();
+
+ secondary_transport_devices_cache_.clear();
}
DataAccessor<ApplicationSet> ApplicationManagerImpl::applications() const {
@@ -398,13 +404,14 @@ 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();
bool mobile_projection_state = app->mobile_projection_enabled();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
- if (active_app.valid()) {
+ if (active_app.use_count() != 0) {
// If checking app hmi level FULL, we return false
// because we couldn't have two applications with same HMIType in FULL and
// LIMITED HMI level
@@ -431,28 +438,28 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
// Check LIMITED apps
if (voice_state) {
- if (get_limited_voice_application().valid() &&
+ if ((get_limited_voice_application().use_count() != 0) &&
(get_limited_voice_application()->app_id() != app->app_id())) {
return true;
}
}
if (media_state) {
- if (get_limited_media_application().valid() &&
+ if ((get_limited_media_application().use_count() != 0) &&
(get_limited_media_application()->app_id() != app->app_id())) {
return true;
}
}
if (navi_state) {
- if (get_limited_navi_application().valid() &&
+ if ((get_limited_navi_application().use_count() != 0) &&
(get_limited_navi_application()->app_id() != app->app_id())) {
return true;
}
}
if (mobile_projection_state) {
- if (get_limited_mobile_projection_application().valid() &&
+ if ((get_limited_mobile_projection_application().use_count() != 0) &&
(get_limited_mobile_projection_application()->app_id() !=
app->app_id())) {
return true;
@@ -463,7 +470,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
}
ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
- const utils::SharedPtr<smart_objects::SmartObject>&
+ const std::shared_ptr<smart_objects::SmartObject>&
request_for_registration) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -481,7 +488,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (connection_handler().get_session_observer().GetDataOnSessionKey(
connection_key, &app_id, &sessions_list, &device_id) == -1) {
LOG4CXX_ERROR(logger_, "Failed to create application: no connection info.");
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
@@ -492,7 +499,8 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
}
smart_objects::SmartObject& params = message[strings::msg_params];
- const std::string& policy_app_id = params[strings::app_id].asString();
+ const std::string& policy_app_id =
+ GetCorrectMobileIDFromMessage(request_for_registration);
const custom_str::CustomString& app_name =
message[strings::msg_params][strings::app_name].asCustomString();
std::string device_mac;
@@ -513,7 +521,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
if (!is_all_apps_allowed_) {
LOG4CXX_WARN(logger_,
"RegisterApplication: access to app's disabled by user");
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
@@ -532,7 +540,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
GetPolicyHandler().GetStatisticManager(),
*this));
if (!application) {
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
mobile_apis::FunctionID::RegisterAppInterfaceID,
@@ -543,7 +551,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
}
HmiStatePtr initial_state =
- CreateRegularState(utils::SharedPtr<Application>(application),
+ CreateRegularState(std::shared_ptr<Application>(application),
mobile_apis::HMILevel::INVALID_ENUM,
mobile_apis::AudioStreamingState::INVALID_ENUM,
mobile_apis::VideoStreamingState::INVALID_ENUM,
@@ -628,8 +636,6 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
application->set_app_icon_path(full_icon_path);
}
- PutDriverDistractionMessageToPostponed(application);
-
// Stops timer of saving data to resumption in order to
// doesn't erase data from resumption storage.
// Timer will be started after hmi level resumption.
@@ -644,17 +650,19 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
apps_size_ = applications_.size();
applications_list_lock_ptr_->Release();
- return application;
-}
-
-DEPRECATED bool ApplicationManagerImpl::RemoveAppDataFromHMI(
- ApplicationSharedPtr app) {
- return true;
-}
+ // It is possible that secondary transport of this app has been already
+ // established. Make sure that the information is reflected to application
+ // instance.
+ // Also, make sure that this is done *after* we updated applications_ list to
+ // avoid timing issues.
+ DeviceMap::iterator itr =
+ secondary_transport_devices_cache_.find(connection_key);
+ if (secondary_transport_devices_cache_.end() != itr) {
+ connection_handler::DeviceHandle secondary_device_handle = itr->second;
+ application->set_secondary_device(secondary_device_handle);
+ }
-DEPRECATED bool ApplicationManagerImpl::LoadAppDataToHMI(
- ApplicationSharedPtr app) {
- return true;
+ return application;
}
bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
@@ -688,7 +696,7 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::IsHmiLevelFullAllowed(
const bool is_audio_app = app->IsAudioApplication();
const bool does_audio_app_with_same_type_exist =
IsAppTypeExistsInFullOrLimited(app);
- const bool is_active_app_exist = active_application().valid();
+ const bool is_active_app_exist = (active_application().use_count() != 0);
mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL;
if (is_audio_app && does_audio_app_with_same_type_exist) {
@@ -730,42 +738,42 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
hmi_cooperating_ = true;
MessageHelper::SendGetSystemInfoRequest(*this);
- utils::SharedPtr<smart_objects::SmartObject> is_vr_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_vr_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady,
*this));
rpc_service_->ManageHMICommand(is_vr_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_tts_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_tts_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady,
*this));
rpc_service_->ManageHMICommand(is_tts_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_ui_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_ui_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady,
*this));
rpc_service_->ManageHMICommand(is_ui_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_navi_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_navi_ready(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Navigation_IsReady, *this));
rpc_service_->ManageHMICommand(is_navi_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_ivi_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_ivi_ready(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VehicleInfo_IsReady, *this));
rpc_service_->ManageHMICommand(is_ivi_ready);
- utils::SharedPtr<smart_objects::SmartObject> is_rc_ready(
+ std::shared_ptr<smart_objects::SmartObject> is_rc_ready(
MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady,
*this));
rpc_service_->ManageHMICommand(is_rc_ready);
- utils::SharedPtr<smart_objects::SmartObject> button_capabilities(
+ std::shared_ptr<smart_objects::SmartObject> button_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Buttons_GetCapabilities, *this));
rpc_service_->ManageHMICommand(button_capabilities);
- utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request(
+ std::shared_ptr<smart_objects::SmartObject> mixing_audio_supported_request(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
*this));
@@ -783,16 +791,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_) {
@@ -804,16 +802,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) {
@@ -835,17 +823,12 @@ 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;
}
HmiStatePtr ApplicationManagerImpl::CreateRegularState(
- utils::SharedPtr<Application> app,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
mobile_apis::VideoStreamingState::eType video_state,
@@ -858,18 +841,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,
@@ -962,6 +933,22 @@ const ApplicationManagerSettings& ApplicationManagerImpl::get_settings() const {
return settings_;
}
+// Extract the app ID to use for policy based on the UseFullAppID .ini setting
+std::string ApplicationManagerImpl::GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const {
+ // If core is expecting a fullAppID
+ if (get_settings().use_full_app_id()) {
+ // fullAppID is present and core is configured to use it
+ if ((*message)[strings::msg_params].keyExists(strings::full_app_id)) {
+ return (*message)[strings::msg_params][strings::full_app_id].asString();
+ } else {
+ LOG4CXX_DEBUG(logger_, "UseFullAppID is on but only short ID given!");
+ }
+ }
+ // If core isn't using full or no full given, use regular appID
+ return (*message)[strings::msg_params][strings::app_id].asString();
+}
+
void application_manager::ApplicationManagerImpl::MarkAppsGreyOut(
const connection_handler::DeviceHandle handle, bool is_greyed_out) {
sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_);
@@ -1004,7 +991,8 @@ void ApplicationManagerImpl::OnDeviceListUpdated(
return;
}
- smart_objects::SmartObjectSPtr update_list = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr update_list =
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& so_to_send = *update_list;
so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
@@ -1091,7 +1079,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart(
return;
}
- auto update_list = utils::MakeShared<smart_objects::SmartObject>();
+ auto update_list = std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& so_to_send = *update_list;
so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
@@ -1181,127 +1169,95 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
return default_hmi;
}
-uint32_t ApplicationManagerImpl::GenerateGrammarID() {
- return rand();
-}
-
-uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
+bool ApplicationManagerImpl::CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const {
+ using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
- uint32_t hmi_app_id = get_rand_from_range(1);
- LOG4CXX_DEBUG(logger_, "GenerateNewHMIAppID value is: " << hmi_app_id);
- while (resume_controller().IsHMIApplicationIdExist(hmi_app_id)) {
- LOG4CXX_DEBUG(logger_, "HMI appID " << hmi_app_id << " is exists.");
- hmi_app_id = get_rand_from_range(1);
- LOG4CXX_DEBUG(logger_, "Trying new value: " << hmi_app_id);
- }
+ const std::map<std::string, std::vector<std::string> >& transport_map =
+ get_settings().transport_required_for_resumption_map();
- return hmi_app_id;
-}
+ // retrieve transport type string used in .ini file
+ const std::string transport_type =
+ GetTransportTypeProfileString(application->device());
+ const std::string secondary_transport_type =
+ GetTransportTypeProfileString(application->secondary_device());
-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.valid()) {
- 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; }
+ const smart_objects::SmartObject* app_types_array = application->app_types();
+ if (app_types_array == NULL || app_types_array->length() == 0) {
+ // This app does not have any AppHMIType. In this case, check "EMPTY_APP"
+ // entry
+ std::map<std::string, std::vector<std::string> >::const_iterator it =
+ transport_map.find(std::string("EMPTY_APP"));
+ if (it == transport_map.end()) {
+ // if "EMPTY_APP" is not specified, resumption is always enabled
+ return true;
}
- }
-}
-
-void ApplicationManagerImpl::ReplaceHMIByMobileAppId(
- smart_objects::SmartObject& message) {
- if (message.keyExists(strings::app_id)) {
- ApplicationSharedPtr application =
- application_by_hmi_app(message[strings::app_id].asUInt());
+ const std::vector<std::string>& required_transport_list = it->second;
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceHMIByMobileAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->app_id());
- message[strings::app_id] = application->app_id();
+ for (std::vector<std::string>::const_iterator itr =
+ required_transport_list.begin();
+ itr != required_transport_list.end();
+ ++itr) {
+ if (transport_type == *itr || secondary_transport_type == *itr) {
+ return true;
+ }
}
+ return false;
} 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;
+ // check all AppHMITypes that the app has
+ for (size_t i = 0; i < app_types_array->length(); i++) {
+ const std::string app_type_string =
+ AppHMITypeToString(static_cast<mobile_apis::AppHMIType::eType>(
+ app_types_array->getElement(i).asUInt()));
+ bool transport_is_found = false;
+
+ std::map<std::string, std::vector<std::string> >::const_iterator it =
+ transport_map.find(app_type_string);
+ if (it == transport_map.end()) {
+ // this AppHMIType is not listed in .ini file, so resumption is always
+ // enabled
+ continue;
}
- 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]);
+
+ const std::vector<std::string>& required_transport_list = it->second;
+ for (std::vector<std::string>::const_iterator itr =
+ required_transport_list.begin();
+ itr != required_transport_list.end();
+ ++itr) {
+ if (transport_type == *itr || secondary_transport_type == *itr) {
+ transport_is_found = true;
+ break;
}
- 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");
+ // if neither primary or secondary transport type is included in the list,
+ // then resumption will be disabled
+ if (!transport_is_found) {
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;
+}
+
+uint32_t ApplicationManagerImpl::GenerateGrammarID() {
+ return rand();
+}
+
+uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ uint32_t hmi_app_id = get_rand_from_range(1);
+ LOG4CXX_DEBUG(logger_, "GenerateNewHMIAppID value is: " << hmi_app_id);
+
+ while (resume_controller().IsHMIApplicationIdExist(hmi_app_id)) {
+ LOG4CXX_DEBUG(logger_, "HMI appID " << hmi_app_id << " is exists.");
+ hmi_app_id = get_rand_from_range(1);
+ LOG4CXX_DEBUG(logger_, "Trying new value: " << hmi_app_id);
+ }
+
+ return hmi_app_id;
}
bool ApplicationManagerImpl::StartNaviService(
@@ -1443,46 +1399,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,
@@ -1605,6 +1521,79 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
}
}
+void ApplicationManagerImpl::OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (device_handle == 0) {
+ LOG4CXX_WARN(logger_,
+ "Invalid device handle passed for secondary transport of app "
+ << session_key);
+ return;
+ }
+
+ secondary_transport_devices_cache_[session_key] = device_handle;
+
+ {
+ sync_primitives::AutoLock auto_lock(applications_list_lock_ptr_);
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ // It is possible that secondary transport is established prior to
+ // RegisterAppInterface request being processed. In this case, we will
+ // update the app's information during RegisterApplication().
+ LOG4CXX_DEBUG(logger_,
+ "Application with id: " << session_key << " is not found");
+ return;
+ }
+ app->set_secondary_device(device_handle);
+ }
+
+ // notify the event to HMI through BC.UpdateAppList request
+ SendUpdateAppList();
+
+ // if resumption has not been enabled, run it now
+ resume_controller().RetryResumption(session_key);
+}
+
+void ApplicationManagerImpl::OnSecondaryTransportEndedCallback(
+ const int32_t session_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ DeviceMap::iterator it = secondary_transport_devices_cache_.find(session_key);
+ if (it == secondary_transport_devices_cache_.end()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Unknown session_key specified while removing secondary transport: "
+ << session_key);
+ } else {
+ secondary_transport_devices_cache_.erase(it);
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(applications_list_lock_ptr_);
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ LOG4CXX_DEBUG(logger_,
+ "Application with id: " << session_key << " is not found");
+ return;
+ }
+
+ connection_handler::DeviceHandle device_handle = app->secondary_device();
+ if (device_handle == 0) {
+ LOG4CXX_WARN(logger_,
+ "Secondary transport of app " << session_key
+ << " is not found");
+ return;
+ }
+
+ app->set_secondary_device(0);
+ }
+
+ // notify the event to HMI through BC.UpdateAppList request
+ SendUpdateAppList();
+}
+
bool ApplicationManagerImpl::CheckAppIsNavi(const uint32_t app_id) const {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
@@ -1784,6 +1773,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_,
@@ -2163,6 +2154,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);
@@ -2255,10 +2254,14 @@ 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 =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*msg)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnSDLClose;
@@ -2275,7 +2278,7 @@ void ApplicationManagerImpl::SendOnSDLClose() {
}
// SmartObject |message| has no way to declare priority for now
- utils::SharedPtr<Message> message_to_send(
+ std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
hmi_so_factory().attachSchema(*msg, false);
@@ -2283,15 +2286,11 @@ void ApplicationManagerImpl::SendOnSDLClose() {
logger_,
"Attached schema to message, result if valid: " << msg->isValid());
-#ifdef HMI_DBUS_API
- message_to_send->set_smart_object(*msg);
-#else
if (!ConvertSOtoMessage(*msg, *message_to_send)) {
LOG4CXX_WARN(logger_,
"Cannot send message to HMI: failed to create string");
return;
}
-#endif // HMI_DBUS_API
if (!hmi_handler_) {
LOG4CXX_WARN(logger_, "No HMI Handler set");
@@ -2448,11 +2447,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);
@@ -2556,14 +2557,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;
@@ -2721,7 +2732,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
navi_app_to_stop_.push_back(app_id);
- TimerSPtr close_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr close_timer(std::make_shared<timer::Timer>(
"CloseNaviAppTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::CloseNaviApp)));
@@ -2796,7 +2807,7 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
if (from == HMI_FULL || from == HMI_LIMITED) {
LOG4CXX_TRACE(logger_, "HMILevel from FULL or LIMITED");
navi_app_to_end_stream_.push_back(app_id);
- TimerSPtr end_stream_timer(utils::MakeShared<timer::Timer>(
+ TimerSPtr end_stream_timer(std::make_shared<timer::Timer>(
"AppShouldFinishStreaming",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::EndNaviStreaming)));
@@ -2814,11 +2825,11 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
}
void ApplicationManagerImpl::SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) {
+ const std::shared_ptr<Application> app) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
@@ -2982,12 +2993,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,
@@ -3082,14 +3087,14 @@ void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
std::vector<uint32_t> app_list;
{
sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
- std::map<uint32_t, TimevalStruct>::iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it =
tts_global_properties_app_list_.begin();
- std::map<uint32_t, TimevalStruct>::iterator it_end =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it_end =
tts_global_properties_app_list_.end();
date_time::TimeCompare time_comp;
for (; it != it_end; ++it) {
- time_comp = date_time::DateTime::compareTime(
- date_time::DateTime::getCurrentTime(), it->second);
+ time_comp =
+ date_time::compareTime(date_time::getCurrentTime(), it->second);
if (date_time::GREATER == time_comp || date_time::EQUAL == time_comp) {
app_list.push_back(it->first);
}
@@ -3110,8 +3115,8 @@ void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
uint16_t timeout = get_settings().tts_global_properties_timeout();
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- current_time.tv_sec += timeout;
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
+ current_time += date_time::seconds(timeout);
// please avoid AutoLock usage to avoid deadlock
tts_global_properties_app_list_lock_.Acquire();
if (tts_global_properties_app_list_.end() ==
@@ -3134,7 +3139,7 @@ void ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList(
LOG4CXX_AUTO_TRACE(logger_);
// please avoid AutoLock usage to avoid deadlock
tts_global_properties_app_list_lock_.Acquire();
- std::map<uint32_t, TimevalStruct>::iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::iterator it =
tts_global_properties_app_list_.find(app_id);
if (tts_global_properties_app_list_.end() != it) {
tts_global_properties_app_list_.erase(it);
@@ -3179,6 +3184,39 @@ mobile_apis::AppHMIType::eType ApplicationManagerImpl::StringToAppHMIType(
}
}
+const std::string ApplicationManagerImpl::AppHMITypeToString(
+ mobile_apis::AppHMIType::eType type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (type) {
+ case mobile_apis::AppHMIType::DEFAULT:
+ return "DEFAULT";
+ case mobile_apis::AppHMIType::COMMUNICATION:
+ return "COMMUNICATION";
+ case mobile_apis::AppHMIType::MEDIA:
+ return "MEDIA";
+ case mobile_apis::AppHMIType::MESSAGING:
+ return "MESSAGING";
+ case mobile_apis::AppHMIType::NAVIGATION:
+ return "NAVIGATION";
+ case mobile_apis::AppHMIType::INFORMATION:
+ return "INFORMATION";
+ case mobile_apis::AppHMIType::SOCIAL:
+ return "SOCIAL";
+ case mobile_apis::AppHMIType::BACKGROUND_PROCESS:
+ return "BACKGROUND_PROCESS";
+ case mobile_apis::AppHMIType::TESTING:
+ return "TESTING";
+ case mobile_apis::AppHMIType::SYSTEM:
+ return "SYSTEM";
+ case mobile_apis::AppHMIType::PROJECTION:
+ return "PROJECTION";
+ case mobile_apis::AppHMIType::REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
+ default:
+ return "INVALID_ENUM";
+ }
+}
+
bool ApplicationManagerImpl::CompareAppHMIType(
const smart_objects::SmartObject& from_policy,
const smart_objects::SmartObject& from_application) {
@@ -3316,8 +3354,8 @@ void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) {
plugin_manager_->ForEachPlugin(on_app_policy_updated);
}
-void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
- ApplicationSharedPtr application) const {
+void ApplicationManagerImpl::SendDriverDistractionState(
+ ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
if (hmi_apis::Common_DriverDistractionState::INVALID_ENUM ==
driver_distraction_state()) {
@@ -3325,7 +3363,7 @@ void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
return;
}
smart_objects::SmartObjectSPtr on_driver_distraction =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*on_driver_distraction)[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kNotification);
@@ -3335,7 +3373,20 @@ void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
driver_distraction_state();
(*on_driver_distraction)[strings::params][strings::connection_key] =
application->app_id();
- application->PushMobileMessage(on_driver_distraction);
+
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*on_driver_distraction)[strings::params][strings::function_id]
+ .asUInt()));
+ const RPCParams params;
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(application, function_id, params);
+ if (mobile_api::Result::SUCCESS == check_result) {
+ rpc_service_->ManageMobileCommand(on_driver_distraction,
+ commands::Command::SOURCE_SDL);
+ } else {
+ application->PushMobileMessage(on_driver_distraction);
+ }
}
protocol_handler::MajorProtocolVersion
@@ -3405,37 +3456,13 @@ 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_);
LOG4CXX_DEBUG(logger_,
"There are applications subscribed: "
<< subscribed_way_points_apps_list_.size());
- if (subscribed_way_points_apps_list_.find(app) ==
+ if (subscribed_way_points_apps_list_.find(app->app_id()) ==
subscribed_way_points_apps_list_.end()) {
return false;
}
@@ -3446,7 +3473,7 @@ void ApplicationManagerImpl::SubscribeAppForWayPoints(
ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.insert(app);
+ subscribed_way_points_apps_list_.insert(app->app_id());
LOG4CXX_DEBUG(logger_,
"There are applications subscribed: "
<< subscribed_way_points_apps_list_.size());
@@ -3456,7 +3483,7 @@ void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
ApplicationSharedPtr app) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
- subscribed_way_points_apps_list_.erase(app);
+ subscribed_way_points_apps_list_.erase(app->app_id());
LOG4CXX_DEBUG(logger_,
"There are applications subscribed: "
<< subscribed_way_points_apps_list_.size());
@@ -3478,6 +3505,16 @@ const std::set<int32_t> ApplicationManagerImpl::GetAppsSubscribedForWayPoints()
return subscribed_way_points_apps_list_;
}
+// retrieve transport type string used in .ini file, e.g. "TCP_WIFI"
+const std::string ApplicationManagerImpl::GetTransportTypeProfileString(
+ connection_handler::DeviceHandle device_handle) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ return connection_handler()
+ .get_session_observer()
+ .TransportTypeProfileStringFromDeviceHandle(device_handle);
+}
+
static hmi_apis::Common_VideoStreamingProtocol::eType ConvertVideoProtocol(
const char* str) {
if (strcmp(str, "RAW") == 0) {
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
index 9799b170dc..ea74e78f4e 100644
--- a/src/components/application_manager/src/command_holder_impl.cc
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -43,7 +43,7 @@ CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager)
void CommandHolderImpl::Suspend(
ApplicationSharedPtr application,
CommandType type,
- utils::SharedPtr<smart_objects::SmartObject> command) {
+ std::shared_ptr<smart_objects::SmartObject> command) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(application);
LOG4CXX_DEBUG(logger_,
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index dbe89b8881..04fabfb2ec 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -40,7 +40,7 @@ namespace {
struct AppExtensionPredicate {
AppExtensionUID uid;
bool operator()(const ApplicationSharedPtr app) {
- return app ? app->QueryInterface(uid).valid() : false;
+ return app ? (app->QueryInterface(uid).use_count() != 0) : false;
}
};
}
@@ -111,7 +111,7 @@ void CommandImpl::SetAllowedToTerminate(const bool allowed) {
}
bool CommandImpl::ReplaceMobileWithHMIAppId(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& message) {
LOG4CXX_AUTO_TRACE(logger_);
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
@@ -155,15 +155,8 @@ 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) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& message) {
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
application_manager_.application_by_hmi_app(
@@ -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/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index 491fc72de4..68e8cfe6b4 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -34,7 +34,7 @@
#include <numeric>
#include <string>
#include "utils/macro.h"
-#include "utils/make_shared.h"
+
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
@@ -145,7 +145,8 @@ struct DisallowedParamsInserter {
VehicleData::const_iterator it = vehicle_data.find(param);
if (vehicle_data.end() != it) {
smart_objects::SmartObjectSPtr disallowed_param =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*disallowed_param)[strings::data_type] = (*it).second;
(*disallowed_param)[strings::result_code] = code_;
response_[strings::msg_params][param.c_str()] = *disallowed_param;
@@ -273,7 +274,7 @@ void CommandRequestImpl::SendResponse(
}
smart_objects::SmartObjectSPtr result =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& response = *result;
@@ -417,7 +418,8 @@ uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params,
bool use_events) {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
const uint32_t hmi_correlation_id =
application_manager_.GetNextHMICorrelationID();
@@ -454,8 +456,9 @@ uint32_t CommandRequestImpl::SendHMIRequest(
void CommandRequestImpl::CreateHMINotification(
const hmi_apis::FunctionID::eType& function_id,
- const NsSmart::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ const ns_smart::SmartObject& msg_params) const {
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -956,7 +959,7 @@ const std::string InfoInterfaceSeparator(
void CommandRequestImpl::AddTimeOutComponentInfoToMessage(
smart_objects::SmartObject& response) const {
- using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
if (awaiting_response_interfaces_.empty()) {
diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc
index 1fef383213..75e49b180e 100644
--- a/src/components/application_manager/src/commands/notification_from_hmi.cc
+++ b/src/components/application_manager/src/commands/notification_from_hmi.cc
@@ -76,7 +76,8 @@ void NotificationFromHMI::SendNotificationToMobile(
void NotificationFromHMI::CreateHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -86,7 +87,7 @@ void NotificationFromHMI::CreateHMIRequest(
const uint32_t hmi_correlation_id_ =
application_manager_.GetNextHMICorrelationID();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ ns_smart_device_link::ns_smart_objects::SmartObject& request = *result;
request[strings::params][strings::message_type] =
static_cast<int32_t>(application_manager::MessageType::kRequest);
request[strings::params][strings::function_id] =
diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc
index f77495ac31..ff760c2d2a 100644
--- a/src/components/application_manager/src/commands/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -33,7 +33,6 @@
#include "application_manager/commands/request_from_hmi.h"
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
-#include "utils/make_shared.h"
namespace application_manager {
@@ -74,7 +73,7 @@ void RequestFromHMI::SendResponse(
const hmi_apis::FunctionID::eType function_id,
const hmi_apis::Common_Result::eType result_code) {
smart_objects::SmartObjectSPtr message =
- ::utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
FillCommonParametersOfSO(*message, correlation_id, function_id);
(*message)[strings::params][strings::message_type] = MessageType::kResponse;
@@ -91,7 +90,7 @@ void RequestFromHMI::SendErrorResponse(
const hmi_apis::Common_Result::eType result_code,
const std::string error_message) {
smart_objects::SmartObjectSPtr message =
- ::utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
FillCommonParametersOfSO(*message, correlation_id, function_id);
(*message)[strings::params][strings::message_type] =
diff --git a/src/components/application_manager/src/commands/response_from_hmi.cc b/src/components/application_manager/src/commands/response_from_hmi.cc
index 123dbad828..c88b14bf9c 100644
--- a/src/components/application_manager/src/commands/response_from_hmi.cc
+++ b/src/components/application_manager/src/commands/response_from_hmi.cc
@@ -80,7 +80,8 @@ void ResponseFromHMI::SendResponseToMobile(
void ResponseFromHMI::CreateHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject& msg_params) const {
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr result =
+ std::make_shared<smart_objects::SmartObject>();
if (!result) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
@@ -91,7 +92,7 @@ void ResponseFromHMI::CreateHMIRequest(
const uint32_t hmi_correlation_id_ =
application_manager_.GetNextHMICorrelationID();
- NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ ns_smart_device_link::ns_smart_objects::SmartObject& request = *result;
request[strings::params][strings::message_type] = MessageType::kRequest;
request[strings::params][strings::function_id] = function_id;
request[strings::params][strings::correlation_id] = hmi_correlation_id_;
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
index b19a6f9194..f1e5bf9735 100644
--- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
+++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
@@ -39,8 +39,7 @@ namespace application_manager {
namespace event_engine {
using namespace sync_primitives;
-EventDispatcherImpl::EventDispatcherImpl()
- : state_lock_(false), observer_lock_(true), observers_event_() {}
+EventDispatcherImpl::EventDispatcherImpl() : observers_event_() {}
EventDispatcherImpl::~EventDispatcherImpl() {}
diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc
new file mode 100644
index 0000000000..803a0e6743
--- /dev/null
+++ b/src/components/application_manager/src/help_prompt_manager_impl.cc
@@ -0,0 +1,395 @@
+/*
+ * 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 "application_manager/help_prompt_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "smart_objects/smart_object.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HelpPromptManagerImpl")
+
+namespace {
+const size_t kLimitCommand = 30;
+}
+
+namespace application_manager {
+
+HelpPromptManagerImpl::HelpPromptManagerImpl(Application& app,
+ ApplicationManager& app_manager)
+ : app_(app)
+ , app_manager_(app_manager)
+ , sending_type_(SendingType::kSendBoth)
+ , is_tts_send_(false)
+ , is_ui_send_(false) {}
+
+HelpPromptManagerImpl::~HelpPromptManagerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool HelpPromptManagerImpl::AddCommand(
+ const uint32_t cmd_id, const smart_objects::SmartObject& command) {
+ if (!command.keyExists(strings::vr_commands)) {
+ LOG4CXX_DEBUG(logger_, "vr_commands does`t present");
+ return false;
+ }
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+ auto it = std::find_if(
+ vr_commands_.begin(),
+ vr_commands_.end(),
+ [cmd_id](const VRCommandPair& pair) { return pair.first == cmd_id; });
+
+ if (vr_commands_.end() != it) {
+ LOG4CXX_DEBUG(logger_, "Commands with id:" << cmd_id << " already exists");
+ return false;
+ }
+
+ const smart_objects::SmartObject& commands = command[strings::vr_commands];
+ const size_t count_new_commands = commands.length();
+ const bool limit_exceeded =
+ kLimitCommand <= GetCommandsCount(vr_commands_.end());
+
+ LOG4CXX_DEBUG(logger_, "Will be added " << count_new_commands << " commands");
+
+ smart_objects::SmartObjectSPtr vr_item =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Array);
+ smart_objects::SmartArray& ar_vr_cmd = *(vr_item->asArray());
+ smart_objects::SmartArray& ar_cmd = *(commands.asArray());
+ ar_vr_cmd.reserve(count_new_commands);
+ ar_vr_cmd.insert(
+ ar_vr_cmd.end(), ar_cmd.begin(), ar_cmd.begin() + count_new_commands);
+ vr_commands_.push_back(std::make_pair(cmd_id, vr_item));
+
+ LOG4CXX_DEBUG(logger_,
+ "VR commands with id: " << cmd_id << " added for appID: "
+ << app_.app_id() << ". Total "
+ << vr_commands_.size() << " in cache");
+
+ return !limit_exceeded;
+}
+
+bool HelpPromptManagerImpl::DeleteCommand(const uint32_t cmd_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+
+ auto it = std::find_if(
+ vr_commands_.begin(),
+ vr_commands_.end(),
+ [cmd_id](const VRCommandPair& pair) { return pair.first == cmd_id; });
+
+ if (vr_commands_.end() == it) {
+ LOG4CXX_WARN(logger_, "VR command with id: " << cmd_id << " not found");
+ return false;
+ }
+
+ const size_t commands_before_current = GetCommandsCount(it);
+ vr_commands_.erase(it);
+ LOG4CXX_DEBUG(logger_,
+ "VR command with id: "
+ << cmd_id << " found after " << commands_before_current
+ << " commands was deleted for appID: " << app_.app_id()
+ << " Cache size after deleting: " << vr_commands_.size());
+
+ return commands_before_current < kLimitCommand;
+}
+
+void HelpPromptManagerImpl::OnVrCommandAdded(
+ const uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool is_resumption) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ << " commands with id:" << cmd_id
+ << " will not be added");
+ return;
+ }
+ if (AddCommand(cmd_id, command) && !is_resumption) {
+ SendRequests();
+ }
+}
+
+void HelpPromptManagerImpl::OnVrCommandDeleted(const uint32_t cmd_id,
+ const bool is_resumption) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ << " commands with id:" << cmd_id
+ << " will not be deleted");
+ return;
+ }
+ if (DeleteCommand(cmd_id) && !is_resumption) {
+ SendRequests();
+ }
+}
+
+void HelpPromptManagerImpl::OnSetGlobalPropertiesReceived(
+ const smart_objects::SmartObject& msg, const bool is_response) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (SendingType::kNoneSend == sending_type_) {
+ LOG4CXX_DEBUG(logger_,
+ "SendingType::kNoneSend"
+ " do not track SetGlobalProperties");
+ return;
+ }
+
+ if (!is_response) {
+ if (msg.keyExists(strings::help_prompt)) {
+ is_tts_send_ = true;
+ }
+ if (msg.keyExists(strings::vr_help)) {
+ is_ui_send_ = true;
+ }
+
+ LOG4CXX_DEBUG(logger_, "is_tts_send_:" << is_tts_send_);
+ LOG4CXX_DEBUG(logger_, "is_ui_send_:" << is_ui_send_);
+ return;
+ }
+
+ SetSendingType(msg);
+}
+
+HelpPromptManagerImpl::SendingType HelpPromptManagerImpl::GetSendingType()
+ const {
+ return sending_type_;
+}
+
+size_t HelpPromptManagerImpl::GetCommandsCount(
+ VRCommandPairs::const_iterator end_element) const {
+ size_t commands_count = 0;
+ std::for_each(vr_commands_.begin(),
+ end_element,
+ [&commands_count](const VRCommandPair& pair) {
+ commands_count += pair.second->length();
+ });
+ return commands_count;
+}
+
+void HelpPromptManagerImpl::SendTTSRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "TTS request for appID:" << app_.app_id());
+ smart_objects::SmartObjectSPtr tts_global_properties =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ if (tts_global_properties) {
+ smart_objects::SmartObject& ref = *tts_global_properties;
+
+ ref[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ ref[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ ref[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ ref[strings::params][strings::correlation_id] =
+ app_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& so_to_send = *tts_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::TTS_SetGlobalProperties;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CreatePromptMsg(msg_params);
+
+ msg_params[strings::app_id] = app_.app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ app_manager_.GetRPCService().ManageHMICommand(tts_global_properties);
+ }
+ is_tts_send_ = false;
+}
+
+void HelpPromptManagerImpl::SendUIRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "UI request for appID:" << app_.app_id());
+ smart_objects::SmartObjectSPtr ui_global_properties =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ if (ui_global_properties) {
+ smart_objects::SmartObject& ref = *ui_global_properties;
+
+ ref[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ ref[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ ref[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ ref[strings::params][strings::correlation_id] =
+ app_manager_.GetNextHMICorrelationID();
+
+ smart_objects::SmartObject& so_to_send = *ui_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_SetGlobalProperties;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CreateVRMsg(msg_params);
+
+ msg_params[strings::app_id] = app_.app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ app_manager_.GetRPCService().ManageHMICommand(ui_global_properties);
+ }
+ is_ui_send_ = false;
+}
+
+void HelpPromptManagerImpl::SendBothRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendTTSRequest();
+ SendUIRequest();
+}
+
+void HelpPromptManagerImpl::SendRequests() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(vr_commands_lock_);
+ switch (sending_type_) {
+ case SendingType::kSendHelpPrompt:
+ SendTTSRequest();
+ return;
+ case SendingType::kSendVRHelp:
+ SendUIRequest();
+ return;
+ case SendingType::kSendBoth:
+ SendBothRequests();
+ return;
+ case SendingType::kNoneSend:
+ break;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "SendingType:" << static_cast<uint32_t>(sending_type_)
+ << " request not sending");
+}
+
+void HelpPromptManagerImpl::CreatePromptMsg(
+ smart_objects::SmartObject& out_msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ out_msg_params[strings::help_prompt] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ uint32_t index = 0;
+ for (size_t i = 0; i < vr_commands_.size(); ++i) {
+ const VRCommandPair& pair = vr_commands_[i];
+ for (size_t j = 0; j < pair.second->length() && index < kLimitCommand;
+ ++j) {
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+
+ item[strings::text] = pair.second->getElement(j).asString();
+ item[strings::type] = mobile_apis::SpeechCapabilities::SC_TEXT;
+
+ out_msg_params[strings::help_prompt][index++] = item;
+ }
+ }
+ app_.set_help_prompt(out_msg_params[strings::help_prompt]);
+}
+
+void HelpPromptManagerImpl::CreateVRMsg(
+ smart_objects::SmartObject& out_msg_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (false == out_msg_params.keyExists(strings::vr_help_title)) {
+ if (app_.vr_help_title()) {
+ out_msg_params[strings::vr_help_title] = (*app_.vr_help_title());
+ } else {
+ out_msg_params[strings::vr_help_title] = app_.name();
+ }
+ }
+ out_msg_params[strings::vr_help] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ uint32_t index = 0;
+ for (size_t i = 0; i < vr_commands_.size(); ++i) {
+ const VRCommandPair& pair = vr_commands_[i];
+ for (size_t j = 0; j < pair.second->length() && index < kLimitCommand;
+ ++j) {
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+
+ item[strings::text] = pair.second->getElement(j).asString();
+ item[strings::position] = index + 1;
+
+ out_msg_params[strings::vr_help][index++] = item;
+ }
+ }
+ if (out_msg_params[strings::vr_help].empty()) {
+ out_msg_params.erase(strings::vr_help);
+ app_.reset_vr_help();
+ } else {
+ app_.set_vr_help(out_msg_params[strings::vr_help]);
+ }
+}
+
+void HelpPromptManagerImpl::SetSendingType(
+ const smart_objects::SmartObject& msg) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ hmi_apis::Common_Result::eType result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ msg[strings::params][hmi_response::code].asInt());
+ LOG4CXX_DEBUG(logger_, "HMI response result:" << result);
+ if (hmi_apis::Common_Result::eType::SUCCESS == result) {
+ hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ msg[strings::params][strings::function_id].asUInt());
+ LOG4CXX_DEBUG(logger_, "Function id:" << function_id);
+ switch (function_id) {
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ if (is_tts_send_) {
+ is_tts_send_ = false;
+ sending_type_ = SendingType::kSendHelpPrompt == sending_type_
+ ? SendingType::kNoneSend
+ : SendingType::kSendVRHelp;
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ if (is_ui_send_) {
+ is_ui_send_ = false;
+ sending_type_ = SendingType::kSendVRHelp == sending_type_
+ ? SendingType::kNoneSend
+ : SendingType::kSendHelpPrompt;
+ }
+ break;
+ }
+ default: { break; }
+ }
+ LOG4CXX_DEBUG(
+ logger_,
+ "Sending type set to:" << static_cast<uint32_t>(sending_type_));
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
index 66afd6b0b6..59f1c6caf2 100644
--- a/src/components/application_manager/src/helpers/application_helper.cc
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -21,6 +21,7 @@ void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) {
for (auto cmd : cmap) {
MessageHelper::SendDeleteCommandRequest(cmd.second, app, app_manager);
app->RemoveCommand(cmd.first);
+ app->help_prompt_manager().OnVrCommandDeleted(cmd.first, true);
}
}
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index d00fc2ae19..f67590543d 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -44,7 +44,7 @@
#include "utils/file_system.h"
namespace application_manager {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
namespace {
std::map<std::string, hmi_apis::Common_VrCapabilities::eType>
@@ -99,6 +99,8 @@ void InitCapabilities() {
button_enum_name.insert(
std::make_pair(std::string("OK"), hmi_apis::Common_ButtonName::OK));
button_enum_name.insert(std::make_pair(
+ std::string("PLAY_PAUSE"), hmi_apis::Common_ButtonName::PLAY_PAUSE));
+ button_enum_name.insert(std::make_pair(
std::string("SEEKLEFT"), hmi_apis::Common_ButtonName::SEEKLEFT));
button_enum_name.insert(std::make_pair(
std::string("SEEKRIGHT"), hmi_apis::Common_ButtonName::SEEKRIGHT));
@@ -884,7 +886,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(ui, "displayCapabilities")) {
smart_objects::SmartObject display_capabilities_so;
Json::Value display_capabilities = ui.get("displayCapabilities", "");
- Formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
+ formatters::CFormatterJsonBase::jsonValueToObj(display_capabilities,
display_capabilities_so);
if (display_capabilities_so.keyExists(hmi_response::display_type)) {
@@ -1081,7 +1083,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value soft_button_capabilities =
ui.get("softButtonCapabilities", "");
smart_objects::SmartObject soft_button_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(
+ formatters::CFormatterJsonBase::jsonValueToObj(
soft_button_capabilities, soft_button_capabilities_so);
set_soft_button_capabilities(soft_button_capabilities_so);
}
@@ -1092,7 +1094,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value navigation_capability =
system_capabilities.get("navigationCapability", "");
smart_objects::SmartObject navigation_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(
+ formatters::CFormatterJsonBase::jsonValueToObj(
navigation_capability, navigation_capability_so);
set_navigation_capability(navigation_capability_so);
if (!navigation_capability_so.empty()) {
@@ -1104,7 +1106,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value phone_capability =
system_capabilities.get("phoneCapability", "");
smart_objects::SmartObject phone_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability,
+ formatters::CFormatterJsonBase::jsonValueToObj(phone_capability,
phone_capability_so);
set_phone_capability(phone_capability_so);
if (!phone_capability_so.empty()) {
@@ -1116,7 +1118,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value vs_capability =
system_capabilities.get("videoStreamingCapability", "");
smart_objects::SmartObject vs_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(vs_capability,
+ formatters::CFormatterJsonBase::jsonValueToObj(vs_capability,
vs_capability_so);
if (vs_capability_so.keyExists("supportedFormats")) {
@@ -1166,7 +1168,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
Json::Value rc_capability =
system_capabilities.get("remoteControlCapability", "");
smart_objects::SmartObject rc_capability_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
+ formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
rc_capability_so);
set_rc_capability(rc_capability_so);
if (!rc_capability_so.empty()) {
@@ -1245,7 +1247,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(buttons, "capabilities")) {
Json::Value bt_capabilities = buttons.get("capabilities", "");
smart_objects::SmartObject buttons_capabilities_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
+ formatters::CFormatterJsonBase::jsonValueToObj(bt_capabilities,
buttons_capabilities_so);
for (uint32_t i = 0; i < buttons_capabilities_so.length(); ++i) {
@@ -1265,7 +1267,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(buttons, "presetBankCapabilities")) {
Json::Value presetBank = buttons.get("presetBankCapabilities", "");
smart_objects::SmartObject preset_bank_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
+ formatters::CFormatterJsonBase::jsonValueToObj(presetBank,
preset_bank_so);
set_preset_bank_capabilities(preset_bank_so);
}
@@ -1275,7 +1277,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
if (check_existing_json_member(root_json, "VehicleInfo")) {
Json::Value vehicle_info = root_json.get("VehicleInfo", "");
smart_objects::SmartObject vehicle_type_so;
- Formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
+ formatters::CFormatterJsonBase::jsonValueToObj(vehicle_info,
vehicle_type_so);
set_vehicle_type(vehicle_type_so);
} // VehicleType end
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index e6636ed38f..452b5ab79d 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -61,8 +61,6 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnFileRemoved] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
- convert_map[BasicCommunication_AllowDeviceToConnect] =
- HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnDeviceChosen] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnFindApplications] =
diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc
index ce8514010f..6e89b2419c 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -223,7 +223,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile(
const uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
DCHECK_OR_RETURN_VOID(notification);
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] =
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index e1bc2b5125..aa4c979ae7 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -42,7 +42,7 @@ namespace application_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState")
-HmiState::HmiState(utils::SharedPtr<Application> app,
+HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id)
: app_(app)
@@ -55,7 +55,7 @@ HmiState::HmiState(utils::SharedPtr<Application> app,
LOG4CXX_DEBUG(logger_, *this);
}
-HmiState::HmiState(utils::SharedPtr<Application> app,
+HmiState::HmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: app_(app)
, state_id_(STATE_ID_REGULAR)
@@ -67,27 +67,6 @@ HmiState::HmiState(utils::SharedPtr<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;
@@ -115,22 +94,14 @@ mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
return AudioStreamingState::NOT_AUDIBLE;
}
-VRHmiState::VRHmiState(utils::SharedPtr<Application> app,
+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(utils::SharedPtr<Application> app,
+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;
@@ -147,7 +118,7 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
}
VideoStreamingHmiState::VideoStreamingHmiState(
- utils::SharedPtr<Application> app, const ApplicationManager& app_mngr)
+ std::shared_ptr<Application> app, const ApplicationManager& app_mngr)
: HmiState(app, app_mngr, STATE_ID_VIDEO_STREAMING) {}
mobile_apis::VideoStreamingState::eType
@@ -159,7 +130,7 @@ VideoStreamingHmiState::video_streaming_state() const {
return mobile_apis::VideoStreamingState::NOT_STREAMABLE;
}
-NaviStreamingHmiState::NaviStreamingHmiState(utils::SharedPtr<Application> app,
+NaviStreamingHmiState::NaviStreamingHmiState(std::shared_ptr<Application> app,
const ApplicationManager& app_mngr)
: VideoStreamingHmiState(app, app_mngr) {
set_state_id(STATE_ID_NAVI_STREAMING);
@@ -185,14 +156,10 @@ NaviStreamingHmiState::audio_streaming_state() const {
return expected_state;
}
-PhoneCallHmiState::PhoneCallHmiState(utils::SharedPtr<Application> app,
+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;
@@ -210,22 +177,14 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
return HMILevel::HMI_BACKGROUND;
}
-SafetyModeHmiState::SafetyModeHmiState(utils::SharedPtr<Application> app,
+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(utils::SharedPtr<Application> app,
+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;
@@ -238,32 +197,27 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
return HMILevel::HMI_BACKGROUND;
}
-AudioSource::AudioSource(utils::SharedPtr<Application> app,
+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;
}
-EmbeddedNavi::EmbeddedNavi(utils::SharedPtr<Application> app,
+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 1f1ff4ddf0..5bda17ecbd 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -61,7 +61,6 @@
#include "utils/file_system.h"
#include "utils/macro.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
#include "formatters/formatter_json_rpc.h"
#include "formatters/CFormatterJsonSDLRPCv2.h"
@@ -95,11 +94,8 @@ bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) {
// Check if image parameter is valid
if (button.keyExists(strings::image)) {
SmartObject& buttonImage = button[strings::image];
-
- // Image name must not be empty and must not contain incorrect
- // character
- if (false == MessageHelper::VerifySoftButtonString(
- buttonImage[strings::value].asString())) {
+ if (false ==
+ MessageHelper::VerifyString(buttonImage[strings::value].asString())) {
return false;
}
}
@@ -191,6 +187,9 @@ std::pair<std::string,
mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
std::make_pair(strings::belt_status,
mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
+ std::make_pair(
+ strings::electronic_park_brake_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ELECTRONICPARKBRAKESTATUS),
std::make_pair(strings::body_information,
mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
std::make_pair(strings::device_status,
@@ -229,58 +228,44 @@ const VehicleData MessageHelper::vehicle_data_(
kVehicleDataInitializer,
kVehicleDataInitializer + ARRAYSIZE(kVehicleDataInitializer));
-#ifdef HMI_DBUS_API
-namespace {
-struct VehicleInfo_Requests {
- hmi_apis::FunctionID::eType func_id;
- const char* str;
-};
-static VehicleInfo_Requests ivi_subrequests[] = {
- {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- strings::fuel_level_state},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- strings::instant_fuel_consumption},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- strings::external_temp},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
- {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- strings::tire_pressure},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- strings::belt_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- strings::body_information},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- strings::device_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- strings::driver_braking},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- strings::wiper_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- strings::head_lamp_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- strings::engine_torque},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- strings::acc_pedal_pos},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- strings::steering_wheel_angle},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- strings::e_call_info},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- strings::airbag_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- strings::emergency_event},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- strings::cluster_mode_status},
- {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
-};
+smart_objects::SmartObjectSPtr MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id) {
+ using smart_objects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr object(
+ new SmartObject(smart_objects::SmartType_Map));
+ (*object)[strings::params][strings::message_type] =
+ static_cast<int>(kNotification);
+ (*object)[strings::params][strings::function_id] = function_id;
+ (*object)[strings::params][strings::connection_key] = app_id;
+ (*object)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*object)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ (*object)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ return object;
+}
+
+ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
+MessageHelper::CreateHMINotification(hmi_apis::FunctionID::eType function_id) {
+ using smart_objects::SmartObject;
+ using smart_objects::SmartObjectSPtr;
+ using smart_objects::SmartType_Map;
+ LOG4CXX_AUTO_TRACE(logger_);
+ SmartObjectSPtr notification_ptr =
+ std::make_shared<SmartObject>(SmartType_Map);
+ SmartObject& notification = *notification_ptr;
+ notification[strings::params][strings::message_type] =
+ static_cast<int32_t>(kNotification);
+ notification[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ notification[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ notification[strings::params][strings::function_id] = function_id;
+
+ return notification_ptr;
}
-#endif // #ifdef HMI_DBUS_API
const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
CommonAppPriorityMap::const_iterator it = app_priority_values.find(priority);
@@ -292,7 +277,7 @@ const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
const std::string& language) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Language::eType value;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::StringToEnum(
language, &value)) {
@@ -313,7 +298,7 @@ std::string MessageHelper::GetDeviceMacAddressForHandle(
std::string MessageHelper::CommonLanguageToString(
hmi_apis::Common_Language::eType language) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Language::eType>::EnumToCString(
language, &str)) {
@@ -326,7 +311,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
using namespace smart_objects;
- SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
SmartObject& ref = *message;
ref[strings::params][strings::message_type] = static_cast<int>(message_type);
@@ -342,7 +327,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
mobile_apis::FunctionID::OnHashChangeID;
@@ -410,7 +395,7 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& message = *notification;
message[strings::params][strings::function_id] = static_cast<int32_t>(
@@ -645,7 +630,7 @@ const VehicleData& MessageHelper::vehicle_data() {
std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType hmi_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::EnumToCString(
hmi_result, &str)) {
@@ -656,7 +641,7 @@ std::string MessageHelper::HMIResultToString(
hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
const std::string& hmi_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
hmi_apis::Common_Result::eType value;
if (EnumConversionHelper<hmi_apis::Common_Result::eType>::StringToEnum(
hmi_result, &value)) {
@@ -667,7 +652,7 @@ hmi_apis::Common_Result::eType MessageHelper::HMIResultFromString(
std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType mobile_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::Result::eType>::EnumToCString(
mobile_result, &str)) {
@@ -678,7 +663,7 @@ std::string MessageHelper::MobileResultToString(
mobile_apis::Result::eType MessageHelper::MobileResultFromString(
const std::string& mobile_result) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::Result::eType value;
if (EnumConversionHelper<mobile_apis::Result::eType>::StringToEnum(
mobile_result, &value)) {
@@ -709,7 +694,8 @@ void MessageHelper::SendHMIStatusNotification(
const Application& application_impl,
ApplicationManager& application_manager) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ smart_objects::SmartObjectSPtr notification =
+ std::make_shared<smart_objects::SmartObject>();
if (!notification) {
LOG4CXX_ERROR(logger_, "Failed to create smart object");
return;
@@ -750,8 +736,9 @@ void MessageHelper::SendActivateAppToHMI(
return;
}
- utils::SharedPtr<smart_objects::SmartObject> message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::shared_ptr<smart_objects::SmartObject> message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_ActivateApp;
@@ -794,7 +781,7 @@ void MessageHelper::SendActivateAppToHMI(
mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
const std::string& hmi_level) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
mobile_apis::HMILevel::eType value;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::StringToEnum(
hmi_level, &value)) {
@@ -805,7 +792,7 @@ mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
std::string MessageHelper::StringifiedHMILevel(
const mobile_apis::HMILevel::eType hmi_level) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::EnumToCString(
hmi_level, &str)) {
@@ -817,7 +804,7 @@ std::string MessageHelper::StringifiedHMILevel(
std::string MessageHelper::StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id) {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::FunctionID::eType>::EnumToCString(
function_id, &str)) {
@@ -830,103 +817,13 @@ std::string MessageHelper::StringifiedFunctionID(
return std::string();
}
-#ifdef HMI_DBUS_API
-namespace {
-const std::map<std::string, uint16_t> create_get_vehicle_data_args() {
- std::map<std::string, uint16_t> rc;
- rc.insert(std::make_pair(strings::gps,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData));
- rc.insert(std::make_pair(strings::speed,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed));
- rc.insert(
- std::make_pair(strings::rpm, hmi_apis::FunctionID::VehicleInfo_GetRpm));
- rc.insert(std::make_pair(strings::fuel_level,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel));
- rc.insert(
- std::make_pair(strings::fuel_level_state,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState));
- rc.insert(std::make_pair(
- strings::instant_fuel_consumption,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption));
- rc.insert(
- std::make_pair(strings::external_temp,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature));
- rc.insert(
- std::make_pair(strings::vin, hmi_apis::FunctionID::VehicleInfo_GetVin));
- rc.insert(std::make_pair(strings::prndl,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl));
- rc.insert(std::make_pair(strings::tire_pressure,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure));
- rc.insert(std::make_pair(strings::odometer,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer));
- rc.insert(std::make_pair(strings::belt_status,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus));
- rc.insert(
- std::make_pair(strings::body_information,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation));
- rc.insert(std::make_pair(strings::device_status,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus));
- rc.insert(std::make_pair(strings::driver_braking,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking));
- rc.insert(std::make_pair(strings::wiper_status,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus));
- rc.insert(
- std::make_pair(strings::head_lamp_status,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus));
- rc.insert(std::make_pair(strings::engine_torque,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque));
- rc.insert(
- std::make_pair(strings::acc_pedal_pos,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition));
- rc.insert(
- std::make_pair(strings::steering_wheel_angle,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle));
- rc.insert(std::make_pair(strings::e_call_info,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo));
- rc.insert(std::make_pair(strings::airbag_status,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus));
- rc.insert(
- std::make_pair(strings::emergency_event,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent));
- rc.insert(
- std::make_pair(strings::cluster_mode_status,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus));
- rc.insert(std::make_pair(strings::my_key,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey));
- return rc;
-}
-static std::map<std::string, uint16_t> vehicle_data_args =
- create_get_vehicle_data_args();
-}
-#endif
-
void MessageHelper::CreateGetVehicleDataRequest(
const uint32_t correlation_id,
const std::vector<std::string>& params,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
-#ifdef HMI_DBUS_API
- for (std::vector<std::string>::const_iterator it = params.begin();
- it != params.end();
- it++) {
- smart_objects::SmartObjectSPtr request =
- utils::MakeShared<smart_objects::SmartObject>();
-
- (*request)[strings::params][strings::message_type] =
- static_cast<int>(kRequest);
- (*request)[strings::params][strings::correlation_id] = correlation_id;
- (*request)[strings::params][strings::protocol_version] =
- commands::CommandImpl::protocol_version_;
- (*request)[strings::params][strings::protocol_type] =
- commands::CommandImpl::hmi_protocol_type_;
- (*request)[strings::params][strings::function_id] =
- static_cast<int>(vehicle_data_args[*it]);
- app_mngr.GetRPCService().ManageHMICommand(request);
- }
-#else
-
smart_objects::SmartObjectSPtr request =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*request)[strings::params][strings::message_type] =
static_cast<int>(kRequest);
@@ -945,7 +842,6 @@ void MessageHelper::CreateGetVehicleDataRequest(
(*request)[strings::msg_params][*it] = true;
}
app_mngr.GetRPCService().ManageHMICommand(request);
-#endif
}
smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
@@ -955,7 +851,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
uint32_t connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr response =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*response)[strings::params][strings::function_id] =
static_cast<int>(function_id);
@@ -979,7 +875,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr device_list_so =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*device_list_so)[strings::device_list] =
@@ -1013,7 +909,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
uint32_t function_id, ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr module_info =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
smart_objects::SmartObject& object = *module_info;
object[strings::params][strings::message_type] = static_cast<int>(kRequest);
@@ -1029,7 +925,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
const std::string& path_to_icon, uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr set_icon =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!set_icon) {
@@ -1056,7 +952,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification(
LOG4CXX_AUTO_TRACE(logger_);
SmartObjectSPtr notification_ptr =
- utils::MakeShared<SmartObject>(SmartType_Map);
+ std::make_shared<SmartObject>(SmartType_Map);
if (!notification_ptr) {
LOG4CXX_ERROR(logger_, "Memory allocation failed.");
return;
@@ -1090,7 +986,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application pointer ");
return;
}
@@ -1146,7 +1042,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app,
void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return;
}
@@ -1166,14 +1062,24 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectList requests;
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return requests;
}
+ auto& help_prompt_manager =
+ const_cast<Application*>(app.get())->help_prompt_manager();
+
+ const bool can_send_ui = helpers::Compare<HelpPromptManager::SendingType,
+ helpers::EQ,
+ helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendVRHelp,
+ HelpPromptManager::SendingType::kSendBoth);
+
// UI global properties
- if (app->vr_help_title() || app->vr_help()) {
+ if (can_send_ui && (app->vr_help_title() || app->vr_help())) {
smart_objects::SmartObjectSPtr ui_global_properties =
CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!ui_global_properties) {
@@ -1207,8 +1113,15 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
requests.push_back(ui_global_properties);
}
+ const bool can_send_vr = helpers::Compare<HelpPromptManager::SendingType,
+ helpers::EQ,
+ helpers::ONE>(
+ help_prompt_manager.GetSendingType(),
+ HelpPromptManager::SendingType::kSendHelpPrompt,
+ HelpPromptManager::SendingType::kSendBoth);
+
// TTS global properties
- if (app->help_prompt() || app->timeout_prompt()) {
+ if (can_send_vr && (app->help_prompt() || app->timeout_prompt())) {
smart_objects::SmartObjectSPtr tts_global_properties =
CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!tts_global_properties) {
@@ -1282,7 +1195,7 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app,
smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp(
ApplicationConstSharedPtr app) {
smart_objects::SmartObjectSPtr result =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!result) {
return NULL;
@@ -1505,7 +1418,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration(
void MessageHelper::SendUIChangeRegistrationRequestToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Application is not valid");
return;
}
@@ -1566,13 +1479,47 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
return vr_command;
}
+bool MessageHelper::CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output) {
+ DCHECK_OR_RETURN(output, false);
+
+ std::string device_name;
+ std::string mac_address;
+ std::string transport_type;
+ if (-1 ==
+ session_observer.GetDataOnDeviceID(
+ device_handle, &device_name, NULL, &mac_address, &transport_type)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to extract information for device " << device_handle);
+ }
+
+ smart_objects::SmartObject& device_info_map = *output;
+ device_info_map = smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ device_info_map[strings::name] = device_name;
+ device_info_map[strings::id] = mac_address;
+ device_info_map[strings::transport_type] =
+ app_mngr.GetDeviceTransportType(transport_type);
+
+ const policy::DeviceConsent device_consent =
+ policy_handler.GetUserConsentForDevice(mac_address);
+ device_info_map[strings::isSDLAllowed] =
+ policy::DeviceConsent::kDeviceAllowed == device_consent;
+
+ return true;
+}
+
bool MessageHelper::CreateHMIApplicationStruct(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
- NsSmartDeviceLink::NsSmartObjects::SmartObject* output,
+ ns_smart_device_link::ns_smart_objects::SmartObject* output,
ApplicationManager& app_mngr) {
- using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ using ns_smart_device_link::ns_smart_objects::SmartObject;
DCHECK_OR_RETURN(output, false);
SmartObject& message = *output;
@@ -1587,15 +1534,6 @@ bool MessageHelper::CreateHMIApplicationStruct(
const smart_objects::SmartObject* day_color_scheme = app->day_color_scheme();
const smart_objects::SmartObject* night_color_scheme =
app->night_color_scheme();
- std::string device_name;
- std::string mac_address;
- std::string transport_type;
- if (-1 ==
- session_observer.GetDataOnDeviceID(
- app->device(), &device_name, NULL, &mac_address, &transport_type)) {
- LOG4CXX_ERROR(logger_,
- "Failed to extract information for device " << app->device());
- }
message = smart_objects::SmartObject(smart_objects::SmartType_Map);
message[strings::app_name] = app->name();
@@ -1634,21 +1572,28 @@ bool MessageHelper::CreateHMIApplicationStruct(
message[strings::device_info] =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- message[strings::device_info][strings::name] = device_name;
- message[strings::device_info][strings::id] = mac_address;
- const policy::DeviceConsent device_consent =
- policy_handler.GetUserConsentForDevice(mac_address);
- message[strings::device_info][strings::isSDLAllowed] =
- policy::DeviceConsent::kDeviceAllowed == device_consent;
+ smart_objects::SmartObject& device_info = message[strings::device_info];
+ CreateDeviceInfo(
+ app->device(), session_observer, policy_handler, app_mngr, &device_info);
+
+ if (app->secondary_device() != 0) {
+ message[strings::secondary_device_info] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& secondary_device_info =
+ message[strings::secondary_device_info];
+ CreateDeviceInfo(app->secondary_device(),
+ session_observer,
+ policy_handler,
+ app_mngr,
+ &secondary_device_info);
+ }
- message[strings::device_info][strings::transport_type] =
- app_mngr.GetDeviceTransportType(transport_type);
return true;
}
void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Invalid application");
return;
}
@@ -1704,7 +1649,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
bool is_unexpected_disconnect,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
smart_objects::SmartObject& message = *notification;
@@ -1734,7 +1679,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_ActivateApp;
@@ -1777,8 +1722,8 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
return;
}
- utils::SharedPtr<smart_objects::SmartObject> message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::shared_ptr<smart_objects::SmartObject> message =
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1797,7 +1742,7 @@ void MessageHelper::SendSDLActivateAppResponse(
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1846,7 +1791,7 @@ void MessageHelper::SendSDLActivateAppResponse(
void MessageHelper::SendOnSDLConsentNeeded(
const policy::DeviceParams& device_info, ApplicationManager& app_man) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
@@ -1886,7 +1831,8 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
if (!message) {
return;
}
@@ -1956,7 +1902,7 @@ void MessageHelper::SendGetListOfPermissionsResponse(
using namespace smart_objects;
using namespace hmi_apis;
- SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
DCHECK_OR_RETURN_VOID(message);
SmartObject& params = (*message)[strings::params];
@@ -1998,7 +1944,7 @@ void MessageHelper::SendGetListOfPermissionsResponse(
using namespace smart_objects;
using namespace hmi_apis;
- SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map);
DCHECK_OR_RETURN_VOID(message);
SmartObject& params = (*message)[strings::params];
@@ -2039,7 +1985,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
response_data[strings::msg_params][strings::success] = false;
response_data[strings::params][strings::connection_key] = connection_key;
- return utils::MakeShared<smart_objects::SmartObject>(response_data);
+ return std::make_shared<smart_objects::SmartObject>(response_data);
}
void MessageHelper::SendNaviSetVideoConfig(
@@ -2189,7 +2135,7 @@ void MessageHelper::SendOnDataStreaming(
}
smart_objects::SmartObjectSPtr notification =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
(*notification)[strings::params][strings::function_id] =
@@ -2279,7 +2225,7 @@ void MessageHelper::SendSystemRequestNotification(
#endif
DCHECK(app_mngr.GetRPCService().ManageMobileCommand(
- utils::MakeShared<smart_objects::SmartObject>(content),
+ std::make_shared<smart_objects::SmartObject>(content),
commands::Command::SOURCE_SDL));
}
@@ -2447,7 +2393,7 @@ void MessageHelper::SendOnPermissionsChangeNotification(
}
app_mngr.GetRPCService().ManageMobileCommand(
- utils::MakeShared<smart_objects::SmartObject>(content),
+ std::make_shared<smart_objects::SmartObject>(content),
commands::Command::SOURCE_SDL);
}
@@ -2532,14 +2478,14 @@ void MessageHelper::SendOnAppPermissionsChangedNotification(
}
app_mngr.GetRPCService().ManageHMICommand(
- utils::MakeShared<smart_objects::SmartObject>(message));
+ std::make_shared<smart_objects::SmartObject>(message));
}
void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!message) {
return;
@@ -2560,7 +2506,7 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result,
const uint32_t correlation_id,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
DCHECK(message);
@@ -2578,7 +2524,7 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result,
void MessageHelper::SendOnStatusUpdate(const std::string& status,
ApplicationManager& app_mngr) {
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Map);
if (!message) {
return;
@@ -2611,7 +2557,8 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == message.getType()) {
+ if (ns_smart_device_link::ns_smart_objects::SmartType_Array ==
+ message.getType()) {
for (uint32_t i = 0; i < message.length(); ++i) {
mobile_apis::Result::eType res =
VerifyImageFiles(message[i], app, app_mngr);
@@ -2620,7 +2567,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return res;
}
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Map ==
message.getType()) {
if (message.keyExists(strings::image_type)) {
mobile_apis::Result::eType verification_result =
@@ -2652,27 +2599,15 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return mobile_apis::Result::SUCCESS;
}
-mobile_apis::Result::eType MessageHelper::VerifyImageApplyPath(
- smart_objects::SmartObject& image,
- ApplicationConstSharedPtr app,
- ApplicationManager& app_mngr) {
- // Checking image type first: if STATIC - skip existence check, since it is
- // HMI related file and it should know it location
- const uint32_t image_type = image[strings::image_type].asUInt();
- mobile_apis::ImageType::eType type =
- static_cast<mobile_apis::ImageType::eType>(image_type);
- if (mobile_apis::ImageType::STATIC == type) {
- return mobile_apis::Result::SUCCESS;
- }
-
+void MessageHelper::ApplyImagePath(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
const std::string& file_name = image[strings::value].asString();
const std::string& full_file_path = GetAppFilePath(file_name, app, app_mngr);
image[strings::value] = full_file_path;
- if (file_system::FileExists(full_file_path)) {
- return mobile_apis::Result::SUCCESS;
- }
- return mobile_apis::Result::INVALID_DATA;
+
+ return;
}
std::string MessageHelper::GetAppFilePath(std::string file_name,
@@ -2733,19 +2668,61 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
smart_objects::SmartObject& image,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
- smart_objects::SmartObject temp_image = image;
const uint32_t image_type = image[strings::image_type].asUInt();
- const mobile_apis::ImageType::eType type =
+ mobile_apis::ImageType::eType type =
static_cast<mobile_apis::ImageType::eType>(image_type);
+ const std::string& file_name = image[strings::value].asString();
- const mobile_apis::Result::eType result =
- VerifyImageApplyPath(temp_image, app, app_mngr);
- if ((mobile_apis::Result::SUCCESS == result) &&
- (mobile_apis::ImageType::DYNAMIC == type)) {
- image[strings::value] = temp_image[strings::value];
+ if (!VerifyString(file_name)) {
+ return mobile_apis::Result::INVALID_DATA;
}
- return result;
+ if (mobile_apis::ImageType::STATIC == type) {
+ return mobile_apis::Result::SUCCESS;
+ }
+
+ ApplyImagePath(image, app, app_mngr);
+
+ const std::string& imagePath = image[strings::value].asString();
+
+ if (file_system::FileExists(imagePath)) {
+ return mobile_apis::Result::SUCCESS;
+ }
+ 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(
@@ -2758,21 +2735,21 @@ mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
if (message[i].keyExists(strings::image)) {
verification_result_image =
VerifyImage(message[i][strings::image], app, app_mngr);
- if (mobile_apis::Result::SUCCESS != verification_result_image) {
- return verification_result_image;
+ if (mobile_apis::Result::INVALID_DATA == verification_result_image) {
+ break;
}
}
}
- return mobile_apis::Result::SUCCESS;
+ return verification_result_image;
}
-bool MessageHelper::VerifySoftButtonString(const std::string& str) {
+bool MessageHelper::VerifyString(const std::string& str) {
if ((std::string::npos != str.find_first_of("\t\n")) ||
(std::string::npos != str.find("\\n")) ||
(std::string::npos != str.find("\\t")) ||
(std::string::npos == str.find_first_not_of(' '))) {
LOG4CXX_ERROR(logger_,
- "MessageHelper::VerifySoftButtonString"
+ "MessageHelper::VerifyString"
"string contains incorrect character");
return false;
}
@@ -2831,7 +2808,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
}
if ((!request_soft_buttons[i].keyExists(strings::image) ||
- (Result::SUCCESS !=
+ (Result::INVALID_DATA ==
VerifyImage(
request_soft_buttons[i][strings::image], app, app_mngr)))) {
return Result::INVALID_DATA;
@@ -2843,7 +2820,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
request_soft_buttons[i].erase(strings::image);
}
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
- (!VerifySoftButtonString(
+ (!VerifyString(
request_soft_buttons[i][strings::text].asString()))) {
return Result::INVALID_DATA;
}
@@ -2852,13 +2829,13 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
case SoftButtonType::SBT_BOTH: {
if ((!request_soft_buttons[i].keyExists(strings::text)) ||
((request_soft_buttons[i][strings::text].length()) &&
- (!VerifySoftButtonString(
+ (!VerifyString(
request_soft_buttons[i][strings::text].asString())))) {
return Result::INVALID_DATA;
}
if ((!request_soft_buttons[i].keyExists(strings::image) ||
- (Result::SUCCESS !=
+ (Result::INVALID_DATA ==
VerifyImage(
request_soft_buttons[i][strings::image], app, app_mngr)))) {
return Result::INVALID_DATA;
@@ -2912,7 +2889,7 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
}
switch (object.getType()) {
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Array: {
+ case ns_smart_device_link::ns_smart_objects::SmartType_Array: {
for (size_t i = 0; i < object.length(); i++) {
++tab;
@@ -2924,7 +2901,7 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
}
break;
}
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Map: {
+ case ns_smart_device_link::ns_smart_objects::SmartType_Map: {
std::set<std::string> keys = object.enumerate();
for (std::set<std::string>::const_iterator key = keys.begin();
@@ -2940,20 +2917,20 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
}
break;
}
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean:
+ case ns_smart_device_link::ns_smart_objects::SmartType_Boolean:
object.asBool() ? printf("true\n") : printf("false\n");
break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Double: {
+ case ns_smart_device_link::ns_smart_objects::SmartType_Double: {
printf("%f", object.asDouble());
break;
}
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Integer:
+ case ns_smart_device_link::ns_smart_objects::SmartType_Integer:
printf("%lld", static_cast<long long int>(object.asInt()));
break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_String:
+ case ns_smart_device_link::ns_smart_objects::SmartType_String:
printf("%s", object.asString().c_str());
break;
- case NsSmartDeviceLink::NsSmartObjects::SmartType_Character:
+ case ns_smart_device_link::ns_smart_objects::SmartType_Character:
printf("%c", object.asChar());
break;
default:
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 8e64bc952b..1ee368a212 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -179,7 +179,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
return NULL;
}
- std::auto_ptr<application_manager::Message> outgoing_message(
+ std::unique_ptr<application_manager::Message> outgoing_message(
new application_manager::Message(
protocol_handler::MessagePriority::FromServiceType(
message->service_type())));
diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc
index 828f2d923a..f397814005 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -63,14 +63,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
-#ifdef HMI_DBUS_API
- case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
- ProcessOdometerEvent(message);
- break;
- }
- default: { break; }
- unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer);
-#else
case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
ProcessOdometerEvent(message);
unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
@@ -82,7 +74,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
break;
}
default: { break; }
-#endif
}
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 1cff7b7c96..cbc434a485 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -54,7 +54,7 @@
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
#include "utils/scope_guard.h"
-#include "utils/make_shared.h"
+
#include "utils/helpers.h"
#include "policy/policy_manager.h"
@@ -224,7 +224,7 @@ struct LinksCollector {
}
void operator()(const ApplicationSharedPtr& app) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Skip current application.");
@@ -258,7 +258,7 @@ struct LinkAppToDevice {
}
void operator()(const ApplicationSharedPtr& app) {
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Skip current application.");
@@ -327,8 +327,7 @@ PolicyHandler::PolicyHandler(const PolicySettings& settings,
: AsyncRunner("PolicyHandler async runner thread")
, dl_handle_(0)
, last_activated_app_id_(0)
- , app_to_device_link_lock_(true)
- , statistic_manager_impl_(utils::MakeShared<StatisticManagerImpl>(this))
+ , statistic_manager_impl_(std::make_shared<StatisticManagerImpl>(this))
, settings_(settings)
, application_manager_(application_manager) {}
@@ -355,14 +354,14 @@ bool PolicyHandler::LoadPolicyLibrary() {
if (CreateManager()) {
policy_manager_->set_listener(this);
event_observer_ =
- utils::SharedPtr<PolicyEventObserver>(new PolicyEventObserver(
+ std::shared_ptr<PolicyEventObserver>(new PolicyEventObserver(
this, application_manager_.event_dispatcher()));
}
} else {
LOG4CXX_ERROR(logger_, error);
}
- return policy_manager_.valid();
+ return (policy_manager_.use_count() != 0);
}
bool PolicyHandler::CreateManager() {
@@ -375,11 +374,11 @@ bool PolicyHandler::CreateManager() {
char* error_string = dlerror();
if (NULL == error_string) {
policy_manager_ =
- utils::SharedPtr<PolicyManager>(create_manager(), delete_manager);
+ std::shared_ptr<PolicyManager>(create_manager(), delete_manager);
} else {
LOG4CXX_WARN(logger_, error_string);
}
- return policy_manager_.valid();
+ return (policy_manager_.use_count() != 0);
}
const PolicySettings& PolicyHandler::get_settings() const {
@@ -520,7 +519,7 @@ void PolicyHandler::SendOnAppPermissionsChanged(
<< policy_app_id);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id);
return;
}
@@ -555,7 +554,7 @@ struct SmartObjectToInt {
StatusNotifier PolicyHandler::AddApplication(
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
- POLICY_LIB_CHECK(utils::MakeShared<utils::CallNothing>());
+ POLICY_LIB_CHECK(std::make_shared<utils::CallNothing>());
return policy_manager_->AddApplication(application_id, hmi_types);
}
@@ -591,7 +590,7 @@ void PolicyHandler::OnAppPermissionConsentInternal(
if (connection_key) {
ApplicationSharedPtr app = application_manager_.application(connection_key);
- if (app.valid()) {
+ if (app.use_count() != 0) {
out_permissions.policy_app_id = app->policy_app_id();
DeviceParams device_params = GetDeviceParams(
app->device(),
@@ -618,7 +617,7 @@ void PolicyHandler::OnAppPermissionConsentInternal(
// If list of apps sent to HMI for user consents is not the same as
// current,
// permissions should be set only for coincident to registered apps
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Invalid pointer to application was passed."
"Permissions setting skipped.");
@@ -659,9 +658,9 @@ void PolicyHandler::OnAppPermissionConsentInternal(
void policy::PolicyHandler::SetDaysAfterEpoch() {
POLICY_LIB_CHECK_VOID();
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+ int days_after_epoch = date_time::getSecs(current_time) / kSecondsInDay;
PTUpdatedAt(Counters::DAYS_AFTER_EPOCH, days_after_epoch);
}
@@ -733,7 +732,7 @@ std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions(
ApplicationSharedPtr app = application_manager_.application(connection_key);
std::vector<FunctionalGroupPermission> group_permissions;
- if (NULL == app.get() || !app.valid()) {
+ if (NULL == app.get() || app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Connection key '"
<< connection_key
@@ -883,7 +882,7 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"Application with id '"
<< policy_app_id
@@ -958,7 +957,7 @@ void PolicyHandler::OnPendingPermissionChange(
POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_,
"No app found for " << policy_app_id << " policy app id.");
return;
@@ -1083,12 +1082,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
SetDaysAfterEpoch();
event_observer_->subscribe_on_event(
-#ifdef HMI_DBUS_API
- hmi_apis::FunctionID::VehicleInfo_GetOdometer, correlation_id
-#else
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id
-#endif
- );
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id);
std::vector<std::string> vehicle_data_args;
vehicle_data_args.push_back(strings::odometer);
MessageHelper::CreateGetVehicleDataRequest(
@@ -1272,9 +1266,8 @@ void PolicyHandler::OnIgnitionCycleOver() {
void PolicyHandler::OnActivateApp(uint32_t connection_key,
uint32_t correlation_id) {
LOG4CXX_AUTO_TRACE(logger_);
- POLICY_LIB_CHECK_VOID();
ApplicationSharedPtr app = application_manager_.application(connection_key);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(logger_, "Activated App failed: no app found.");
return;
}
@@ -1368,7 +1361,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1421,7 +1414,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
@@ -1464,7 +1457,7 @@ void PolicyHandler::OnSnapshotCreated(
std::string policy_snapshot_full_path;
if (SaveSnapshot(pt_string, policy_snapshot_full_path)) {
const uint32_t timeout_exchange_s =
- timeout_exchange_ms / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ timeout_exchange_ms / date_time::MILLISECONDS_IN_SECOND;
MessageHelper::SendPolicyUpdate(policy_snapshot_full_path,
timeout_exchange_s,
retry_delay_seconds,
@@ -1593,7 +1586,7 @@ uint32_t PolicyHandler::NextRetryTimeout() {
}
uint32_t PolicyHandler::TimeoutExchangeSec() const {
- return TimeoutExchangeMSec() / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return TimeoutExchangeMSec() / date_time::MILLISECONDS_IN_SECOND;
}
uint32_t PolicyHandler::TimeoutExchangeMSec() const {
@@ -1632,7 +1625,7 @@ void PolicyHandler::remove_listener(PolicyHandlerObserver* listener) {
listeners_.remove(listener);
}
-utils::SharedPtr<usage_statistics::StatisticsManager>
+std::shared_ptr<usage_statistics::StatisticsManager>
PolicyHandler::GetStatisticManager() const {
return statistic_manager_impl_;
}
@@ -1674,7 +1667,7 @@ custom_str::CustomString PolicyHandler::GetAppName(
ApplicationSharedPtr app =
application_manager_.application_by_policy_id(policy_app_id);
- if (!app.valid()) {
+ if (app.use_count() == 0) {
LOG4CXX_WARN(
logger_,
"Connection_key not found for application_id:" << policy_app_id);
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index e052e347f0..28c773ffcb 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -35,7 +35,7 @@
#include "application_manager/request_controller.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/request_to_hmi.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace application_manager {
@@ -176,7 +176,7 @@ RequestController::TResult RequestController::addHMIRequest(
const RequestPtr request) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!request.valid()) {
+ if (request.use_count() == 0) {
LOG4CXX_ERROR(logger_, "HMI request pointer is invalid");
return RequestController::INVALID_DATA;
}
@@ -185,7 +185,7 @@ RequestController::TResult RequestController::addHMIRequest(
const uint64_t timeout_in_mseconds =
static_cast<uint64_t>(request->default_timeout());
RequestInfoPtr request_info_ptr =
- utils::MakeShared<HMIRequestInfo>(request, timeout_in_mseconds);
+ std::make_shared<HMIRequestInfo>(request, timeout_in_mseconds);
if (0 == timeout_in_mseconds) {
LOG4CXX_DEBUG(logger_,
@@ -287,7 +287,7 @@ void RequestController::terminateWaitingForExecutionAppRequests(
std::list<RequestPtr>::iterator request_it = mobile_request_list_.begin();
while (mobile_request_list_.end() != request_it) {
RequestPtr request = (*request_it);
- if ((request.valid()) && (request->connection_key() == app_id)) {
+ if ((request.use_count() != 0) && (request->connection_key() == app_id)) {
mobile_request_list_.erase(request_it++);
} else {
++request_it;
@@ -407,11 +407,11 @@ void RequestController::TimeoutThread() {
<< " request id: " << probably_expired->requestId()
<< " connection_key: " << probably_expired->app_id()
<< " NOT expired");
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- const TimevalStruct end_time = probably_expired->end_time();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
+ const date_time::TimeDuration end_time = probably_expired->end_time();
if (current_time < end_time) {
- const uint32_t msecs = static_cast<uint32_t>(
- date_time::DateTime::getmSecs(end_time - current_time));
+ const uint32_t msecs =
+ static_cast<uint32_t>(date_time::getmSecs(end_time - current_time));
LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs");
timer_condition_.WaitFor(auto_lock, msecs);
}
@@ -488,7 +488,7 @@ void RequestController::Worker::threadMain() {
const uint32_t timeout_in_mseconds = request_ptr->default_timeout();
RequestInfoPtr request_info_ptr =
- utils::MakeShared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
+ std::make_shared<MobileRequestInfo>(request_ptr, timeout_in_mseconds);
if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) {
commands::CommandRequestImpl* cmd_request =
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index 9a5828d939..45e56c5f9e 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -51,7 +51,7 @@ HMIRequestInfo::HMIRequestInfo(RequestPtr request, const uint64_t timeout_msec)
}
HMIRequestInfo::HMIRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, HMIRequest, start_time, timeout_msec) {
correlation_id_ = request_->correlation_id();
@@ -66,7 +66,7 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request,
}
MobileRequestInfo::MobileRequestInfo(RequestPtr request,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, MobileRequest, start_time, timeout_msec) {
correlation_id_ = request_.get()->correlation_id();
@@ -75,7 +75,7 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request,
RequestInfo::RequestInfo(RequestPtr request,
const RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: request_(request), start_time_(start_time), timeout_msec_(timeout_msec) {
updateEndTime();
@@ -85,8 +85,8 @@ RequestInfo::RequestInfo(RequestPtr request,
}
void application_manager::request_controller::RequestInfo::updateEndTime() {
- end_time_ = date_time::DateTime::getCurrentTime();
- date_time::DateTime::AddMilliseconds(end_time_, timeout_msec_);
+ end_time_ = date_time::getCurrentTime();
+ date_time::AddMilliseconds(end_time_, timeout_msec_);
}
void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
@@ -95,9 +95,8 @@ void RequestInfo::updateTimeOut(const uint64_t& timeout_msec) {
}
bool RequestInfo::isExpired() {
- TimevalStruct curr_time = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::getmSecs(end_time_) <=
- date_time::DateTime::getmSecs(curr_time);
+ date_time::TimeDuration curr_time = date_time::getCurrentTime();
+ return date_time::getmSecs(end_time_) <= date_time::getmSecs(curr_time);
}
uint64_t RequestInfo::hash() {
@@ -151,7 +150,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key,
RequestInfoPtr result;
// Request info for searching in request info set by log_n time
- utils::SharedPtr<FakeRequestInfo> request_info_for_search(
+ std::shared_ptr<FakeRequestInfo> request_info_for_search(
new FakeRequestInfo(connection_key, correlation_id));
sync_primitives::AutoLock lock(this_lock_);
@@ -283,7 +282,7 @@ bool RequestInfoSet::AppIdCompararator::operator()(
bool RequestInfoTimeComparator::operator()(const RequestInfoPtr lhs,
const RequestInfoPtr rhs) const {
date_time::TimeCompare compare_result =
- date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
+ date_time::compareTime(lhs->end_time(), rhs->end_time());
if (compare_result == date_time::LESS) {
return true;
} else if (compare_result == date_time::GREATER) {
diff --git a/src/components/application_manager/src/request_tracker.cc b/src/components/application_manager/src/request_tracker.cc
index 13b3d4d873..c047c82579 100644
--- a/src/components/application_manager/src/request_tracker.cc
+++ b/src/components/application_manager/src/request_tracker.cc
@@ -77,7 +77,7 @@ bool RequestTracker::Track(const ApplicationID& app_id,
const uint32_t max_requests,
ApplicationsRequestsTracker& tracker) {
LOG4CXX_AUTO_TRACE(logger_);
- using date_time::DateTime;
+ using namespace date_time;
if (!time_scale || !max_requests) {
LOG4CXX_INFO(logger_, "Time scale request tracking is disabled.");
@@ -93,7 +93,7 @@ bool RequestTracker::Track(const ApplicationID& app_id,
if (tracker.end() == it_app) {
LOG4CXX_DEBUG(logger_, "Adding new application into tracking.");
- tracker[app_id].push_back(DateTime::getCurrentTime());
+ tracker[app_id].push_back(getCurrentTime());
return true;
}
@@ -102,25 +102,24 @@ bool RequestTracker::Track(const ApplicationID& app_id,
if (it_app->second.size() < max_requests) {
LOG4CXX_DEBUG(logger_, "Adding new request into tracking.");
- tracker[app_id].push_back(DateTime::getCurrentTime());
+ tracker[app_id].push_back(getCurrentTime());
return true;
}
LOG4CXX_DEBUG(logger_,
"Oldest request is added at: "
- << DateTime::getmSecs(it_app->second.front())
- << ". Current time is: "
- << DateTime::getmSecs(DateTime::getCurrentTime())
+ << getmSecs(it_app->second.front())
+ << ". Current time is: " << getmSecs(getCurrentTime())
<< ". Time scale is: " << time_scale);
- if (DateTime::calculateTimeSpan(it_app->second.front()) > time_scale) {
+ if (calculateTimeSpan(it_app->second.front()) > time_scale) {
LOG4CXX_DEBUG(logger_, "Dropping oldest request, adding new one.");
ApplicationsRequestsTracker::mapped_type& times = tracker[app_id];
DCHECK_OR_RETURN(!times.empty(), false);
times.erase(times.begin());
- times.push_back(DateTime::getCurrentTime());
+ times.push_back(getCurrentTime());
return true;
}
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 b7fc9f0b70..3e77078ee5 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -48,17 +48,22 @@
#include "utils/helpers.h"
#include "application_manager/resumption/resumption_data_db.h"
#include "application_manager/resumption/resumption_data_json.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace resumption {
using namespace application_manager;
+static mobile_api::HMILevel::eType PickHigherHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2);
+static mobile_api::HMILevel::eType PickLowerHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2);
+static mobile_api::HMILevel::eType ConvertHmiLevelString(const std::string str);
+
CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
: event_engine::EventObserver(application_manager.event_dispatcher())
- , queue_lock_(false)
, restore_hmi_level_timer_(
"RsmCtrlRstore",
new timer::TimerTaskImpl<ResumeCtrlImpl>(
@@ -69,13 +74,20 @@ 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(
- utils::SharedPtr<ResumptionData> mock_storage) {
+ std::shared_ptr<ResumptionData> mock_storage) {
resumption_storage_ = mock_storage;
}
+
+bool ResumeCtrlImpl::get_resumption_active() const {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ return is_resumption_active_;
+}
#endif // BUILD_TESTS
bool ResumeCtrlImpl::Init(resumption::LastState& last_state) {
@@ -118,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;
}
@@ -134,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);
}
@@ -158,10 +176,38 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
if (result) {
DCHECK_OR_RETURN(application, false);
if (saved_app.keyExists(strings::hmi_level)) {
- const HMILevel::eType saved_hmi_level =
- static_cast<mobile_apis::HMILevel::eType>(
- saved_app[strings::hmi_level].asInt());
- LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ HMILevel::eType saved_hmi_level;
+ if (HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ saved_hmi_level = application->deferred_resumption_hmi_level();
+ LOG4CXX_INFO(logger_,
+ "Retry resuming into HMI level : " << saved_hmi_level);
+ application->set_deferred_resumption_hmi_level(
+ HMILevel::eType::INVALID_ENUM);
+ } else {
+ saved_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
+ saved_app[strings::hmi_level].asInt());
+ LOG4CXX_DEBUG(logger_, "Saved HMI Level is : " << saved_hmi_level);
+ }
+
+ // Check one of the high-bandwidth transports (configured through
+ // smartDeviceLink.ini file) is available. If not, then the HMI level to
+ // resume into will be modified.
+ if (!application_manager_.CheckResumptionRequiredTransportAvailable(
+ application)) {
+ mobile_apis::HMILevel::eType low_bandwidth_level =
+ GetHmiLevelOnLowBandwidthTransport(application);
+
+ application->set_deferred_resumption_hmi_level(saved_hmi_level);
+
+ saved_hmi_level =
+ PickLowerHmiLevel(saved_hmi_level, low_bandwidth_level);
+ LOG4CXX_DEBUG(
+ logger_,
+ "High-bandwidth transport not available, app will resume into : "
+ << saved_hmi_level);
+ }
+
return SetAppHMIState(application, saved_hmi_level, true);
} else {
result = false;
@@ -176,9 +222,23 @@ bool ResumeCtrlImpl::RestoreAppHMIState(ApplicationSharedPtr application) {
bool ResumeCtrlImpl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(application, false);
- mobile_apis::HMILevel::eType default_hmi =
+ mobile_apis::HMILevel::eType hmi_level =
application_manager_.GetDefaultHmiLevel(application);
- return SetAppHMIState(application, default_hmi, false);
+
+ // Check one of the high-bandwidth transports (configured through
+ // smartDeviceLink.ini file) is available. If not, then the HMI level to
+ // resume into will be modified.
+ if (!application_manager_.CheckResumptionRequiredTransportAvailable(
+ application)) {
+ mobile_apis::HMILevel::eType low_bandwidth_level =
+ GetHmiLevelOnLowBandwidthTransport(application);
+ hmi_level = PickLowerHmiLevel(hmi_level, low_bandwidth_level);
+ LOG4CXX_DEBUG(
+ logger_,
+ "High-bandwidth transport not available, default HMI level is set to : "
+ << hmi_level);
+ }
+ return SetAppHMIState(application, hmi_level, false);
}
void ResumeCtrlImpl::ApplicationResumptiOnTimer() {
@@ -258,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);
@@ -271,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() {
@@ -282,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_;
}
@@ -353,6 +439,28 @@ bool ResumeCtrlImpl::StartResumptionOnlyHMILevel(
return result;
}
+void ResumeCtrlImpl::RetryResumption(const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Invalid app_id = " << app_id);
+ return;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ // check and update resumption deferred flag in queue_lock_
+ if (mobile_api::HMILevel::eType::INVALID_ENUM ==
+ app->deferred_resumption_hmi_level()) {
+ LOG4CXX_DEBUG(logger_, "No need to retry resumption for app: " << app_id);
+ return;
+ }
+ }
+
+ AddToResumptionTimerQueue(app_id);
+}
+
void ResumeCtrlImpl::StartAppHmiStateResumption(
ApplicationSharedPtr application) {
using namespace date_time;
@@ -366,15 +474,33 @@ 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);
+ if (mobile_apis::HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ // the application has not been fully resumed
+ return;
+ }
RemoveApplicationFromSaved(application);
} else {
LOG4CXX_INFO(logger_,
@@ -545,8 +671,12 @@ void ResumeCtrlImpl::AddCommands(ApplicationSharedPtr application,
saved_app[strings::application_commands];
for (size_t i = 0; i < app_commands.length(); ++i) {
const smart_objects::SmartObject& command = app_commands[i];
+ const uint32_t cmd_id = command[strings::cmd_id].asUInt();
+ const bool is_resumption = true;
- application->AddCommand(command[strings::cmd_id].asUInt(), command);
+ application->AddCommand(cmd_id, command);
+ application->help_prompt_manager().OnVrCommandAdded(
+ cmd_id, command, is_resumption);
}
ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI(
application, application_manager_));
@@ -633,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_,
@@ -669,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) {
@@ -677,16 +904,23 @@ bool ResumeCtrlImpl::CheckAppRestrictions(
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN(saved_app.keyExists(strings::hmi_level), false);
- const HMILevel::eType hmi_level =
- static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ HMILevel::eType hmi_level;
+ if (mobile_api::HMILevel::eType::INVALID_ENUM !=
+ application->deferred_resumption_hmi_level()) {
+ hmi_level = application->deferred_resumption_hmi_level();
+ } else {
+ hmi_level =
+ static_cast<HMILevel::eType>(saved_app[strings::hmi_level].asInt());
+ }
const bool result = Compare<HMILevel::eType, EQ, ONE>(
hmi_level, HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)
? 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;
}
@@ -699,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();
@@ -719,7 +978,7 @@ time_t ResumeCtrlImpl::LaunchTime() const {
return launch_time_;
}
-time_t ResumeCtrlImpl::GetIgnOffTime() {
+time_t ResumeCtrlImpl::GetIgnOffTime() const {
return resumption_storage_->GetIgnOffTime();
}
@@ -754,14 +1013,21 @@ void ResumeCtrlImpl::ProcessHMIRequests(
void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
+ bool run_resumption = false;
queue_lock_.Acquire();
waiting_for_timer_.push_back(app_id);
+
+ if (!is_resumption_active_) {
+ is_resumption_active_ = true;
+ run_resumption = true;
+ }
queue_lock_.Release();
LOG4CXX_DEBUG(logger_,
"Application ID " << app_id << " have been added"
" to resumption queue.");
- if (!is_resumption_active_) {
- is_resumption_active_ = true;
+ 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);
@@ -826,4 +1092,97 @@ bool ResumeCtrlImpl::IsAppDataResumptionExpired(
return max_ign_off_count <= application[strings::ign_off_count].asInt();
}
+mobile_apis::HMILevel::eType ResumeCtrlImpl::GetHmiLevelOnLowBandwidthTransport(
+ ApplicationConstSharedPtr application) const {
+ using namespace mobile_apis;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const ApplicationManagerSettings& settings =
+ application_manager_.get_settings();
+ const std::string& level_for_navi_app =
+ settings.navigation_lowbandwidth_resumption_level();
+ const std::string& level_for_projection_app =
+ settings.projection_lowbandwidth_resumption_level();
+ const std::string& level_for_media_app =
+ settings.media_lowbandwidth_resumption_level();
+
+ HMILevel::eType result_level = HMILevel::HMI_NONE;
+ HMILevel::eType level;
+
+ // NAVIGATION, PROJECTION and media apps have special exceptions. Their HMI
+ // level can be configured through .ini file. when the app has multiple
+ // AppHMIType, then the highest level will be applied.
+ if (application->is_navi()) {
+ level = ConvertHmiLevelString(level_for_navi_app);
+ LOG4CXX_DEBUG(logger_,
+ "NAVIGATION apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+ if (application->mobile_projection_enabled()) {
+ level = ConvertHmiLevelString(level_for_projection_app);
+ LOG4CXX_DEBUG(logger_,
+ "PROJECTION apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+ if (application->is_media_application()) {
+ level = ConvertHmiLevelString(level_for_media_app);
+ LOG4CXX_DEBUG(logger_,
+ "media apps may have level "
+ << level
+ << " while high-bandwidth transport is not available.");
+ result_level = PickHigherHmiLevel(level, result_level);
+ }
+
+ return result_level;
+}
+
+static mobile_api::HMILevel::eType PickHigherHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2) {
+ using namespace mobile_apis;
+
+ if (val1 == HMILevel::INVALID_ENUM) {
+ return val2;
+ } else if (val2 == HMILevel::INVALID_ENUM) {
+ return val1;
+ }
+
+ // smaller enum value has higher level
+ return val1 < val2 ? val1 : val2;
+}
+
+static mobile_api::HMILevel::eType PickLowerHmiLevel(
+ mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2) {
+ using namespace mobile_apis;
+
+ if (val1 == HMILevel::INVALID_ENUM) {
+ return val2;
+ } else if (val2 == HMILevel::INVALID_ENUM) {
+ return val1;
+ }
+
+ // bigger enum value has lower level
+ return val1 > val2 ? val1 : val2;
+}
+
+static mobile_api::HMILevel::eType ConvertHmiLevelString(
+ const std::string str) {
+ using namespace mobile_apis;
+
+ if ("BACKGROUND" == str) {
+ return HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == str) {
+ return HMILevel::HMI_FULL;
+ } else if ("LIMITED" == str) {
+ return HMILevel::HMI_LIMITED;
+ } else if ("NONE" == str) {
+ return HMILevel::HMI_NONE;
+ } else {
+ return HMILevel::HMI_NONE;
+ }
+}
+
} // namespce resumption
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 72215dcf97..856fb03750 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -41,7 +41,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
ResumptionData::ResumptionData(
const application_manager::ApplicationManager& application_manager)
- : resumption_lock_(true), application_manager_(application_manager) {}
+ : application_manager_(application_manager) {}
smart_objects::SmartObject ResumptionData::GetApplicationCommands(
app_mngr::ApplicationConstSharedPtr application) const {
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..c8e9032dfa 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -41,7 +41,7 @@
namespace resumption {
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
@@ -81,22 +81,22 @@ void ResumptionDataJson::SaveApplication(
json_app[strings::hmi_level] = static_cast<int32_t>(hmi_level);
json_app[strings::ign_off_count] = 0;
json_app[strings::hash_id] = hash;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationCommands(application), tmp);
json_app[strings::application_commands] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubMenus(application), tmp);
json_app[strings::application_submenus] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationInteractionChoiseSets(application), tmp);
json_app[strings::application_choice_sets] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationGlobalProperties(application), tmp);
json_app[strings::application_global_properties] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubscriptions(application), tmp);
json_app[strings::application_subscriptions] = tmp;
- Formatters::CFormatterJsonBase::objToJsonValue(
+ formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationFiles(application), tmp);
json_app[strings::application_files] = tmp;
json_app[strings::time_stamp] = time_stamp;
@@ -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_);
@@ -229,7 +225,7 @@ bool ResumptionDataJson::GetSavedApplication(
return false;
}
const Json::Value& json_saved_app = GetSavedApplications()[idx];
- Formatters::CFormatterJsonBase::jsonValueToObj(json_saved_app, saved_app);
+ formatters::CFormatterJsonBase::jsonValueToObj(json_saved_app, saved_app);
return true;
}
@@ -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 5cf5500709..0ccdf8b758 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -36,8 +36,8 @@ namespace application_manager {
namespace rpc_handler {
CREATE_LOGGERPTR_LOCAL(logger_, "RPCHandlerImpl")
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager)
: app_manager_(app_manager)
@@ -54,15 +54,15 @@ RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager)
RPCHandlerImpl::~RPCHandlerImpl() {}
void RPCHandlerImpl::ProcessMessageFromMobile(
- const utils::SharedPtr<Message> message) {
+ const std::shared_ptr<Message> message) {
LOG4CXX_AUTO_TRACE(logger_);
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver::MessageMetricSharedPtr metric(
new AMTelemetryObserver::MessageMetric());
- metric->begin = date_time::DateTime::getCurrentTime();
+ metric->begin = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
smart_objects::SmartObjectSPtr so_from_mobile =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
DCHECK_OR_RETURN_VOID(so_from_mobile);
if (!so_from_mobile) {
@@ -83,7 +83,7 @@ void RPCHandlerImpl::ProcessMessageFromMobile(
LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
}
#ifdef TELEMETRY_MONITOR
- metric->end = date_time::DateTime::getCurrentTime();
+ metric->end = date_time::getCurrentTime();
if (metric_observer_) {
metric_observer_->OnMessage(metric);
}
@@ -91,18 +91,16 @@ void RPCHandlerImpl::ProcessMessageFromMobile(
}
void RPCHandlerImpl::ProcessMessageFromHMI(
- const utils::SharedPtr<Message> message) {
+ const std::shared_ptr<Message> message) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject);
+ smart_objects::SmartObjectSPtr smart_object =
+ std::make_shared<smart_objects::SmartObject>();
if (!smart_object) {
LOG4CXX_ERROR(logger_, "Null pointer");
return;
}
-#ifdef HMI_DBUS_API
- *smart_object = message->smart_object();
-#else
if (!ConvertMessageToSO(*message, *smart_object)) {
if (application_manager::MessageType::kResponse ==
(*smart_object)[strings::params][strings::message_type].asInt()) {
@@ -116,7 +114,6 @@ void RPCHandlerImpl::ProcessMessageFromHMI(
return;
}
}
-#endif // HMI_DBUS_API
LOG4CXX_DEBUG(logger_, "Converted message, trying to create hmi command");
if (!app_manager_.GetRPCService().ManageHMICommand(smart_object)) {
@@ -158,7 +155,7 @@ void RPCHandlerImpl::OnMessageReceived(
return;
}
- utils::SharedPtr<Message> outgoing_message = ConvertRawMsgToMessage(message);
+ std::shared_ptr<Message> outgoing_message = ConvertRawMsgToMessage(message);
if (outgoing_message) {
LOG4CXX_DEBUG(logger_, "Posting new Message");
@@ -197,9 +194,40 @@ void RPCHandlerImpl::SetTelemetryObserver(AMTelemetryObserver* observer) {
#endif // TELEMETRY_MONITOR
+void RPCHandlerImpl::GetMessageVersion(
+ ns_smart_device_link::ns_smart_objects::SmartObject& output,
+ utils::SemanticVersion& message_version) {
+ if (output.keyExists(
+ ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS) &&
+ output[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS]
+ .keyExists(strings::sync_msg_version)) {
+ // SyncMsgVersion exists, check if it is valid.
+ auto sync_msg_version =
+ output[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS]
+ [strings::sync_msg_version];
+ uint16_t major = 0;
+ uint16_t minor = 0;
+ uint16_t patch = 0;
+ if (sync_msg_version.keyExists(strings::major_version)) {
+ major = sync_msg_version[strings::major_version].asUInt();
+ }
+ if (sync_msg_version.keyExists(strings::minor_version)) {
+ minor = sync_msg_version[strings::minor_version].asUInt();
+ }
+ if (sync_msg_version.keyExists(strings::patch_version)) {
+ patch = sync_msg_version[strings::patch_version].asUInt();
+ }
+ utils::SemanticVersion temp_version(major, minor, patch);
+ if (temp_version.isValid()) {
+ utils::SemanticVersion ver_4_5(4, 5, 0);
+ message_version = (temp_version > ver_4_5) ? temp_version : ver_4_5;
+ }
+ }
+}
+
bool RPCHandlerImpl::ConvertMessageToSO(
const Message& message,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& output) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& output) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_,
"\t\t\tMessage to convert: protocol "
@@ -218,18 +246,37 @@ bool RPCHandlerImpl::ConvertMessageToSO(
message.function_id(),
message.type(),
message.correlation_id());
+
+ rpc::ValidationReport report("RPC");
+
+ // Attach RPC version to SmartObject if it does not exist yet.
+ auto app_ptr = app_manager_.application(message.connection_key());
+ utils::SemanticVersion msg_version(0, 0, 0);
+ if (app_ptr) {
+ msg_version = app_ptr->msg_version();
+ } else if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
+ static_cast<mobile_apis::FunctionID::eType>(
+ output[strings::params][strings::function_id].asInt())) {
+ GetMessageVersion(output, msg_version);
+ }
+
if (!conversion_result ||
- !mobile_so_factory().attachSchema(output, true) ||
- ((output.validate() != smart_objects::Errors::OK))) {
+ !mobile_so_factory().attachSchema(output, true, msg_version) ||
+ ((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());
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
message.connection_key(),
message.function_id(),
message.correlation_id(),
mobile_apis::Result::INVALID_DATA));
+
+ (*response)[strings::msg_params][strings::info] =
+ rpc::PrettyFormat(report);
app_manager_.GetRPCService().ManageMobileCommand(
response, commands::Command::SOURCE_SDL);
return false;
@@ -249,7 +296,7 @@ bool RPCHandlerImpl::ConvertMessageToSO(
<< " binary size should be " << message.data_size()
<< " payload data size is "
<< message.payload_size());
- utils::SharedPtr<smart_objects::SmartObject> response(
+ std::shared_ptr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
message.connection_key(),
message.function_id(),
@@ -279,22 +326,32 @@ bool RPCHandlerImpl::ConvertMessageToSO(
LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
return false;
}
- if (output.validate() != smart_objects::Errors::OK) {
- LOG4CXX_ERROR(logger_, "Incorrect parameter from HMI");
+
+ rpc::ValidationReport report("RPC");
+
+ if (output.validate(&report) != smart_objects::errors::OK) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect parameter from HMI"
+ << rpc::PrettyFormat(report));
+
+ output.erase(strings::msg_params);
+ output[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_DATA;
+ output[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
return false;
}
break;
}
case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: {
- static NsSmartDeviceLinkRPC::V1::v4_protocol_v1_2_no_extra v1_shema;
+ static ns_smart_device_link_rpc::V1::v4_protocol_v1_2_no_extra v1_shema;
if (message.function_id() == 0 || message.type() == kUnknownType) {
LOG4CXX_ERROR(logger_, "Message received: UNSUPPORTED_VERSION");
int32_t conversation_result =
formatters::CFormatterJsonSDLRPCv1::fromString<
- NsSmartDeviceLinkRPC::V1::FunctionID::eType,
- NsSmartDeviceLinkRPC::V1::messageType::eType>(
+ ns_smart_device_link_rpc::V1::FunctionID::eType,
+ ns_smart_device_link_rpc::V1::messageType::eType>(
message.json_message(), output);
if (formatters::CFormatterJsonSDLRPCv1::kSuccess ==
@@ -303,7 +360,7 @@ bool RPCHandlerImpl::ConvertMessageToSO(
smart_objects::SmartType::SmartType_Map);
output[strings::params][strings::message_type] =
- NsSmartDeviceLinkRPC::V1::messageType::response;
+ ns_smart_device_link_rpc::V1::messageType::response;
output[strings::params][strings::connection_key] =
message.connection_key();
@@ -311,10 +368,10 @@ bool RPCHandlerImpl::ConvertMessageToSO(
smart_objects::SmartType::SmartType_Map);
output[strings::msg_params][strings::success] = false;
output[strings::msg_params][strings::result_code] =
- NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION;
+ ns_smart_device_link_rpc::V1::Result::UNSUPPORTED_VERSION;
smart_objects::SmartObjectSPtr msg_to_send =
- new smart_objects::SmartObject(output);
+ std::make_shared<smart_objects::SmartObject>(output);
v1_shema.attachSchema(*msg_to_send, false);
app_manager_.GetRPCService().SendMessageToMobile(msg_to_send);
return false;
@@ -333,11 +390,11 @@ bool RPCHandlerImpl::ConvertMessageToSO(
return true;
}
-utils::SharedPtr<Message> RPCHandlerImpl::ConvertRawMsgToMessage(
+std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage(
const protocol_handler::RawMessagePtr message) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(message);
- utils::SharedPtr<Message> outgoing_message;
+ std::shared_ptr<Message> outgoing_message;
LOG4CXX_DEBUG(logger_, "Service type." << message->service_type());
if (message->service_type() != protocol_handler::kRpc &&
@@ -351,7 +408,7 @@ utils::SharedPtr<Message> RPCHandlerImpl::ConvertRawMsgToMessage(
MobileMessageHandler::HandleIncomingMessageProtocol(message);
if (convertion_result) {
- outgoing_message = convertion_result;
+ outgoing_message = std::shared_ptr<Message>(convertion_result);
} else {
LOG4CXX_ERROR(logger_, "Received invalid message");
}
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index 7d930d1432..217af091b5 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -36,8 +36,8 @@ namespace application_manager {
namespace rpc_service {
CREATE_LOGGERPTR_LOCAL(logger_, "RPCServiceImpl")
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace jhs = ns_smart_device_link::ns_json_handler::strings;
RPCServiceImpl::RPCServiceImpl(
ApplicationManager& app_manager,
@@ -327,8 +327,8 @@ void RPCServiceImpl::Handle(const impl::MessageToMobile message) {
return;
}
- utils::SharedPtr<protocol_handler::RawMessage> rawMessage =
- MobileMessageHandler::HandleOutgoingMessageProtocol(message);
+ std::shared_ptr<protocol_handler::RawMessage> rawMessage(
+ MobileMessageHandler::HandleOutgoingMessageProtocol(message));
if (!rawMessage) {
LOG4CXX_ERROR(logger_, "Failed to create raw message.");
@@ -380,7 +380,7 @@ void RPCServiceImpl::SendMessageToMobile(
LOG4CXX_ERROR(logger_, "No application associated with connection key");
if (is_result_code_exists &&
((*message)[strings::msg_params][strings::result_code] ==
- NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION)) {
+ ns_smart_device_link_rpc::V1::Result::UNSUPPORTED_VERSION)) {
(*message)[strings::params][strings::protocol_version] =
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1;
} else {
@@ -404,7 +404,7 @@ void RPCServiceImpl::SendMessageToMobile(
"Attached schema to message, result if valid: " << message->isValid());
// Messages to mobile are not yet prioritized so use default priority value
- utils::SharedPtr<Message> message_to_send(
+ std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
if (!ConvertSOtoMessage((*message), (*message_to_send))) {
LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
@@ -486,7 +486,7 @@ void RPCServiceImpl::SendMessageToHMI(
}
// SmartObject |message| has no way to declare priority for now
- utils::SharedPtr<Message> message_to_send(
+ std::shared_ptr<Message> message_to_send(
new Message(protocol_handler::MessagePriority::kDefault));
if (!message_to_send) {
LOG4CXX_ERROR(logger_, "Null pointer");
@@ -498,15 +498,11 @@ void RPCServiceImpl::SendMessageToHMI(
logger_,
"Attached schema to message, result if valid: " << message->isValid());
-#ifdef HMI_DBUS_API
- message_to_send->set_smart_object(*message);
-#else
if (!ConvertSOtoMessage(*message, *message_to_send)) {
LOG4CXX_WARN(logger_,
"Cannot send message to HMI: failed to create string");
return;
}
-#endif // HMI_DBUS_API
messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
}
@@ -522,7 +518,7 @@ void RPCServiceImpl::set_hmi_message_handler(
}
bool RPCServiceImpl::ConvertSOtoMessage(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& message,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& message,
Message& output) {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 5514ad688a..ff9ebb6208 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -18,6 +18,7 @@ const char* msg_params = "msg_params";
const char* method_name = "methodName";
const char* info = "info";
const char* app_id = "appID";
+const char* full_app_id = "fullAppID";
const char* bundle_id = "appBundleID";
const char* app_info = "appInfo";
const char* app_launch = "app_launch";
@@ -124,6 +125,7 @@ const char* hours = "hours";
const char* minutes = "minutes";
const char* seconds = "seconds";
const char* update_mode = "updateMode";
+const char* audioStreamingIndicator = "audioStreamingIndicator";
const char* trigger_source = "triggerSource";
const char* hmi_level = "hmiLevel";
const char* activate_app_hmi_level = "level";
@@ -182,6 +184,7 @@ const char* did_location = "didLocation";
const char* app_list = "appList";
const char* device_list = "deviceList";
const char* device_info = "deviceInfo";
+const char* secondary_device_info = "secondaryDeviceInfo";
const char* name = "name";
const char* id = "id";
const char* isSDLAllowed = "isSDLAllowed";
@@ -224,6 +227,7 @@ const char* prndl = "prndl";
const char* tire_pressure = "tirePressure";
const char* odometer = "odometer";
const char* belt_status = "beltStatus";
+const char* electronic_park_brake_status = "electronicParkBrakeStatus";
const char* body_information = "bodyInformation";
const char* device_status = "deviceStatus";
const char* driver_braking = "driverBraking";
@@ -273,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 1a1e5543df..3d44709657 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -35,7 +35,7 @@
#include "application_manager/usage_statistics.h"
#include "application_manager/rpc_service.h"
#include "utils/helpers.h"
-#include "utils/make_shared.h"
+
#include "connection_handler/connection_handler.h"
namespace application_manager {
@@ -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);
@@ -472,7 +475,7 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel(
return result;
}
- const bool is_active_app_exist = app_mngr_.active_application();
+ const bool is_active_app_exist = (bool)app_mngr_.active_application();
if (is_audio_app) {
if (does_audio_app_with_same_type_exist) {
result = app_mngr_.GetDefaultHmiLevel(app);
@@ -853,7 +856,7 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
DCHECK_OR_RETURN_VOID(app);
const HmiStatePtr regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(regular);
- HmiStatePtr new_regular = utils::MakeShared<HmiState>(*regular);
+ HmiStatePtr new_regular = std::make_shared<HmiState>(*regular);
LOG4CXX_DEBUG(logger_, "Current HMI level: '" << app->hmi_level() << "'");
const bool is_audio_app = app->IsAudioApplication();
@@ -968,53 +971,53 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const {
}
HmiStatePtr StateControllerImpl::CreateHmiState(
- utils::SharedPtr<Application> app, HmiState::StateID state_id) const {
+ std::shared_ptr<Application> app, HmiState::StateID state_id) const {
using namespace utils;
LOG4CXX_AUTO_TRACE(logger_);
HmiStatePtr new_state;
switch (state_id) {
case HmiState::STATE_ID_PHONE_CALL: {
- new_state = MakeShared<PhoneCallHmiState>(app, app_mngr_);
+ new_state = std::make_shared<PhoneCallHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_SAFETY_MODE: {
- new_state = MakeShared<SafetyModeHmiState>(app, app_mngr_);
+ new_state = std::make_shared<SafetyModeHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_VR_SESSION: {
- new_state = MakeShared<VRHmiState>(app, app_mngr_);
+ new_state = std::make_shared<VRHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_TTS_SESSION: {
- new_state = MakeShared<TTSHmiState>(app, app_mngr_);
+ new_state = std::make_shared<TTSHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_VIDEO_STREAMING: {
- new_state = MakeShared<VideoStreamingHmiState>(app, app_mngr_);
+ new_state = std::make_shared<VideoStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_NAVI_STREAMING: {
- new_state = MakeShared<NaviStreamingHmiState>(app, app_mngr_);
+ new_state = std::make_shared<NaviStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_REGULAR: {
- new_state = MakeShared<HmiState>(app, app_mngr_);
+ new_state = std::make_shared<HmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_POSTPONED: {
- new_state = MakeShared<HmiState>(app, app_mngr_, state_id);
+ new_state = std::make_shared<HmiState>(app, app_mngr_, state_id);
break;
}
case HmiState::STATE_ID_DEACTIVATE_HMI: {
- new_state = MakeShared<DeactivateHMI>(app, app_mngr_);
+ new_state = std::make_shared<DeactivateHMI>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_AUDIO_SOURCE: {
- new_state = MakeShared<AudioSource>(app, app_mngr_);
+ new_state = std::make_shared<AudioSource>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_EMBEDDED_NAVI: {
- new_state = MakeShared<EmbeddedNavi>(app, app_mngr_);
+ new_state = std::make_shared<EmbeddedNavi>(app, app_mngr_);
break;
}
default:
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
index 80755b6509..1cfccd816e 100644
--- a/src/components/application_manager/src/usage_statistics.cc
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -35,10 +35,9 @@
#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
using namespace mobile_apis;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
using namespace usage_statistics;
namespace application_manager {
@@ -56,7 +55,7 @@ std::string LanguageIdToString(Language::eType lang_id) {
UsageStatistics::UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<StatisticsManager> statistics_manager)
+ std::shared_ptr<StatisticsManager> statistics_manager)
: time_in_hmi_state_sptr_(
new usage_statistics::AppStopwatchImpl(statistics_manager, app_id))
, app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI)
@@ -78,7 +77,7 @@ UsageStatistics::UsageStatistics(
UsageStatistics::UsageStatistics(
const std::string& app_id,
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
AppStopwatch* time_in_hmi_state_ptr)
: time_in_hmi_state_sptr_(time_in_hmi_state_ptr)
, app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI)
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 579ffe8c1b..02cf58485a 100644..100755
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -45,6 +45,7 @@ include_directories(
${COMPONENTS_DIR}/media_manager/include/
${COMPONENTS_DIR}/security_manager/include/
${COMPONENTS_DIR}/application_manager/test/include/
+ ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/
${BSON_INCLUDE_DIRECTORY}
)
@@ -72,6 +73,10 @@ set(testSourcesMockHmi
${AM_TEST_DIR}/application_manager_impl_mock_hmi_test.cc
)
+set(testSourcesHelpPromptManager
+ ${AM_TEST_DIR}/help_prompt_manager_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+)
set (RequestController_SOURCES
${AM_TEST_DIR}/request_controller/request_controller_test.cc
${AM_TEST_DIR}/mock_message_helper.cc
@@ -80,6 +85,7 @@ set (RequestController_SOURCES
set(LIBRARIES
Utils
ApplicationManager
+ sdl_rpc_plugin
jsoncpp
Policy
connectionHandler
@@ -129,7 +135,8 @@ set(CMAKE_EXE_LINKER_FLAGS
)
create_test("application_manager_test" "${testSources}" "${LIBRARIES}")
create_test("application_manager_mock_hmi_test" "${testSourcesMockHmi}" "${LIBRARIES}")
-#add_dependencies("application_manager_test" libbson)
+
+create_test("help_prompt_manager_test" "${testSourcesHelpPromptManager}" "${LIBRARIES}")
create_test("request_controller_test" "${RequestController_SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
index 1b90f29647..3293a8908d 100644
--- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -40,7 +40,7 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
#include "connection_handler/mock_connection_handler.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
namespace test {
@@ -60,12 +60,12 @@ namespace ch_test = test::components::connection_handler_test;
namespace am_test = test::components::application_manager_test;
const uint32_t MAX_TEST_DURATION = 1000; // 1 second
-typedef utils::SharedPtr<am_test::MockApplication> MockAppPtr;
+typedef std::shared_ptr<am_test::MockApplication> MockAppPtr;
class AppLaunchCtrlTest : public ::testing::Test {
public:
MockAppPtr AppFromAppData(const app_launch::ApplicationData& app_data) {
- utils::SharedPtr<NiceMock<am_test::MockApplication> > app =
- utils::MakeShared<NiceMock<am_test::MockApplication> >();
+ std::shared_ptr<NiceMock<am_test::MockApplication> > app =
+ std::make_shared<NiceMock<am_test::MockApplication> >();
ON_CALL(*app, mac_address()).WillByDefault(ReturnRef(app_data.device_mac_));
ON_CALL(*app, bundle_id()).WillByDefault(ReturnRef(app_data.bundle_id_));
@@ -77,7 +77,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
app_launch::ApplicationDataPtr AppDataFromApp(
const am_test::MockApplication& app) {
app_launch::ApplicationDataPtr app_data =
- utils::MakeShared<NiceMock<app_launch::ApplicationData> >(
+ std::make_shared<NiceMock<app_launch::ApplicationData> >(
app.policy_app_id(), app.bundle_id(), app.mac_address());
return app_data;
}
@@ -137,7 +137,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
using app_launch::ApplicationData;
AppAndAppData app;
app.second =
- utils::MakeShared<ApplicationData>(app_id, bundle_id, device_mac);
+ std::make_shared<ApplicationData>(app_id, bundle_id, device_mac);
app.first = AppFromAppData(*app.second);
return app;
}
@@ -164,7 +164,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
NiceMock<ch_test::MockConnectionHandler> connection_handler_mock_;
NiceMock<resumprion_test::MockResumeCtrl> resume_ctrl_mock_;
NiceMock<app_launch_test::MockAppLaunchSettings> settings_;
- std::auto_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
+ std::unique_ptr<app_launch::AppLaunchCtrlImpl> app_launch_ctrl_;
};
app_launch::ApplicationData AppDataFromApp(
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
index e095f0682e..dc96fcf176 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc
@@ -38,7 +38,7 @@
#include "utils/macro.h"
#include "sql_database.h"
#include "sql_query.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "application_manager/mock_app_launch_settings.h"
#include "application_manager/app_launch/app_launch_data_db.h"
@@ -113,7 +113,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
return test_db_;
}
- static std::auto_ptr<AppLaunchDataDB> res_db_;
+ static std::unique_ptr<AppLaunchDataDB> res_db_;
AppLaunchDataDB* res_db() {
return res_db_.get();
@@ -145,7 +145,7 @@ class AppLaunchDataDBTest : public ::testing::Test {
};
utils::dbms::SQLDatabase* AppLaunchDataDBTest::test_db_ = NULL;
-std::auto_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
+std::unique_ptr<AppLaunchDataDB> AppLaunchDataDBTest::res_db_;
void AppLaunchDataDBTest::AddApplicationDataWithIncreaseTable(
const ApplicationData& data) {
@@ -284,7 +284,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d1_mobile_app_id", i);
const std::string bundle_id = AddCounter("d1_bundle_id", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_1);
AddApplicationDataWithIncreaseTable(*app_data);
input_data1.push_back(app_data);
@@ -294,7 +294,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d2_mobile_app_id", i);
const std::string bundle_id = AddCounter("d2_bundle_id", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_2);
AddApplicationDataWithIncreaseTable(*app_data);
input_data2.push_back(app_data);
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
index cc7d3f5814..4541970c70 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
@@ -36,7 +36,6 @@
#include "json/json.h"
#include "gtest/gtest.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
#include "resumption/last_state_impl.h"
@@ -67,7 +66,7 @@ class AppLaunchDataJsonTest : public ::testing::Test {
private:
virtual void SetUp() {
::file_system::DeleteFile(kAppStorageFile);
- test_last_state_ = std::auto_ptr<resumption::LastState>(
+ test_last_state_ = std::unique_ptr<resumption::LastState>(
new resumption::LastStateImpl(kAppStorageFolder, kAppInfoStorage));
ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
@@ -97,14 +96,15 @@ class AppLaunchDataJsonTest : public ::testing::Test {
void AddApplicationDataWithIncreaseTable(const ApplicationData& data);
void AddApplicationDataWithoutIncreaseTable(const ApplicationData& data);
- TimevalStruct GetApplicationData_EXPECT_TRUE(const ApplicationData& in_data,
- ApplicationData& out_data);
+ date_time::TimeDuration GetApplicationData_EXPECT_TRUE(
+ const ApplicationData& in_data, ApplicationData& out_data);
void GetApplicationData_EXPECT_FALSE(const ApplicationData& in_data);
std::string AddCounter(const std::string& inp, int32_t val);
- std::auto_ptr<resumption::LastState> test_last_state_;
- std::auto_ptr<AppLaunchDataJson> res_json_;
- void SetTimestamp(const ApplicationData& in_data, TimevalStruct& timestamp);
+ std::unique_ptr<resumption::LastState> test_last_state_;
+ std::unique_ptr<AppLaunchDataJson> res_json_;
+ void SetTimestamp(const ApplicationData& in_data,
+ date_time::TimeDuration& timestamp);
};
void AppLaunchDataJsonTest::AddApplicationDataWithIncreaseTable(
@@ -129,7 +129,7 @@ void AppLaunchDataJsonTest::AddApplicationDataWithoutIncreaseTable(
EXPECT_EQ(sizeBeforeAdding, sizeAfterAdding);
}
-TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
+date_time::TimeDuration AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
const ApplicationData& in_data, ApplicationData& out_data) {
uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
@@ -148,9 +148,9 @@ TimevalStruct AppLaunchDataJsonTest::GetApplicationData_EXPECT_TRUE(
out_data.bundle_id_ =
json_data_list[index][am::strings::bundle_id].asString();
// time stamp
- TimevalStruct tmVal = {0};
- tmVal.tv_sec =
- json_data_list[index][am::strings::app_launch_last_session].asUInt64();
+ date_time::TimeDuration tmVal = date_time::seconds(
+ json_data_list[index][am::strings::app_launch_last_session].asUInt64());
+
return tmVal;
}
@@ -168,7 +168,7 @@ void AppLaunchDataJsonTest::GetApplicationData_EXPECT_FALSE(
}
void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
- TimevalStruct& timestamp) {
+ date_time::TimeDuration& timestamp) {
uint32_t sizeBeforeGetting = res_json()->GetCurentNumberOfAppData();
int32_t index = NotFound;
@@ -183,7 +183,7 @@ void AppLaunchDataJsonTest::SetTimestamp(const ApplicationData& in_data,
EXPECT_EQ(sizeBeforeGetting, sizeAfterGetting);
// time stamp
json_data_list[index][am::strings::app_launch_last_session] =
- static_cast<Json::Value::UInt64>(timestamp.tv_sec);
+ static_cast<Json::Value::UInt64>(date_time::getSecs(timestamp));
}
std::string AppLaunchDataJsonTest::AddCounter(const std::string& inp,
@@ -225,18 +225,18 @@ TEST_F(AppLaunchDataJsonTest, RefreshTimestamp) {
ApplicationData data("mobile_app_id", "bundle_id", "device_mac");
AddApplicationDataWithIncreaseTable(data);
ApplicationData recoveredData("", "", "");
- TimevalStruct timestamp1 =
+ date_time::TimeDuration timestamp1 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
- TimevalStruct tm = {0, 0};
+ date_time::TimeDuration tm = date_time::TimeDurationZero();
SetTimestamp(data, tm);
- TimevalStruct timestamp2 =
+ date_time::TimeDuration timestamp2 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
- EXPECT_NE(timestamp1.tv_sec, timestamp2.tv_sec);
+ EXPECT_NE(date_time::getSecs(timestamp1), date_time::getSecs(timestamp2));
AddApplicationDataWithoutIncreaseTable(data); // again insert the same
- TimevalStruct timestamp3 =
+ date_time::TimeDuration timestamp3 =
GetApplicationData_EXPECT_TRUE(data, recoveredData);
EXPECT_TRUE(data == recoveredData);
- EXPECT_NE(timestamp2.tv_sec, timestamp3.tv_sec);
+ EXPECT_NE(date_time::getSecs(timestamp2), date_time::getSecs(timestamp3));
}
TEST_F(AppLaunchDataJsonTest, MaxCount) {
@@ -250,7 +250,7 @@ TEST_F(AppLaunchDataJsonTest, MaxCount) {
// insert new time stamp
ApplicationData changedRecord("mobile_app_id_0", "bundle_id_0", "device_mac");
- TimevalStruct tm = {0, 0};
+ date_time::TimeDuration tm = date_time::TimeDurationZero();
SetTimestamp(changedRecord, tm);
uint32_t size_max = res_json()->GetCurentNumberOfAppData();
@@ -301,7 +301,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d1_mobile_app_id_", i);
const std::string bundle_id = AddCounter("d1_bundle_id_", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_1);
AddApplicationDataWithIncreaseTable(*app_data);
input_data1.push_back(app_data);
@@ -311,7 +311,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) {
const std::string mobile_app_id = AddCounter("d2_mobile_app_id_", i);
const std::string bundle_id = AddCounter("d2_bundle_id_", i);
- ApplicationDataPtr app_data = utils::MakeShared<ApplicationData>(
+ ApplicationDataPtr app_data = std::make_shared<ApplicationData>(
mobile_app_id, bundle_id, device_mac_2);
AddApplicationDataWithIncreaseTable(*app_data);
input_data2.push_back(app_data);
diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc
index c9a8fd2da4..3203839fc2 100644
--- a/src/components/application_manager/test/application_helper_test.cc
+++ b/src/components/application_manager/test/application_helper_test.cc
@@ -50,8 +50,7 @@
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "test/resumption/mock_last_state.h"
#include "media_manager/mock_media_manager.h"
@@ -121,13 +120,13 @@ class ApplicationHelperTest : public testing::Test {
.WillOnce(ReturnRef(path_to_plagin));
app_manager_impl_.Init(mock_last_state_, &mock_media_manager_);
- app_impl_ = new ApplicationImpl(
+ app_impl_ = std::make_shared<ApplicationImpl>(
application_id,
policy_app_id,
mac_address,
device_id,
app_name,
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>(),
+ std::make_shared<usage_statistics_test::MockStatisticsManager>(),
app_manager_impl_);
}
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index be2986e719..301ed227b8 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -39,7 +39,6 @@
#include "application_manager/hmi_state.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
#include "application_manager/mock_message_helper.h"
#include "utils/custom_string.h"
#include "application_manager/mock_application_manager.h"
@@ -64,6 +63,7 @@ using namespace mobile_apis;
namespace custom_str = utils::custom_string;
using ::testing::_;
+using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::AtLeast;
@@ -100,12 +100,17 @@ class ApplicationImplTest : public ::testing::Test {
mac_address,
device_handle,
app_name,
- utils::MakeShared<MockStatisticsManager>(),
+ std::make_shared<MockStatisticsManager>(),
mock_application_manager_));
HmiStatePtr initial_state = CreateTestHmiState();
app_impl->SetInitialState(initial_state);
}
+
+ virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(MockMessageHelper::message_helper_mock());
+ }
+
HmiStatePtr CreateTestHmiState();
HmiStatePtr TestAddHmiState(HMILevel::eType hmi_lvl,
@@ -115,7 +120,7 @@ class ApplicationImplTest : public ::testing::Test {
void CheckCurrentHMIState();
MockApplicationManagerSettings mock_application_manager_settings_;
MockApplicationManager mock_application_manager_;
- utils::SharedPtr<ApplicationImpl> app_impl;
+ std::shared_ptr<ApplicationImpl> app_impl;
uint32_t app_id;
std::string policy_app_id;
std::string mac_address;
@@ -130,8 +135,8 @@ class ApplicationImplTest : public ::testing::Test {
};
HmiStatePtr ApplicationImplTest::CreateTestHmiState() {
- HmiStatePtr testState = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(app_impl),
+ HmiStatePtr testState = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(app_impl),
mock_application_manager_,
state_id);
testState->set_hmi_level(test_lvl);
@@ -265,7 +270,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) {
// Last state does not have a parent
EXPECT_EQ(HMILevel::HMI_LIMITED, current_state->hmi_level());
EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id());
- EXPECT_EQ(NULL, current_state->parent());
+ EXPECT_EQ(nullptr, current_state->parent());
}
TEST_F(ApplicationImplTest, SetRegularState_RemoveFirstState) {
@@ -304,7 +309,7 @@ TEST_F(ApplicationImplTest, SetPostponedState_RemovePostponedState) {
// Check that state was correctly removed
app_impl->RemovePostponedState();
state2 = app_impl->PostponedHmiState();
- EXPECT_EQ(NULL, state2);
+ EXPECT_EQ(nullptr, state2);
}
TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) {
@@ -400,7 +405,7 @@ TEST_F(ApplicationImplTest, GetFile) {
test_file.file_type = FileType::GRAPHIC_JPEG;
test_file.file_name = "test_file 1";
- EXPECT_EQ(NULL, app_impl->GetFile(test_file.file_name));
+ EXPECT_EQ(nullptr, app_impl->GetFile(test_file.file_name));
EXPECT_TRUE(app_impl->AddFile(test_file));
const AppFile* app_file = app_impl->GetFile(test_file.file_name);
EXPECT_EQ(test_file.is_persistent, app_file->is_persistent);
@@ -806,7 +811,7 @@ TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) {
TEST_F(ApplicationImplTest, PushPopMobileMessage) {
smart_objects::SmartObjectSPtr on_driver_distraction =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
const hmi_apis::Common_DriverDistractionState::eType state =
hmi_apis::Common_DriverDistractionState::DD_ON;
(*on_driver_distraction)[strings::params][strings::function_id] =
@@ -827,6 +832,29 @@ TEST_F(ApplicationImplTest, PushPopMobileMessage) {
EXPECT_TRUE(messages.empty());
}
+TEST_F(ApplicationImplTest, SetSecondaryDeviceTest) {
+ connection_handler::DeviceHandle initial_device =
+ app_impl->secondary_device();
+ EXPECT_EQ(0u, initial_device);
+
+ connection_handler::DeviceHandle device = 123;
+ app_impl->set_secondary_device(device);
+
+ EXPECT_EQ(device, app_impl->secondary_device());
+}
+
+TEST_F(ApplicationImplTest, SetDeferredResumptionHMILevelTest) {
+ using namespace mobile_api::HMILevel;
+ HMILevel::eType initial_deferred_level =
+ app_impl->deferred_resumption_hmi_level();
+ EXPECT_EQ(HMILevel::eType::INVALID_ENUM, initial_deferred_level);
+
+ HMILevel::eType deferred_level = HMILevel::eType::HMI_FULL;
+ app_impl->set_deferred_resumption_hmi_level(deferred_level);
+
+ EXPECT_EQ(deferred_level, app_impl->deferred_resumption_hmi_level());
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
index 9ae388c809..8ab852779a 100644
--- a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
@@ -38,7 +38,7 @@
#include "application_manager/application_impl.h"
#include "application_manager/application_manager_impl.h"
#include "utils/custom_string.h"
-#include "utils/make_shared.h"
+
#include "encryption/hashing.h"
#include "application_manager/mock_application_manager_settings.h"
@@ -87,7 +87,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test {
public:
ApplicationManagerImplMockHmiTest()
: mock_storage_(
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
mock_app_mngr_)) {}
protected:
@@ -146,8 +146,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test {
Return(0)));
}
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
application_manager_test::MockApplicationManager mock_app_mngr_;
NiceMock<policy_handler_test::MockPolicySettings> mock_policy_settings_;
NiceMock<connection_handler_test::MockConnectionHandler>
@@ -168,13 +167,13 @@ TEST_F(ApplicationManagerImplMockHmiTest,
plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
new plugin_manager::MockRPCPluginManager;
- utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl(
+ std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>(
application_id,
policy_app_id,
encryption::MakeHash(mac_address),
device_id,
app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager()),
*app_manager_impl_);
std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr(
@@ -195,7 +194,7 @@ TEST_F(ApplicationManagerImplMockHmiTest,
// // Skip sending notification on device switching as it is not the goal
// here
EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
- .WillOnce(Return(utils::SharedPtr<commands::Command>()));
+ .WillOnce(Return(std::shared_ptr<commands::Command>()));
plugin_manager::MockRPCPlugin mock_rpc_plugin;
utils::Optional<plugin_manager::RPCPlugin> mock_rpc_plugin_opt =
@@ -212,15 +211,15 @@ TEST_F(ApplicationManagerImplMockHmiTest,
const uint32_t correlation_id_1 = 1u;
const uint32_t correlation_id_2 = 2u;
const uint32_t correlation_id_3 = 3u;
- utils::SharedPtr<NiceMock<MockRequest> > cmd_1 =
- utils::MakeShared<NiceMock<MockRequest> >(connection_key,
- correlation_id_1);
- utils::SharedPtr<NiceMock<MockRequest> > cmd_2 =
- utils::MakeShared<NiceMock<MockRequest> >(connection_key,
- correlation_id_2);
- utils::SharedPtr<NiceMock<MockRequest> > cmd_3 =
- utils::MakeShared<NiceMock<MockRequest> >(connection_key,
- correlation_id_3);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_1 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_1);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_2 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_2);
+ std::shared_ptr<NiceMock<MockRequest> > cmd_3 =
+ std::make_shared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_3);
EXPECT_CALL(mock_command_factory, CreateCommand(_, _))
.WillOnce(Return(cmd_1))
@@ -228,11 +227,11 @@ TEST_F(ApplicationManagerImplMockHmiTest,
.WillOnce(Return(cmd_3));
commands::MessageSharedPtr hmi_msg_1 =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
commands::MessageSharedPtr hmi_msg_2 =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
commands::MessageSharedPtr hmi_msg_3 =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*hmi_msg_1)[strings::msg_params][strings::app_id] =
(*hmi_msg_2)[strings::msg_params][strings::app_id] =
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 c13a47aae5..cf848ba159 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -58,7 +58,7 @@
#include "utils/custom_string.h"
#include "utils/file_system.h"
#include "utils/lock.h"
-#include "utils/make_shared.h"
+
#include "utils/push_log.h"
#include "encryption/hashing.h"
@@ -71,6 +71,7 @@ namespace policy_test = test::components::policy_handler_test;
namespace con_test = connection_handler_test;
using testing::_;
+using ::testing::An;
using ::testing::Matcher;
using ::testing::ByRef;
using ::testing::DoAll;
@@ -102,18 +103,20 @@ class ApplicationManagerImplTest : public ::testing::Test {
ApplicationManagerImplTest()
: app_id_(0u)
, mock_storage_(
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
mock_app_mngr_))
, mock_rpc_service_(new MockRPCService)
, mock_message_helper_(
application_manager::MockMessageHelper::message_helper_mock())
{
+#ifdef ENABLE_LOG
logger::create_log_message_loop_thread();
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+#endif
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
}
~ApplicationManagerImplTest() {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ Mock::VerifyAndClearExpectations(mock_message_helper_);
}
protected:
@@ -150,7 +153,7 @@ class ApplicationManagerImplTest : public ::testing::Test {
app_manager_impl_.reset(new am::ApplicationManagerImpl(
mock_application_manager_settings_, mock_policy_settings_));
- mock_app_ptr_ = utils::SharedPtr<MockApplication>(new MockApplication());
+ mock_app_ptr_ = std::shared_ptr<MockApplication>(new MockApplication());
app_manager_impl_->set_protocol_handler(&mock_protocol_handler_);
ASSERT_TRUE(app_manager_impl_.get());
ASSERT_TRUE(mock_app_ptr_.get());
@@ -185,25 +188,32 @@ class ApplicationManagerImplTest : public ::testing::Test {
SetArgPointee<4u>(connection_type),
Return(0)));
}
+
+ bool CheckResumptionRequiredTransportAvailableTest(
+ smart_objects::SmartObject* app_types_array,
+ connection_handler::DeviceHandle primary_device_handle,
+ std::string primary_transport_device_string,
+ connection_handler::DeviceHandle secondary_device_handle,
+ std::string secondary_transport_device_string);
+
uint32_t app_id_;
NiceMock<policy_test::MockPolicySettings> mock_policy_settings_;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
std::unique_ptr<rpc_service::RPCService> mock_rpc_service_;
NiceMock<con_test::MockConnectionHandler> mock_connection_handler_;
NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_app_mngr_;
- std::auto_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
application_manager::MockMessageHelper* mock_message_helper_;
- utils::SharedPtr<MockApplication> mock_app_ptr_;
+ std::shared_ptr<MockApplication> mock_app_ptr_;
NiceMock<protocol_handler_test::MockProtocolHandler> mock_protocol_handler_;
};
TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject app_data;
const uint32_t connection_key = 65537u;
app_data[am::json::name] = "application_manager_test";
@@ -212,7 +222,7 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
app_data[am::json::android][am::json::packageName] = "com.android.test";
smart_objects::SmartObject sm_object(SmartType_Map);
sm_object[am::json::response][0] = app_data;
- SmartObjectSPtr sptr = MakeShared<SmartObject>(sm_object);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(sm_object);
ON_CALL(*mock_message_helper_, CreateModuleInfoSO(_, _))
.WillByDefault(Return(sptr));
@@ -223,16 +233,14 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
TEST_F(ApplicationManagerImplTest,
SubscribeAppForWayPoints_ExpectSubscriptionApp) {
- auto app_ptr =
- ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
}
TEST_F(ApplicationManagerImplTest,
UnsubscribeAppForWayPoints_ExpectUnsubscriptionApp) {
- auto app_ptr =
- ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
app_manager_impl_->UnsubscribeAppFromWayPoints(app_ptr);
@@ -246,19 +254,19 @@ 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());
}
TEST_F(
ApplicationManagerImplTest,
GetAppsSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
- auto app_ptr =
- ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_);
app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
std::set<int32_t> result = app_manager_impl_->GetAppsSubscribedForWayPoints();
EXPECT_EQ(1u, result.size());
- EXPECT_TRUE(result.find(app_ptr) != result.end());
+ EXPECT_TRUE(result.find(app_ptr->app_id()) != result.end());
}
TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) {
@@ -688,9 +696,89 @@ TEST_F(ApplicationManagerImplTest,
}
TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportStartedCallback_BeforeAppRegistration) {
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = 123;
+
+ // make sure that BC.UpdateAppList is not invoked
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .Times(0);
+
+ app_manager_impl_->OnSecondaryTransportStartedCallback(device_handle,
+ session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportStartedCallback_AfterAppRegistration) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ AddMockApplication();
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(app_id_));
+
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = app_id_;
+
+ EXPECT_CALL(*mock_app_ptr_, set_secondary_device(device_handle)).Times(1);
+ // called by ResumeCtrlImpl::RetryResumption()
+ EXPECT_CALL(*mock_app_ptr_, deferred_resumption_hmi_level())
+ .WillOnce(Return(mobile_api::HMILevel::eType::INVALID_ENUM));
+
+ smart_objects::SmartObject dummy_object(SmartType_Map);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+
+ app_manager_impl_->OnSecondaryTransportStartedCallback(device_handle,
+ session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportEndedCallback_AfterAppRegistration) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ const connection_handler::DeviceHandle device_handle = 1;
+ const int32_t session_key = app_id_;
+
+ AddMockApplication();
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(app_id_));
+ EXPECT_CALL(*mock_app_ptr_, secondary_device())
+ .WillRepeatedly(Return(device_handle));
+
+ EXPECT_CALL(*mock_app_ptr_, set_secondary_device(0)).Times(1);
+
+ smart_objects::SmartObject dummy_object(SmartType_Map);
+ SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object);
+
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .WillOnce(Return(sptr));
+
+ app_manager_impl_->OnSecondaryTransportEndedCallback(session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnSecondaryTransportEndedCallback_BeforeAppRegistration) {
+ const int32_t session_key = app_id_;
+
+ // make sure that BC.UpdateAppList is not invoked
+ EXPECT_CALL(*mock_message_helper_,
+ CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _))
+ .Times(0);
+
+ app_manager_impl_->OnSecondaryTransportEndedCallback(session_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
OnDeviceSwitchingStart_ExpectPutAppsInWaitList) {
- utils::SharedPtr<MockApplication> switching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> switching_app_ptr =
+ std::make_shared<MockApplication>();
const std::string switching_device_id = "switching";
const std::string switching_device_id_hash =
@@ -707,8 +795,8 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*switching_app_ptr, hmi_level())
.WillRepeatedly(Return(hmi_level_switching_app));
- utils::SharedPtr<MockApplication> nonswitching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> nonswitching_app_ptr =
+ std::make_shared<MockApplication>();
const std::string nonswitching_device_id = "nonswitching";
const std::string nonswitching_device_id_hash =
@@ -747,8 +835,8 @@ TEST_F(ApplicationManagerImplTest,
TEST_F(ApplicationManagerImplTest,
OnDeviceSwitchingFinish_ExpectUnregisterAppsInWaitList) {
- utils::SharedPtr<MockApplication> switching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> switching_app_ptr =
+ std::make_shared<MockApplication>();
plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager =
new plugin_manager::MockRPCPluginManager;
@@ -771,8 +859,8 @@ TEST_F(ApplicationManagerImplTest,
EXPECT_CALL(*switching_app_ptr, hmi_level())
.WillRepeatedly(Return(hmi_level_switching_app));
- utils::SharedPtr<MockApplication> nonswitching_app_ptr =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> nonswitching_app_ptr =
+ std::make_shared<MockApplication>();
const std::string nonswitching_device_id = "nonswitching";
const std::string nonswitching_device_id_hash =
@@ -820,13 +908,13 @@ TEST_F(ApplicationManagerImplTest,
const connection_handler::DeviceHandle device_id = 1;
const custom_str::CustomString app_name("");
- utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl(
+ std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>(
application_id,
policy_app_id,
mac_address,
device_id,
app_name,
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager()),
*app_manager_impl_);
@@ -897,8 +985,8 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
const uint32_t app_id_2 = 65538;
std::string dummy_mac_address;
- utils::SharedPtr<MockApplication> mock_app_1 =
- utils::SharedPtr<MockApplication>(new MockApplication());
+ std::shared_ptr<MockApplication> mock_app_1 =
+ std::shared_ptr<MockApplication>(new MockApplication());
EXPECT_CALL(*mock_app_1, app_id()).WillRepeatedly(Return(app_id_1));
EXPECT_CALL(*mock_app_1, device()).WillRepeatedly(Return(0));
EXPECT_CALL(*mock_app_1, mac_address())
@@ -908,8 +996,8 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
.WillRepeatedly(
Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
- utils::SharedPtr<MockApplication> mock_app_2 =
- utils::SharedPtr<MockApplication>(new MockApplication());
+ std::shared_ptr<MockApplication> mock_app_2 =
+ std::shared_ptr<MockApplication>(new MockApplication());
EXPECT_CALL(*mock_app_2, app_id()).WillRepeatedly(Return(app_id_2));
EXPECT_CALL(*mock_app_2, device()).WillRepeatedly(Return(0));
EXPECT_CALL(*mock_app_2, mac_address())
@@ -963,6 +1051,324 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) {
}
}
+static std::map<std::string, std::vector<std::string> > CreateTransportMap() {
+ /*
+ * DefaultTransportRequiredForResumption = TCP_WIFI, IAP_USB, SPP_BLUETOOTH
+ * MediaTransportRequiredForResumption = TCP_WIFI, AOA_USB
+ * NavigationTransportRequiredForResumption = AOA_USB, SPP_BLUETOOTH
+ * TestingTransportRequiredForResumption =
+ * EmptyAppTransportRequiredForResumption = TCP_WIFI
+ */
+ std::string TCP_WIFI("TCP_WIFI");
+ std::string IAP_USB("IAP_USB");
+ std::string SPP_BLUETOOTH("SPP_BLUETOOTH");
+ std::string AOA_USB("AOA_USB");
+
+ std::vector<std::string> default_transports;
+ default_transports.push_back(TCP_WIFI);
+ default_transports.push_back(IAP_USB);
+ default_transports.push_back(SPP_BLUETOOTH);
+ std::vector<std::string> media_transports;
+ media_transports.push_back(TCP_WIFI);
+ media_transports.push_back(AOA_USB);
+ std::vector<std::string> navi_transports;
+ navi_transports.push_back(AOA_USB);
+ navi_transports.push_back(SPP_BLUETOOTH);
+ std::vector<std::string> testing_transports;
+ std::vector<std::string> empty_transports;
+ empty_transports.push_back(TCP_WIFI);
+
+ std::map<std::string, std::vector<std::string> > transport_map;
+ transport_map[std::string("DEFAULT")] = default_transports;
+ transport_map[std::string("MEDIA")] = media_transports;
+ transport_map[std::string("NAVIGATION")] = navi_transports;
+ transport_map[std::string("TESTING")] = testing_transports;
+ transport_map[std::string("EMPTY_APP")] = empty_transports;
+
+ return transport_map;
+}
+
+bool ApplicationManagerImplTest::CheckResumptionRequiredTransportAvailableTest(
+ smart_objects::SmartObject* app_types_array,
+ connection_handler::DeviceHandle primary_device_handle,
+ std::string primary_transport_device_string,
+ connection_handler::DeviceHandle secondary_device_handle,
+ std::string secondary_transport_device_string) {
+ EXPECT_CALL(*mock_app_ptr_, app_types())
+ .WillRepeatedly(Return(app_types_array));
+
+ std::map<std::string, std::vector<std::string> > transport_map =
+ CreateTransportMap();
+
+ EXPECT_CALL(mock_application_manager_settings_,
+ transport_required_for_resumption_map())
+ .WillRepeatedly(ReturnRef(transport_map));
+
+ EXPECT_CALL(*mock_app_ptr_, device())
+ .WillRepeatedly(Return(primary_device_handle));
+ EXPECT_CALL(*mock_app_ptr_, secondary_device())
+ .WillRepeatedly(Return(secondary_device_handle));
+
+ EXPECT_CALL(mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(primary_device_handle))
+ .WillOnce(Return(primary_transport_device_string));
+
+ if (secondary_device_handle != 0) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(secondary_device_handle))
+ .WillOnce(Return(secondary_transport_device_string));
+ } else {
+ EXPECT_CALL(mock_session_observer_,
+ TransportTypeProfileStringFromDeviceHandle(
+ secondary_device_handle)).WillOnce(Return(std::string("")));
+ }
+
+ return app_manager_impl_->CheckResumptionRequiredTransportAvailable(
+ mock_app_ptr_);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_Success) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::DEFAULT;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is DEFAULT.
+ // - A DEFAULT app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI, IAP_USB or SPP_BLUETOOTH.
+ // - We have SPP_BLUETOOTH for primary transport.
+ // -> Conclusion: the app has required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NotListed) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::SOCIAL;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is SOCIAL.
+ // - We do not have an entry in .ini file for SOCIAL apps.
+ // -> In this case, resumption is always enabled for backward compatibility.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_Disabled) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::TESTING;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app is TESTING.
+ // - We do not have any transports allowed for TESTING apps.
+ // -> In this case, resumption is always disabled.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NoAppTypes) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ // we don't specify any app type
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app doesn't specify AppHMIType.
+ // - .ini file specifies TCP_WIFI for EMPTY_APP entry.
+ // -> The app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_PrimaryOnly_NoAppTypes2) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 0;
+
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("");
+
+ // - The app doesn't specify AppHMIType.
+ // - .ini file specifies TCP_WIFI for EMPTY_APP entry.
+ // -> The app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ NULL,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_TwoTransports_Success) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::MEDIA;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("SPP_BLUETOOTH");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is MEDIA.
+ // - A MEDIA app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI or AOA_USB.
+ // - We have TCP_WIFI for secondary transport.
+ // -> Conclusion: the app has required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_TRUE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_TwoTransports_Failure) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::NAVIGATION;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ // refer to transport_adapter_impl.cc
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is NAVIGATION.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - We have IAP_USB for primary and TCP_WIFI for secondary transport.
+ // -> Conclusion: the app does not have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_MultipleAppTypes_Failure) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::MEDIA;
+ app_types_array[1] = mobile_apis::AppHMIType::eType::NAVIGATION;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is MEDIA and NAVIGATION.
+ // - A MEDIA app is allowed for resumption if either primary or secondary
+ // transport is TCP_WIFI or AOA_USB.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - We have IAP_USB for primary and TCP_WIFI is secondary
+ // -> Conclusion: the app does NOT have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ CheckResumptionRequiredTransportAvailableTest_MultipleAppTypes_Empty) {
+ using namespace ns_smart_device_link::ns_smart_objects;
+
+ smart_objects::SmartObject app_types_array(SmartType_Array);
+ app_types_array[0] = mobile_apis::AppHMIType::eType::NAVIGATION;
+ app_types_array[1] = mobile_apis::AppHMIType::eType::SYSTEM;
+
+ const connection_handler::DeviceHandle primary_device_handle = 1;
+ const connection_handler::DeviceHandle secondary_device_handle = 2;
+
+ std::string primary_transport_device_string("IAP_USB");
+ std::string secondary_transport_device_string("TCP_WIFI");
+
+ // - The app is NAVIGATION and SYSTEM.
+ // - A NAVIGATION app is allowed for resumption if either primary or secondary
+ // transport is AOA_USB or SPP_BLUETOOTH.
+ // - .ini file does not have an entry for SYSTEM apps. So any transport is
+ // allowed.
+ // - We have SPP_BLUETOOTH for primary and TCP_WIFI is secondary
+ // -> Conclusion: the app does NOT have required transport.
+ bool result = CheckResumptionRequiredTransportAvailableTest(
+ &app_types_array,
+ primary_device_handle,
+ primary_transport_device_string,
+ secondary_device_handle,
+ secondary_transport_device_string);
+ EXPECT_FALSE(result);
+}
+
TEST_F(ApplicationManagerImplTest,
RegisterApplication_PathToTheIconExists_IconWasSet) {
file_system::CreateDirectory(kDirectoryName);
@@ -990,7 +1396,7 @@ TEST_F(ApplicationManagerImplTest,
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2;
smart_objects::SmartObjectSPtr request_for_registration_ptr =
- MakeShared<smart_objects::SmartObject>(request_for_registration);
+ std::make_shared<smart_objects::SmartObject>(request_for_registration);
ApplicationSharedPtr application =
app_manager_impl_->RegisterApplication(request_for_registration_ptr);
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
index 6f732b6adc..a0bfa2890f 100644
--- a/src/components/application_manager/test/application_state_test.cc
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -41,8 +41,6 @@
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "utils/make_shared.h"
-
namespace test {
namespace components {
namespace application_manager_test {
@@ -75,7 +73,7 @@ class ApplicationStateTest : public ::testing::Test {
ApplicationState app_state;
const StateID current_id = StateID::STATE_ID_CURRENT;
const StateID postponed_id = StateID::STATE_ID_POSTPONED;
- utils::SharedPtr<MockApplication> mock_app_;
+ std::shared_ptr<MockApplication> mock_app_;
MockApplicationManager app_mngr_;
};
@@ -85,8 +83,8 @@ std::vector<StateID> ApplicationStateTest::added_states_ =
TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -97,8 +95,8 @@ TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -120,18 +118,18 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
// Added some states
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
}
// Postponed state wasn't added
HmiStatePtr get_postponed_id = app_state.GetState(postponed_id);
- EXPECT_EQ(NULL, get_postponed_id);
+ EXPECT_EQ(nullptr, get_postponed_id);
// Add posponed state
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
@@ -143,8 +141,8 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
// Add state
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
state->set_hmi_level(HMILevel::HMI_FULL);
@@ -152,8 +150,8 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
++new_state;
// Add some other
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -169,16 +167,16 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
++new_state;
// Add postponed state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
@@ -188,8 +186,8 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
ASSERT_EQ(state, post_state);
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
*new_state);
app_state.AddState(state);
@@ -211,30 +209,30 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
// Add some state
StateID first_state = StateID::STATE_ID_PHONE_CALL;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
first_state);
app_state.AddState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
// Add new postponed state
- utils::SharedPtr<MockApplication> mock_app_2(new MockApplication);
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ std::shared_ptr<MockApplication> mock_app_2(new MockApplication);
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
// Add regular state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
StateID::STATE_ID_REGULAR);
app_state.AddState(state);
@@ -250,8 +248,8 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
TEST_F(ApplicationStateTest, InitState_GetRegularState) {
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
init_state);
@@ -267,8 +265,8 @@ TEST_F(ApplicationStateTest, InitState_GetRegularState) {
TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
// Precondition
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
init_state);
state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
@@ -276,8 +274,8 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
app_state.InitState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
postponed_id);
app_state.AddState(state);
@@ -290,14 +288,14 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
app_state.RemoveState(postponed_id);
get_postponed_state = app_state.GetState(postponed_id);
- EXPECT_EQ(NULL, get_postponed_state);
+ EXPECT_EQ(nullptr, get_postponed_state);
}
TEST_F(ApplicationStateTest,
AddRegularState_RemoveRegularState_RegularStateNotDeleted) {
StateID reg_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(
- static_cast<utils::SharedPtr<Application> >(mock_app_),
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
app_mngr_,
reg_state);
app_state.InitState(state);
diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc
index 9227fd8fcb..56e24b8d29 100644
--- a/src/components/application_manager/test/command_holder_test.cc
+++ b/src/components/application_manager/test/command_holder_test.cc
@@ -35,8 +35,6 @@
#include "application_manager/command_holder_impl.h"
#include "application_manager/commands/command.h"
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
@@ -75,8 +73,8 @@ class CommandHolderImplTest : public testing::Test {
const std::string kPolicyAppId_;
const uint32_t kHmiApplicationId_;
const uint32_t kConnectionKey_;
- utils::SharedPtr<smart_objects::SmartObject> cmd_ptr_;
- utils::SharedPtr<MockApplication> mock_app_ptr_;
+ std::shared_ptr<smart_objects::SmartObject> cmd_ptr_;
+ std::shared_ptr<MockApplication> mock_app_ptr_;
application_manager_test::MockRPCService mock_rpc_service_;
};
@@ -126,8 +124,8 @@ TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) {
mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
// Act
- utils::SharedPtr<MockApplication> another_app =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> another_app =
+ std::make_shared<MockApplication>();
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0);
cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand);
@@ -144,8 +142,8 @@ TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) {
} while (iterations < 3);
// Act
- utils::SharedPtr<MockApplication> another_app =
- utils::MakeShared<MockApplication>();
+ std::shared_ptr<MockApplication> another_app =
+ std::make_shared<MockApplication>();
cmd_holder.Clear(another_app);
EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations);
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index ab412c7e4e..33258e60db 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -35,10 +35,8 @@ 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
)
-#${COMPONENTS_DIR}/application_manager/test/include/
-#${COMPONENTS_DIR}/application_manager/test/include/application_manager/
-#${COMPONENTS_DIR}/application_manager/src/commands/
set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands)
@@ -51,8 +49,6 @@ file(GLOB SOURCES
${COMPONENTS_DIR}/application_manager/test/commands/command_response_impl_test.cc
)
-#${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
-#${COMPONENTS_DIR}/application_manager/src/message.cc
set(LIBRARIES
gmock
Utils
@@ -66,9 +62,3 @@ set(LIBRARIES
)
create_test("commands_test" "${SOURCES}" "${LIBRARIES}")
-#${COMMANDS_TEST_DIR}/hmi/*
-#${COMMANDS_TEST_DIR}/hmi/hmi_notifications/*
-#${COMMANDS_TEST_DIR}/mobile/*
-#ApplicationManager
-#AMHMICommandsLibrary
-#AMMobileCommandsLibrary
diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc
index b50d94f824..222f16ef46 100644
--- a/src/components/application_manager/test/commands/command_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -37,7 +37,7 @@
#include <set>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -55,7 +55,6 @@ using ::testing::Return;
using ::testing::AtLeast;
using ::testing::_;
-using ::utils::SharedPtr;
namespace strings = ::application_manager::strings;
using ::application_manager::commands::CommandImpl;
using ::application_manager::ApplicationManager;
@@ -63,7 +62,7 @@ using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::ApplicationSharedPtr;
using ::test::components::application_manager_test::MockApplication;
-typedef SharedPtr<MockApplication> MockAppPtr;
+typedef std::shared_ptr<MockApplication> MockAppPtr;
namespace {
const uint32_t kDefaultMsgCount = 5u;
@@ -125,11 +124,11 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
};
typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl;
-typedef SharedPtr<UCommandImpl> UCommandImplPtr;
+typedef std::shared_ptr<UCommandImpl> UCommandImplPtr;
TEST_F(CommandImplTest, GetMethods_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandImpl> command =
+ std::shared_ptr<CommandImpl> command =
CreateCommand<CommandImpl>(kDefaultTimeout_, msg);
// Current implementation always return `true`
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index c5a3459673..c70dd14852 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -40,7 +40,7 @@
#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
+
#include "utils/data_accessor.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -65,7 +65,6 @@ using ::testing::Return;
using ::testing::SaveArg;
using ::testing::DoAll;
-using ::utils::SharedPtr;
using am::commands::MessageSharedPtr;
using am::CommandParametersPermissions;
using am::event_engine::EventObserver;
@@ -134,8 +133,8 @@ class CommandRequestImplTest
}
};
- MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
- app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
+ MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) {
+ app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set);
MockAppPtr app(CreateMockApp());
app_set->insert(app);
EXPECT_CALL(app_mngr_, applications())
@@ -148,7 +147,7 @@ class CommandRequestImplTest
};
typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
-typedef SharedPtr<UCommandRequestImpl> CommandPtr;
+typedef std::shared_ptr<UCommandRequestImpl> CommandPtr;
TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>();
diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc
index bd7499ce8f..41cc654a24 100644
--- a/src/components/application_manager/test/commands/command_response_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_response_impl_test.cc
@@ -34,7 +34,7 @@
#include <string>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/commands/commands_test.h"
@@ -49,7 +49,7 @@ namespace command_response_impl {
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
-using ::utils::SharedPtr;
+
using ::application_manager::commands::MessageSharedPtr;
using ::application_manager::commands::CommandResponseImpl;
@@ -57,7 +57,8 @@ class CommandResponseImplTest
: public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
- SharedPtr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>();
+ std::shared_ptr<CommandResponseImpl> command =
+ CreateCommand<CommandResponseImpl>();
// Current implementation always return `true`
EXPECT_TRUE(command->Init());
EXPECT_TRUE(command->CleanUp());
@@ -66,7 +67,7 @@ TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) {
TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
// Do not have a weight in this case
const bool kSuccess = true;
@@ -86,7 +87,7 @@ TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) {
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageValidResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const bool kSuccess = true;
@@ -108,7 +109,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCode_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const bool kSuccess = true;
@@ -133,7 +134,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_SUCCESS) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const mobile_apis::Result::eType kResultCode =
@@ -158,7 +159,7 @@ TEST_F(CommandResponseImplTest,
TEST_F(CommandResponseImplTest,
SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_INVALID_ENUM) {
MessageSharedPtr msg;
- SharedPtr<CommandResponseImpl> command =
+ std::shared_ptr<CommandResponseImpl> command =
CreateCommand<CommandResponseImpl>(msg);
const mobile_apis::Result::eType kResultCode =
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index 440763d4c3..de0b5afb3c 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -38,7 +38,7 @@
#include "application_manager/mock_event_observer.h"
#include "application_manager/mock_event_dispatcher.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "interfaces/HMI_API.h"
namespace test {
diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc
new file mode 100644
index 0000000000..f921eb1dde
--- /dev/null
+++ b/src/components/application_manager/test/help_prompt_manager_test.cc
@@ -0,0 +1,369 @@
+/*
+ * 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 "application_manager/application_impl.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/hmi_state.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_help_prompt_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_resumption_data.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "gtest/gtest.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h"
+#include "utils/file_system.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kCorrelationKey = 2u;
+const uint32_t kAppId = 10u;
+const uint32_t kCmdId = 1u;
+const std::string kPolicyAppId = "fake_app_id";
+const uint32_t kTimeout = 10000u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
+const std::string kFirstVrCommand = "first";
+const int32_t kGrammarId = 12;
+const std::string kDirectoryName = "./test_storage";
+const uint8_t expected_tread_pool_size = 2u;
+const uint8_t stop_streaming_timeout = 1u;
+const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
+} // namespace
+
+using namespace application_manager;
+using namespace policy;
+using namespace test::components::commands_test;
+using namespace mobile_apis;
+
+using am::HmiStatePtr;
+using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest;
+using testing::_;
+using testing::Mock;
+using testing::NiceMock;
+using testing::Return;
+using testing::ReturnRef;
+using usage_statistics_test::MockStatisticsManager;
+
+class ApplicationImplTest : public ApplicationImpl {
+ public:
+ ApplicationImplTest(
+ uint32_t application_id,
+ const std::string& policy_app_id,
+ const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
+ const custom_str::CustomString& app_name,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
+ ApplicationManager& application_manager,
+ MockHelpPromptManager& mock_help_prompt_manager)
+ : ApplicationImpl(application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ statistics_manager,
+ application_manager)
+ , mock_help_prompt_manager_(mock_help_prompt_manager) {}
+
+ HelpPromptManager& help_prompt_manager() OVERRIDE {
+ return mock_help_prompt_manager_;
+ }
+
+ private:
+ MockHelpPromptManager& mock_help_prompt_manager_;
+};
+
+class HelpPromptManagerTest : public ::testing::Test {
+ public:
+ HelpPromptManagerTest()
+ : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+ void SetUp() OVERRIDE;
+ void TearDown() OVERRIDE;
+ MessageSharedPtr CreateMsgParams();
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array);
+ void CreateBasicParamsVRRequest(MessageSharedPtr msg);
+ void CreateApplication(MockHelpPromptManager& mock_help_prompt_manager);
+ HmiStatePtr CreateTestHmiState();
+
+ template <class Command>
+ std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) {
+ return std::make_shared<Command>(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
+ }
+
+ protected:
+ typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager
+ MockAppManager;
+ MockAppManager app_mngr_;
+ std::shared_ptr<ApplicationImplTest> app_impl_;
+ MockHmiInterfaces mock_hmi_interfaces_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+ NiceMock<MockApplicationManagerSettings> app_mngr_settings_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
+ sync_primitives::Lock app_lock_;
+ MockRPCService mock_rpc_service_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_;
+ MockMessageHelper& mock_message_helper_;
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_;
+};
+
+void HelpPromptManagerTest::SetUp() {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(app_mngr_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kTimeout));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(app_mngr_settings_, audio_data_stopped_timeout())
+ .WillByDefault(Return(0));
+ ON_CALL(app_mngr_settings_, video_data_stopped_timeout())
+ .WillByDefault(Return(0));
+
+ mock_help_prompt_manager_ =
+ std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
+
+ HmiStatePtr state = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(mock_app_),
+ app_mngr_,
+ HmiState::STATE_ID_REGULAR);
+
+ std::string path = file_system::CreateDirectory("storage");
+ file_system::CreateFile(path + "/" + "certificate");
+
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
+}
+
+void HelpPromptManagerTest::TearDown() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+}
+
+MessageSharedPtr HelpPromptManagerTest::CreateMsgParams() {
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+}
+
+void HelpPromptManagerTest::VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+}
+
+void HelpPromptManagerTest::CreateBasicParamsVRRequest(MessageSharedPtr msg) {
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[strings::cmd_id] = kCmdId;
+ msg_params[strings::vr_commands] =
+ SmartObject(smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands][0] = kFirstVrCommand;
+ msg_params[strings::type] = kPosition;
+ msg_params[strings::grammar_id] = kGrammarId;
+ msg_params[strings::info] = "VR info";
+}
+
+HmiStatePtr HelpPromptManagerTest::CreateTestHmiState() {
+ HmiStatePtr testState = std::make_shared<HmiState>(
+ static_cast<std::shared_ptr<Application> >(app_impl_),
+ app_mngr_,
+ HmiState::STATE_ID_REGULAR);
+ testState->set_hmi_level(HMILevel::INVALID_ENUM);
+ testState->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE);
+ testState->set_system_context(SystemContext::SYSCTXT_MAIN);
+ return testState;
+}
+
+void HelpPromptManagerTest::CreateApplication(
+ MockHelpPromptManager& mock_help_prompt_manager) {
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ app_impl_.reset(
+ new ApplicationImplTest(kAppId,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ std::make_shared<MockStatisticsManager>(),
+ app_mngr_,
+ mock_help_prompt_manager));
+ HmiStatePtr initial_state = CreateTestHmiState();
+ app_impl_->SetInitialState(initial_state);
+}
+
+TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) {
+ CreateApplication(*mock_help_prompt_manager_.get());
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ CreateBasicParamsVRRequest(msg);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[strings::msg_params][strings::cmd_id] = kCmdId;
+
+ app_impl_->AddCommand(kCmdId, (*msg)[strings::msg_params]);
+}
+
+TEST_F(HelpPromptManagerTest, RemoveCommand_OnVrCommandDeleted) {
+ CreateApplication(*mock_help_prompt_manager_.get());
+ MessageSharedPtr msg =
+ std::make_shared<SmartObject>(smart_objects::SmartType_Map);
+ CreateBasicParamsVRRequest(msg);
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[strings::msg_params][strings::cmd_id] = kCmdId;
+
+ app_impl_->AddCommand(kCmdId, (*msg)[strings::msg_params]);
+ app_impl_->RemoveCommand(kCmdId);
+}
+
+TEST_F(HelpPromptManagerTest,
+ Request_OnSetGlobalPropertiesReceived_TTS_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(help_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_, VerifyTtsFiles(timeout_prompt, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(HelpPromptManagerTest,
+ Request_OnSetGlobalPropertiesReceived_UI_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ EXPECT_CALL(*mock_app_, help_prompt_manager())
+ .WillOnce(ReturnRef(*mock_help_prompt_manager_.get()));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnSetGlobalPropertiesReceived(_, false));
+
+ std::shared_ptr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
index 1c024f2669..ca67d81d8c 100644
--- a/src/components/application_manager/test/hmi_capabilities.json
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -684,6 +684,12 @@
"upDownAvailable": true
},
{
+ "name": "PLAY_PAUSE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ },
+ {
"name": "SEEKLEFT",
"shortPressAvailable": true,
"longPressAvailable": true,
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index e1d2eeb402..ae95fca35f 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -41,7 +41,7 @@
#include "application_manager/mock_message_helper.h"
#include "smart_objects/enum_schema_item.h"
#include "interfaces/HMI_API.h"
-#include "utils/make_shared.h"
+
#include "application_manager/hmi_capabilities_for_testing.h"
#include "utils/file_system.h"
#include "application_manager/mock_application_manager.h"
@@ -82,7 +82,7 @@ class HMICapabilitiesTest : public ::testing::Test {
EXPECT_CALL(mock_application_manager_settings_, launch_hmi())
.WillOnce(Return(false));
hmi_capabilities_test =
- utils::MakeShared<HMICapabilitiesForTesting>(app_mngr_);
+ std::make_shared<HMICapabilitiesForTesting>(app_mngr_);
hmi_capabilities_test->Init(&last_state_);
}
@@ -100,7 +100,7 @@ class HMICapabilitiesTest : public ::testing::Test {
event_engine_test::MockEventDispatcher mock_event_dispatcher;
resumption::LastStateImpl last_state_;
MockApplicationManagerSettings mock_application_manager_settings_;
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities_test;
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities_test;
const std::string file_name_;
application_manager_test::MockRPCService mock_rpc_service_;
};
@@ -255,7 +255,7 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
// Count of buttons in json file
const uint32_t btn_length = buttons_capabilities_so.length();
- EXPECT_EQ(15u, btn_length);
+ EXPECT_EQ(16u, btn_length);
for (uint32_t i = 0; i < btn_length; ++i) {
EXPECT_TRUE((buttons_capabilities_so[i]).keyExists(strings::name));
EXPECT_TRUE((buttons_capabilities_so[i]).keyExists("shortPressAvailable"));
@@ -506,8 +506,8 @@ TEST_F(HMICapabilitiesTest,
EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
}
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities =
- utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr);
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
hmi_capabilities->Init(&last_state_);
// Check system capabilities; only phone capability is available
@@ -546,8 +546,8 @@ TEST_F(HMICapabilitiesTest,
EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
}
- utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities =
- utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr);
+ std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities =
+ std::make_shared<HMICapabilitiesForTesting>(mock_app_mngr);
hmi_capabilities->Init(&last_state_);
// Check system capabilities; only navigation capability is valid, the other
diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc
index 9b8bddc6bc..ec88075212 100644
--- a/src/components/application_manager/test/hmi_language_handler_test.cc
+++ b/src/components/application_manager/test/hmi_language_handler_test.cc
@@ -45,8 +45,7 @@
#include "application_manager/mock_rpc_service.h"
#include "application_manager/smart_object_keys.h"
#include "test/resumption/mock_last_state.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/lock.h"
namespace test {
@@ -57,7 +56,6 @@ namespace am = ::application_manager;
using am::event_engine::Event;
using am::ApplicationSet;
-using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -75,7 +73,7 @@ typedef NiceMock< ::test::components::event_engine_test::MockEventDispatcher>
typedef NiceMock<application_manager_test::MockApplication> MockApp;
typedef NiceMock<application_manager_test::MockRPCService> MockRPCService;
-typedef SharedPtr<MockApp> ApplicationSharedPtr;
+typedef std::shared_ptr<MockApp> ApplicationSharedPtr;
typedef am::HMILanguageHandler::Apps Apps;
namespace {
@@ -89,7 +87,7 @@ class HmiLanguageHandlerTest : public ::testing::Test {
EXPECT_CALL(app_manager_, event_dispatcher())
.WillOnce(ReturnRef(event_dispatcher_));
hmi_language_handler_ =
- ::utils::MakeShared<am::HMILanguageHandler>(app_manager_);
+ std::make_shared<am::HMILanguageHandler>(app_manager_);
}
void InitHMIActiveLanguages(hmi_apis::Common_Language::eType ui_language,
@@ -114,7 +112,7 @@ class HmiLanguageHandlerTest : public ::testing::Test {
ApplicationSharedPtr CreateMockApp(const uint32_t app_id,
bool expect_call = false) const {
- ApplicationSharedPtr app = ::utils::MakeShared<MockApp>();
+ ApplicationSharedPtr app = std::make_shared<MockApp>();
if (expect_call) {
EXPECT_CALL(*app, app_id()).WillRepeatedly(Return(app_id));
} else {
@@ -135,7 +133,7 @@ class HmiLanguageHandlerTest : public ::testing::Test {
MockApplicationManager app_manager_;
MockHMICapabilities hmi_capabilities_;
MockEventDispatcher event_dispatcher_;
- SharedPtr<am::HMILanguageHandler> hmi_language_handler_;
+ std::shared_ptr<am::HMILanguageHandler> hmi_language_handler_;
std::shared_ptr<sync_primitives::Lock> app_set_lock_;
resumption_test::MockLastState last_state_;
MockRPCService mock_rpc_service_;
@@ -317,7 +315,7 @@ TEST_F(HmiLanguageHandlerTest,
// Needed to call of `ManageMobileCommand` method
ON_CALL(*am::MockMessageHelper::message_helper_mock(),
GetOnAppInterfaceUnregisteredNotificationToMobile(_, _))
- .WillByDefault(Return(::utils::MakeShared<smart_objects::SmartObject>()));
+ .WillByDefault(Return(std::make_shared<smart_objects::SmartObject>()));
// Wait for `ManageMobileCommand` call twice.
// First time in `SendOnLanguageChangeToMobile`
diff --git a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
index 05cb80c989..1980ffa100 100644
--- a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
@@ -36,7 +36,7 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/test/include/application_manager/commands/commands_test.h"
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 ab392c5ba0..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
@@ -36,15 +36,15 @@
#include <stdint.h>
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application_manager.h"
#include "test/application_manager/mock_application_manager_settings.h"
#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"
@@ -60,7 +60,6 @@ using ::testing::NiceMock;
using ::testing::Mock;
using ::testing::_;
-using ::utils::SharedPtr;
using ::smart_objects::SmartObject;
using am::commands::MessageSharedPtr;
using ::test::components::application_manager_test::MockApplicationManager;
@@ -104,7 +103,7 @@ class CommandsTest : public ::testing::Test {
typedef typename TypeIf<kIsNice,
NiceMock<MockApplication>,
MockApplication>::Result MockApp;
- typedef SharedPtr<MockApp> MockAppPtr;
+ typedef std::shared_ptr<MockApp> MockAppPtr;
virtual ~CommandsTest() {
Mock::VerifyAndClearExpectations(&mock_message_helper_);
@@ -112,60 +111,65 @@ class CommandsTest : public ::testing::Test {
static MessageSharedPtr CreateMessage(
const smart_objects::SmartType type = smart_objects::SmartType_Null) {
- return ::utils::MakeShared<SmartObject>(type);
+ return std::make_shared<SmartObject>(type);
}
static MockAppPtr CreateMockApp() {
- return ::utils::MakeShared<MockApp>();
+ return std::make_shared<MockApp>();
}
template <class Command>
- SharedPtr<Command> CreateCommand(const uint32_t timeout,
- MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateCommand(const uint32_t timeout,
+ MessageSharedPtr& msg) {
InitCommand(timeout);
- return ::utils::MakeShared<Command>((msg ? msg : msg = CreateMessage()),
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_);
+ return std::make_shared<Command>((msg ? msg : msg = CreateMessage()),
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
}
template <class Command>
- SharedPtr<Command> CreateCommand(MessageSharedPtr& msg) {
+ std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) {
return CreateCommand<Command>(kDefaultTimeout_, msg);
}
template <class Command>
- SharedPtr<Command> CreateCommand(const uint32_t timeout = kDefaultTimeout_) {
+ std::shared_ptr<Command> CreateCommand(
+ const uint32_t timeout = kDefaultTimeout_) {
InitCommand(timeout);
MessageSharedPtr msg = CreateMessage();
- return ::utils::MakeShared<Command>(msg,
- app_mngr_,
- mock_rpc_service_,
- mock_hmi_capabilities_,
- mock_policy_handler_);
+ return std::make_shared<Command>(msg,
+ app_mngr_,
+ mock_rpc_service_,
+ mock_hmi_capabilities_,
+ mock_policy_handler_);
}
enum { kDefaultTimeout_ = 100 };
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_;
protected:
virtual void InitCommand(const uint32_t& timeout) {
+ timeout_ = timeout;
ON_CALL(app_mngr_, get_settings())
.WillByDefault(ReturnRef(app_mngr_settings_));
ON_CALL(app_mngr_settings_, default_timeout())
- .WillByDefault(ReturnRef(timeout));
+ .WillByDefault(ReturnRef(timeout_));
}
CommandsTest()
- : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) {
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
+ , timeout_(0) {
ON_CALL(app_mngr_, hmi_interfaces())
.WillByDefault(ReturnRef(mock_hmi_interfaces_));
ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
@@ -223,6 +227,9 @@ class CommandsTest : public ::testing::Test {
MobileResult::DATA_NOT_AVAILABLE);
link_hmi_to_mob_result(HMIResult::READ_ONLY, MobileResult::READ_ONLY);
}
+
+ private:
+ uint32_t timeout_;
};
MATCHER_P(MobileResultCodeIs, result_code, "") {
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 952b485e48..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
@@ -38,6 +38,7 @@
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/usage_statistics.h"
+#include "utils/semantic_version.h"
namespace test {
namespace components {
@@ -50,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());
@@ -110,8 +108,10 @@ class MockApplication : public ::application_manager::Application {
const mobile_apis::VideoStreamingState::eType());
MOCK_CONST_METHOD0(app_icon_path, const std::string&());
MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
+ 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));
@@ -128,6 +128,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
MOCK_METHOD1(set_app_allowed, void(const bool allowed));
MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
+ MOCK_METHOD1(set_secondary_device,
+ void(connection_handler::DeviceHandle secondary_device));
MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
MOCK_METHOD1(set_grammar_id, void(uint32_t value));
MOCK_METHOD1(
@@ -137,6 +139,10 @@ class MockApplication : public ::application_manager::Application {
::protocol_handler::MajorProtocolVersion());
MOCK_METHOD1(set_is_resuming, void(bool));
MOCK_CONST_METHOD0(is_resuming, bool());
+ MOCK_METHOD1(set_deferred_resumption_hmi_level,
+ void(application_manager::mobile_api::HMILevel::eType level));
+ MOCK_CONST_METHOD0(deferred_resumption_hmi_level,
+ application_manager::mobile_api::HMILevel::eType());
MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file));
MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&());
MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file));
@@ -155,6 +161,10 @@ class MockApplication : public ::application_manager::Application {
bool(mobile_apis::FunctionID::eType cmd_id,
::application_manager::TLimitSource source));
MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
+ MOCK_METHOD0(help_prompt_manager,
+ ::application_manager::HelpPromptManager&());
+ MOCK_CONST_METHOD0(help_prompt_manager,
+ const ::application_manager::HelpPromptManager&());
MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetPostponedState,
@@ -180,6 +190,7 @@ class MockApplication : public ::application_manager::Application {
const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&());
MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&());
+ MOCK_CONST_METHOD0(msg_version, const utils::SemanticVersion&());
MOCK_METHOD1(set_app_types,
void(const smart_objects::SmartObject& app_types));
MOCK_METHOD1(set_vr_synonyms,
@@ -192,6 +203,7 @@ class MockApplication : public ::application_manager::Application {
void(const mobile_apis::Language::eType& language));
MOCK_METHOD1(set_ui_language,
void(const mobile_apis::Language::eType& ui_language));
+ MOCK_METHOD1(set_msg_version, void(const utils::SemanticVersion& version));
// DynamicApplicationData methods
MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
diff --git a/src/components/application_manager/test/include/application_manager/mock_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_command_factory.h
index a55183e341..c49b5e7ce2 100644
--- a/src/components/application_manager/test/include/application_manager/mock_command_factory.h
+++ b/src/components/application_manager/test/include/application_manager/mock_command_factory.h
@@ -37,7 +37,6 @@
#include "application_manager/command_factory.h"
#include "application_manager/commands/command.h"
#include "smart_objects/smart_object.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
@@ -53,9 +52,6 @@ class MockCommandFactory : public application_manager::CommandFactory {
IsAbleToProcess,
bool(const int32_t,
const application_manager::commands::Command::CommandSource));
-
- // const commands::MessageSharedPtr& message,
- // application_manager::commands::Command::CommandSource));
};
} // namespace application_manager_test
diff --git a/src/components/dbus/test/mock_subscriber.cc b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
index 2c5dccaa50..a415f94d56 100644
--- a/src/components/dbus/test/mock_subscriber.cc
+++ b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h
@@ -1,5 +1,5 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
+/*
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,42 +30,32 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "dbus/dbus.h"
-#include "dbus/mock_subscriber.h"
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
+#include "gmock/gmock.h"
namespace test {
namespace components {
-namespace dbus {
-
-MockSubscriber::MockSubscriber(const std::string nameService,
- const std::string path)
- : nameService_(nameService), path_(path), conn_(NULL) {}
-
-MockSubscriber::~MockSubscriber() {}
-
-void MockSubscriber::Receive() {}
-
-bool MockSubscriber::Start() {
- DBusError err;
- dbus_error_init(&err);
- conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- dbus_error_free(&err);
- return false;
- }
-
- std::string rule = "type='signal',interface='" + nameService_ + "'";
- dbus_bus_add_match(conn_, rule.c_str(), &err);
- dbus_connection_flush(conn_);
- if (dbus_error_is_set(&err)) {
- dbus_error_free(&err);
- return false;
- }
- return true;
-}
-
-void MockSubscriber::Send(const std::string& message) {}
-
-} // namespace dbus
+namespace application_manager_test {
+
+using namespace application_manager;
+
+class MockHelpPromptManager : public ::application_manager::HelpPromptManager {
+ public:
+ MockHelpPromptManager() {}
+ MOCK_METHOD3(OnVrCommandAdded,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command,
+ const bool should_send_requests));
+ MOCK_METHOD2(OnVrCommandDeleted,
+ void(uint32_t cmd_id, const bool should_send_requests));
+ MOCK_METHOD2(OnSetGlobalPropertiesReceived,
+ void(const smart_objects::SmartObject& msg, bool is_response));
+ MOCK_CONST_METHOD0(GetSendingType, SendingType());
+};
+
+} // namespace application_manager_test
} // namespace components
} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_
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 fe17eb6788..84a3b6bc87 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
@@ -46,6 +46,12 @@ namespace application_manager {
class MockMessageHelper {
public:
+ MOCK_METHOD2(CreateNotification,
+ smart_objects::SmartObjectSPtr(mobile_apis::FunctionID::eType,
+ uint32_t));
+ MOCK_METHOD1(CreateHMINotification,
+ smart_objects::SmartObjectSPtr(hmi_apis::FunctionID::eType));
+
MOCK_METHOD1(GetHashUpdateNotification,
smart_objects::SmartObjectSPtr(const uint32_t app_id));
MOCK_METHOD2(SendHashUpdateNotification,
@@ -189,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(
@@ -199,7 +208,7 @@ class MockMessageHelper {
bool send_policy_priority,
ApplicationManager& app_mngr));
MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr(
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason));
MOCK_METHOD4(ProcessSoftButtons,
@@ -230,6 +239,12 @@ class MockMessageHelper {
MOCK_METHOD2(SendUIChangeRegistrationRequestToHMI,
void(ApplicationConstSharedPtr app,
ApplicationManager& app_mngr));
+ MOCK_METHOD5(CreateDeviceInfo,
+ bool(connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output));
MOCK_METHOD5(CreateHMIApplicationStruct,
bool(ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
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 fb264b7d82..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,13 +50,21 @@ 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));
MOCK_METHOD1(StartResumptionOnlyHMILevel,
bool(app_mngr::ApplicationSharedPtr application));
+ MOCK_METHOD1(RetryResumption, void(const uint32_t app_id));
MOCK_METHOD1(CheckPersistenceFilesForResumption,
bool(app_mngr::ApplicationSharedPtr application));
MOCK_METHOD2(CheckApplicationHash,
@@ -95,7 +103,8 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
#ifdef BUILD_TESTS
MOCK_METHOD1(set_resumption_storage,
- void(utils::SharedPtr<resumption::ResumptionData> mock_storage));
+ void(std::shared_ptr<resumption::ResumptionData> mock_storage));
+ MOCK_CONST_METHOD0(get_resumption_active, bool());
#endif // BUILD_TESTS
};
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/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index 0d34c113b2..4e614c4d9f 100644
--- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -79,7 +79,7 @@ class ResumptionDataTest : public ::testing::Test {
void CheckSavedApp(sm::SmartObject& saved_data);
// Set data for resumption
virtual void PrepareData();
- utils::SharedPtr<NiceMock<application_manager_test::MockApplication> >
+ std::shared_ptr<NiceMock<application_manager_test::MockApplication> >
app_mock;
profile::Profile profile_;
@@ -125,7 +125,8 @@ class ResumptionDataTest : public ::testing::Test {
void CheckMenuIcon(sm::SmartObject& res_list);
void CheckHelpPrompt(sm::SmartObject& res_list);
void CheckTimeoutPrompt(sm::SmartObject& res_list);
- void CheckVRHelp(NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list);
+ void CheckVRHelp(
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list);
void CheckVRTitle(sm::SmartObject& res_list);
void CheckSubscriptions(sm::SmartObject& res_list);
@@ -152,7 +153,7 @@ class ResumptionDataTest : public ::testing::Test {
application_manager_test::MockApplicationManagerSettings
mock_application_manager_settings_;
application_manager_test::MockApplicationManager mock_application_manager_;
- utils::SharedPtr<NiceMock<application_manager_test::MockAppExtension> >
+ std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
mock_app_extension_;
std::list<application_manager::AppExtensionPtr> extensions_;
};
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index e43348cc80..15a09c33cc 100644
--- a/src/components/application_manager/test/message_helper/message_helper_test.cc
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -35,9 +35,10 @@
#include "gmock/gmock.h"
#include "utils/macro.h"
-#include "utils/make_shared.h"
+
#include "application_manager/policies/policy_handler.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "utils/custom_string.h"
#include "utils/lock.h"
#include "policy/mock_policy_settings.h"
@@ -62,9 +63,9 @@ namespace MobileResults = mobile_apis::Result;
using namespace application_manager;
-typedef utils::SharedPtr<MockApplication> MockApplicationSharedPtr;
+typedef std::shared_ptr<MockApplication> MockApplicationSharedPtr;
typedef std::vector<std::string> StringArray;
-typedef utils::SharedPtr<application_manager::Application> ApplicationSharedPtr;
+typedef std::shared_ptr<application_manager::Application> ApplicationSharedPtr;
using testing::AtLeast;
using testing::ReturnRefOfCopy;
@@ -86,7 +87,7 @@ TEST(MessageHelperTestCreate,
application_manager::MessageHelper::CreateBlockedByPoliciesResponse(
function_id, result, correlation_id, connection_key);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -108,7 +109,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) {
smart_objects::SmartObjectSPtr ptr =
MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -127,7 +128,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
smart_objects::SmartObjectSPtr ptr =
MessageHelper::CreateSetAppIcon(path_to_icon, app_id);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -142,12 +143,19 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) {
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
EXPECT_CALL(*appSharedMock, vr_help_title()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, vr_help()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, help_prompt()).Times(AtLeast(1));
EXPECT_CALL(*appSharedMock, timeout_prompt()).Times(AtLeast(1));
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager =
+ std::make_shared<MockHelpPromptManager>();
+ EXPECT_CALL(*appSharedMock, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager));
+ EXPECT_CALL(*mock_help_prompt_manager, GetSendingType())
+ .WillRepeatedly(Return(HelpPromptManager::SendingType::kSendBoth));
+
smart_objects::SmartObjectList ptr =
MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
@@ -156,9 +164,9 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
smart_objects::SmartObjectSPtr objPtr =
- MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*objPtr)[0][strings::vr_help_title] = "111";
(*objPtr)[1][strings::vr_help] = "222";
@@ -191,6 +199,13 @@ TEST(MessageHelperTestCreate,
.WillRepeatedly(Return(&(*objPtr)[4]));
EXPECT_CALL(*appSharedMock, app_id()).WillRepeatedly(Return(0));
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager =
+ std::make_shared<MockHelpPromptManager>();
+ EXPECT_CALL(*appSharedMock, help_prompt_manager())
+ .WillRepeatedly(ReturnRef(*mock_help_prompt_manager));
+ EXPECT_CALL(*mock_help_prompt_manager, GetSendingType())
+ .WillRepeatedly(Return(HelpPromptManager::SendingType::kSendBoth));
+
smart_objects::SmartObjectList ptr =
MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u);
@@ -210,10 +225,10 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
const smart_objects::SmartObject& object = *smartObjectPtr;
@@ -236,10 +251,10 @@ TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Empty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
::application_manager::CommandsMap vis;
DataAccessor<application_manager::CommandsMap> data_accessor(
- vis, std::make_shared<sync_primitives::Lock>(true));
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor));
application_manager_test::MockApplicationManager mock_application_manager;
@@ -252,12 +267,12 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
CommandsMap vis;
DataAccessor<CommandsMap> data_accessor(
- vis, std::make_shared<sync_primitives::Lock>(true));
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -294,10 +309,10 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::ChoiceSetMap vis;
DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(
- vis, std::make_shared<sync_primitives::Lock>(true));
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor));
application_manager_test::MockApplicationManager mock_application_manager;
@@ -310,12 +325,12 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::ChoiceSetMap vis;
DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(
- vis, std::make_shared<sync_primitives::Lock>(true));
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -357,12 +372,12 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::SubMenuMap vis;
DataAccessor< ::application_manager::SubMenuMap> data_accessor(
- vis, std::make_shared<sync_primitives::Lock>(true));
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
smart_objects::SmartObjectSPtr smartObjectPtr =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
smart_objects::SmartObject& object = *smartObjectPtr;
@@ -397,10 +412,10 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
application_manager::SubMenuMap vis;
DataAccessor< ::application_manager::SubMenuMap> data_accessor(
- vis, std::make_shared<sync_primitives::Lock>(true));
+ vis, std::make_shared<sync_primitives::RecursiveLock>());
EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor));
@@ -420,7 +435,7 @@ TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) {
smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateNegativeResponse(
connection_key, function_id, correlation_id, result_code);
- EXPECT_TRUE(ptr);
+ EXPECT_TRUE((bool)ptr);
smart_objects::SmartObject& obj = *ptr;
@@ -700,7 +715,7 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_WrongStrings_False) {
"soft_button1\\n",
"soft_button1\\t"};
for (size_t i = 0; i < wrong_strings.size(); ++i) {
- EXPECT_FALSE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ EXPECT_FALSE(MessageHelper::VerifyString(wrong_strings[i]));
}
}
@@ -711,14 +726,14 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) {
"soft_button1??....asd",
"soft_button12313fcvzxc./.,"};
for (size_t i = 0; i < wrong_strings.size(); ++i) {
- EXPECT_TRUE(MessageHelper::VerifySoftButtonString(wrong_strings[i]));
+ EXPECT_TRUE(MessageHelper::VerifyString(wrong_strings[i]));
}
}
TEST_F(MessageHelperTest,
ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
policy_handler_test::MockPolicySettings policy_settings_;
@@ -733,8 +748,8 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
ProcessSoftButtons_IncorectSoftButonValue_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
smart_objects::SmartObject& buttons = object[strings::soft_buttons];
@@ -751,11 +766,12 @@ TEST_F(MessageHelperTest,
}
TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::STATIC;
+ image[strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
@@ -764,8 +780,8 @@ TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
}
TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -779,42 +795,44 @@ TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
}
TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::STATIC;
image[strings::value] = "icon.png";
// Method call
- mobile_apis::Result::eType result = MessageHelper::VerifyImageApplyPath(
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
- // EXPECT
EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+ // EXPECT
EXPECT_EQ("icon.png", image[strings::value].asString());
}
TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
// Invalid value
image[strings::value] = " ";
// Method call
- mobile_apis::Result::eType result = MessageHelper::VerifyImageApplyPath(
+ mobile_apis::Result::eType result = MessageHelper::VerifyImage(
image, appSharedMock, mock_application_manager);
// EXPECT
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::STATIC;
images[1][strings::image_type] = mobile_apis::ImageType::STATIC;
+ images[0][strings::value] = "static_icon";
+ images[1][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles(
images, appSharedMock, mock_application_manager);
@@ -824,8 +842,8 @@ TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
TEST_F(MessageHelperTest,
VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -842,14 +860,17 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
mobile_apis::ImageType::STATIC;
message[1][strings::image][strings::image_type] =
mobile_apis::ImageType::STATIC;
+
+ message[0][strings::image][strings::value] = "static_icon";
+ message[1][strings::image][strings::value] = "static_icon";
// Method call
mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems(
message, appSharedMock, mock_application_manager);
@@ -859,8 +880,8 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) {
- // Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating std::shared_ptr to MockApplication
+ MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
@@ -921,7 +942,7 @@ TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) {
TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
// Create application mock
- MockApplicationSharedPtr appSharedPtr = utils::MakeShared<MockApplication>();
+ MockApplicationSharedPtr appSharedPtr = std::make_shared<MockApplication>();
// Prepare data for method
smart_objects::SmartObject message_params;
size_t function_id = 1;
@@ -952,7 +973,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
correlation_id,
mock_application_manager);
- ASSERT_TRUE(result);
+ ASSERT_TRUE(result.get());
EXPECT_EQ(hmi_apis::FunctionID::SDL_GetListOfPermissions,
(*result)[strings::params][strings::function_id].asInt());
@@ -992,7 +1013,7 @@ TEST_F(MessageHelperTest,
correlation_id,
mock_application_manager);
- ASSERT_TRUE(result);
+ ASSERT_TRUE(result.get());
smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
const std::string external_consent_status_key = "externalConsentStatus";
diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc
index 2fe28d8249..23957b61fb 100644
--- a/src/components/application_manager/test/mobile_message_handler_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -41,7 +41,6 @@
#include "gmock/gmock.h"
#include "application_manager/message.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
namespace test {
namespace components {
@@ -106,12 +105,12 @@ class MobileMessageHandlerTest : public testing::Test {
size_t full_size = sizeof(uint8_t) * full_data.size();
- message_ptr_ = utils::MakeShared<RawMessage>(connection_key_,
- protocol_version,
- &full_data[0],
- full_size,
- ServiceType::kRpc,
- payload_size);
+ message_ptr_ = std::make_shared<RawMessage>(connection_key_,
+ protocol_version,
+ &full_data[0],
+ full_size,
+ ServiceType::kRpc,
+ payload_size);
return MobileMessageHandler::HandleIncomingMessageProtocol(message_ptr_);
}
@@ -170,7 +169,7 @@ class MobileMessageHandlerTest : public testing::Test {
uint32_t connection_key,
const std::string& json_msg,
const application_manager::BinaryData* data = NULL) {
- MobileMessage message = utils::MakeShared<Message>(
+ MobileMessage message = std::make_shared<Message>(
MessagePriority::FromServiceType(ServiceType::kRpc));
message->set_function_id(function_id);
message->set_correlation_id(correlation_id);
@@ -254,7 +253,7 @@ class MobileMessageHandlerTest : public testing::Test {
TEST(mobile_message_test, basic_test) {
// Example message
MobileMessage message =
- utils::MakeShared<Message>(protocol_handler::MessagePriority::kDefault);
+ std::make_shared<Message>(protocol_handler::MessagePriority::kDefault);
EXPECT_FALSE(message->has_binary_data());
application_manager::BinaryData binary_data;
binary_data.push_back('X');
diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
index a19ea991b9..5cbc28b20c 100644
--- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
@@ -40,7 +40,6 @@
#include "gmock/gmock.h"
#include "application_manager/message.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
@@ -70,7 +69,7 @@ const unsigned char* data_v1 =
TEST(MobileMessageHandlerTestV1Test,
HandleIncomingMessageProtocolV1_SendJSONData_ExpectEqual) {
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key_p1, protocol_version_1, data_v1, data_json.length());
application_manager::Message* ptr =
@@ -90,7 +89,7 @@ TEST(MobileMessageHandlerTestV1Test,
const unsigned char* data_v1 =
reinterpret_cast<const unsigned char*>(full_data.c_str());
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key_p1, protocol_version_1, data_v1, full_data.length());
application_manager::Message* ptr =
@@ -108,7 +107,7 @@ TEST(MobileMessageHandlerTestV1Test,
uint32_t connection_key = 1;
application_manager::MobileMessage message =
- utils::MakeShared<application_manager::Message>(
+ std::make_shared<application_manager::Message>(
protocol_handler::MessagePriority::kDefault);
message->set_protocol_version(
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index fc2136cdd8..f091e183dc 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -39,6 +39,18 @@
namespace application_manager {
+smart_objects::SmartObjectSPtr MessageHelper::CreateNotification(
+ mobile_apis::FunctionID::eType function_id, uint32_t app_id) {
+ return MockMessageHelper::message_helper_mock()->CreateNotification(
+ function_id, app_id);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateHMINotification(
+ hmi_apis::FunctionID::eType function_id) {
+ return MockMessageHelper::message_helper_mock()->CreateHMINotification(
+ function_id);
+}
+
void MessageHelper::SendHashUpdateNotification(uint32_t const app_id,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendHashUpdateNotification(
@@ -328,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,
@@ -357,7 +376,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
app_mngr);
}
-NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr
+ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
int32_t connection_key,
mobile_apis::AppInterfaceUnregisteredReason::eType reason) {
@@ -423,6 +442,16 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI(
->SendUIChangeRegistrationRequestToHMI(app, app_mngr);
}
+bool MessageHelper::CreateDeviceInfo(
+ connection_handler::DeviceHandle device_handle,
+ const protocol_handler::SessionObserver& session_observer,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr,
+ smart_objects::SmartObject* output) {
+ return MockMessageHelper::message_helper_mock()->CreateDeviceInfo(
+ device_handle, session_observer, policy_handler, app_mngr, output);
+}
+
bool MessageHelper::CreateHMIApplicationStruct(
ApplicationConstSharedPtr app,
const protocol_handler::SessionObserver& session_observer,
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 57fa67bf0a..15123385a0 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -53,13 +53,13 @@
#include "json/value.h"
#include "smart_objects/smart_object.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
+
#include "utils/custom_string.h"
#include "policy/usage_statistics/counter.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
@@ -134,14 +134,14 @@ class PolicyHandlerTest : public ::testing::Test {
protected:
NiceMock<MockPolicySettings> policy_settings_;
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
connection_handler_test::MockConnectionHandler conn_handler;
protocol_handler_test::MockSessionObserver mock_session_observer;
application_manager_test::MockStateController mock_state_controller;
components::usage_statistics_test::MockStatisticsManager
mock_statistics_manager_;
PolicyHandler policy_handler_;
- utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ std::shared_ptr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
application_manager_test::MockApplicationManager app_manager_;
const std::string kPolicyAppId_;
const std::string kMacAddr_;
@@ -179,15 +179,15 @@ class PolicyHandlerTest : public ::testing::Test {
std::string path = file_system::CreateDirectory("storage");
file_system::CreateFile(path + "/" + "certificate");
mock_policy_manager_ =
- utils::MakeShared<policy_manager_test::MockPolicyManager>();
- ASSERT_TRUE(mock_policy_manager_.valid());
+ std::make_shared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.use_count() != 0);
ON_CALL(app_manager_, connection_handler())
.WillByDefault(ReturnRef(conn_handler));
ON_CALL(conn_handler, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer));
- mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
}
virtual void TearDown() OVERRIDE {
@@ -444,7 +444,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) {
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(mock_message_helper_,
@@ -455,7 +455,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
}
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) {
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(mock_app_))
.WillOnce(Return(invalid_app));
@@ -774,8 +774,8 @@ TEST_F(PolicyHandlerTest, KmsChanged) {
void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
const uint32_t correlation_id) {
- utils::SharedPtr<application_manager_test::MockApplication> application1 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application1 =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, ActivateApplication(_))
.WillRepeatedly(Return(true));
EXPECT_CALL(app_manager_, application(connection_key))
@@ -791,12 +791,12 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
.WillRepeatedly(ReturnRef(conn_handler));
EXPECT_CALL(conn_handler, get_session_observer())
.WillOnce(ReturnRef(mock_session_observer));
- utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ std::shared_ptr<usage_statistics_test::MockStatisticsManager>
mock_statistics_manager =
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ std::make_shared<usage_statistics_test::MockStatisticsManager>();
UsageStatistics usage_stats(
"0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
mock_statistics_manager));
EXPECT_CALL(*application1, usage_report()).WillOnce(ReturnRef(usage_stats));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
@@ -839,7 +839,7 @@ TEST_F(PolicyHandlerTest, OnActivateApp) {
TEST_F(PolicyHandlerTest, OnActivateApp_InvalidApp_UNSUCCESS) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application(kConnectionKey_))
.WillOnce(Return(invalid_app));
@@ -859,12 +859,12 @@ TEST_F(PolicyHandlerTest, OnActivateApp_AppIsRevoked_AppNotActivated) {
permissions.appRevoked = true;
#ifdef EXTERNAL_PROPRIETARY_MODE
- utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ std::shared_ptr<usage_statistics_test::MockStatisticsManager>
mock_statistics_manager =
- utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ std::make_shared<usage_statistics_test::MockStatisticsManager>();
UsageStatistics usage_stats(
"0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
mock_statistics_manager));
EXPECT_CALL(*mock_app_, usage_report()).WillOnce(ReturnRef(usage_stats));
const std::string default_mac = "00:00:00:00:00:00";
@@ -898,8 +898,8 @@ void PolicyHandlerTest::OnPendingPermissionChangePrecondition(
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
@@ -997,8 +997,8 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appUnauthorized = true;
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
- utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr message =
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>();
// Check expectations
EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
@@ -1050,8 +1050,8 @@ TEST_F(PolicyHandlerTest,
AppPermissions permissions(kPolicyAppId_);
permissions.appUnauthorized = true;
- NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
- utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
+ ns_smart_device_link::ns_smart_objects::SmartObjectSPtr message =
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>();
// Check expectations
// Notification won't be sent
EXPECT_CALL(mock_message_helper_,
@@ -1168,8 +1168,8 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
EXPECT_CALL(app_manager_, connection_handler())
@@ -1271,8 +1271,8 @@ TEST_F(PolicyHandlerTest, GetAppName) {
// Check expectations
const CustomString app_name("my_mobile_app");
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*application, name()).WillOnce(ReturnRef(app_name));
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
@@ -1309,8 +1309,8 @@ TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> application =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> application =
+ std::make_shared<application_manager_test::MockApplication>();
// Check expectations
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
@@ -1337,7 +1337,7 @@ TEST_F(PolicyHandlerTest, AddApplication) {
EXPECT_CALL(
*mock_policy_manager_,
AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)))
- .WillOnce(Return(utils::MakeShared<utils::CallNothing>()));
+ .WillOnce(Return(std::make_shared<utils::CallNothing>()));
// Act
policy_handler_.AddApplication(kPolicyAppId_,
HmiTypes(policy_table::AHT_DEFAULT));
@@ -1953,8 +1953,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_full =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_in_full =
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_full_id = 1;
EXPECT_CALL(*mock_app_in_full, app_id())
.WillRepeatedly(Return(app_in_full_id));
@@ -1964,9 +1964,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_full);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_limited =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_limited_id = 2;
EXPECT_CALL(*mock_app_in_limited, app_id())
.WillRepeatedly(Return(app_in_limited_id));
@@ -1976,9 +1976,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_limited);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_background =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_background_id = 3;
EXPECT_CALL(*mock_app_in_background, app_id())
.WillRepeatedly(Return(app_in_background_id));
@@ -1988,8 +1988,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
test_app.insert(mock_app_in_background);
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_none =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_in_none =
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id = 4;
EXPECT_CALL(*mock_app_in_none, app_id())
.WillRepeatedly(Return(app_in_none_id));
@@ -2017,9 +2017,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_none_1 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id_1 = 1;
EXPECT_CALL(*mock_app_in_none_1, app_id())
.WillRepeatedly(Return(app_in_none_id_1));
@@ -2029,9 +2029,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
test_app.insert(mock_app_in_none_1);
- utils::SharedPtr<application_manager_test::MockApplication>
+ std::shared_ptr<application_manager_test::MockApplication>
mock_app_in_none_2 =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::make_shared<application_manager_test::MockApplication>();
const uint32_t app_in_none_id_2 = 2;
EXPECT_CALL(*mock_app_in_none_2, app_id())
.WillRepeatedly(Return(app_in_none_id_2));
@@ -2109,8 +2109,8 @@ TEST_F(PolicyHandlerTest,
// Expected to get 0 as application id so SDL does not have valid application
// with such id
EXPECT_CALL(app_manager_, application(0))
- .WillOnce(Return(
- utils::SharedPtr<application_manager_test::MockApplication>()));
+ .WillOnce(
+ Return(std::shared_ptr<application_manager_test::MockApplication>()));
EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url));
}
@@ -2122,8 +2122,8 @@ TEST_F(PolicyHandlerTest, CanUpdate) {
TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) {
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> second_mock_app =
- utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> second_mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*mock_app_, hmi_level())
.WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc
index 0d9cbfe6aa..b7caf635c9 100644
--- a/src/components/application_manager/test/rc_policy_handler_test.cc
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -46,7 +46,7 @@
#include "json/writer.h"
#include "json/value.h"
#include "smart_objects/smart_object.h"
-#include "utils/make_shared.h"
+
#include "utils/custom_string.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
@@ -94,13 +94,13 @@ class RCPolicyHandlerTest : public ::testing::Test {
protected:
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ std::shared_ptr<application_manager_test::MockApplication> mock_app_;
connection_handler_test::MockConnectionHandler conn_handler;
protocol_handler_test::MockSessionObserver mock_session_observer;
components::usage_statistics_test::MockStatisticsManager
mock_statistics_manager_;
PolicyHandler policy_handler_;
- utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ std::shared_ptr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
application_manager_test::MockApplicationManager app_manager_;
const std::string kPolicyAppId_;
const std::string kMacAddr_;
@@ -122,15 +122,15 @@ class RCPolicyHandlerTest : public ::testing::Test {
ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set));
ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
mock_policy_manager_ =
- utils::MakeShared<policy_manager_test::MockPolicyManager>();
- ASSERT_TRUE(mock_policy_manager_.valid());
+ std::make_shared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.use_count() != 0);
ON_CALL(app_manager_, connection_handler())
.WillByDefault(ReturnRef(conn_handler));
ON_CALL(conn_handler, get_session_observer())
.WillByDefault(ReturnRef(mock_session_observer));
- mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ mock_app_ = std::make_shared<application_manager_test::MockApplication>();
}
virtual void TearDown() OVERRIDE {
@@ -206,7 +206,7 @@ TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) {
TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) {
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
.WillOnce(Return(invalid_app));
EXPECT_CALL(mock_message_helper_, StringToHMILevel(_)).Times(0);
@@ -293,7 +293,7 @@ TEST_F(RCPolicyHandlerTest,
TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_InvalidApp_UNSUCCESS) {
EnablePolicyAndPolicyManagerMock();
- utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ std::shared_ptr<application_manager_test::MockApplication> invalid_app;
EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app));
EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
@@ -379,7 +379,7 @@ TEST_F(RCPolicyHandlerTest, CheckHMIType_ValidTypes_SUCCESS) {
mobile_apis::AppHMIType::eType hmi = mobile_apis::AppHMIType::MEDIA;
const smart_objects::SmartObjectSPtr app_types =
- utils::MakeShared<smart_objects::SmartObject>(
+ std::make_shared<smart_objects::SmartObject>(
smart_objects::SmartType_Array);
(*app_types)[strings::app_hmi_type][0] = mobile_apis::AppHMIType::MEDIA;
(*app_types)[strings::app_hmi_type][1] =
diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc
index c2912fdc0b..112e3c1c39 100644
--- a/src/components/application_manager/test/request_controller/request_controller_test.cc
+++ b/src/components/application_manager/test/request_controller/request_controller_test.cc
@@ -36,12 +36,12 @@
#include "application_manager/request_controller.h"
#include "application_manager/request_info.h"
#include "application_manager/mock_request.h"
-#include "utils/shared_ptr.h"
+
#include "smart_objects/smart_object.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/message_helper.h"
#include "application_manager/application_impl.h"
-#include "utils/make_shared.h"
+
#include "application_manager/mock_application_manager.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "resumption/last_state.h"
@@ -65,8 +65,8 @@ using ::testing::NiceMock;
using ::testing::_;
typedef NiceMock<application_manager_test::MockRequest> MRequest;
-typedef utils::SharedPtr<MRequest> RequestPtr;
-typedef utils::SharedPtr<RequestController> RequestControllerSPtr;
+typedef std::shared_ptr<MRequest> RequestPtr;
+typedef std::shared_ptr<RequestController> RequestControllerSPtr;
namespace {
const size_t kNumberOfRequests = 10u;
@@ -105,7 +105,7 @@ class RequestControllerTestClass : public ::testing::Test {
ON_CALL(mock_request_controller_settings_, thread_pool_size())
.WillByDefault(Return(kThreadPoolSize));
request_ctrl_ =
- utils::MakeShared<RequestController>(mock_request_controller_settings_);
+ std::make_shared<RequestController>(mock_request_controller_settings_);
}
RequestPtr GetMockRequest(
@@ -113,7 +113,7 @@ class RequestControllerTestClass : public ::testing::Test {
const uint32_t connection_key = kDefaultConnectionKey,
const uint32_t default_timeout = kDefaultTimeout) {
RequestPtr output =
- utils::MakeShared<MRequest>(connection_key, correlation_id);
+ std::make_shared<MRequest>(connection_key, correlation_id);
ON_CALL(*output, default_timeout()).WillByDefault(Return(default_timeout));
ON_CALL(*output, CheckPermissions()).WillByDefault(Return(true));
return output;
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
index 11b2d2f259..0d7e6c65ac 100644
--- a/src/components/application_manager/test/request_info_test.cc
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -36,8 +36,6 @@
#include <vector>
#include <limits>
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
namespace request_info = application_manager::request_controller;
@@ -49,10 +47,10 @@ class TestRequestInfo : public request_info::RequestInfo {
public:
TestRequestInfo(request_info::RequestPtr request,
const RequestType requst_type,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
const uint64_t timeout_msec)
: RequestInfo(request, requst_type, start_time, timeout_msec) {}
- void SetEndTime(const TimevalStruct& end_time) {
+ void SetEndTime(const date_time::TimeDuration& end_time) {
end_time_ = end_time;
}
};
@@ -76,26 +74,26 @@ class RequestInfoTest : public ::testing::Test {
uint32_t default_timeout_;
uint32_t mobile_correlation_id;
- utils::SharedPtr<TestRequestInfo> CreateTestInfo(
+ std::shared_ptr<TestRequestInfo> CreateTestInfo(
uint32_t connection_key,
uint32_t correlation_id,
request_info::RequestInfo::RequestType requst_type,
- const TimevalStruct& start_time,
+ const date_time::TimeDuration& start_time,
uint64_t timeout_msec) {
- utils::SharedPtr<MockRequest> mock_request =
- utils::MakeShared<MockRequest>(connection_key, correlation_id);
- utils::SharedPtr<TestRequestInfo> request =
- utils::MakeShared<TestRequestInfo>(
+ std::shared_ptr<MockRequest> mock_request =
+ std::make_shared<MockRequest>(connection_key, correlation_id);
+ std::shared_ptr<TestRequestInfo> request =
+ std::make_shared<TestRequestInfo>(
mock_request, requst_type, start_time, timeout_msec);
return request;
}
};
TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
- const TimevalStruct& time = date_time::DateTime::getCurrentTime();
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
+ const date_time::TimeDuration& time = date_time::getCurrentTime();
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request = CreateTestInfo(
+ std::shared_ptr<TestRequestInfo> request = CreateTestInfo(
i, i, request_info::RequestInfo::MobileRequest, time, default_timeout_);
request->SetEndTime(time);
EXPECT_TRUE(request_info_set_.Add(request));
@@ -105,11 +103,11 @@ TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(hmi_connection_key_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(request));
EXPECT_TRUE(request_info_set_.RemoveRequest(request));
@@ -119,15 +117,15 @@ TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
}
TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
// Add hmi requests
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(hmi_connection_key_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(request);
EXPECT_TRUE(request_info_set_.Add(request));
@@ -135,7 +133,7 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
// Delete every request
- std::vector<utils::SharedPtr<TestRequestInfo> >::iterator req_it =
+ std::vector<std::shared_ptr<TestRequestInfo> >::iterator req_it =
requests.begin();
for (; req_it != requests.end(); ++req_it) {
@@ -155,18 +153,18 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
- utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ std::shared_ptr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
12345,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request1));
- utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ std::shared_ptr<TestRequestInfo> mobile_request2 =
CreateTestInfo(mobile_connection_key2_,
54321,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
EXPECT_TRUE(request_info_set_.Add(mobile_request2));
EXPECT_EQ(2u, request_info_set_.Size());
@@ -175,15 +173,15 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
- std::vector<utils::SharedPtr<TestRequestInfo> > requests;
+ std::vector<std::shared_ptr<TestRequestInfo> > requests;
const uint32_t count_of_mobile_request1 = 200;
const uint32_t count_of_mobile_request2 = 100;
for (uint32_t i = 0; i < count_of_mobile_request1; ++i) {
- utils::SharedPtr<TestRequestInfo> mobile_request1 =
+ std::shared_ptr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
i,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(mobile_request1);
@@ -192,11 +190,11 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
EXPECT_EQ(count_of_mobile_request1, request_info_set_.Size());
for (uint32_t i = 0; i < count_of_mobile_request2; ++i) {
- utils::SharedPtr<TestRequestInfo> mobile_request2 =
+ std::shared_ptr<TestRequestInfo> mobile_request2 =
CreateTestInfo(mobile_connection_key2_,
i,
request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
default_timeout_);
requests.push_back(mobile_request2);
@@ -214,20 +212,20 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
TEST_F(RequestInfoTest, RequestInfoSetFront) {
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
i,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
i);
request_info_set_.Add(request);
}
for (uint32_t i = 1; i < count_of_requests_for_test_; ++i) {
request_info::RequestInfoPtr request_info = request_info_set_.Front();
- EXPECT_TRUE(request_info.valid());
+ EXPECT_TRUE(request_info.use_count() != 0);
request_info = request_info_set_.FrontWithNotNullTimeout();
- EXPECT_TRUE(request_info.valid());
+ EXPECT_TRUE(request_info.use_count() != 0);
EXPECT_TRUE(request_info_set_.RemoveRequest(request_info));
}
EXPECT_EQ(1u, request_info_set_.Size());
@@ -248,27 +246,27 @@ TEST_F(RequestInfoTest, RequestInfoSetFind) {
appid_connection_id.end();
for (; req_it != end; ++req_it) {
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(req_it->first,
req_it->second,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
10);
EXPECT_TRUE(request_info_set_.Add(request));
}
request_info::RequestInfoPtr request = request_info_set_.Find(
count_of_requests_for_test_, count_of_requests_for_test_);
- EXPECT_FALSE(request.valid());
+ EXPECT_FALSE(request.use_count() != 0);
req_it = appid_connection_id.begin();
for (; req_it != end; ++req_it) {
request_info::RequestInfoPtr request =
request_info_set_.Find(req_it->first, req_it->second);
- EXPECT_TRUE(request.valid());
+ EXPECT_TRUE(request.use_count() != 0);
EXPECT_TRUE(request_info_set_.RemoveRequest(request));
request = request_info_set_.Find(req_it->first, req_it->second);
- EXPECT_FALSE(request.valid());
+ EXPECT_FALSE(request.use_count() != 0);
}
EXPECT_EQ(0u, request_info_set_.Size());
}
@@ -277,11 +275,11 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
request_info::RequestInfoSet request_info_set;
const uint32_t connection_key = 65483;
const uint32_t corr_id = 65483;
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(connection_key,
corr_id,
request_info::RequestInfo::HMIRequest,
- date_time::DateTime::getCurrentTime(),
+ date_time::getCurrentTime(),
10);
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
@@ -289,31 +287,33 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) {
EXPECT_EQ(1u, request_info_set.Size());
request_info::RequestInfoPtr found =
request_info_set.Find(connection_key, corr_id);
- EXPECT_TRUE(found.valid());
+ EXPECT_TRUE(found.use_count() != 0);
EXPECT_TRUE(request_info_set.RemoveRequest(found));
EXPECT_EQ(0u, request_info_set.Size());
EXPECT_TRUE(request_info_set.Add(request));
EXPECT_FALSE(request_info_set.Add(request));
found = request_info_set.FrontWithNotNullTimeout();
- EXPECT_TRUE(found.valid());
+ EXPECT_TRUE(found.use_count() != 0);
EXPECT_TRUE(request_info_set.RemoveRequest(found));
found = request_info_set.FrontWithNotNullTimeout();
- EXPECT_FALSE(found.valid());
+ EXPECT_FALSE(found.use_count() != 0);
found = request_info_set.Front();
- EXPECT_FALSE(found.valid());
+ EXPECT_FALSE(found.use_count() != 0);
EXPECT_EQ(0u, request_info_set.Size());
}
TEST_F(RequestInfoTest, EndTimeisExpired) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ // get just the seconds part of the current time
+ date_time::TimeDuration not_expired =
+ date_time::seconds(date_time::getSecs(date_time::getCurrentTime()));
+ not_expired += date_time::microseconds(std::numeric_limits<time_t>::min());
- TimevalStruct not_expired = date_time::DateTime::getCurrentTime();
- not_expired.tv_usec = std::numeric_limits<time_t>::min();
+ date_time::TimeDuration expired =
+ date_time::seconds(date_time::getSecs(date_time::getCurrentTime()));
+ expired += date_time::microseconds(std::numeric_limits<time_t>::max());
- TimevalStruct expired = date_time::DateTime::getCurrentTime();
- expired.tv_usec = std::numeric_limits<time_t>::max();
-
- utils::SharedPtr<TestRequestInfo> request =
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -328,8 +328,8 @@ TEST_F(RequestInfoTest, EndTimeisExpired) {
}
TEST_F(RequestInfoTest, UpdateEndTime) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
- utils::SharedPtr<TestRequestInfo> request =
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -337,13 +337,13 @@ TEST_F(RequestInfoTest, UpdateEndTime) {
default_timeout_);
request->SetEndTime(time);
request->updateEndTime();
- TimevalStruct last_time = request->end_time();
- EXPECT_LE(time.tv_sec, last_time.tv_sec);
+ date_time::TimeDuration last_time = request->end_time();
+ EXPECT_LE(date_time::getSecs(time), date_time::getSecs(last_time));
}
TEST_F(RequestInfoTest, UpdateTimeOut) {
- TimevalStruct time = date_time::DateTime::getCurrentTime();
- utils::SharedPtr<TestRequestInfo> request =
+ date_time::TimeDuration time = date_time::getCurrentTime();
+ std::shared_ptr<TestRequestInfo> request =
CreateTestInfo(mobile_connection_key1_,
mobile_correlation_id,
request_info::RequestInfo::MobileRequest,
@@ -353,9 +353,10 @@ TEST_F(RequestInfoTest, UpdateTimeOut) {
request->updateEndTime();
request->updateTimeOut(100);
- time = date_time::DateTime::getCurrentTime();
- TimevalStruct last_time = request->end_time();
- EXPECT_NEAR(time.tv_sec + 100, last_time.tv_sec, 500);
+ time = date_time::getCurrentTime();
+ date_time::TimeDuration last_time = request->end_time();
+ EXPECT_NEAR(
+ date_time::getSecs(time) + 100, date_time::getSecs(last_time), 500);
}
} // namespace application_manager_test
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 1a5d070941..1c2339096c 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -38,12 +38,14 @@
#include "application_manager/usage_statistics.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_app_extension.h"
+#include "application_manager/mock_help_prompt_manager.h"
#include "application_manager/mock_resumption_data.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application.h"
#include "utils/data_accessor.h"
-#include "utils/make_shared.h"
+#include "config_profile/profile.h"
+
#include "application_manager/mock_message_helper.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application_manager_settings.h"
@@ -64,6 +66,8 @@ using ::testing::NiceMock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SetArgReferee;
+using ::testing::ReturnPointee;
+using ::testing::SaveArg;
using namespace application_manager_test;
using namespace resumption;
@@ -82,32 +86,63 @@ class ResumeCtrlTest : public ::testing::Test {
, kHash_("saved_hash")
, kAppResumingTimeout_(30000u) // miliseconds
, kTestTimeStamp_(1452074434u)
- , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {}
+ , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>())
+ , kDefaultDeferredTestLevel_(eType::INVALID_ENUM)
+ , kNaviLowbandwidthLevel_("LIMITED")
+ , kProjectionLowbandwidthLevel_("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_);
ON_CALL(mock_app_mngr_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
mock_storage_ =
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ std::make_shared<NiceMock<resumption_test::MockResumptionData> >(
mock_app_mngr_);
- mock_app_ = utils::MakeShared<NiceMock<MockApplication> >();
- mock_app_extension_ = utils::MakeShared<
+ mock_app_ = std::make_shared<NiceMock<MockApplication> >();
+ mock_help_prompt_manager_ =
+ std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager());
+ mock_app_extension_ = std::make_shared<
NiceMock<application_manager_test::MockAppExtension> >();
const_app_ =
static_cast<application_manager::ApplicationConstSharedPtr>(mock_app_);
- res_ctrl_ = utils::MakeShared<ResumeCtrlImpl>(mock_app_mngr_);
+ res_ctrl_ = std::make_shared<ResumeCtrlImpl>(mock_app_mngr_);
res_ctrl_->set_resumption_storage(mock_storage_);
ON_CALL(mock_app_mngr_, state_controller())
.WillByDefault(ReturnRef(mock_state_controller_));
ON_CALL(mock_app_mngr_, get_settings())
.WillByDefault(ReturnRef(mock_application_manager_settings_));
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .Times(AtLeast(0))
+ .WillRepeatedly(Return(true));
ON_CALL(mock_application_manager_settings_, use_db_for_resumption())
.WillByDefault(Return(false));
ON_CALL(mock_application_manager_settings_, app_resuming_timeout())
.WillByDefault(ReturnRef(kAppResumingTimeout_));
+ // use EXPECTED_CALL().Times(AtLeast(0)) instead of ON_CALL to remove
+ // warning messages
+ EXPECT_CALL(mock_application_manager_settings_,
+ navigation_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kNaviLowbandwidthLevel_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ projection_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kProjectionLowbandwidthLevel_));
+ EXPECT_CALL(mock_application_manager_settings_,
+ media_lowbandwidth_resumption_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(kMediaLowbandwidthLevel_));
+
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .Times(AtLeast(0))
+ .WillRepeatedly(Return(kDefaultDeferredTestLevel_));
}
void TearDown() OVERRIDE {
Mock::VerifyAndClearExpectations(&mock_app_mngr_);
@@ -123,14 +158,14 @@ 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_;
- utils::SharedPtr<NiceMock<application_manager_test::MockAppExtension> >
+ NiceMock<application_manager_test::MockApplicationManager> mock_app_mngr_;
+ std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> >
mock_app_extension_;
MockStateController mock_state_controller_;
- utils::SharedPtr<ResumeCtrl> res_ctrl_;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
- mock_storage_;
- utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ std::shared_ptr<ResumeCtrl> res_ctrl_;
+ std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_;
+ std::shared_ptr<NiceMock<MockApplication> > mock_app_;
+ std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_;
application_manager::ApplicationConstSharedPtr const_app_;
const uint32_t kTestAppId_;
const std::string kTestPolicyAppId_;
@@ -142,7 +177,13 @@ 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_;
+ const std::string kNaviLowbandwidthLevel_;
+ const std::string kProjectionLowbandwidthLevel_;
+ const std::string kMediaLowbandwidthLevel_;
};
/**
@@ -316,9 +357,13 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
.WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
EXPECT_CALL(*mock_app_, UpdateHash());
EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_));
+ ON_CALL(*mock_app_, help_prompt_manager())
+ .WillByDefault(ReturnRef(*mock_help_prompt_manager_));
for (uint32_t i = 0; i < count_of_commands; ++i) {
EXPECT_CALL(*mock_app_, AddCommand(i, test_application_commands[i]));
+ EXPECT_CALL(*mock_help_prompt_manager_,
+ OnVrCommandAdded(i, test_application_commands[i], true));
}
smart_objects::SmartObjectList requests;
@@ -544,16 +589,53 @@ TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
EXPECT_TRUE(res);
}
+TEST_F(ResumeCtrlTest, RetryResumption) {
+ const uint32_t app_id = 1;
+
+ EXPECT_CALL(mock_app_mngr_, application(app_id)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillOnce(Return(eType::HMI_FULL));
+
+ res_ctrl_->RetryResumption(app_id);
+
+ bool is_resumption_active = res_ctrl_->get_resumption_active();
+ EXPECT_TRUE(is_resumption_active);
+}
+
+TEST_F(ResumeCtrlTest, RetryResumption_NotDeferred) {
+ const uint32_t app_id = 1;
+
+ EXPECT_CALL(mock_app_mngr_, application(app_id)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillOnce(Return(eType::INVALID_ENUM));
+
+ res_ctrl_->RetryResumption(app_id);
+
+ bool is_resumption_active = res_ctrl_->get_resumption_active();
+ EXPECT_FALSE(is_resumption_active);
+}
+
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(
+ 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)));
@@ -584,6 +666,138 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
res_ctrl_->StartAppHmiStateResumption(mock_app_);
}
+TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppHasDeferredResumption) {
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_NONE;
+ 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))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ mobile_apis::HMILevel::eType app_deferred_level = deferred_level;
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(ReturnPointee(&app_deferred_level));
+ EXPECT_CALL(*mock_app_,
+ set_deferred_resumption_hmi_level(eType::INVALID_ENUM))
+ .WillOnce(SaveArg<0>(&app_deferred_level));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(ResumeCtrlTest,
+ StartAppHmiStateResumption_HighBandwidthTransportNotAvailable) {
+ 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));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
+
+ // if resumption is deferred ...
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(Return(restored_test_type));
+
+ // ... then RemoveApplicationFromSaved() will not be called
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .Times(0);
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
+TEST_F(
+ ResumeCtrlTest,
+ StartAppHmiStateResumption_HighBandwidthTransportNotAvailable_NaviAndMedia) {
+ 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
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_LIMITED))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(true));
+
+ std::string navi_lowbandwidth_level("NONE");
+ std::string projection_lowbandwidth_level("BACKGROUND");
+ std::string media_lowbandwidth_level("LIMITED");
+ EXPECT_CALL(mock_application_manager_settings_,
+ navigation_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(navi_lowbandwidth_level));
+ EXPECT_CALL(mock_application_manager_settings_,
+ projection_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(projection_lowbandwidth_level));
+ EXPECT_CALL(mock_application_manager_settings_,
+ media_lowbandwidth_resumption_level())
+ .WillRepeatedly(ReturnRef(media_lowbandwidth_level));
+
+ EXPECT_CALL(*mock_app_, deferred_resumption_hmi_level())
+ .WillRepeatedly(Return(restored_test_type));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .Times(0);
+
+ ON_CALL(mock_app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(mock_app_);
+}
+
/**
* @brief Group of tests which check restoring resumption with different data
*/
@@ -591,6 +805,10 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ ::application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
@@ -599,6 +817,9 @@ TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
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)));
@@ -630,15 +851,52 @@ TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
res_ctrl_->SetupDefaultHMILevel(mock_app_);
}
+TEST_F(ResumeCtrlTest,
+ SetupDefaultHMILevel_HighBandwidthTransportNotAvailable) {
+ smart_objects::SmartObject saved_app;
+
+ saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
+
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ GetInfoFromApp();
+ EXPECT_CALL(mock_app_mngr_, GetUserConsentForDevice("12345")).Times(0);
+
+ ON_CALL(mock_app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+
+ EXPECT_CALL(mock_app_mngr_, CheckResumptionRequiredTransportAvailable(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillRepeatedly(Return(false));
+
+ // SetRegularState() should be called with kProjectionLowbandwidthLevel_
+ EXPECT_CALL(mock_state_controller_, SetRegularState(_, eType::HMI_NONE))
+ .Times(AtLeast(1));
+
+ res_ctrl_->SetupDefaultHMILevel(mock_app_);
+}
+
TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
ON_CALL(mock_app_mngr_, application(kTestAppId_))
.WillByDefault(Return(mock_app_));
+ ::application_manager::CommandsMap command;
+ DataAccessor<application_manager::CommandsMap> data_accessor(
+ command, app_set_lock_ptr_);
+
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())
@@ -646,6 +904,9 @@ TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
EXPECT_CALL(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)));
@@ -735,8 +996,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) {
}
TEST_F(ResumeCtrlTest, SaveAllApplications) {
- utils::SharedPtr<application_manager_test::MockApplication> test_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> test_app =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*test_app, app_id()).WillRepeatedly(Return(kTestAppId_));
application_manager::ApplicationSet app_set;
@@ -751,8 +1012,8 @@ TEST_F(ResumeCtrlTest, SaveAllApplications) {
}
TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) {
- utils::SharedPtr<application_manager::Application> mock_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
application_manager::ApplicationSet app_set;
@@ -765,8 +1026,8 @@ TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) {
}
TEST_F(ResumeCtrlTest, SaveApplication) {
- utils::SharedPtr<application_manager::Application> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*mock_storage_, SaveApplication(app_sh_mock));
res_ctrl_->SaveApplication(app_sh_mock);
@@ -786,16 +1047,16 @@ TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) {
const bool res = res_ctrl_->StartResumptionOnlyHMILevel(mock_app_);
EXPECT_TRUE(res);
- utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_));
res_ctrl_->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) {
- utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager_test::MockApplication> app_sh_mock =
+ std::make_shared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).Times(0);
res_ctrl_->OnAppActivated(app_sh_mock);
}
@@ -901,8 +1162,8 @@ TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
}
TEST_F(ResumeCtrlTest, OnSuspend_EmptyApplicationlist) {
- utils::SharedPtr<application_manager::Application> mock_app =
- ::utils::MakeShared<application_manager_test::MockApplication>();
+ std::shared_ptr<application_manager::Application> mock_app =
+ std::make_shared<application_manager_test::MockApplication>();
application_manager::ApplicationSet app_set;
@@ -968,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 a75ba23bfb..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
@@ -38,7 +38,7 @@
#include "interfaces/MOBILE_API.h"
#include "utils/sqlite_wrapper/sql_database.h"
#include "utils/sqlite_wrapper/sql_query.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "application_manager/resumption_data_test.h"
#include "application_manager/test_resumption_data_db.h"
@@ -68,7 +68,7 @@ const std::string kPath =
class ResumptionDataDBTest : public ResumptionDataTest {
protected:
void SetUp() OVERRIDE {
- app_mock = utils::MakeShared<NiceMock<MockApplication> >();
+ app_mock = std::make_shared<NiceMock<MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
is_audio_ = true;
@@ -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/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
index ea257b902c..40e61a3c53 100644
--- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -61,7 +61,7 @@ using namespace file_system;
using namespace resumption;
using namespace mobile_apis;
-namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
class ResumptionDataJsonTest : public ResumptionDataTest {
protected:
@@ -69,7 +69,8 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
: last_state_("app_storage_folder", "app_info_storage")
, res_json(last_state_, mock_application_manager_) {}
virtual void SetUp() {
- app_mock = new NiceMock<application_manager_test::MockApplication>();
+ app_mock = std::make_shared<
+ NiceMock<application_manager_test::MockApplication> >();
policy_app_id_ = "test_policy_app_id";
app_id_ = 10;
@@ -91,7 +92,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
dictionary[am::strings::resumption][am::strings::resume_app_list];
sm::SmartObject res_app_list;
for (uint32_t i = 0; i < resume_app_list.size(); i++) {
- Formatters::CFormatterJsonBase::jsonValueToObj(resume_app_list[i],
+ formatters::CFormatterJsonBase::jsonValueToObj(resume_app_list[i],
res_app_list);
CheckSavedApp(res_app_list);
}
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index e80349dd47..fe24ea39b6 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -40,7 +40,6 @@
#include "application_manager/application.h"
#include "utils/data_accessor.h"
#include "application_manager/message_helper.h"
-#include "utils/make_shared.h"
#include "application_manager/resumption_data_test.h"
@@ -292,7 +291,7 @@ void ResumptionDataTest::CheckHelpPrompt(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckTimeoutPrompt(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list) {
for (uint i = 0; i < tts_chunks_count; ++i) {
std::string text = (*timeout_prompt_)[i][am::strings::text].asString();
SpeechCapabilities::eType speech = static_cast<SpeechCapabilities::eType>(
@@ -316,14 +315,14 @@ void ResumptionDataTest::CheckVRHelp(sm::SmartObject& res_list) {
}
void ResumptionDataTest::CheckVRTitle(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& res_list) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& res_list) {
std::string vtitle = (*vr_help_title_)[am::strings::vr_help_title].asString();
EXPECT_EQ(vtitle, res_list[am::strings::vr_help_title].asString());
}
void ResumptionDataTest::PrepareData() {
- mock_app_extension_ = utils::MakeShared<
- NiceMock<application_manager_test::MockAppExtension> >();
+ mock_app_extension_ =
+ std::make_shared<NiceMock<application_manager_test::MockAppExtension> >();
extensions_.insert(extensions_.begin(), mock_app_extension_);
ON_CALL(*app_mock, Extensions()).WillByDefault(ReturnRef(extensions_));
SetGlobalProporties();
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
index 7f5436b5b6..59e3f947c3 100644
--- a/src/components/application_manager/test/sdl_preloaded_pt.json
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -297,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -309,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -321,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -333,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index e5fdb33a93..23c75e8475 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -1433,6 +1433,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1445,6 +1446,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1457,6 +1459,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1469,6 +1472,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
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 bbd7220bc9..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
@@ -41,7 +41,7 @@
#include "transport_manager/mock_transport_manager.h"
#include "utils/lock.h"
#include "utils/data_accessor.h"
-#include "utils/make_shared.h"
+
#include "application_manager/message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/smart_object_keys.h"
@@ -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;
@@ -138,7 +139,7 @@ class StateControllerImplTest : public ::testing::Test {
StateControllerImplTest()
: ::testing::Test()
, usage_stat("0",
- utils::SharedPtr<usage_statistics::StatisticsManager>(
+ std::shared_ptr<usage_statistics::StatisticsManager>(
new usage_statistics_test::MockStatisticsManager))
, applications_lock_ptr_(std::make_shared<sync_primitives::Lock>())
, applications_(application_set_, applications_lock_ptr_)
@@ -164,7 +165,7 @@ class StateControllerImplTest : public ::testing::Test {
am::ApplicationSet application_set_;
mutable std::shared_ptr<sync_primitives::Lock> applications_lock_ptr_;
DataAccessor<am::ApplicationSet> applications_;
- utils::SharedPtr<am::StateControllerImpl> state_ctrl_;
+ std::shared_ptr<am::StateControllerImpl> state_ctrl_;
am::ApplicationSharedPtr simple_app_;
NiceMock<application_manager_test::MockApplication>* simple_app_ptr_;
@@ -222,7 +223,7 @@ class StateControllerImplTest : public ::testing::Test {
namespace SystemContext = mobile_apis::SystemContext;
am::HmiStatePtr state =
- utils::MakeShared<am::HmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::HmiState>(simple_app_, app_manager_mock_);
state->set_hmi_level(hmi_level);
state->set_audio_streaming_state(audio_ss);
state->set_video_streaming_state(video_ss);
@@ -242,7 +243,7 @@ class StateControllerImplTest : public ::testing::Test {
const mobile_apis::SystemContext::eType system_context,
const am::ApplicationSharedPtr app) {
am::HmiStatePtr new_state =
- utils::MakeShared<HmiStateType>(app, app_manager_mock_);
+ std::make_shared<HmiStateType>(app, app_manager_mock_);
new_state->set_hmi_level(hmi_level);
new_state->set_audio_streaming_state(audio_ss);
@@ -646,10 +647,9 @@ class StateControllerImplTest : public ::testing::Test {
app_id = (*it_begin)->app_id();
app_type = AppType(app_id);
app = (*it_begin);
- am::HmiStatePtr state_first =
- utils::MakeShared<T>(app, app_manager_mock_);
+ am::HmiStatePtr state_first = std::make_shared<T>(app, app_manager_mock_);
am::HmiStatePtr state_second =
- utils::MakeShared<Q>(app, app_manager_mock_);
+ std::make_shared<Q>(app, app_manager_mock_);
TestSetSeveralState(
app, state_first, state_second, app_type, call_back_result);
TestSetSeveralState(
@@ -954,7 +954,7 @@ class StateControllerImplTest : public ::testing::Test {
virtual void SetUp() OVERRIDE {
ON_CALL(app_manager_mock_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
- state_ctrl_ = utils::MakeShared<am::StateControllerImpl>(app_manager_mock_);
+ state_ctrl_ = std::make_shared<am::StateControllerImpl>(app_manager_mock_);
ON_CALL(app_manager_mock_, applications())
.WillByDefault(Return(applications_));
@@ -984,7 +984,7 @@ class StateControllerImplTest : public ::testing::Test {
ON_CALL(app_manager_mock_, GetPolicyHandler())
.WillByDefault(ReturnRef(policy_interface_));
smart_objects::SmartObjectSPtr bc_activate_app_request =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
ON_CALL(message_helper_mock_,
@@ -1929,7 +1929,7 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
smart_objects::SmartObjectSPtr bc_activate_app_request =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
(*bc_activate_app_request)[am::strings::params][am::strings::correlation_id] =
corr_id;
@@ -2096,7 +2096,7 @@ TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviVCApp) {
TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
am::HmiStatePtr state_phone_call =
- utils::MakeShared<am::PhoneCallHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::PhoneCallHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_phone_call,
APP_TYPE_NON_MEDIA,
@@ -2105,7 +2105,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
am::HmiStatePtr state_phone_call =
- utils::MakeShared<am::PhoneCallHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::PhoneCallHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_phone_call,
APP_TYPE_MEDIA,
@@ -2113,7 +2113,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
+ am::HmiStatePtr state_phone_call = std::make_shared<am::PhoneCallHmiState>(
media_navi_app_, app_manager_mock_);
TestSetState(media_navi_app_,
state_phone_call,
@@ -2123,7 +2123,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_vr,
APP_TYPE_NON_MEDIA,
@@ -2132,7 +2132,7 @@ TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -2141,7 +2141,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -2151,7 +2151,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(simple_app_,
@@ -2163,7 +2163,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(simple_app_,
@@ -2175,7 +2175,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_app_,
@@ -2187,7 +2187,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_app_,
@@ -2199,7 +2199,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_navi_vc_app_,
@@ -2211,7 +2211,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_navi_vc_app_,
@@ -2222,8 +2222,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(simple_app_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(simple_app_,
+ app_manager_mock_);
TestSetState(simple_app_,
state_navi_streming,
APP_TYPE_NON_MEDIA,
@@ -2233,8 +2233,8 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
TEST_F(StateControllerImplTest,
DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(media_app_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(media_app_,
+ app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_app_,
@@ -2246,8 +2246,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(media_app_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(media_app_,
+ app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_app_,
@@ -2259,7 +2259,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
DISABLED_SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(vc_app_,
@@ -2271,7 +2271,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
DISABLED_SetNaviStreamingStateVCApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(vc_app_,
@@ -2282,8 +2282,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(navi_app_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(navi_app_,
+ app_manager_mock_);
TestSetState(navi_app_,
state_navi_streming,
APP_TYPE_NAVI,
@@ -2293,8 +2293,8 @@ TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) {
TEST_F(StateControllerImplTest,
DISABLED_SetNaviStreamingStateMediaNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::VideoStreamingHmiState>(media_navi_app_,
- app_manager_mock_);
+ std::make_shared<am::VideoStreamingHmiState>(media_navi_app_,
+ app_manager_mock_);
TestSetState(media_navi_app_,
state_navi_streming,
APP_TYPE_NAVI,
@@ -2303,7 +2303,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::SafetyModeHmiState>(simple_app_, app_manager_mock_);
+ std::make_shared<am::SafetyModeHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_safety_mode,
APP_TYPE_NON_MEDIA,
@@ -2312,7 +2312,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::VRHmiState>(media_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2322,7 +2322,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
TEST_F(StateControllerImplTest,
SetSafetyModeStateForMediaNaviVoiceApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
+ std::make_shared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2830,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();
@@ -2956,7 +3028,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
.WillRepeatedly(Return(true));
smart_objects::SmartObjectSPtr activate_app =
- utils::MakeShared<smart_objects::SmartObject>();
+ std::make_shared<smart_objects::SmartObject>();
(*activate_app)[am::strings::params][am::strings::correlation_id] = kCorrID;
SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
state_ctrl_->on_event(event);
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
index 6efef83052..dfc694f3c5 100644
--- a/src/components/application_manager/test/usage_statistics_test.cc
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -36,16 +36,14 @@
#include "smart_objects/enum_schema_item.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/mock_app_stopwatch.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
namespace usage_statistics_test {
-using namespace mobile_apis; // For Language enums
-using namespace NsSmartDeviceLink::NsSmartObjects; // For EnumToCString &
- // EnumConversionHelper
+using namespace mobile_apis; // For Language enums
+using namespace ns_smart_device_link::ns_smart_objects; // For EnumToCString &
+ // EnumConversionHelper
using namespace usage_statistics;
using testing::_;
@@ -69,23 +67,22 @@ const std::string kAppId = "SPT";
class UsageStatisticsTest : public testing::Test {
public:
UsageStatisticsTest()
- : mock_statistics_manager_sptr_(
- utils::MakeShared<MockStatisticsManager>())
+ : mock_statistics_manager_sptr_(std::make_shared<MockStatisticsManager>())
, usage_statistics_test_object1_sptr_(
new application_manager::UsageStatistics(
kAppId, mock_statistics_manager_sptr_))
, language_(LanguageIdToString(kTestLanguageId)) {}
protected:
- utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_;
- std::auto_ptr<application_manager::UsageStatistics>
+ std::shared_ptr<MockStatisticsManager> mock_statistics_manager_sptr_;
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object1_sptr_;
const std::string language_;
};
TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
// Arrange
- std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object(
+ std::unique_ptr<MockAppStopwatch> mock_app_stopwatch_object(
new MockAppStopwatch);
// Checks
@@ -93,7 +90,7 @@ TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) {
EXPECT_CALL(*mock_app_stopwatch_object, Switch(kTestAppStopwatchId));
// Act
- std::auto_ptr<application_manager::UsageStatistics>
+ std::unique_ptr<application_manager::UsageStatistics>
usage_statistics_test_object2_sptr_(
new application_manager::UsageStatistics(
kAppId,
diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc
index cce0b2abf2..640a186e2b 100644
--- a/src/components/application_manager/test/zero_request_amount_test.cc
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -51,7 +51,7 @@ using namespace ::profile;
using namespace application_manager::request_controller;
using namespace application_manager;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
commands::Command* RegisterApplication() {
SmartObjectSPtr resultsmart =
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 61dddf55b0..57e925cd43 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -37,6 +37,7 @@
#include <string>
#include <vector>
#include <list>
+#include <map>
#include "utils/macro.h"
#include "protocol_handler/protocol_handler_settings.h"
#include "connection_handler/connection_handler_settings.h"
@@ -109,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
@@ -368,6 +384,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
bool enable_policy() const;
+ /**
+ * @brief Should core use fullAppID internally instead of appID (Default true)
+ * @return Flag
+ */
+ bool use_full_app_id() const;
+
// TransportManageSettings interface
/*
@@ -385,6 +407,12 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
uint16_t transport_manager_tcp_adapter_port() const OVERRIDE;
+ /**
+ * @brief Returns the network interface name for TCP transport adapter
+ */
+ const std::string& transport_manager_tcp_adapter_network_interface()
+ const OVERRIDE;
+
// TransportManageMMESettings interface
const std::string& event_mq_name() const OVERRIDE;
@@ -466,17 +494,39 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
size_t update_before_hours() const;
#endif // ENABLE_SECURITY
- /**
- * @brief Reads a string value from the profile
- *
- * @param value Result value
- * @param default_value Value to use key wasn't found
- * @param pSection The section to read the value in
- * @param pKey The key whose value needs to be read out
- *
- * @return FALSE if could not read the value out of the profile
- * (then the value is equal \c default_value)
- */
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ const bool multiple_transports_enabled() const OVERRIDE;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ const std::vector<std::string>& secondary_transports_for_bluetooth()
+ const OVERRIDE;
+ const std::vector<std::string>& secondary_transports_for_usb() const OVERRIDE;
+ const std::vector<std::string>& secondary_transports_for_wifi()
+ const OVERRIDE;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ const std::vector<std::string>& audio_service_transports() const OVERRIDE;
+ const std::vector<std::string>& video_service_transports() const OVERRIDE;
+
+ /**
+ * @brief Reads a string value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
bool ReadStringValue(std::string* value,
const char* default_value,
const char* const pSection,
@@ -520,13 +570,17 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @param pKey The key whose value needs to be read out
* @param out_result Pointer to bool value for result reading Section
* (could be NULL)
+ * @param allow_empty If true, then out_result will be true when the value
+ * contains an empty string.
+ * If false, then out_result will be false in such case.
*
* @return container of values or empty continer
* if could not read the value out of the profile
*/
std::vector<std::string> ReadStringContainer(const char* const pSection,
const char* const pKey,
- bool* out_result) const;
+ bool* out_result,
+ bool allow_empty = false) const;
/**
* @brief Reads an container of hex int values from the profile,
* which handle as "0x01, 0xA0, 0XFF"
@@ -618,6 +672,33 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint16_t open_attempt_timeout_ms_resumption_db() const;
/**
+ * @brief Returns "transport required for resumption" map
+ *
+ * Keys of the map are AppHMIType strings, i.e. "DEFAULT", "COMMUNICATION",
+ * "MEDIA", and so on. The map may contain a special key "EMPTY_APP" for apps
+ * that does not specify any AppHMIType.
+ */
+ const std::map<std::string, std::vector<std::string> >&
+ transport_required_for_resumption_map() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a NAVIGATION app
+ */
+ const std::string& navigation_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a PROJECTION app
+ */
+ const std::string& projection_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
+ * @brief Returns HMI level for resumption of a media app
+ *
+ * Note: this is *not* for AppHMIType = MEDIA.
+ */
+ const std::string& media_lowbandwidth_resumption_level() const OVERRIDE;
+
+ /**
* @brief Returns wait time after device connection
* before app launch request
*/
@@ -687,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;
@@ -714,13 +797,29 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @param pKey The key whose value needs to be read out
*
* @return FALSE if could not read the value out of the profile
- * (then the value is not changed)
+ * (then the value is not changed) or the value was empty
*/
bool ReadValue(std::string* value,
const char* const pSection,
const char* const pKey) const;
/**
+ * @brief Reads a string value from the profile
+ *
+ * This is same as ReadValue(), except that this method will accept an empty
+ * string.
+ *
+ * @param value The value to return
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return TRUE if the value is read, FALSE if the value is not found
+ */
+ bool ReadValueEmpty(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
* @brief Reads a boolean value from the profile
*
* @param value The value to return
@@ -854,11 +953,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string preloaded_pt_file_;
std::string policy_snapshot_file_name_;
bool enable_policy_;
+ bool use_full_app_id_;
uint32_t transport_manager_disconnect_timeout_;
bool use_last_state_;
std::vector<uint32_t> supported_diag_modes_;
std::string system_files_path_;
uint16_t transport_manager_tcp_adapter_port_;
+ std::string transport_manager_tcp_adapter_network_interface_;
std::string tts_delimiter_;
uint32_t audio_data_stopped_timeout_;
uint32_t video_data_stopped_timeout_;
@@ -895,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
@@ -919,6 +1026,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool use_db_for_resumption_;
uint16_t attempts_to_open_resumption_db_;
uint16_t open_attempt_timeout_ms_resumption_db_;
+ std::map<std::string, std::vector<std::string> >
+ transport_required_for_resumption_map_;
+ std::string navigation_lowbandwidth_resumption_level_;
+ std::string projection_lowbandwidth_resumption_level_;
+ std::string media_lowbandwidth_resumption_level_;
uint16_t app_launch_wait_time_;
uint16_t app_launch_max_retry_attempt_;
uint16_t app_launch_retry_wait_time_;
@@ -928,8 +1040,17 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
bool enable_app_launch_ios_;
uint32_t app_tranport_change_timer_;
uint32_t app_tranport_change_timer_addition_;
+ bool multiple_transports_enabled_;
+ std::vector<std::string> secondary_transports_for_bluetooth_;
+ std::vector<std::string> secondary_transports_for_usb_;
+ std::vector<std::string> secondary_transports_for_wifi_;
+ std::vector<std::string> audio_service_transports_;
+ 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 4137476d63..57984324aa 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -33,6 +33,7 @@
#include "config_profile/profile.h"
#include <errno.h>
+#include <numeric>
#include <string.h>
#include <stdlib.h>
#include <sstream>
@@ -88,6 +89,12 @@ const char* kSDL4Section = "SDL4";
const char* kSDL5Section = "SDL5";
const char* kResumptionSection = "Resumption";
const char* kAppLaunchSection = "AppLaunch";
+const char* kMultipleTransportsSection = "MultipleTransports";
+const char* kServicesMapSection = "ServicesMap";
+const char* kTransportRequiredForResumptionSection =
+ "TransportRequiredForResumption";
+const char* kLowBandwidthTransportResumptionLevelSection =
+ "LowBandwidthTransportResumptionLevel";
const char* kSDLVersionKey = "SDLVersion";
const char* kHmiCapabilitiesKey = "HMICapabilities";
@@ -146,6 +153,7 @@ const char* kHeartBeatTimeoutKey = "HeartBeatTimeout";
const char* kMaxSupportedProtocolVersionKey = "MaxSupportedProtocolVersion";
const char* kUseLastStateKey = "UseLastState";
const char* kTCPAdapterPortKey = "TCPAdapterPort";
+const char* kTCPAdapterNetworkInterfaceKey = "TCPAdapterNetworkInterface";
const char* kServerPortKey = "ServerPort";
const char* kVideoStreamingPortKey = "VideoStreamingPort";
const char* kAudioStreamingPortKey = "AudioStreamingPort";
@@ -176,11 +184,14 @@ const char* kTTSDelimiterKey = "TTSDelimiter";
const char* kRecordingFileNameKey = "RecordingFileName";
const char* kRecordingFileSourceKey = "RecordingFileSource";
const char* kEnablePolicy = "EnablePolicy";
+const char* kUseFullAppID = "UseFullAppID";
const char* kEventMQKey = "EventMQ";
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";
@@ -214,6 +225,63 @@ 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";
+const char* kSecondaryTransportForUSBKey = "SecondaryTransportForUSB";
+const char* kSecondaryTransportForWiFiKey = "SecondaryTransportForWiFi";
+const char* kAudioServiceTransportsKey = "AudioServiceTransports";
+const char* kVideoServiceTransportsKey = "VideoServiceTransports";
+
+const char* kDefaultTransportRequiredForResumptionKey =
+ "DefaultTransportRequiredForResumption";
+const char* kAppHMITypeDefault = "DEFAULT";
+const char* kCommunicationTransportRequiredForResumptionKey =
+ "CommunicationTransportRequiredForResumption";
+const char* kAppHMITypeCommunication = "COMMUNICATION";
+const char* kMediaTransportRequiredForResumptionKey =
+ "MediaTransportRequiredForResumption";
+const char* kAppHMITypeMedia = "MEDIA";
+const char* kMessagingTransportRequiredForResumptionKey =
+ "MessagingTransportRequiredForResumption";
+const char* kAppHMITypeMessaging = "MESSAGING";
+const char* kNavigationTransportRequiredForResumptionKey =
+ "NavigationTransportRequiredForResumption";
+const char* kAppHMITypeNavigation = "NAVIGATION";
+const char* kInformationTransportRequiredForResumptionKey =
+ "InformationTransportRequiredForResumption";
+const char* kAppHMITypeInformation = "INFORMATION";
+const char* kSocialTransportRequiredForResumptionKey =
+ "SocialTransportRequiredForResumption";
+const char* kAppHMITypeSocial = "SOCIAL";
+const char* kBackgroundProcessTransportRequiredForResumptionKey =
+ "BackgroundProcessTransportRequiredForResumption";
+const char* kAppHMITypeBackgroundProcess = "BACKGROUND_PROCESS";
+const char* kTestingTransportRequiredForResumptionKey =
+ "TestingTransportRequiredForResumption";
+const char* kAppHMITypeTesting = "TESTING";
+const char* kSystemTransportRequiredForResumptionKey =
+ "SystemTransportRequiredForResumption";
+const char* kAppHMITypeSystem = "SYSTEM";
+const char* kProjectionTransportRequiredForResumptionKey =
+ "ProjectionTransportRequiredForResumption";
+const char* kAppHMITypeProjection = "PROJECTION";
+const char* kRemoteControlTransportRequiredForResumptionKey =
+ "RemoteControlTransportRequiredForResumption";
+const char* kAppHMITypeRemoteControl = "REMOTE_CONTROL";
+const char* kEmptyAppTransportRequiredForResumptionKey =
+ "EmptyAppTransportRequiredForResumption";
+const char* kAppHMITypeEmptyApp = "EMPTY_APP";
+const char* kNavigationLowBandwidthResumptionLevelKey =
+ "NavigationLowBandwidthResumptionLevel";
+const char* kProjectionLowBandwidthResumptionLevelKey =
+ "ProjectionLowBandwidthResumptionLevel";
+const char* kMediaLowBandwidthResumptionLevelKey =
+ "MediaLowBandwidthResumptionLevel";
+
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
@@ -237,6 +305,7 @@ const char* kDefaultHubProtocolMask = "com.smartdevicelink.prot";
const char* kDefaultPoolProtocolMask = "com.smartdevicelink.prot";
const char* kDefaultIAPSystemConfig = "/fs/mp/etc/mm/ipod.cfg";
const char* kDefaultIAP2SystemConfig = "/fs/mp/etc/mm/iap2.cfg";
+const char* kDefaultTransportManagerTCPAdapterNetworkInterface = "";
#ifdef ENABLE_SECURITY
const char* kDefaultSecurityProtocol = "TLSv1.2";
@@ -276,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;
@@ -309,8 +379,13 @@ 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;
+const char* kDefaultLowBandwidthResumptionLevel = "NONE";
} // namespace
namespace profile {
@@ -370,6 +445,7 @@ Profile::Profile()
, max_supported_protocol_version_(kDefaultMaxSupportedProtocolVersion)
, policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName)
, enable_policy_(false)
+ , use_full_app_id_(true)
, transport_manager_disconnect_timeout_(
kDefaultTransportManagerDisconnectTimeout)
, use_last_state_(false)
@@ -403,6 +479,11 @@ Profile::Profile()
, attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB)
, open_attempt_timeout_ms_resumption_db_(
kDefaultOpenAttemptTimeoutMsResumptionDB)
+ , navigation_lowbandwidth_resumption_level_(
+ kDefaultLowBandwidthResumptionLevel)
+ , projection_lowbandwidth_resumption_level_(
+ kDefaultLowBandwidthResumptionLevel)
+ , media_lowbandwidth_resumption_level_(kDefaultLowBandwidthResumptionLevel)
, app_launch_wait_time_(kDefaultAppLaunchWaitTime)
, app_launch_max_retry_attempt_(kDefaultAppLaunchMaxRetryAttempt)
, app_launch_retry_wait_time_(kDefaultAppLaunchRetryWaitTime)
@@ -413,8 +494,12 @@ Profile::Profile()
, app_tranport_change_timer_(kDefaultAppTransportChangeTimer)
, app_tranport_change_timer_addition_(
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);
@@ -459,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 {
@@ -659,6 +752,10 @@ bool Profile::enable_policy() const {
return enable_policy_;
}
+bool Profile::use_full_app_id() const {
+ return use_full_app_id_;
+}
+
uint32_t Profile::transport_manager_disconnect_timeout() const {
return transport_manager_disconnect_timeout_;
}
@@ -682,6 +779,11 @@ uint16_t Profile::transport_manager_tcp_adapter_port() const {
return transport_manager_tcp_adapter_port_;
}
+const std::string& Profile::transport_manager_tcp_adapter_network_interface()
+ const {
+ return transport_manager_tcp_adapter_network_interface_;
+}
+
const std::string& Profile::tts_delimiter() const {
return tts_delimiter_;
}
@@ -714,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_;
}
@@ -899,6 +1006,23 @@ uint16_t Profile::open_attempt_timeout_ms_resumption_db() const {
return open_attempt_timeout_ms_resumption_db_;
}
+const std::map<std::string, std::vector<std::string> >&
+Profile::transport_required_for_resumption_map() const {
+ return transport_required_for_resumption_map_;
+}
+
+const std::string& Profile::navigation_lowbandwidth_resumption_level() const {
+ return navigation_lowbandwidth_resumption_level_;
+}
+
+const std::string& Profile::projection_lowbandwidth_resumption_level() const {
+ return projection_lowbandwidth_resumption_level_;
+}
+
+const std::string& Profile::media_lowbandwidth_resumption_level() const {
+ return media_lowbandwidth_resumption_level_;
+}
+
const uint16_t Profile::app_launch_max_retry_attempt() const {
return app_launch_max_retry_attempt_;
}
@@ -935,6 +1059,31 @@ const uint16_t Profile::wait_time_between_apps() const {
return wait_time_between_apps_;
}
+const bool Profile::multiple_transports_enabled() const {
+ return multiple_transports_enabled_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_bluetooth()
+ const {
+ return secondary_transports_for_bluetooth_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_usb() const {
+ return secondary_transports_for_usb_;
+}
+
+const std::vector<std::string>& Profile::secondary_transports_for_wifi() const {
+ return secondary_transports_for_wifi_;
+}
+
+const std::vector<std::string>& Profile::audio_service_transports() const {
+ return audio_service_transports_;
+}
+
+const std::vector<std::string>& Profile::video_service_transports() const {
+ return video_service_transports_;
+}
+
const bool Profile::ErrorOccured() const {
return error_occured_;
}
@@ -1610,6 +1759,16 @@ void Profile::UpdateValues() {
kTCPAdapterPortKey,
kTransportManagerSection);
+ // Transport manager TCP network interface
+ ReadStringValue(&transport_manager_tcp_adapter_network_interface_,
+ kDefaultTransportManagerTCPAdapterNetworkInterface,
+ kTransportManagerSection,
+ kTCPAdapterNetworkInterfaceKey);
+
+ LOG_UPDATED_VALUE(transport_manager_tcp_adapter_network_interface_,
+ kTCPAdapterNetworkInterfaceKey,
+ kTransportManagerSection);
+
// Event MQ
ReadStringValue(
&event_mq_name_, kDefaultEventMQ, kTransportManagerSection, kEventMQKey);
@@ -1701,6 +1860,15 @@ void Profile::UpdateValues() {
enable_policy_ = false;
}
+ // Use full app ID internally?
+ std::string use_full_id_string;
+ if (ReadValue(&use_full_id_string, kPolicySection, kUseFullAppID) &&
+ 0 == strcmp("true", use_full_id_string.c_str())) {
+ use_full_app_id_ = true;
+ } else {
+ use_full_app_id_ = false;
+ }
+
// Max protocol version
ReadUIntValue(&max_supported_protocol_version_,
kDefaultMaxSupportedProtocolVersion,
@@ -1735,6 +1903,11 @@ void Profile::UpdateValues() {
kMainSection,
kGetVehicleDataFrequencyKey);
+ ReadUintIntPairValue(&get_interior_vehicle_data_frequency_,
+ kGetInteriorVehicleDataFrequency,
+ kMainSection,
+ kGetInteriorVehicleDataFrequencyKey);
+
ReadUIntValue(&max_thread_pool_size_,
kDefaultMaxThreadPoolSize,
kApplicationManagerSection,
@@ -1841,6 +2014,84 @@ void Profile::UpdateValues() {
kOpenAttemptTimeoutMsResumptionDBKey,
kResumptionSection);
+ { // read parameters from TransportRequiredForResumption section
+ struct KeyPair {
+ const char* ini_key_name;
+ const char* map_key_name;
+ } keys[] = {
+ {kDefaultTransportRequiredForResumptionKey, kAppHMITypeDefault},
+ {kCommunicationTransportRequiredForResumptionKey,
+ kAppHMITypeCommunication},
+ {kMediaTransportRequiredForResumptionKey, kAppHMITypeMedia},
+ {kMessagingTransportRequiredForResumptionKey, kAppHMITypeMessaging},
+ {kNavigationTransportRequiredForResumptionKey, kAppHMITypeNavigation},
+ {kInformationTransportRequiredForResumptionKey, kAppHMITypeInformation},
+ {kSocialTransportRequiredForResumptionKey, kAppHMITypeSocial},
+ {kBackgroundProcessTransportRequiredForResumptionKey,
+ kAppHMITypeBackgroundProcess},
+ {kTestingTransportRequiredForResumptionKey, kAppHMITypeTesting},
+ {kSystemTransportRequiredForResumptionKey, kAppHMITypeSystem},
+ {kProjectionTransportRequiredForResumptionKey, kAppHMITypeProjection},
+ {kRemoteControlTransportRequiredForResumptionKey,
+ kAppHMITypeRemoteControl},
+ {kEmptyAppTransportRequiredForResumptionKey, kAppHMITypeEmptyApp},
+ {NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_key_name != NULL) {
+ bool exist = false;
+ std::vector<std::string> transport_list =
+ ReadStringContainer(kTransportRequiredForResumptionSection,
+ entry->ini_key_name,
+ &exist,
+ true);
+ if (exist) {
+ transport_required_for_resumption_map_[entry->map_key_name] =
+ transport_list;
+
+ const std::string list_with_comma = std::accumulate(
+ transport_list.begin(),
+ transport_list.end(),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ LOG_UPDATED_VALUE(list_with_comma,
+ entry->ini_key_name,
+ kTransportRequiredForResumptionSection);
+ }
+ entry++;
+ }
+ }
+
+ // Read parameters from LowBandwidthTransportResumptionLevel section
+ ReadStringValue(&navigation_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kNavigationLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(navigation_lowbandwidth_resumption_level_,
+ kNavigationLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
+ ReadStringValue(&projection_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kProjectionLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(projection_lowbandwidth_resumption_level_,
+ kProjectionLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
+ ReadStringValue(&media_lowbandwidth_resumption_level_,
+ kDefaultLowBandwidthResumptionLevel,
+ kLowBandwidthTransportResumptionLevelSection,
+ kMediaLowBandwidthResumptionLevelKey);
+
+ LOG_UPDATED_VALUE(media_lowbandwidth_resumption_level_,
+ kMediaLowBandwidthResumptionLevelKey,
+ kLowBandwidthTransportResumptionLevelSection);
+
// Read parameters from App Launch section
ReadUIntValue(&app_launch_wait_time_,
kDefaultAppLaunchWaitTime,
@@ -1917,6 +2168,83 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(app_tranport_change_timer_addition_,
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,
+ kMultipleTransportsEnabledKey);
+
+ LOG_UPDATED_BOOL_VALUE(multiple_transports_enabled_,
+ kMultipleTransportsEnabledKey,
+ kMultipleTransportsSection);
+
+ { // Secondary Transports and ServicesMap
+ struct KeyPair {
+ std::vector<std::string>* ini_vector;
+ const char* ini_section_name;
+ const char* ini_key_name;
+ } keys[] = {{&secondary_transports_for_bluetooth_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForBluetoothKey},
+ {&secondary_transports_for_usb_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForUSBKey},
+ {&secondary_transports_for_wifi_,
+ kMultipleTransportsSection,
+ kSecondaryTransportForWiFiKey},
+ {&audio_service_transports_,
+ kServicesMapSection,
+ kAudioServiceTransportsKey},
+ {&video_service_transports_,
+ kServicesMapSection,
+ kVideoServiceTransportsKey},
+ {NULL, NULL, NULL}};
+ struct KeyPair* entry = keys;
+
+ while (entry->ini_vector != NULL) {
+ bool exist = false;
+ std::vector<std::string> profile_entry = ReadStringContainer(
+ entry->ini_section_name, entry->ini_key_name, &exist, true);
+ if (exist) {
+ *entry->ini_vector = profile_entry;
+
+ const std::string list_with_comma = std::accumulate(
+ profile_entry.begin(),
+ profile_entry.end(),
+ std::string(""),
+ [](std::string& first, std::string& second) {
+ return first.empty() ? second : first + ", " + second;
+ });
+ LOG_UPDATED_VALUE(
+ list_with_comma, entry->ini_key_name, entry->ini_section_name);
+ }
+ entry++;
+ }
+ }
}
bool Profile::ReadValue(bool* value,
@@ -1944,15 +2272,22 @@ bool Profile::ReadValue(std::string* value,
const char* const pSection,
const char* const pKey) const {
DCHECK(value);
+ return ReadValueEmpty(value, pSection, pKey) && "\0" != *value;
+}
+
+bool Profile::ReadValueEmpty(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
bool ret = false;
char buf[INI_LINE_LEN + 1];
*buf = '\0';
- if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) &&
- ('\0' != *buf)) {
+ if (0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) {
*value = buf;
ret = true;
}
+
return ret;
}
@@ -2014,6 +2349,18 @@ namespace {
int32_t hex_to_int(const std::string& value) {
return static_cast<int32_t>(strtol(value.c_str(), NULL, 16));
}
+
+std::string trim_string(const std::string& str) {
+ const char* delims = " \t";
+
+ size_t start = str.find_first_not_of(delims);
+ if (std::string::npos == start) {
+ return std::string();
+ }
+ size_t end = str.find_last_not_of(delims);
+
+ return str.substr(start, end - start + 1);
+}
}
std::vector<int> Profile::ReadIntContainer(const char* const pSection,
@@ -2031,9 +2378,15 @@ std::vector<int> Profile::ReadIntContainer(const char* const pSection,
std::vector<std::string> Profile::ReadStringContainer(
const char* const pSection,
const char* const pKey,
- bool* out_result) const {
+ bool* out_result,
+ bool allow_empty) const {
std::string string;
- const bool result = ReadValue(&string, pSection, pKey);
+ bool result;
+ if (allow_empty) {
+ result = ReadValueEmpty(&string, pSection, pKey);
+ } else {
+ result = ReadValue(&string, pSection, pKey);
+ }
if (out_result)
*out_result = result;
std::vector<std::string> value_container;
@@ -2043,7 +2396,7 @@ std::vector<std::string> Profile::ReadStringContainer(
while (iss) {
if (!getline(iss, temp_str, ','))
break;
- value_container.push_back(temp_str);
+ value_container.push_back(trim_string(temp_str));
}
}
return value_container;
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
index e7d62f4740..64bafdd6bf 100644
--- a/src/components/config_profile/test/profile_test.cc
+++ b/src/components/config_profile/test/profile_test.cc
@@ -690,10 +690,34 @@ TEST_F(ProfileTest, CheckStringContainer) {
std::vector<std::string>::iterator element_mode = diagmodes_list.begin();
element_mode++;
element_mode++;
- diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), " 0x03");
+ diag_mode = std::find(diagmodes_list.begin(), diagmodes_list.end(), "0x03");
EXPECT_EQ(diag_mode, element_mode);
}
+TEST_F(ProfileTest, CheckStringContainerEmpty) {
+ // Set new config file
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
+ EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
+
+ bool isread = false;
+ std::vector<std::string> output_list =
+ profile_.ReadStringContainer("MAIN", "AppConfigFolder", &isread);
+ EXPECT_FALSE(isread);
+ EXPECT_TRUE(output_list.empty());
+
+ isread = false;
+ std::vector<std::string> output_list2 =
+ profile_.ReadStringContainer("MAIN", "AppConfigFolder", &isread, true);
+ EXPECT_TRUE(isread);
+ EXPECT_TRUE(output_list2.empty());
+
+ isread = false;
+ std::vector<std::string> output_list3 =
+ profile_.ReadStringContainer("MAIN", "DoesNotExistKey", &isread, true);
+ EXPECT_FALSE(isread);
+ EXPECT_TRUE(output_list2.empty());
+}
+
#ifdef ENABLE_SECURITY
TEST_F(ProfileTest, CheckIntContainerInSecurityData) {
// Set new config file
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index 9b72d60776..4f900bb65e 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -72,13 +72,18 @@ typedef std::map<int32_t, Connection*> ConnectionList;
*/
struct Service {
protocol_handler::ServiceType service_type;
+ transport_manager::ConnectionUID connection_id;
bool is_protected_;
Service()
: service_type(protocol_handler::kInvalidServiceType)
+ , connection_id(0)
, is_protected_(false) {}
- explicit Service(protocol_handler::ServiceType service_type)
- : service_type(service_type), is_protected_(false) {}
+ explicit Service(protocol_handler::ServiceType service_type,
+ transport_manager::ConnectionUID connection_id)
+ : service_type(service_type)
+ , connection_id(connection_id)
+ , is_protected_(false) {}
bool operator==(const protocol_handler::ServiceType service_type) const {
return this->service_type == service_type;
@@ -154,9 +159,11 @@ class Connection {
/**
* @brief Adds session to connection
+ * @param connection_handle Connection Handle for the session
* @return new session id or 0 in case of issues
*/
- uint32_t AddNewSession();
+ uint32_t AddNewSession(
+ const transport_manager::ConnectionUID connection_handle);
/**
* @brief Removes session from connection
@@ -171,11 +178,13 @@ class Connection {
* @param session_id session ID
* @param service_type Type of service
* @param is_protected protection state
+ * @param connection_id Connection ID associated with the service
* @return TRUE on success, otherwise FALSE
*/
bool AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
- const bool is_protected);
+ const bool is_protected,
+ transport_manager::ConnectionUID connection_id);
/**
* @brief Removes service from session
* @param session_id session ID
@@ -184,6 +193,18 @@ class Connection {
*/
bool RemoveService(uint8_t session_id,
protocol_handler::ServiceType service_type);
+
+ /**
+ * @brief Removes secondary service from session
+ * @param secondary_connection_handle connection identifying services to be
+ * removed
+ * @param removed_services_list Returned: List of service types removed
+ * @return the session ID associated with the services removed
+ */
+ uint8_t RemoveSecondaryServices(
+ transport_manager::ConnectionUID secondary_connection_handle,
+ std::list<protocol_handler::ServiceType>& removed_services_list);
+
#ifdef ENABLE_SECURITY
/**
* @brief Sets crypto context of service
@@ -213,10 +234,11 @@ class Connection {
const protocol_handler::ServiceType& service_type);
#endif // ENABLE_SECURITY
- /**
- * @brief Returns map of sessions which have been opened in
- * current connection.
- */
+
+ /**
+ * @brief Returns map of sessions which have been opened in
+ * current connection.
+ */
const SessionMap session_map() const;
/**
@@ -283,6 +305,20 @@ class Connection {
*/
bool ProtocolVersion(uint8_t session_id, uint8_t& protocol_version);
+ /**
+ * @brief Returns the primary connection handle associated with this
+ * connection
+ * @return ConnectionHandle
+ */
+ ConnectionHandle primary_connection_handle() const;
+
+ /**
+ * @brief Sets the primary connection handle
+ * @param primary_connection_handle the primary connection handle to
+ * associate with this connection
+ */
+ void SetPrimaryConnectionHandle(ConnectionHandle primary_connection_handle);
+
private:
/**
* @brief Current connection handler.
@@ -304,7 +340,12 @@ class Connection {
*/
SessionMap session_map_;
- mutable sync_primitives::Lock session_map_lock_;
+ mutable sync_primitives::RecursiveLock session_map_lock_;
+
+ /**
+ * @brief primary connection handle for secondary connections
+ */
+ ConnectionHandle primary_connection_handle_;
/**
* @brief monitor that closes connection if there is no traffic over it
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 e270d9faeb..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
@@ -54,11 +54,14 @@
#include "utils/stl_utils.h"
#include "utils/rwlock.h"
+const transport_manager::ConnectionUID kDisabledSecondary = 0xFFFFFFFF;
+
/**
* \namespace connection_handler
* \brief SmartDeviceLink connection_handler namespace.
*/
namespace connection_handler {
+
/**
* \class ConnectionHandlerImpl
* \brief SmartDeviceLink connection_handler main class
@@ -193,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.
@@ -227,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.
@@ -274,6 +243,24 @@ class ConnectionHandlerImpl
void OnMalformedMessageCallback(const uint32_t& connection_key) OVERRIDE;
/**
+ * @brief Converts connection handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param connection_handle A connection identifier
+ * @return string representation of the transport of the device
+ */
+ const std::string TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const;
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ const std::string TransportTypeProfileStringFromDeviceHandle(
+ DeviceHandle device_handle) const;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
@@ -509,6 +496,43 @@ class ConnectionHandlerImpl
DevicesDiscoveryStarter& get_device_discovery_starter();
/**
+ * \brief Add a session. This is meant to be called from Connection class.
+ * \param primary_transport_id the primary connection ID to associate with the
+ * newly created session
+ * \return new session id, or 0 if failed
+ **/
+ uint32_t AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) OVERRIDE;
+
+ /**
+ * \brief Remove a session. This is meant to be called from Connection class.
+ * \param session_id ID of the session to remove
+ * \return true if successful, false otherwise
+ **/
+ bool RemoveSession(uint8_t session_id) OVERRIDE;
+
+ DataAccessor<SessionConnectionMap> session_connection_map() OVERRIDE;
+
+ /**
+ * \brief Associate a secondary transport ID with a session
+ * \param session_id the session ID
+ * \param connection_id the new secondary connection ID to associate with the
+ * session
+ * \return the SessionTransports (newly) associated with the session
+ **/
+ SessionTransports SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) OVERRIDE;
+
+ /**
+ * \brief Retrieve the session transports associated with a session
+ * \param session_id the session ID
+ * \return the SessionTransports associated with the session
+ **/
+ const SessionTransports GetSessionTransports(
+ uint8_t session_id) const OVERRIDE;
+
+ /**
* \brief Invoked when observer's OnServiceStartedCallback is completed
* \param session_key the key of started session passed to
* OnServiceStartedCallback().
@@ -524,6 +548,28 @@ class ConnectionHandlerImpl
bool result,
std::vector<std::string>& rejected_params);
+ /**
+ * \brief Called when secondary transport with given session ID is established
+ * \param primary_connection_handle Set to identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * \param sessionid session ID taken from Register Secondary Transport frame
+ **/
+ bool OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) OVERRIDE;
+
+ /**
+ * \brief Called when secondary transport shuts down
+ * \param primary_connection_handle Identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * transport
+ **/
+ void OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle)
+ OVERRIDE;
+
private:
/**
* \brief Disconnect application.
@@ -535,6 +581,9 @@ class ConnectionHandlerImpl
void OnConnectionEnded(const transport_manager::ConnectionUID connection_id);
+ const uint8_t GetSessionIdFromSecondaryTransport(
+ transport_manager::ConnectionUID secondary_transport_id) const;
+
const ConnectionHandlerSettings& settings_;
/**
* \brief Pointer to observer
@@ -554,6 +603,13 @@ class ConnectionHandlerImpl
DeviceMap device_list_;
/**
+ * @brief session/connection map
+ */
+ SessionConnectionMap session_connection_map_;
+ mutable std::shared_ptr<sync_primitives::RecursiveLock>
+ session_connection_map_lock_ptr_;
+
+ /**
* \brief List of connections
*/
ConnectionList connection_list_;
@@ -573,6 +629,11 @@ class ConnectionHandlerImpl
std::map<uint32_t, protocol_handler::SessionContext>
start_service_context_map_;
+ /**
+ * @brief connection object as it's being closed
+ */
+ Connection* ending_connection_;
+
#ifdef BUILD_TESTS
// Methods for test usage
public:
@@ -581,6 +642,9 @@ class ConnectionHandlerImpl
void addDeviceConnection(
const transport_manager::DeviceInfo& device_info,
const transport_manager::ConnectionUID connection_id);
+ SessionConnectionMap& getSessionConnectionMap() {
+ return session_connection_map_;
+ }
#endif
private:
DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl);
diff --git a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
index 4d1d07112c..cf956353dd 100644
--- a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -102,7 +102,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
void RefreshExpiration();
uint32_t heartbeat_timeout_mseconds_;
- TimevalStruct heartbeat_expiration_;
+ date_time::TimeDuration heartbeat_expiration_;
bool is_heartbeat_sent_;
};
@@ -111,7 +111,7 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
typedef std::map<uint8_t, SessionState> SessionMap;
SessionMap sessions_;
- sync_primitives::Lock sessions_list_lock_; // recurcive
+ sync_primitives::RecursiveLock sessions_list_lock_; // recurcive
sync_primitives::Lock main_thread_lock_;
mutable sync_primitives::Lock heartbeat_timeout_seconds_lock_;
sync_primitives::ConditionalVariable heartbeat_monitor_;
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 614120312a..5a35919c6c 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -81,7 +81,7 @@ Connection::Connection(ConnectionHandle connection_handle,
: connection_handler_(connection_handler)
, connection_handle_(connection_handle)
, connection_device_handle_(connection_device_handle)
- , session_map_lock_(true)
+ , primary_connection_handle_(0)
, heartbeat_timeout_(heartbeat_timeout) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK(connection_handler_);
@@ -97,39 +97,62 @@ Connection::~Connection() {
heart_beat_monitor_thread_->join();
delete heartbeat_monitor_;
threads::DeleteThread(heart_beat_monitor_thread_);
- sync_primitives::AutoLock lock(session_map_lock_);
- session_map_.clear();
-}
-// Finds a key not presented in std::map<unsigned char, T>
-// Returns 0 if that key not found
-namespace {
-template <class T>
-uint32_t findGap(const std::map<unsigned char, T>& map) {
- for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
- if (map.find(i) == map.end()) {
- return i;
- }
+ // Before clearing out the session_map_, we must remove all sessions
+ // associated with this Connection from the SessionConnectionMap.
+
+ // NESTED LOCK: make sure to lock session_map_lock_ then ConnectionHandler's
+ // session_connection_map_lock_ptr_ (which will be taken in RemoveSession).
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.begin();
+ while (session_it != session_map_.end()) {
+ LOG4CXX_INFO(
+ logger_,
+ "Removed Session ID "
+ << static_cast<int>(session_it->first)
+ << " from Session/Connection Map in Connection Destructor");
+ connection_handler_->RemoveSession(session_it->first);
+ session_it++;
}
- return 0;
+
+ session_map_.clear();
}
-} // namespace
-uint32_t Connection::AddNewSession() {
+uint32_t Connection::AddNewSession(
+ const transport_manager::ConnectionUID connection_handle) {
LOG4CXX_AUTO_TRACE(logger_);
+
+ // NESTED LOCK: make sure to lock session_map_lock_ then ConnectionHandler's
+ // session_connection_map_lock_ptr_ (which will be taken in AddSession)
sync_primitives::AutoLock lock(session_map_lock_);
- const uint32_t session_id = findGap(session_map_);
+
+ // Even though we have our own SessionMap, we use the Connection Handler's
+ // SessionConnectionMap to generate a session ID. We want to make sure that
+ // session IDs are globally unique, and not only unique within a Connection.
+ const uint32_t session_id =
+ connection_handler_->AddSession(connection_handle);
if (session_id > 0) {
Session& new_session = session_map_[session_id];
new_session.protocol_version = ::protocol_handler::PROTOCOL_VERSION_2;
- new_session.service_list.push_back(Service(protocol_handler::kRpc));
- new_session.service_list.push_back(Service(protocol_handler::kBulk));
+ new_session.service_list.push_back(
+ Service(protocol_handler::kRpc, connection_handle));
+ new_session.service_list.push_back(
+ Service(protocol_handler::kBulk, connection_handle));
}
+
return session_id;
}
uint32_t Connection::RemoveSession(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Again, a NESTED lock, but it follows the rules.
sync_primitives::AutoLock lock(session_map_lock_);
+
+ if (!connection_handler_->RemoveSession(session_id)) {
+ return 0;
+ }
+
SessionMap::iterator it = session_map_.find(session_id);
if (session_map_.end() == it) {
LOG4CXX_WARN(logger_, "Session not found in this connection!");
@@ -137,12 +160,14 @@ uint32_t Connection::RemoveSession(uint8_t session_id) {
}
heartbeat_monitor_->RemoveSession(session_id);
session_map_.erase(session_id);
+
return session_id;
}
bool Connection::AddNewService(uint8_t session_id,
protocol_handler::ServiceType service_type,
- const bool request_protection) {
+ const bool request_protection,
+ transport_manager::ConnectionUID connection_id) {
// Ignore wrong services
if (protocol_handler::kControl == service_type ||
protocol_handler::kInvalidServiceType == service_type) {
@@ -152,7 +177,9 @@ bool Connection::AddNewService(uint8_t session_id,
LOG4CXX_DEBUG(logger_,
"Add service " << service_type << " for session "
- << static_cast<uint32_t>(session_id));
+ << static_cast<uint32_t>(session_id)
+ << " using connection ID "
+ << static_cast<uint32_t>(connection_id));
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::iterator session_it = session_map_.find(session_id);
@@ -201,7 +228,7 @@ bool Connection::AddNewService(uint8_t session_id,
#endif // ENABLE_SECURITY
}
// id service is not exists
- session.service_list.push_back(Service(service_type));
+ session.service_list.push_back(Service(service_type, connection_id));
return true;
}
@@ -246,6 +273,63 @@ bool Connection::RemoveService(uint8_t session_id,
return true;
}
+uint8_t Connection::RemoveSecondaryServices(
+ transport_manager::ConnectionUID secondary_connection_handle,
+ std::list<protocol_handler::ServiceType>& removed_services_list) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t found_session_id = 0;
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices looking for services on Connection ID "
+ << static_cast<int>(secondary_connection_handle));
+
+ // Walk the SessionMap in the primary connection, and for each
+ // Session, we walk its ServiceList, looking for all the services
+ // that were running on the now-closed Secondary Connection.
+ for (SessionMap::iterator session_it = session_map_.begin();
+ session_map_.end() != session_it;
+ ++session_it) {
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices found session ID "
+ << static_cast<int>(session_it->first));
+
+ // Now, for each session, walk the its ServiceList, looking for services
+ // that were using secondary)_connection_handle. If we find such a service,
+ // set session_found and break out of the outer loop.
+ ServiceList& service_list = session_it->second.service_list;
+ ServiceList::iterator service_it = service_list.begin();
+ for (; service_it != service_list.end();) {
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices found service ID "
+ << static_cast<int>(service_it->service_type));
+ if (service_it->connection_id == secondary_connection_handle) {
+ found_session_id = session_it->first;
+
+ LOG4CXX_INFO(logger_,
+ "RemoveSecondaryServices removing Service "
+ << static_cast<int>(service_it->service_type)
+ << " in session "
+ << static_cast<int>(found_session_id));
+
+ removed_services_list.push_back(service_it->service_type);
+ service_it = service_list.erase(service_it);
+ } else {
+ service_it++;
+ }
+ }
+
+ // If we found a session that had services running on the secondary
+ // connection, we're done.
+ if (found_session_id != 0) {
+ break;
+ }
+ }
+
+ return found_session_id;
+}
+
#ifdef ENABLE_SECURITY
int Connection::SetSSLContext(uint8_t session_id,
security_manager::SSLContext* context) {
@@ -405,6 +489,15 @@ bool Connection::ProtocolVersion(uint8_t session_id,
return true;
}
+ConnectionHandle Connection::primary_connection_handle() const {
+ return primary_connection_handle_;
+}
+
+void Connection::SetPrimaryConnectionHandle(
+ ConnectionHandle primary_connection_handle) {
+ primary_connection_handle_ = primary_connection_handle;
+}
+
void Connection::StartHeartBeat(uint8_t session_id) {
heartbeat_monitor_->AddSession(session_id);
}
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 83d80d9696..045985f650 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -68,11 +68,14 @@ ConnectionHandlerImpl::ConnectionHandlerImpl(
, connection_handler_observer_(NULL)
, transport_manager_(tm)
, protocol_handler_(NULL)
+ , session_connection_map_lock_ptr_(
+ std::make_shared<sync_primitives::RecursiveLock>())
, connection_list_lock_()
, connection_handler_observer_lock_()
, connection_list_deleter_(&connection_list_)
, start_service_context_map_lock_()
- , start_service_context_map_() {}
+ , start_service_context_map_()
+ , ending_connection_(NULL) {}
ConnectionHandlerImpl::~ConnectionHandlerImpl() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -335,86 +338,42 @@ bool AllowProtection(const ConnectionHandlerSettings& settings,
}
#endif // ENABLE_SECURITY
-uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
+void 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) {
+ const BsonObject* params) {
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;
+ std::vector<std::string> rejected_params;
- Connection* connection = it->second;
- if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
- new_session_id = connection->AddNewSession();
- 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)) {
- 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) {
+ // In case this is a Session running on a Secondary Transport, we need to
+ // find the Sessions's primary transport. In this case, "connection_handle"
+ // reflects the secondary transport, which we need for the various callbacks,
+ // so they can send appropriate Ack or NAK messages on the correct transport.
+ transport_manager::ConnectionUID primary_connection_handle =
+ connection_handle;
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
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;
+ "OnSessionStartedCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnSessionStartedCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ primary_connection_handle = st.primary_transport;
}
}
- return new_session_id;
-}
-
-void ConnectionHandlerImpl::OnSessionStartedCallback(
- const transport_manager::ConnectionUID connection_handle,
- const uint8_t session_id,
- const protocol_handler::ServiceType& service_type,
- const bool is_protected,
- const BsonObject* params) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<std::string> rejected_params;
- protocol_handler::SessionContext context(connection_handle,
+ protocol_handler::SessionContext context(primary_connection_handle,
+ connection_handle,
session_id,
0,
service_type,
@@ -428,7 +387,8 @@ void ConnectionHandlerImpl::OnSessionStartedCallback(
}
#endif // ENABLE_SECURITY
sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(connection_handle);
+ ConnectionList::iterator it =
+ connection_list_.find(primary_connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_ERROR(logger_, "Unknown connection!");
protocol_handler_->NotifySessionStarted(context, rejected_params);
@@ -440,15 +400,18 @@ void ConnectionHandlerImpl::OnSessionStartedCallback(
!connection->SessionServiceExists(session_id, service_type);
if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
- context.new_session_id_ = connection->AddNewSession();
+ context.new_session_id_ =
+ connection->AddNewSession(primary_connection_handle);
if (0 == context.new_session_id_) {
LOG4CXX_ERROR(logger_, "Couldn't start new session!");
protocol_handler_->NotifySessionStarted(context, rejected_params);
return;
}
- context.hash_id_ = KeyFromPair(connection_handle, context.new_session_id_);
+ context.hash_id_ =
+ KeyFromPair(primary_connection_handle, context.new_session_id_);
} else { // Could be create new service or protected exists one
- if (!connection->AddNewService(session_id, service_type, is_protected)) {
+ if (!connection->AddNewService(
+ session_id, service_type, is_protected, connection_handle)) {
LOG4CXX_ERROR(logger_,
"Couldn't establish "
#ifdef ENABLE_SECURITY
@@ -465,7 +428,7 @@ void ConnectionHandlerImpl::OnSessionStartedCallback(
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
const uint32_t session_key =
- KeyFromPair(connection_handle, context.new_session_id_);
+ KeyFromPair(primary_connection_handle, context.new_session_id_);
{
sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
@@ -502,10 +465,12 @@ void ConnectionHandlerImpl::NotifyServiceStartedResult(
start_service_context_map_.erase(it);
}
+ // We need the context's primary connection so we can manage its services list
Connection* connection = NULL;
{
sync_primitives::AutoReadLock lock(connection_list_lock_);
- ConnectionList::iterator it = connection_list_.find(context.connection_id_);
+ ConnectionList::iterator it =
+ connection_list_.find(context.primary_connection_id_);
if (connection_list_.end() == it) {
LOG4CXX_ERROR(logger_, "connection not found");
return;
@@ -538,6 +503,28 @@ void ConnectionHandlerImpl::OnApplicationFloodCallBack(
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
+ // In case this is a Session running on a Secondary Transport,
+ // "connection_handle" will reflect the active (secondary) transport.
+ // To close the conneciton and its sessions properly, we need to find
+ // the Sessions's primary transport/connection.
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnApplicationFloodCallBack could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnApplicationFloodCallBack found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ connection_handle = st.primary_transport;
+ }
+ }
+
LOG4CXX_INFO(logger_, "Disconnect flooding application");
if (session_id != 0) {
CloseSession(connection_handle, session_id, kFlood);
@@ -555,6 +542,28 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback(
uint8_t session_id = 0;
PairFromKey(connection_key, &connection_handle, &session_id);
+ // In case this is a Session running on a Secondary Transport,
+ // "connection_handle" will reflect the active (secondary) transport.
+ // To close the conneciton and its sessions properly, we need to find
+ // the Sessions's primary transport/connection.
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnMalformedMessageCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnMalformedMessageCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ connection_handle = st.primary_transport;
+ }
+ }
+
LOG4CXX_INFO(logger_, "Disconnect malformed messaging application");
CloseConnectionSessions(connection_handle, kMalformed);
CloseConnection(connection_handle);
@@ -563,22 +572,37 @@ 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_);
+ // In case this is a Session running on a Secondary Transport, we need to
+ // find the Sessions's primary transport. In this case, "connection_handle"
+ // reflects the secondary transport, which we need for the various callbacks,
+ // so they can send appropriate Ack or NAK messages on the correct transport.
+ transport_manager::ConnectionUID primary_connection_handle =
+ connection_handle;
+ if (session_id != 0) {
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "OnSessionEndedCallback could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "OnSessionEndedCallback found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+ primary_connection_handle = st.primary_transport;
+ }
+ }
+
connection_list_lock_.AcquireForReading();
- ConnectionList::iterator it = connection_list_.find(connection_handle);
+ ConnectionList::iterator it =
+ connection_list_.find(primary_connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_WARN(logger_, "Unknown connection!");
connection_list_lock_.Release();
@@ -588,7 +612,8 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
connection_list_lock_.Release();
Connection* connection = connection_item.second;
- const uint32_t session_key = KeyFromPair(connection_handle, session_id);
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
if (protocol_handler::kRpc == service_type) {
LOG4CXX_INFO(logger_,
@@ -631,6 +656,178 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
return session_key;
}
+bool ConnectionHandlerImpl::OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (session_id == 0) {
+ LOG4CXX_WARN(logger_, "Session id for secondary transport is invalid");
+ return false;
+ }
+
+ DeviceHandle device_handle;
+ Connection* connection;
+ {
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::iterator it =
+ connection_list_.find(secondary_connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Unknown connection " << secondary_connection_handle);
+ return false;
+ }
+
+ connection = it->second;
+ device_handle = connection->connection_device_handle();
+ }
+
+ // Add the secondary transport connection ID to the SessionConnectionMap
+ SessionTransports st =
+ SetSecondaryTransportID(session_id, secondary_connection_handle);
+ primary_connection_handle = st.primary_transport;
+ if (st.secondary_transport != secondary_connection_handle) {
+ LOG4CXX_WARN(logger_,
+ "Failed setting the session's secondary transport ID");
+ return false;
+ }
+
+ connection->SetPrimaryConnectionHandle(primary_connection_handle);
+
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
+
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ LOG4CXX_TRACE(logger_,
+ "Calling Connection Handler Observer's "
+ "OnSecondaryTransportStartedCallback");
+ connection_handler_observer_->OnSecondaryTransportStartedCallback(
+ device_handle, session_key);
+ }
+
+ return true;
+}
+
+void ConnectionHandlerImpl::OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_,
+ "Secondary Transport: "
+ << static_cast<int32_t>(secondary_connection_handle)
+ << " ended. Cleaning up services from primary connection ID "
+ << static_cast<int32_t>(primary_connection_handle));
+ connection_list_lock_.AcquireForReading();
+ ConnectionList::iterator itr =
+ connection_list_.find(primary_connection_handle);
+ if (connection_list_.end() == itr) {
+ LOG4CXX_ERROR(logger_, "Primary Connection not found!");
+ connection_list_lock_.Release();
+ return;
+ }
+ Connection* connection = itr->second;
+ connection_list_lock_.Release();
+
+ if (connection != NULL) {
+ std::list<protocol_handler::ServiceType> removed_services_list;
+ uint8_t session_id = connection->RemoveSecondaryServices(
+ secondary_connection_handle, removed_services_list);
+
+ if (session_id == 0) {
+ // The secondary services have already been removed from the primary
+ // connection, so we find the session associated with this secondary
+ // transport in the SessionConnectionMap
+ session_id =
+ GetSessionIdFromSecondaryTransport(secondary_connection_handle);
+ }
+
+ if (session_id != 0) {
+ {
+ sync_primitives::AutoReadLock read_lock(
+ connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ const uint32_t session_key =
+ KeyFromPair(primary_connection_handle, session_id);
+
+ // Walk the returned list of services and call the ServiceEnded
+ // callback for each
+ std::list<protocol_handler::ServiceType>::const_iterator it =
+ removed_services_list.begin();
+ for (; removed_services_list.end() != it; ++it) {
+ connection_handler_observer_->OnServiceEndedCallback(
+ session_key, *it, CloseSessionReason::kCommon);
+ }
+
+ connection_handler_observer_->OnSecondaryTransportEndedCallback(
+ session_key);
+ }
+ }
+
+ // Clear the secondary connection from the Session/Connection map entry
+ // associated with this session
+ SetSecondaryTransportID(session_id, 0);
+ }
+ }
+}
+
+const std::string
+ConnectionHandlerImpl::TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::const_iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_, "Unknown connection " << connection_handle);
+ return std::string();
+ } else {
+ DeviceHandle device_handle = it->second->connection_device_handle();
+ return TransportTypeProfileStringFromDeviceHandle(device_handle);
+ }
+}
+
+const std::string
+ConnectionHandlerImpl::TransportTypeProfileStringFromDeviceHandle(
+ DeviceHandle device_handle) const {
+ std::string connection_type;
+ DeviceMap::const_iterator it = device_list_.find(device_handle);
+ if (device_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Device not found!");
+ } else {
+ connection_type = it->second.connection_type();
+ }
+
+ // Caution: this should be in sync with devicesType map in
+ // transport_adapter_impl.cc
+ if (connection_type == "USB_AOA") {
+ return std::string("AOA_USB");
+ } else if (connection_type == "BLUETOOTH") {
+ return std::string("SPP_BLUETOOTH");
+ } else if (connection_type == "USB_IOS") {
+ return std::string("IAP_USB");
+ } else if (connection_type == "BLUETOOTH_IOS") {
+ return std::string("IAP_BLUETOOTH");
+ } else if (connection_type == "WIFI") {
+ return std::string("TCP_WIFI");
+ } else if (connection_type == "USB_IOS_HOST_MODE") {
+ return std::string("IAP_USB_HOST_MODE");
+ } else if (connection_type == "USB_IOS_DEVICE_MODE") {
+ return std::string("IAP_USB_DEVICE_MODE");
+ } else if (connection_type == "CARPLAY_WIRELESS_IOS") {
+ return std::string("IAP_CARPLAY");
+#ifdef BUILD_TESTS
+ } else if (connection_type == "BTMAC") {
+ return std::string("BTMAC");
+#endif
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown transport type string: " << connection_type);
+ return std::string();
+ }
+}
+
uint32_t ConnectionHandlerImpl::KeyFromPair(
transport_manager::ConnectionUID connection_handle,
uint8_t session_id) const {
@@ -639,7 +836,7 @@ uint32_t ConnectionHandlerImpl::KeyFromPair(
"Key for ConnectionHandle:"
<< static_cast<uint32_t>(connection_handle)
<< " Session:" << static_cast<uint32_t>(session_id)
- << " is: " << static_cast<uint32_t>(key));
+ << " is: 0x" << std::hex << static_cast<uint32_t>(key));
if (protocol_handler::HASH_ID_WRONG == key) {
LOG4CXX_ERROR(logger_,
"Connection key is WRONG_HASH_ID "
@@ -722,6 +919,139 @@ DevicesDiscoveryStarter& ConnectionHandlerImpl::get_device_discovery_starter() {
return *this;
}
+// Finds a key not presented in std::map<unsigned char, T>
+// Returns 0 if that key not found
+namespace {
+template <class T>
+uint32_t findGap(const std::map<unsigned char, T>& map) {
+ for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
+ if (map.find(i) == map.end()) {
+ return i;
+ }
+ }
+ return 0;
+}
+} // namespace
+
+uint32_t ConnectionHandlerImpl::AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ const uint32_t session_id = findGap(session_connection_map_);
+ if (session_id > 0) {
+ LOG4CXX_INFO(logger_,
+ "New session ID " << session_id << " and Connection Id "
+ << static_cast<int>(primary_transport_id)
+ << " added to Session/Connection Map");
+ SessionTransports st;
+ st.primary_transport = primary_transport_id;
+ st.secondary_transport = 0;
+ session_connection_map_[session_id] = st;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Session/Connection Map could not create a new session ID!!!");
+ }
+
+ return session_id;
+}
+
+bool ConnectionHandlerImpl::RemoveSession(uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::iterator itr = session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == itr) {
+ LOG4CXX_WARN(logger_, "Session not found in Session/Connection Map!");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Removed Session ID " << static_cast<int>(session_id)
+ << " from Session/Connection Map");
+ session_connection_map_.erase(session_id);
+ return true;
+}
+
+DataAccessor<SessionConnectionMap>
+ConnectionHandlerImpl::session_connection_map() {
+ return DataAccessor<SessionConnectionMap>(session_connection_map_,
+ session_connection_map_lock_ptr_);
+}
+
+SessionTransports ConnectionHandlerImpl::SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) {
+ SessionTransports st;
+
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::iterator it = session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "SetSecondaryTransportID: session ID "
+ << static_cast<int>(session_id)
+ << " not found in Session/Connection map");
+ st.primary_transport = 0;
+ st.secondary_transport = 0;
+ } else {
+ st = it->second;
+
+ // The only time we overwrite an existing entry in the map is if the new
+ // secondary transport ID is kDisabledSecondary, which effectively DISABLES
+ // the secondary transport feature for the session, or if the new secondary
+ // transport ID is 0, which means a secondary transport has shut down
+ if (st.secondary_transport != 0 &&
+ secondary_transport_id != kDisabledSecondary &&
+ secondary_transport_id != 0) {
+ LOG4CXX_WARN(logger_,
+ "SetSecondaryTransportID: session ID "
+ << static_cast<int>(session_id)
+ << " already has a secondary connection "
+ << static_cast<int>(st.secondary_transport)
+ << " in the Session/Connection map");
+ } else {
+ st.secondary_transport = secondary_transport_id;
+ session_connection_map_[session_id] = st;
+ }
+ }
+
+ return st;
+}
+
+const SessionTransports ConnectionHandlerImpl::GetSessionTransports(
+ uint8_t session_id) const {
+ SessionTransports st;
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::const_iterator it =
+ session_connection_map_.find(session_id);
+ if (session_connection_map_.end() == it) {
+ st.primary_transport = 0;
+ st.secondary_transport = 0;
+ } else {
+ st = it->second;
+ }
+
+ return st;
+}
+
+const uint8_t ConnectionHandlerImpl::GetSessionIdFromSecondaryTransport(
+ transport_manager::ConnectionUID secondary_transport_id) const {
+ sync_primitives::AutoLock auto_lock(session_connection_map_lock_ptr_);
+ SessionConnectionMap::const_iterator it = session_connection_map_.begin();
+ for (; session_connection_map_.end() != it; it++) {
+ SessionTransports st = it->second;
+ if (st.secondary_transport == secondary_transport_id) {
+ return it->first;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_,
+ "Could not find secondary transport ID "
+ << static_cast<int>(secondary_transport_id)
+ << " in the Session/Connection map");
+ return 0;
+}
+
struct CompareMAC {
explicit CompareMAC(const std::string& mac) : mac_(mac) {}
bool operator()(const DeviceMap::value_type& device) {
@@ -1098,8 +1428,28 @@ void ConnectionHandlerImpl::SendEndService(uint32_t key, uint8_t service_type) {
uint32_t connection_handle = 0;
uint8_t session_id = 0;
PairFromKey(key, &connection_handle, &session_id);
- protocol_handler_->SendEndService(
- connection_handle, session_id, service_type);
+
+ // If the service is running on a secondary transport, we need to retrieve
+ // that transport from the SessionConnection Map
+ SessionTransports st = GetSessionTransports(session_id);
+ if (st.primary_transport == 0) {
+ LOG4CXX_WARN(logger_,
+ "SendEndService could not find Session in the "
+ "Session/Connection Map!");
+ } else {
+ LOG4CXX_INFO(logger_,
+ "SendEndService found session "
+ << static_cast<int>(session_id)
+ << " with primary connection "
+ << static_cast<int>(st.primary_transport)
+ << " and secondary connection "
+ << static_cast<int>(st.secondary_transport));
+
+ protocol_handler_->SendEndService(st.primary_transport,
+ st.secondary_transport,
+ session_id,
+ service_type);
+ }
}
}
@@ -1160,12 +1510,16 @@ void ConnectionHandlerImpl::OnConnectionEnded(
connection_list_lock_.Release();
return;
}
- std::auto_ptr<Connection> connection(itr->second);
+ std::unique_ptr<Connection> connection(itr->second);
connection_list_.erase(itr);
connection_list_lock_.Release();
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_ && connection.get() != NULL) {
+ // We have to remember the Connection object we just removed from
+ // connection_list_, because we will need to retrieve the protocol
+ // version from it inside of OnServiceEndedCallback
+ ending_connection_ = connection.get();
const SessionMap session_map = connection->session_map();
for (SessionMap::const_iterator session_it = session_map.begin();
@@ -1182,6 +1536,13 @@ void ConnectionHandlerImpl::OnConnectionEnded(
session_key, service_it->service_type, CloseSessionReason::kCommon);
}
}
+ ending_connection_ = NULL;
+ }
+
+ ConnectionHandle primary_connection_handle =
+ connection->primary_connection_handle();
+ if (primary_connection_handle != 0) {
+ OnSecondaryTransportEnded(primary_connection_handle, connection_id);
}
}
@@ -1222,6 +1583,10 @@ bool ConnectionHandlerImpl::ProtocolVersionUsed(
ConnectionList::const_iterator it = connection_list_.find(connection_id);
if (connection_list_.end() != it) {
return it->second->ProtocolVersion(session_id, protocol_version);
+ } else if (ending_connection_ &&
+ static_cast<uint32_t>(ending_connection_->connection_handle()) ==
+ connection_id) {
+ return ending_connection_->ProtocolVersion(session_id, protocol_version);
}
LOG4CXX_WARN(logger_, "Connection not found !");
return false;
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index f3a2322810..12994fd23a 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -47,7 +47,6 @@ HeartBeatMonitor::HeartBeatMonitor(uint32_t heartbeat_timeout_mseconds,
Connection* connection)
: default_heartbeat_timeout_(heartbeat_timeout_mseconds)
, connection_(connection)
- , sessions_list_lock_(true)
, run_(true) {}
void HeartBeatMonitor::Process() {
@@ -164,8 +163,8 @@ HeartBeatMonitor::SessionState::SessionState(
void HeartBeatMonitor::SessionState::RefreshExpiration() {
LOG4CXX_DEBUG(logger_, "Refresh expiration: " << heartbeat_timeout_mseconds_);
using namespace date_time;
- TimevalStruct time = DateTime::getCurrentTime();
- DateTime::AddMilliseconds(time, heartbeat_timeout_mseconds_);
+ date_time::TimeDuration time = getCurrentTime();
+ AddMilliseconds(time, heartbeat_timeout_mseconds_);
heartbeat_expiration_ = time;
}
@@ -194,8 +193,8 @@ void HeartBeatMonitor::SessionState::KeepAlive() {
}
bool HeartBeatMonitor::SessionState::HasTimeoutElapsed() {
- TimevalStruct now = date_time::DateTime::getCurrentTime();
- return date_time::DateTime::Greater(now, heartbeat_expiration_);
+ date_time::TimeDuration now = date_time::getCurrentTime();
+ return date_time::Greater(now, heartbeat_expiration_);
}
} // namespace connection_handler
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
index 56dbf6b9de..f66d6b350c 100644
--- a/src/components/connection_handler/test/connection_handler_impl_test.cc
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -198,10 +198,12 @@ class ConnectionHandlerTest : public ::testing::Test {
}
// Check Service Wrapper
- void CheckServiceExists(const int connectionId,
- const int session_id,
- const ::protocol_handler::ServiceType serviceId,
- const bool exists) {
+ void CheckServiceExists(
+ const int connectionId,
+ const int session_id,
+ const ::protocol_handler::ServiceType serviceId,
+ const ::transport_manager::ConnectionUID serviceConnectionId,
+ const bool exists) {
// Check all trees to find Service and check own protected value
const ConnectionList& connection_list =
connection_handler_->getConnectionList();
@@ -221,6 +223,7 @@ class ConnectionHandlerTest : public ::testing::Test {
std::find(service_list.begin(), service_list.end(), serviceId);
if (exists) {
ASSERT_NE(serv_it, service_list.end());
+ ASSERT_EQ(serv_it->connection_id, serviceConnectionId);
} else {
ASSERT_EQ(serv_it, service_list.end());
}
@@ -306,6 +309,31 @@ class ConnectionHandlerTest : public ::testing::Test {
connection->ProtocolVersion(session_id, check_protocol_version));
EXPECT_EQ(check_protocol_version, protocol_version);
}
+ void AddSecondaryTestService(ServiceType service_type) {
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
+
+ // Set protocol version to 5
+ ChangeProtocol(uid_,
+ out_context_.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_5);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ temp_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &temp_connection_handler_observer);
+ EXPECT_CALL(temp_connection_handler_observer,
+ OnServiceStartedCallback(_, _, service_type, _)).Times(1);
+
+ connection_handler_->OnSessionStartedCallback(2u,
+ out_context_.new_session_id_,
+ service_type,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(0));
+ connection_handler_->set_connection_handler_observer(NULL);
+ }
ConnectionHandlerImpl* connection_handler_;
testing::NiceMock<transport_manager_test::MockTransportManager>
@@ -518,7 +546,7 @@ MATCHER_P(SameDevice, device, "") {
TEST_F(ConnectionHandlerTest, SendEndServiceWithoutSetProtocolHandler) {
AddTestDeviceConnection();
AddTestSession();
- EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, kRpc)).Times(0);
+ EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, _, kRpc)).Times(0);
connection_handler_->SendEndService(connection_key_, kRpc);
}
@@ -526,7 +554,7 @@ TEST_F(ConnectionHandlerTest, SendEndService) {
AddTestDeviceConnection();
AddTestSession();
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, kRpc));
+ EXPECT_CALL(mock_protocol_handler_, SendEndService(_, _, _, kRpc));
connection_handler_->SendEndService(connection_key_, kRpc);
}
@@ -1112,7 +1140,7 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) {
PROTECTION_OFF,
static_cast<BsonObject*>(NULL));
EXPECT_NE(0u, audio_context.new_session_id_);
- CheckServiceExists(uid_, audio_context.new_session_id_, kAudio, true);
+ CheckServiceExists(uid_, audio_context.new_session_id_, kAudio, uid_, true);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, audio_context.hash_id_);
// Start Audio service
@@ -1122,7 +1150,8 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) {
PROTECTION_OFF,
static_cast<BsonObject*>(NULL));
EXPECT_NE(0u, video_context.new_session_id_);
- CheckServiceExists(uid_, video_context.new_session_id_, kMobileNav, true);
+ CheckServiceExists(
+ uid_, video_context.new_session_id_, kMobileNav, uid_, true);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
connection_handler_->set_protocol_handler(NULL);
@@ -1150,7 +1179,8 @@ TEST_F(ConnectionHandlerTest, StartService_withServices_withParams) {
PROTECTION_OFF,
dummy_param);
EXPECT_EQ(out_context_.new_session_id_, video_context.new_session_id_);
- CheckServiceExists(uid_, out_context_.new_session_id_, kMobileNav, true);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, uid_, true);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
connection_handler_->set_protocol_handler(NULL);
@@ -1174,7 +1204,7 @@ TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) {
connection_handler_->OnSessionEndedCallback(
uid_, out_context_.new_session_id_, &dummy_hash, kAudio);
EXPECT_EQ(0u, end_session_result);
- CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, uid_, false);
}
TEST_F(ConnectionHandlerTest, ServiceStop) {
@@ -1204,7 +1234,7 @@ TEST_F(ConnectionHandlerTest, ServiceStop) {
connection_handler_->OnSessionEndedCallback(
uid_, out_context_.new_session_id_, &some_hash_id, kAudio);
EXPECT_EQ(connection_key_, end_session_result);
- CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, uid_, false);
}
}
@@ -2003,6 +2033,193 @@ TEST_F(ConnectionHandlerTest, OnDeviceConnectionSwitching) {
connection_handler_->OnDeviceSwitchingStart(mac_address_, second_mac_address);
}
+TEST_F(ConnectionHandlerTest, StartStopSecondarySession) {
+ // Add virtual device and connection
+ AddTestDeviceConnection();
+ // Start new session with RPC service
+ AddTestSession();
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ // Start a session on a secondary transport
+ const transport_manager::DeviceInfo secondary_device_info(
+ device_handle_, mac_address_, device_name_, std::string("WIFI"));
+ const transport_manager::ConnectionUID secondary_uid = 2u;
+ // Add Device and connection
+ ON_CALL(mock_connection_handler_settings, heart_beat_timeout())
+ .WillByDefault(Return(1000u));
+ connection_handler_->addDeviceConnection(secondary_device_info,
+ secondary_uid);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+
+ connection_handler_->OnSecondaryTransportStarted(
+ uid_, secondary_uid, out_context_.new_session_id_);
+
+ SessionTransports st =
+ connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, secondary_uid);
+
+ AddSecondaryTestService(kAudio);
+ AddSecondaryTestService(kMobileNav);
+
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kAudio, secondary_uid, true);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, secondary_uid, true);
+
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportEndedCallback(_)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(_, kAudio, _)).Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceEndedCallback(_, kMobileNav, _)).Times(1);
+
+ connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
+
+ st = connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, 0u);
+
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kAudio, secondary_uid, false);
+ CheckServiceExists(
+ uid_, out_context_.new_session_id_, kMobileNav, secondary_uid, false);
+}
+
+TEST_F(ConnectionHandlerTest, StopSecondarySession_NoService) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ const transport_manager::DeviceInfo secondary_device_info(
+ device_handle_, mac_address_, device_name_, std::string("WIFI"));
+ const transport_manager::ConnectionUID secondary_uid = 123u;
+ ON_CALL(mock_connection_handler_settings, heart_beat_timeout())
+ .WillByDefault(Return(1000u));
+ connection_handler_->addDeviceConnection(secondary_device_info,
+ secondary_uid);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportStartedCallback(device_handle_, _)).Times(1);
+ connection_handler_->OnSecondaryTransportStarted(
+ uid_, secondary_uid, out_context_.new_session_id_);
+
+ // check if OnSecondaryTransportEndedCallback is triggered with correct
+ // session ID even if we don't have any services
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnSecondaryTransportEndedCallback(_));
+ EXPECT_CALL(mock_connection_handler_observer, OnServiceEndedCallback(_, _, _))
+ .Times(0);
+
+ connection_handler_->OnSecondaryTransportEnded(uid_, secondary_uid);
+
+ SessionTransports st =
+ connection_handler_->GetSessionTransports(out_context_.new_session_id_);
+ EXPECT_EQ(st.primary_transport, uid_);
+ EXPECT_EQ(st.secondary_transport, 0u);
+}
+
+TEST_F(ConnectionHandlerTest, ConnectionType_valid) {
+ AddTestDeviceConnection();
+ AddTestSession();
+
+ std::string ret =
+ connection_handler_->TransportTypeProfileStringFromConnHandle(uid_);
+ EXPECT_EQ(connection_type_, ret);
+}
+
+TEST_F(ConnectionHandlerTest, ConnectionType_invalid) {
+ AddTestDeviceConnection();
+
+ transport_manager::ConnectionUID invalid_uid = 12345;
+ ASSERT_TRUE(invalid_uid != uid_);
+ std::string ret =
+ connection_handler_->TransportTypeProfileStringFromConnHandle(
+ invalid_uid);
+ EXPECT_EQ(std::string(), ret);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_UpdateSuccess) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 0;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ // secondary transport's ID is 0
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ secondary_uid = 200;
+ st = connection_handler_->SetSecondaryTransportID(session_id, secondary_uid);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_UpdateFailure) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 300;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ // secondary transport's ID is already assigned
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ st = connection_handler_->SetSecondaryTransportID(session_id, 500);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ // secondary transport's ID is NOT updated
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_OverwirteSecondaryUID) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 200;
+ transport_manager::ConnectionUID secondary_uid = 500;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ secondary_uid = kDisabledSecondary;
+ st = connection_handler_->SetSecondaryTransportID(session_id, secondary_uid);
+ EXPECT_EQ(primary_uid, st.primary_transport);
+ // secondary transport's ID is updated
+ EXPECT_EQ(secondary_uid, st.secondary_transport);
+}
+
+TEST_F(ConnectionHandlerTest, SetSecondaryTransportID_Failure) {
+ uint8_t session_id = 123;
+ transport_manager::ConnectionUID primary_uid = 100;
+ transport_manager::ConnectionUID secondary_uid = 0;
+
+ SessionConnectionMap& session_connection_map =
+ connection_handler_->getSessionConnectionMap();
+ SessionTransports st = {primary_uid, secondary_uid};
+ session_connection_map[session_id] = st;
+
+ uint8_t invalid_session_id = 10;
+ secondary_uid = 300;
+ st = connection_handler_->SetSecondaryTransportID(invalid_session_id,
+ secondary_uid);
+ EXPECT_EQ(0u, st.primary_transport);
+ EXPECT_EQ(0u, st.secondary_transport);
+}
+
} // namespace connection_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc
index de21dd1e97..98b83f5fc4 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -36,6 +36,7 @@
#include "protocol/common.h"
#include "connection_handler/connection.h"
+#include "connection_handler/mock_connection_handler.h"
#include "connection_handler/connection_handler_impl.h"
#include "protocol/service_type.h"
#include "connection_handler/mock_connection_handler_settings.h"
@@ -56,6 +57,8 @@ namespace connection_handler_test {
using namespace ::connection_handler;
using namespace ::protocol_handler;
+using ::testing::Return;
+
class ConnectionTest : public ::testing::Test {
protected:
void SetUp() OVERRIDE {
@@ -78,7 +81,7 @@ class ConnectionTest : public ::testing::Test {
session_id, protocol_handler::PROTOCOL_VERSION_3);
}
void StartDefaultSession() {
- session_id = connection_->AddNewSession();
+ session_id = connection_->AddNewSession(kDefaultConnectionHandle);
EXPECT_NE(session_id, 0u);
const SessionMap sessionMap = connection_->session_map();
EXPECT_FALSE(sessionMap.empty());
@@ -88,13 +91,14 @@ class ConnectionTest : public ::testing::Test {
std::find(serviceList.begin(), serviceList.end(), kRpc);
const bool found_result = (it != serviceList.end());
EXPECT_TRUE(found_result);
+ EXPECT_EQ(connection_->primary_connection_handle(), 0);
}
void AddNewService(const ServiceType service_type,
const bool protection,
const bool expect_add_new_service_call_result,
const bool expect_exist_service) {
- const bool result =
- connection_->AddNewService(session_id, service_type, protection);
+ const bool result = connection_->AddNewService(
+ session_id, service_type, protection, kDefaultConnectionHandle);
EXPECT_EQ(result, expect_add_new_service_call_result);
#ifdef ENABLE_SECURITY
@@ -110,12 +114,35 @@ class ConnectionTest : public ::testing::Test {
std::find(newServiceList.begin(), newServiceList.end(), service_type);
const bool found_result = it != newServiceList.end();
EXPECT_EQ(expect_exist_service, found_result);
-#ifdef ENABLE_SECURITY
if (found_result) {
const Service& service = *it;
+ transport_manager::ConnectionUID expected_connection_handle =
+ kDefaultConnectionHandle;
+ EXPECT_EQ(service.connection_id, expected_connection_handle);
+#ifdef ENABLE_SECURITY
EXPECT_EQ(service.is_protected_, protection);
- }
#endif // ENABLE_SECURITY
+ }
+ }
+ void AddNewSecondaryService(const ServiceType service_type) {
+ const bool result = connection_->AddNewService(
+ session_id, service_type, false, kSecondaryConnectionHandle);
+ EXPECT_EQ(result, true);
+
+ const SessionMap session_map = connection_->session_map();
+ EXPECT_FALSE(session_map.empty());
+ const ServiceList newServiceList = session_map.begin()->second.service_list;
+ EXPECT_FALSE(newServiceList.empty());
+ const ServiceList::const_iterator it =
+ std::find(newServiceList.begin(), newServiceList.end(), service_type);
+ const bool found_result = it != newServiceList.end();
+ EXPECT_TRUE(found_result);
+ if (found_result) {
+ const Service& service = *it;
+ transport_manager::ConnectionUID expected_secondary_connection_handle =
+ kSecondaryConnectionHandle;
+ EXPECT_EQ(service.connection_id, expected_secondary_connection_handle);
+ }
}
void RemoveService(const ServiceType service_type,
@@ -141,6 +168,8 @@ class ConnectionTest : public ::testing::Test {
transport_manager_mock;
ConnectionHandlerImpl* connection_handler_;
uint32_t session_id;
+ static const transport_manager::ConnectionUID kDefaultConnectionHandle = 1;
+ static const transport_manager::ConnectionUID kSecondaryConnectionHandle = 2;
};
TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) {
@@ -236,13 +265,17 @@ TEST_F(ConnectionTest, HeartBeat_Protocol5_ZeroHeartBeat_NotSupported) {
// Try to add service without session
TEST_F(ConnectionTest, Session_AddNewServiceWithoutSession) {
- EXPECT_EQ(connection_->AddNewService(session_id, kAudio, true),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kAudio, true, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kAudio, false),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kAudio, false, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kMobileNav, true),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kMobileNav, true, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
- EXPECT_EQ(connection_->AddNewService(session_id, kMobileNav, false),
+ EXPECT_EQ(connection_->AddNewService(
+ session_id, kMobileNav, false, kDefaultConnectionHandle),
EXPECT_RETURN_FALSE);
}
@@ -409,6 +442,133 @@ TEST_F(ConnectionTest, RemoveSession) {
EXPECT_EQ(0u, connection_->RemoveSession(session_id));
}
+TEST_F(ConnectionTest, AddNewSession_VerifyAddSessionCalled) {
+ MockConnectionHandler mock_connection_handler;
+
+ ConnectionHandle connection_handle = 123;
+ DeviceHandle device_handle = 0u;
+ uint32_t heart_beat = 10000u;
+ Connection* connection = new Connection(
+ connection_handle, device_handle, &mock_connection_handler, heart_beat);
+
+ transport_manager::ConnectionUID connection_handle_uid = 1;
+ uint32_t mock_session_id = 2;
+ EXPECT_CALL(mock_connection_handler, AddSession(connection_handle_uid))
+ .WillOnce(Return(mock_session_id));
+
+ uint32_t sid = connection->AddNewSession(connection_handle_uid);
+ EXPECT_EQ(mock_session_id, sid);
+
+ EXPECT_CALL(mock_connection_handler, RemoveSession(mock_session_id))
+ .WillOnce(Return(true)); // invoked by destructor of connection
+ delete connection;
+}
+
+TEST_F(ConnectionTest, RemoveSession_VerifyRemoveSessionCalled) {
+ MockConnectionHandler mock_connection_handler;
+
+ ConnectionHandle connection_handle = 123;
+ DeviceHandle device_handle = 0u;
+ uint32_t heart_beat = 10000u;
+ Connection* connection = new Connection(
+ connection_handle, device_handle, &mock_connection_handler, heart_beat);
+
+ transport_manager::ConnectionUID connection_handle_uid = 1;
+ uint32_t mock_session_id = 10;
+ EXPECT_CALL(mock_connection_handler, AddSession(connection_handle_uid))
+ .WillOnce(Return(mock_session_id));
+ EXPECT_CALL(mock_connection_handler,
+ RemoveSession(static_cast<uint8_t>(mock_session_id)))
+ .WillOnce(Return(true));
+
+ uint32_t sid = connection->AddNewSession(connection_handle_uid);
+
+ uint32_t ret = connection->RemoveSession(sid);
+ EXPECT_EQ(sid, ret);
+
+ delete connection;
+}
+
+TEST_F(ConnectionTest, SecondarySessionTest) {
+ StartSession();
+ AddNewService(
+ kRpc, PROTECTION_OFF, EXPECT_RETURN_FALSE, EXPECT_SERVICE_EXISTS);
+
+ const ConnectionHandle connectionHandle = 0;
+ const DeviceHandle device_handle = 0u;
+ const uint32_t heart_beat = 0u;
+ Connection* secondary_connection = new Connection(
+ connectionHandle, device_handle, connection_handler_, heart_beat);
+
+ secondary_connection->SetPrimaryConnectionHandle(kDefaultConnectionHandle);
+ connection_handler::ConnectionHandle expected_primary_connection_handle =
+ kDefaultConnectionHandle;
+ EXPECT_EQ(secondary_connection->primary_connection_handle(),
+ expected_primary_connection_handle);
+
+ AddNewSecondaryService(kAudio);
+ AddNewSecondaryService(kMobileNav);
+
+ delete secondary_connection;
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_SUCCESS) {
+ StartSession();
+
+ ServiceType services[2] = {kMobileNav, kAudio};
+ AddNewSecondaryService(services[0]);
+ AddNewSecondaryService(services[1]);
+ size_t services_count = sizeof(services) / sizeof(services[0]);
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ kSecondaryConnectionHandle, removed_services);
+
+ // check return value
+ EXPECT_EQ(session_id, ret_session_id);
+ // check returned list
+ EXPECT_EQ(services_count, removed_services.size());
+ std::list<protocol_handler::ServiceType>::iterator it;
+ it = std::find(removed_services.begin(), removed_services.end(), services[0]);
+ EXPECT_TRUE(it != removed_services.end());
+ it = std::find(removed_services.begin(), removed_services.end(), services[1]);
+ EXPECT_TRUE(it != removed_services.end());
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_NoService) {
+ StartSession();
+ /* do not call AddNewSecondaryService() */
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ kSecondaryConnectionHandle, removed_services);
+
+ // check return value
+ EXPECT_EQ(0, ret_session_id);
+ // check returned list
+ EXPECT_EQ(0u, removed_services.size());
+}
+
+TEST_F(ConnectionTest, RemoveSecondaryServices_InvalidConnectionHandle) {
+ StartSession();
+
+ ServiceType services[2] = {kMobileNav, kAudio};
+ AddNewSecondaryService(services[0]);
+ AddNewSecondaryService(services[1]);
+
+ transport_manager::ConnectionUID invalid_connection_handle = 123;
+ ASSERT_TRUE(kSecondaryConnectionHandle != invalid_connection_handle);
+
+ std::list<ServiceType> removed_services;
+ uint8_t ret_session_id = connection_->RemoveSecondaryServices(
+ invalid_connection_handle, removed_services);
+
+ // check return value
+ EXPECT_EQ(0, ret_session_id);
+ // check returned list
+ EXPECT_EQ(0u, removed_services.size());
+}
+
#ifdef ENABLE_SECURITY
TEST_F(ConnectionTest, SetSSLContextWithoutSession) {
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
index 4c67c97191..e089a07ec4 100644
--- a/src/components/connection_handler/test/heart_beat_monitor_test.cc
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -51,6 +51,7 @@ namespace connection_handler_test {
using ::testing::DoAll;
using ::testing::_;
+using ::testing::Return;
class HeartBeatMonitorTest : public testing::Test {
public:
@@ -64,6 +65,8 @@ class HeartBeatMonitorTest : public testing::Test {
uint32_t kTimeout;
static const connection_handler::ConnectionHandle kConnectionHandle =
0xABCDEF;
+ static const transport_manager::ConnectionUID kDefaultConnectionHandle = 1;
+ static const uint32_t kDefaultSessionId = 1;
virtual void SetUp() {
conn = new connection_handler::Connection(
@@ -80,25 +83,40 @@ ACTION_P2(RemoveSession, conn, session_id) {
}
TEST_F(HeartBeatMonitorTest, TimerNotStarted) {
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true)); // called by destructor of Connection
+
// Whithout StartHeartBeat nothing to be call
EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
- conn->AddNewSession();
+ conn->AddNewSession(kDefaultConnectionHandle);
}
TEST_F(HeartBeatMonitorTest, TimerNotElapsed) {
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
- const uint32_t session = conn->AddNewSession();
+ const uint32_t session = conn->AddNewSession(kDefaultConnectionHandle);
conn->StartHeartBeat(session);
}
TEST_F(HeartBeatMonitorTest, TimerElapsed) {
- const uint32_t session = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true)); // invoked by RemoveSession action
+
+ const uint32_t session = conn->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
@@ -121,11 +139,16 @@ TEST_F(HeartBeatMonitorTest, TimerElapsed) {
}
TEST_F(HeartBeatMonitorTest, KeptAlive) {
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
- const uint32_t session = conn->AddNewSession();
+ const uint32_t session = conn->AddNewSession(kDefaultConnectionHandle);
conn->StartHeartBeat(session);
usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
conn->KeepAlive(session);
@@ -137,7 +160,12 @@ TEST_F(HeartBeatMonitorTest, KeptAlive) {
}
TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
- const uint32_t session = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t session = conn->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
@@ -167,8 +195,20 @@ TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
}
TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
- const uint32_t kSession1 = conn->AddNewSession();
- const uint32_t kSession2 = conn->AddNewSession();
+ const uint32_t kMockSessionId1 = 1;
+ const uint32_t kMockSessionId2 = 2;
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kMockSessionId1))
+ .WillOnce(Return(kMockSessionId2));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kMockSessionId1))
+ .WillOnce(Return(true));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kMockSessionId2))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession1 = conn->AddNewSession(kDefaultConnectionHandle);
+
+ const transport_manager::ConnectionUID kAnotherConnectionHandle = 2;
+ const uint32_t kSession2 = conn->AddNewSession(kAnotherConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
@@ -199,7 +239,12 @@ TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
}
TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
- const uint32_t kSession = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession = conn->AddNewSession(kDefaultConnectionHandle);
EXPECT_CALL(connection_handler_mock, CloseSession(_, _)).Times(0);
EXPECT_CALL(connection_handler_mock, CloseConnection(_)).Times(0);
@@ -211,7 +256,12 @@ TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
}
TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) {
- const uint32_t kSession = conn->AddNewSession();
+ EXPECT_CALL(connection_handler_mock, AddSession(_))
+ .WillOnce(Return(kDefaultSessionId));
+ EXPECT_CALL(connection_handler_mock, RemoveSession(kDefaultSessionId))
+ .WillOnce(Return(true));
+
+ const uint32_t kSession = conn->AddNewSession(kDefaultConnectionHandle);
TestAsyncWaiter waiter;
uint32_t times = 0;
diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt
deleted file mode 100644
index 26ff9373bf..0000000000
--- a/src/components/dbus/CMakeLists.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright (c) 2016, 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-
-include_directories (
- ${DBUS_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}/include/
- ${CMAKE_SOURCE_DIR}/
- ${COMPONENTS_DIR}
- ${COMPONENTS_DIR}/formatters/include/
- ${COMPONENTS_DIR}/smart_objects/include/
- ${COMPONENTS_DIR}/utils/include/
- ${CMAKE_BINARY_DIR}/src/components/
-)
-
-set(PATHS
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}/src/introspection_xml.cc
- ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
-)
-collect_sources(SOURCES "${PATHS}")
-
-set(LIBRARIES
- HMI_API
- Utils
- dbus-1
-)
-
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
- COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
-)
-
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
- COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
-)
-
-add_library("DBus" ${SOURCES})
-
-target_link_libraries("DBus" "${LIBRARIES}")
-
-if(BUILD_TESTS)
- add_subdirectory(test)
-endif()
diff --git a/src/components/dbus/codegen/code_formatter.py b/src/components/dbus/codegen/code_formatter.py
deleted file mode 100644
index c3eb1b7815..0000000000
--- a/src/components/dbus/codegen/code_formatter.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file code_formatter.py
-# @brief Utility that helps to manage indents in generated code
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, 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.
-
-class CodeBlock:
- indent = 0
- def __init__(self, out):
- self.out = out
- if type(out) == file:
- self.indent = 0
- elif type(out) == CodeBlock:
- self.indent = out.indent
- def __enter__(self):
- self.indent += 1
- return self
- def __exit__(self, exc_type, exc_value, traceback):
- if self.indent >= 1:
- self.indent -= 1
- def write(self, s):
- for string in s.splitlines(True):
- self.out.write(' ' * self.indent + string)
-
-# vim: set ts=4 sw=4 et:
-
diff --git a/src/components/dbus/codegen/ford_xml_parser.py b/src/components/dbus/codegen/ford_xml_parser.py
deleted file mode 100644
index 4f9f222d24..0000000000
--- a/src/components/dbus/codegen/ford_xml_parser.py
+++ /dev/null
@@ -1,231 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file ford_xml_parser.py
-# @brief Parser for HMI_API.xml
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, 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.
-
-from xml.etree import ElementTree
-from collections import OrderedDict
-
-node_name = '/com/ford/hmi'
-
-class ParamDesc:
- pass
-
-class FordXmlParser:
- def __init__(self, in_el_tree, interface_path=None):
- self.interface_path = interface_path
- self.el_tree = in_el_tree
- self.find_enums()
- self.find_structs()
-
- def find_enums(self):
- self.enums = dict()
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for enum_el in interface_el.findall('enum'):
- enum_name = enum_el.get('name')
- self.enums[(interface_name,enum_name)] = enum_el
-
-
- def make_param_desc(self, param_el, iface=None):
- param_desc = ParamDesc()
- param_desc.name = param_el.get('name')
- param_desc.type = param_el.get('type')
- param_desc.enum = False
- param_desc.struct = False
- param_desc.fulltype = param_desc.type
- if param_el.get('mandatory') == 'false':
- param_desc.mandatory = False
- else:
- param_desc.mandatory = True
- if param_el.get('array') == 'true':
- param_desc.array = True
- else:
- param_desc.array = False
- param_desc.minValue = param_el.get('minvalue') if param_el.get('minvalue') else 0
- param_desc.maxValue = param_el.get('maxvalue')
- param_desc.minLength = param_el.get('minlength') if param_el.get('minlength') else 0
- param_desc.maxLength = param_el.get('maxlength')
- param_desc.minSize = param_el.get('minsize')
- param_desc.maxSize = param_el.get('maxsize')
-
- param_desc.restricted = param_desc.minValue != None or \
- param_desc.maxValue != None or \
- param_desc.minLength > 0 or \
- param_desc.maxLength > 0
- param_desc.restrictedArray = param_desc.array and (param_desc.minSize > 0 or param_desc.maxSize > 0)
- if iface is None:
- return param_desc
- if param_desc.type not in ['Integer', 'String', 'Boolean', 'Float']:
- param_type = param_desc.type.split('.')
- if len(param_type) > 1:
- param_type = (param_type[0], param_type[1])
- else:
- param_type = (iface, param_type[0])
- param_desc.fulltype = param_type
- if param_type in self.enums: param_desc.enum = True
- elif param_type in self.structs: param_desc.struct = True
- return param_desc
-
-
- def find_structs(self):
- self.structs = OrderedDict()
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for struct_el in interface_el.findall('struct'):
- struct_name = struct_el.get('name')
- self.structs[(interface_name, struct_name)] = []
-
- for interface_el in self.el_tree.findall('interface'):
- interface_name = interface_el.get('name')
- for struct_el in interface_el.findall('struct'):
- struct_name = struct_el.get('name')
- for param_el in struct_el.findall('param'):
- param_desc = self.make_param_desc(param_el, interface_name)
- self.structs[(interface_name, struct_name)].append(param_desc)
-
-
- def convert_struct_to_dbus(self, param_type):
- ret = '('
- struct = self.structs[param_type]
- for param in struct:
- ret = ret + self.convert_to_dbus_type(param)
- ret = ret + ')'
- return ret
-
-
- def convert_to_dbus_type(self, param):
- if param.type == 'Integer': restype = 'i'
- elif param.type == 'String': restype = 's'
- elif param.type == 'Boolean': restype = 'b'
- elif param.type == 'Float': restype = 'd' # D-Bus double
- elif param.enum: restype = 'i' # D-Bus 32-bit signed int
- elif param.struct: restype = self.convert_struct_to_dbus(param.fulltype)
- else: raise RuntimeError('Unknown type: ' + param.type)
- if param.array: restype = 'a' + restype
- if not param.mandatory: restype = '(b' + restype + ')'
- return restype
-
-
- def find_notifications(self, interface_el):
- notifications = list()
- for function_el in interface_el.findall('function[@messagetype="notification"]'):
- notifications.append(function_el)
- return notifications
-
-
- def find_notifications_by_provider(self, interface_el, provider):
- notifications = list()
- condition = 'function[@messagetype="notification"][@provider="%s"]' % provider
- for function_el in interface_el.findall(condition):
- notifications.append(function_el)
- return notifications
-
-
- def find_request_response_pairs(self, interface_el):
- result = list()
- request_els = interface_el.findall('function[@messagetype="request"]')
- response_els = interface_el.findall('function[@messagetype="response"]')
- for request_el in request_els:
- name = request_el.get('name')
- response_el = next(r for r in response_els if r.get('name') == name)
- result.append((request_el, response_el))
- return result
-
-
- def find_request_response_pairs_by_provider(self, interface_el, provider):
- result = list()
- condition = 'function[@messagetype="request"][@provider="%s"]' % provider
- request_els = interface_el.findall(condition)
- response_els = interface_el.findall('function[@messagetype="response"]')
- for request_el in request_els:
- name = request_el.get('name')
- response_el = next(r for r in response_els if r.get('name') == name)
- result.append((request_el, response_el))
- return result
-
-
- def convert_to_signal(self, notification_el, interface):
- result = ElementTree.Element('signal')
- result.set('name', notification_el.get('name'))
- for param_el in notification_el.findall('param'):
- self.create_arg_element(result, param_el, interface)
- return result
-
-
- def convert_to_method(self, (request_el, response_el), interface):
- result = ElementTree.Element('method')
- result.set('name', request_el.get('name'))
- for param_el in request_el.findall('param'):
- arg_el = self.create_arg_element(result, param_el, interface)
- arg_el.set('direction', 'in')
-
- arg_el = ElementTree.SubElement(result, 'arg')
- arg_el.set('name', 'retCode')
- arg_el.set('type', 'i')
- arg_el.set('direction', 'out')
-
- for param_el in response_el.findall('param'):
- arg_el = self.create_arg_element(result, param_el, interface)
- arg_el.set('direction', 'out')
- return result
-
-
- def create_arg_element(self, parent, param_el, interface):
- arg_el = ElementTree.SubElement(parent, 'arg')
- arg_el.set('name', param_el.get('name'))
- arg_el.set('type', self.convert_to_dbus_type(self.make_param_desc(param_el, interface)))
- return arg_el
-
-
- def create_introspection_iface_el(self, interface_el, provider):
- interface = interface_el.get('name')
- interface_name = self.interface_path + '.' + interface
-
- notifications = self.find_notifications_by_provider(interface_el, provider)
- signals = [self.convert_to_signal(n, interface) for n in notifications]
-
- request_responses = self.find_request_response_pairs_by_provider(interface_el, provider)
- methods = [self.convert_to_method(r, interface) for r in request_responses]
-
- if signals or methods:
- el = ElementTree.Element('interface', attrib={'name':interface_name})
- for m in methods: el.append(m)
- for s in signals: el.append(s)
- return el
-
-
-
diff --git a/src/components/dbus/codegen/introspection_xml.cc b/src/components/dbus/codegen/introspection_xml.cc
deleted file mode 100644
index 210c232a4d..0000000000
--- a/src/components/dbus/codegen/introspection_xml.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// Warning! This file is generated by 'make_introspection_c.py'. Edit at your
-// own risk.
-/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-char introspection_xml[] = {
- 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x6e, 0x6f,
- 0x64, 0x65, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d,
- 0x2f, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f,
- 0x70, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x44, 0x2d, 0x42, 0x55, 0x53,
- 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x72,
- 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e,
- 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70,
- 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64,
- 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x73,
- 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x64, 0x62, 0x75,
- 0x73, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73,
- 0x70, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c,
- 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x2f,
- 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x68, 0x6d, 0x69,
- 0x22, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x66,
- 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64, 0x6c, 0x2e,
- 0x42, 0x61, 0x73, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x53, 0x44, 0x4c, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x52,
- 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x4e,
- 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61,
- 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x67,
- 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x6c,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x73, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x28, 0x62,
- 0x61, 0x73, 0x29, 0x69, 0x69, 0x62, 0x28, 0x62, 0x61, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x28, 0x62, 0x61, 0x69, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x74, 0x74, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x76, 0x72, 0x53, 0x79, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x73,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x73,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x56, 0x72,
- 0x47, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x72, 0x73, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x70,
- 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c,
- 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x41, 0x70, 0x70, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
- 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
- 0x65, 0x64, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6e,
- 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x74, 0x68, 0x6f,
- 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6c,
- 0x6f, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x50,
- 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x65,
- 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x20,
- 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x79, 0x6e, 0x63,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74,
- 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65,
- 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69,
- 0x2e, 0x73, 0x64, 0x6c, 0x2e, 0x55, 0x49, 0x22, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74,
- 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
- 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
- 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d,
- 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64,
- 0x6c, 0x2e, 0x53, 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x41, 0x63, 0x74,
- 0x69, 0x76, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x53, 0x44,
- 0x4c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x69, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64,
- 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50,
- 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
- 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69,
- 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41,
- 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x69, 0x65, 0x6e,
- 0x64, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64,
- 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
- 0x67, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x28, 0x62, 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74,
- 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73,
- 0x74, 0x4f, 0x66, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
- 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
- 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f,
- 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43,
- 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c,
- 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x47, 0x65, 0x74, 0x55, 0x52, 0x4c, 0x53, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22,
- 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72,
- 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f,
- 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x72,
- 0x6c, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x73,
- 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
- 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72,
- 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x76, 0x6f,
- 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76,
- 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74,
- 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6f,
- 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e,
- 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e,
- 0x3c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3e, 0x00}; \ No newline at end of file
diff --git a/src/components/dbus/codegen/make_hmi_requests.py b/src/components/dbus/codegen/make_hmi_requests.py
deleted file mode 100755
index 4716d40439..0000000000
--- a/src/components/dbus/codegen/make_hmi_requests.py
+++ /dev/null
@@ -1,343 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
- def make_requests_classes_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- request_full_name = interface_el.get('name') + '_' +request.get('name')
- out.write('class ' + request_full_name + ': public HMIRequest {\n')
- with CodeBlock(out) as output:
- output.write('Q_OBJECT\n')
- out.write(' public:\n')
- with CodeBlock(out) as output:
- output.write(request_full_name + '(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name):\n')
- output.write(' HMIRequest(hmi_callback, interface, args, name) {}\n')
- out.write(' private:\n')
- with CodeBlock(out) as output:
- output.write('QJSValueList fillArgsList();\n};\n\n')
-
-
- def make_header_file(self, out):
- out.write("namespace requests {\n")
- out.write("class HMIRequest: public QObject {\n")
- with CodeBlock(out) as output:
- output.write('Q_OBJECT\n')
- out.write('public:\n')
- with CodeBlock(out) as output:
- output.write('HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name );\n')
- out.write('protected:\n')
- with CodeBlock(out) as output:
- output.write('virtual QJSValueList fillArgsList() = 0;\n')
- output.write('QDBusPendingCallWatcher *watcher_;\n')
- output.write('QJSValue hmi_callback_;\n\n')
- output.write('template<typename T>\n')
- output.write('QJSValue CreateQJSValue(T value) {\n')
- output.write(' return QJSValue(value);\n')
- output.write('}\n\n')
- output.write('template<typename T>\n')
- output.write('QJSValue CreateQJSValue(QList<T> value) {\n')
- with CodeBlock(output) as output:
- output.write('QJSValue array = hmi_callback_.engine()->newArray();\n')
- output.write('int i = 0;\n')
- output.write('foreach (T item, value) {\n')
- output.write(' QJSValue value = CreateQJSValue(item);\n')
- output.write(' array.setProperty(i, value);\n')
- output.write(' ++i;\n')
- output.write('}\n')
- output.write('return array;\n')
- output.write('}\n')
- out.write('private:\n')
- with CodeBlock(out) as output:
- output.write('QDBusInterface *interface_;\n')
- output.write('QList<QVariant> args_;\n')
- out.write('public slots:\n')
- with CodeBlock(out) as output:
- output.write('void invokeCallback();\n')
- out.write('};\n\n')
- output.write('template<>\n')
- output.write('QJSValue HMIRequest::CreateQJSValue(QStringList value);\n')
- for (interface_name, struct_name) in self.structs:
- out.write('template<>\n')
- out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_name + ' value);\n\n')
- impl.make_requests_classes_header(out)
- out.write("} // namespace requests\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- return "xxx"
-
-
- def make_requests_methods_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- iface_name = interface_el.get('name')
- request_full_name = iface_name + '_' +request.get('name')
- out.write('QJSValueList ' + request_full_name + '::fillArgsList() {\n')
- out.write(' QDBusPendingReply< ')
- count = 0
- for param_el in response.findall('param'):
- param = self.make_param_desc(param_el, iface_name)
- out.write(self.qt_param_type(param))
- count += 1
- if count < len(response.findall('param')):
- out.write(',')
- out.write(' > reply = *watcher_;\n')
-
- with CodeBlock(out) as out:
- out.write('QJSValueList qjsValueList;\n\n')
- out.write('QJSValue param;\n\n')
- count = 0
- for param_el in response.findall('param'):
- if param_el.get('mandatory') == 'false':
- out.write('if (reply.argumentAt<' + str(count) + '>().presence) {\n')
- out.write(' param = CreateQJSValue(reply.argumentAt<' + str(count) + '>().val);\n')
- out.write('} else {\n')
- out.write(' param = QJSValue();\n')
- out.write('}\n')
- out.write('qjsValueList.append(param);\n')
- else:
- out.write('param = CreateQJSValue(reply.argumentAt<' + str(count) + '>());\n')
- out.write('qjsValueList.append(param);\n')
- count += 1
- out.write('return qjsValueList;\n')
- out.write('}\n\n')
-
-
- def make_source_file(self, out):
- out.write("namespace requests {\n")
- for interface_el in self.el_tree.findall('interface'):
- for struct_el in interface_el.findall('struct'):
- out.write('template<>\n')
- out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_el.get('name') + ' value){\n')
- with CodeBlock(out) as output:
- output.write('QJSValue object = hmi_callback_.engine()->newObject();\n')
- for param_el in struct_el.findall('param'):
- param_name = param_el.get('name')
- if param_el.get('mandatory') == 'true':
- with CodeBlock(out) as output:
- output.write('object.setProperty("' + param_name + '", CreateQJSValue(value.' + param_name + '));\n')
- elif param_el.get('mandatory') == 'false':
- with CodeBlock(out) as output:
- output.write('object.setProperty("' + param_name + '", value.' + param_name + '.presence ? CreateQJSValue(value.' + param_name + '.val) : QJSValue());\n')
- out.write('return object;\n')
- out.write('}\n\n')
-
-
- out.write('HMIRequest::HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name) :\n')
- out.write(' hmi_callback_(hmi_callback), interface_(interface), args_(args) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusPendingCall pcall = interface->asyncCallWithArgumentList(name, args);\n')
- output.write('watcher_ = new QDBusPendingCallWatcher(pcall);\n')
- output.write('QObject::connect(watcher_, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(invokeCallback()));\n}\n\n')
- out.write('void HMIRequest::invokeCallback() {\n')
- with CodeBlock(out) as output:
- output.write('if (!hmi_callback_.isUndefined()) {\n')
- with CodeBlock(output) as output:
- output.write('QJSValueList qjsValueList;\n')
- output.write('qjsValueList = this->fillArgsList();\n')
- output.write('hmi_callback_.call(qjsValueList);\n')
- output.write('}\n')
- output.write('watcher_->deleteLater();\n')
- output.write('this->deleteLater();\n}\n\n')
- impl.make_requests_methods_source(out)
- out.write("} // namespace requests\n")
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'hmi_requests.h'
-source_name = 'hmi_requests.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file hmi_requests.h
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2014, 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.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
-header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n\n");
-header_out.write("#include <QObject>\n");
-header_out.write("#include <QJSValue>\n");
-header_out.write("#include <QDBusPendingCall>\n");
-header_out.write("#include <QDBusPendingCallWatcher>\n");
-header_out.write('#include <QDBusPendingReply>\n');
-header_out.write("#include <QDBusAbstractInterface>\n");
-header_out.write("#include <QDBusInterface>\n");
-header_out.write("#include <QJSEngine>\n");
-
-header_out.write('#include "qml_dbus.h"\n\n');
-
-impl.make_header_file(header_out)
-
-header_out.write("#endif // SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file hmi_requests.cc
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2014, 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.
-
-""")
-source_out.write('#include "hmi_requests.h"\n\n')
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_introspection_c.py b/src/components/dbus/codegen/make_introspection_c.py
deleted file mode 100755
index 22a53f308d..0000000000
--- a/src/components/dbus/codegen/make_introspection_c.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_introspection_c.py
-# @brief Converts introspection.xml to C-string
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, 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.
-
-from argparse import ArgumentParser
-from ford_xml_parser import FordXmlParser
-from ford_xml_parser import node_name
-from xml.etree import ElementTree
-from os import path
-from sys import argv
-
-class Impl(FordXmlParser):
- def convert_to_introspection(self, out_el_tree):
- for interface_el in self.el_tree.findall('interface'):
- el = self.create_introspection_iface_el(interface_el, 'sdl')
- if el is not None:
- out_el_tree.append(el)
-
-arg_parser = ArgumentParser(description='Converts introspection.xml to C-string')
-arg_parser.add_argument('--infile', required=True, help="Full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--outdir', required=True, help="Path to directory where output file introspection_xml.cc will be saved")
-args = arg_parser.parse_args()
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-out_file = open(args.outdir + '/' + 'introspection_xml.cc', "w")
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-out_tree_root = ElementTree.Element('node', attrib={'name':node_name})
-
-impl = Impl(in_tree_root, 'com.ford.hmi.sdl')
-impl.convert_to_introspection(out_tree_root)
-
-introspection_string = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">'
-introspection_string += "\n"
-introspection_string += ElementTree.tostring(out_tree_root)
-
-out_file.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-out_file.write("""/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-""")
-
-out_file.write("char introspection_xml[] = {")
-
-cnt = 0
-for char in introspection_string:
- if cnt % 12 == 0:
- out_file.write("\n ")
- else:
- out_file.write(" ")
- out_file.write("0x%02x," % ord(char))
- cnt = cnt + 1
-
-out_file.write(" 0x00\n")
-out_file.write("};")
-
diff --git a/src/components/dbus/codegen/make_message_descriptions.py b/src/components/dbus/codegen/make_message_descriptions.py
deleted file mode 100755
index 0079666392..0000000000
--- a/src/components/dbus/codegen/make_message_descriptions.py
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_message_descriptions.py
-# @brief Generates HMI API message descriptions for D-Bus
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, 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.
-
-from argparse import ArgumentParser
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser
-from os import path
-from sys import argv
-
-namespace_name = 'ford_message_descriptions'
-namespace = namespace_name + '::'
-
-
-class Impl(FordXmlParser):
- def write_param_definition(self, param_var_name, param, out):
- if param.array:
- tmp_param = copy(param)
- tmp_param.array = False
- tmp_param.mandatory = True
- dbus_sig = self.convert_to_dbus_type(tmp_param)
- self.write_param_definition(param_var_name + '_array', tmp_param, out)
-
- if param.array: out.write('const ' + namespace + 'ArrayDescription ')
- elif param.struct: out.write('const ' + namespace + 'StructDescription ')
- else: out.write('const ' + namespace + 'ParameterDescription ')
-
- out.write(param_var_name + " = {\n")
-
- if param.struct or param.array:
- out.write(" {\n")
- shift = ' ' * 4
- else:
- shift = ' ' * 2
-
- out.write(shift + "\"" + param.name + "\",\n")
-
- if param.array:
- out.write(shift + namespace + "Array,\n")
- elif param.struct:
- out.write(shift + namespace + "Struct,\n")
- elif param.enum:
- out.write(shift + namespace + "Enum,\n")
- else:
- out.write(shift + namespace + param.type + ",\n")
-
- if param.mandatory:
- out.write(shift + "true\n")
- else:
- out.write(shift + "false\n")
-
- if param.struct or param.array:
- out.write(" },\n")
- if param.array:
- out.write(" (const " + namespace + "ParameterDescription*)&" + param_var_name + "_array,\n")
- out.write(" \"" + dbus_sig + "\"\n")
- elif param.struct:
- out.write(" Structs::" + param.fulltype[0] + "__" + param.fulltype[1] + "__parameters\n")
- out.write("};\n")
-
-
- def write_struct_params_declarations(self, out):
- out.write("struct Structs {\n");
- for (interface, name), params in self.structs.iteritems():
- params_var_name = interface + '__' + name + '__parameters'
- out.write(" static const " + namespace + "ParameterDescription* " + params_var_name + "[];\n")
- out.write("};\n\n")
-
-
- def write_enum_entries_declarations(self, out):
- out.write("struct Enums {\n");
- for interface, name in self.enums:
- entries_var_name = interface + '__' + name + '__entries'
- out.write(" static const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[];\n")
- out.write("};\n\n")
-
-
- def write_parameters(self, params, out, name):
- n = 1
- for param in params:
- param_var_name = name + str(n)
- n = n + 1
- self.write_param_definition(param_var_name, param, out)
-
-
- def write_struct_params_definitions(self, out):
- for (interface, name), params in self.structs.iteritems():
- param_var_name = interface + '__' + name + '__parameter'
- self.write_parameters(params, out, param_var_name)
- params_var_name = 'Structs::' + interface + '__' + name + '__parameters'
- out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
- for n in range(1, len(params) + 1):
- name = param_var_name + str(n)
- out.write(" (const " + namespace + "ParameterDescription*)&" + name + ",\n")
- out.write( " NULL };\n\n")
-
-
- def write_enum_entries_definitions(self, out):
- for (interface, name), enum_el in self.enums.iteritems():
- n = 1
- for element_el in enum_el.findall('element'):
- entry_var_name = interface + '__' + name + '__entry' + str(n)
- value = element_el.get("value")
- if value is None:
- value = str(n)
- out.write(namespace + "EnumDescription::Entry " + entry_var_name + " = {\"" + element_el.get("name") + "\", " + value + "};\n")
- n = n + 1
-
- entries_var_name = "Enums::" + interface + '__' + name + '__entries'
- out.write("const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[] = {\n")
- for n in range(1, len(enum_el.findall('element')) + 1):
- entry_var_name = interface + '__' + name + '__entry' + str(n)
- out.write(" &" + entry_var_name + ",\n")
- out.write(" NULL };\n\n")
-
-
- def write_message_definition(self, message_el, interface, out):
- name = message_el.get('name')
- messagetype = message_el.get('messagetype')
- params = list()
- for param_el in message_el.findall('param'):
- param_desc = self.make_param_desc(param_el, interface)
- params.append(param_desc)
- param_var_name = interface + '__' + name + '__' + messagetype + '__parameter'
- self.write_parameters(params, out, param_var_name)
-
- params_var_name = param_var_name + 's'
- out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
- for n in range(1, len(params) + 1):
- param_name = param_var_name + str(n)
- out.write(" (const " + namespace + "ParameterDescription*)&" + param_name + ",\n")
- out.write(" NULL };\n")
-
- message_desc_name = interface + '__' + name + '__' + messagetype
- out.write("const " + namespace + "MessageDescription " + message_desc_name + " = {\n")
- out.write(" \"" + interface + "\",\n")
- out.write(" \"" + name + "\",\n")
- out.write(" hmi_apis::messageType::" + messagetype + ",\n")
- out.write(" hmi_apis::FunctionID::" + interface + "_" + name + ",\n")
- out.write(" " + params_var_name + "\n")
- out.write("};\n\n")
-
-
- def write_message_definitions(self, out):
- for interface_el in self.el_tree.findall('interface'):
- interface = interface_el.get('name')
- message_els = interface_el.findall('function')
- for message_el in message_els:
- self.write_message_definition(message_el, interface, out)
-
-
- def make_message_descriptions(self, out):
- self.write_struct_params_declarations(out)
- #self.write_enum_entries_declarations(out)
- self.write_struct_params_definitions(out)
- #self.write_enum_entries_definitions(out)
- self.write_message_definitions(out)
-
-
- def make_message_array(self, out):
- out.write("const MessageDescription* message_descriptions[] = {\n")
- for interface_el in self.el_tree.findall('interface'):
- interface = interface_el.get('name')
- message_els = interface_el.findall('function')
- for message_el in message_els:
- name = message_el.get('name')
- messagetype = message_el.get('messagetype')
- message_desc_name = interface + '__' + name + '__' + messagetype
- out.write(" &" + message_desc_name + ",\n")
- out.write(" NULL\n")
- out.write("};\n")
-
-
-arg_parser = ArgumentParser(description="Generates HMI API message descriptions for D-Bus on SDL core side")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output file message_descriptions.cc will be saved")
-args = arg_parser.parse_args()
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-outfile = 'message_descriptions.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root)
-
-out = open(args.outdir + "/" + outfile, "w")
-
-out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-out.write("""/**
- * @file message_descriptions.cc
- * @brief Generated HMI API message descriptions for D-Bus
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-""")
-
-out.write("#include \"dbus/message_descriptions.h\"\n\n");
-out.write("namespace {\n\n");
-impl.make_message_descriptions(out)
-out.write("}\n\n");
-
-out.write("namespace " + namespace_name + " {\n\n");
-impl.make_message_array(out)
-out.write("}\n\n");
-
diff --git a/src/components/dbus/codegen/make_notifications_qml.py b/src/components/dbus/codegen/make_notifications_qml.py
deleted file mode 100755
index 3c173e8b4f..0000000000
--- a/src/components/dbus/codegen/make_notifications_qml.py
+++ /dev/null
@@ -1,387 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-class Notifications_qml(FordXmlParser):
- #Used for qt signal names, because qt signals cannot begin with a capital letter
- def first_letter_to_lower_case(self, s):
- if len(s) == 0:
- return s
- else:
- return s[0].lower() + s[1:]
-
- def make_header(self, out):
- out.write("class SdlProxy: public Item {\n")
- with CodeBlock(out) as out:
- out.write("Q_OBJECT\n")
- out.write("Q_DISABLE_COPY(SdlProxy)\n")
- out.write("public:\n")
- out.write("explicit SdlProxy(Item* parent = 0);\n")
- out.write("private:\n")
- out.write("QDBusInterface *sdlBasicCommunicationInterface;\n")
- out.write("signals:\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- with CodeBlock(out) as out:
- out.write("void %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("QVariant %s" % param_el.get("name"))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- with CodeBlock(out) as out:
- out.write("private slots:\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- with CodeBlock(out) as out:
- out.write("void slot_%s(" % notification_el.get("name"))
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- out.write("};\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def qml_param_type(self, param):
- if not param.mandatory:
- return "QVariant"
- if param.array:
- return "QVariant"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "QVariant"
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def make_source(self, out):
- def qml_args(variable_name_needed):
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- if variable_name_needed:
- out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
- else:
- out.write("%s" % self.qt_param_type(param))
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write("SdlProxy::SdlProxy(Item *parent): Item(parent) {\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- notification_name = notification_el.get('name')
- with CodeBlock(out) as out:
- out.write("QDBusConnection::sessionBus().connect(\n")
- with CodeBlock(out) as out:
- out.write("\"com.ford.sdl.core\", \"/\", \"com.ford.sdl.core.%s\",\n" % iface_name)
- out.write("\"%s\", this, SLOT(slot_%s(" % (notification_name, notification_el.get("name")))
- qml_args(variable_name_needed = False)
- out.write(")));\n")
- out.write("}\n\n")
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- notifications = self.find_notifications_by_provider(interface_el, "sdl")
- for notification_el in notifications:
- notific_full_name = interface_el.get("name") + "_" + notification_el.get("name")
- out.write("void SdlProxy::slot_%s(" % notification_el.get("name"))
- qml_args(variable_name_needed = True)
- out.write(") {\n")
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"ENTER\");\n\n")
- for param_el in notification_el.findall("param"):
- param = self.make_param_desc(param_el, iface_name)
- tmp_param_name = param.name + "_qvariant"
- out.write("QVariant %s;\n" % tmp_param_name)
- out.write("%s = ValueToVariant(%s);\n" % (tmp_param_name, param.name))
- self.write_param_validation(param, param.name, "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\")" % (param.name, notific_full_name), out)
- out.write("\n")
- out.write("emit %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
- param_el_count = 1
- list_of_params = notification_el.findall("param")
- list_of_params_len = len(list_of_params)
- for param_el in list_of_params:
- param = self.make_param_desc(param_el, iface_name)
- out.write("%s" % param.name + "_qvariant")
- if param_el_count < list_of_params_len:
- out.write(", ")
- param_el_count += 1
- out.write(");\n")
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"EXIT\");\n")
- out.write("}\n\n")
-
-
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % fail_statement)
- out.write("}\n")
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % (fail_statement))
- out.write("}\n")
-
-
-#QVarian name;
-#if (ttsName.presence) {
-
-
-
-arg_parser = ArgumentParser(description="Generator of classes which Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-
-if args.version == "4.8.5":
- prefix_class_item = 'Script'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-else:
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'sdl_proxy.h'
-source_name = 'sdl_proxy.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Notifications_qml(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""
-/*
- Copyright (c) 2014, 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.
-*/
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n")
-header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n\n")
-header_out.write("#include \"qml_dbus.h\"\n")
-header_out.write("#include \"qt_version.h\"\n\n")
-header_out.write("#include <QtCore/QVariant>\n")
-header_out.write("#include <QtDBus/QDBusInterface>\n")
-header_out.write("#if QT_4\n")
-header_out.write("#include <QtDeclarative/QDeclarativeItem>\n")
-header_out.write("typedef QDeclarativeItem Item;\n")
-header_out.write("#elif QT_5\n")
-header_out.write("#include <QtQuick/QQuickItem>\n")
-header_out.write("typedef QQuickItem Item;\n")
-header_out.write("#endif // QT_VERSION\n")
-
-impl.make_header(header_out)
-
-header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""
-/*
- Copyright (c) 2014, 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.
-*/
-
-""")
-
-source_out.write("#include \"sdl_proxy.h\"\n")
-source_out.write("#include \"utils/logger.h\"\n")
-source_out.write("CREATE_LOGGERPTR_GLOBAL(logger_, \"DBusPlugin\")\n\n")
-
-impl.make_source(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_cpp.py b/src/components/dbus/codegen/make_qml_dbus_cpp.py
deleted file mode 100755
index f40bc74df8..0000000000
--- a/src/components/dbus/codegen/make_qml_dbus_cpp.py
+++ /dev/null
@@ -1,736 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
- def make_dbus_type_declarations(self, out):
- for struct in self.structs.items():
- self.write_struct_declaration(struct, out)
-
- def make_dbus_metatype_declarations(self, out):
- for struct in self.structs.items():
- self.write_struct_metatype_declaration(struct, out)
-
-
- def write_struct_declaration(self, ((iface, name), params), out):
- struct_name = "{0}_{1}".format(iface, name)
- out.write("struct {0} {{\n".format(struct_name))
- with CodeBlock(out) as out:
- for param in params:
- out.write("{0} {1};\n".format(self.qt_param_type(param), param.name))
- out.write("{0}()\n".format(struct_name))
- initializersList = map(lambda x: "{0}({1})".format(x.name, defaultValue(x)), [p for p in params if p.type != "String" and not p.struct and not p.array])
- if initializersList:
- out.write(": " + ",\n ".join(initializersList))
-
- out.write("{ }\n")
-
- out.write("};\n")
- out.write('QDBusArgument& operator << (QDBusArgument&, const ' + struct_name + "&);\n")
- out.write('const QDBusArgument& operator >> (const QDBusArgument&, ' + struct_name + "&);\n")
- out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v);\n")
- out.write('QVariant ValueToVariant(const ' + struct_name + "& v);\n")
- out.write('QVariant ValueToVariant(const QList<' + struct_name + " >& v);\n")
- out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v);\n")
- out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v);\n")
- out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + " >& v);\n")
-
-
- def write_struct_metatype_declaration(self, ((iface, name), params), out):
- struct_name = iface + '_' + name
- out.write('Q_DECLARE_METATYPE(' + struct_name + ")\n")
- out.write('Q_DECLARE_METATYPE(OptionalArgument<' + struct_name + ">)\n")
- out.write('Q_DECLARE_METATYPE(QList<' + struct_name + ">)\n")
- out.write('Q_DECLARE_METATYPE(OptionalArgument<QList<' + struct_name + "> >)\n\n")
-
-
- def make_dbus_type_definitions(self, out):
- for struct in self.structs.items():
- self.write_struct_definition(struct, out)
-
- def write_struct_definition(self, ((iface, name), params), out):
- struct_name = iface + '_' + name
-
- out.write('QDBusArgument& operator << (QDBusArgument& arg, const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("arg.beginStructure();\n")
- for param in params:
- out.write("arg << v.{0};\n".format(param.name))
- out.write("arg.endStructure();\n")
- out.write("return arg;\n")
- out.write("}\n\n")
-
- out.write('const QDBusArgument& operator >> (const QDBusArgument& arg, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("arg.beginStructure();\n")
- for param in params:
- out.write("arg >> v.{0};\n".format(param.name))
- out.write("arg.endStructure();\n")
- out.write("return arg;\n")
- out.write("}\n\n")
-
- out.write('QVariant ValueToVariant(const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("QVariantMap map;\n")
- for param in params:
- out.write("""PutArgToMap(map, "{0}", v.{0});\n""".format(param.name))
- out.write("return QVariant::fromValue(map);\n")
- out.write("}\n\n")
-
- out.write('QVariant ValueToVariant(const QList<' + struct_name + ">& v) {\n")
- with CodeBlock(out) as out:
- out.write("QList<QVariant> ret;\n")
- out.write("for (QList<{0}>::const_iterator i = v.begin(); i != v.end(); ++i)\n".format(struct_name))
- with CodeBlock(out) as out:
- out.write("ret.append(ValueToVariant(*i));\n")
- out.write("return QVariant::fromValue(ret);\n")
- out.write("}\n\n")
-
- out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("map.insert(name, ValueToVariant(v));\n")
- out.write("}\n\n")
-
- out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("if (variant.type() != QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a map");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("QVariantMap map = variant.toMap();\n")
- for param in params:
- out.write("if (!GetArgFromMap(map, \"" + param.name + "\", v." + param.name + ")) return false;\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + ">& v) {\n")
- with CodeBlock(out) as out:
- out.write("if (variant.type() != QVariant::List) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a list");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("QList<QVariant> list = variant.toList();\n")
- out.write("for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {\n");
- with CodeBlock(out) as out:
- out.write(struct_name + " s;\n");
- out.write("if (!VariantToValue(*i, s)) return false;\n");
- out.write("v.append(s);\n");
- out.write("}\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v) {\n")
- with CodeBlock(out) as out:
- out.write("QVariantMap::const_iterator it = map.find(name);\n")
- out.write("if (map.end() == it) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_WARN(logger_, "Argument '" << name << "' not found");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("if (it->type() != QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("""LOG4CXX_ERROR(logger_, "Argument '" << name << "' isn't a map");\n""")
- out.write("return false;\n")
- out.write("}\n")
- out.write("const QVariantMap& inmap = it->toMap();\n")
- for param in params:
- out.write("if (!GetArgFromMap(inmap, \"" + param.name + "\", v." + param.name + ")) return false;\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{ {2}; }}\n".format(param_name, param.minSize, fail_statement))
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{ {2}; }}\n".format(param_name, param.maxSize, fail_statement))
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) { %s; }\n' % (' || '.join(conditions), fail_statement))
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- with CodeBlock(out) as out:
- out.write('if (%s) { %s;\n }\n' % (' || '.join(conditions), fail_statement))
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- return "xxx"
-
-
- def from_variant_func_name(self, param, interface):
- prefix = ''
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return 'opt_' + self.from_variant_func_name(param_copy, interface)
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- return 'arr_' + self.from_variant_func_name(param_copy, interface)
-
- if param.type in ['Integer', 'String', 'Boolean', 'Float']:
- param_type = param.type
- else:
- param_type = param.type.split('.')
- if len(param_type) > 1:
- param_type = (param_type[0], param_type[1])
- else:
- param_type = (interface, param_type[0])
- if param_type in self.structs:
- param_type = param_type[0] + '_' + param_type[1]
- elif param_type in self.enums:
- param_type = 'Integer'
- return param_type + '_from_variant'
-
-
- def make_method_signature(self, request, response, interface, add_classname):
- in_params = [self.make_param_desc(x, interface) for x in request.findall('param')]
- out_params = [self.make_param_desc(x, interface) for x in response.findall('param')]
-
- signature_len = len(''.join(map(lambda x: self.convert_to_dbus_type(x), in_params + out_params)))
- if signature_len > 255:
- raise RuntimeError("Too long signature of {0} method. Maximum valid length is 255, actual is {1}", request.get('name'), signature_len)
-
- return "int {0}{1} ({2}{3}const QDBusMessage& message, QString& userMessage_out{4}{5})".format(
- interface + "Adaptor::" if add_classname else "",
- request.get('name'),
- ", ".join(map(lambda x: "const {0}& {1}_in".format(self.qt_param_type(x), x.name), in_params)),
- ", " if in_params else "",
- ", " if out_params else "",
- ", ".join(map(lambda x: "{0}& {1}_out".format(self.qt_param_type(x), x.name), out_params)))
-
-
- def make_signal_signature(self, signal, interface, add_void):
- params = signal.findall('param')
- if add_void:
- retstr = 'void '
- else:
- retstr = ''
- retstr = retstr + signal.get('name') + '('
- params_num = len(params)
- for i in range(0, params_num):
- param_desc = self.make_param_desc(params[i], interface)
- param_type = self.qt_param_type(param_desc)
- retstr = retstr + param_type + ' ' + param_desc.name
- if i <> params_num - 1: retstr = retstr + ", "
- retstr = retstr + ')'
- return retstr
-
-
- def make_qml_signal_signature(self, signal, interface, name, short=False, add_classname=False):
- params = signal.findall('param')
- if short:
- retstr = ''
- else:
- retstr = 'void '
- if add_classname:
- retstr = retstr + interface + 'Adaptor::'
- retstr = retstr + name + '('
- params_num = len(params)
- for i in range(0, params_num):
- param_desc = self.make_param_desc(params[i], interface)
- if param_desc.struct or param_desc.array or not param_desc.mandatory: typ = 'QVariant'
- elif param_desc.type == 'Integer' or param_desc.enum: typ = 'int'
- elif param_desc.type == 'Boolean': typ = 'bool'
- elif param_desc.type == 'Float': typ = 'double'
- elif param_desc.type == 'String': typ = 'QString'
- else: typ = 'QVariant'
- retstr = retstr + typ
- if not short: retstr = retstr + ' ' + param_desc.name
- if i <> params_num - 1: retstr = retstr + ", "
- retstr = retstr + ')'
- return retstr
-
-
- def write_adaptor_declaration(self, interface_el, notifications, request_responses, out):
- global prefix_class_item
- def glue_strings(strings):
- ret = list()
- curstr = ''
- for str in strings:
- curstr = curstr + str
- if(str[-1] == '>'):
- ret.append(curstr)
- curstr = ''
- return ret
- ifacename = interface_el.get('name')
- out.write("class " + ifacename + "Adaptor : public QDBusAbstractAdaptor {\n");
- out.write(" Q_OBJECT\n");
- out.write(" Q_CLASSINFO(\"D-Bus Interface\", \"" + self.interface_path + '.' + ifacename + "\")\n");
- out.write(" Q_CLASSINFO(\"D-Bus Introspection\",\n");
- introspection_el = self.create_introspection_iface_el(interface_el, 'hmi')
- introspection = glue_strings(ElementTree.tostringlist(introspection_el))
- for str in introspection:
- str = str.replace('"', '\\"')
- out.write('"' + str + '"' + "\n")
- out.write(" )\n")
- out.write(" public:\n")
- out.write(" explicit " + ifacename + "Adaptor(QObject *parent = 0);\n")
- out.write(" void SetApi(Q%sItem*);\n" % prefix_class_item)
- out.write(" DBusController *dbusController;\n")
- out.write(" public slots:\n")
- for (request, response) in request_responses:
- signature = self.make_method_signature(request, response, ifacename, False)
- out.write(" " + signature + ";\n")
- out.write(" signals:\n")
- for n in notifications:
- signature = self.make_signal_signature(n, ifacename, True)
- out.write(" " + signature + ";\n")
- out.write(" private slots:\n")
- for n in notifications:
- signature = self.make_qml_signal_signature(n, ifacename, n.get('name') + '_qml', False)
- out.write(" " + signature + ";\n")
- out.write(" private:\n")
- out.write(" Q%sItem* api_;\n" % prefix_class_item)
- out.write("};\n\n");
-
- def write_adaptor_definition(self, interface_el, notifications, request_responses, out):
- global prefix_class_item
- iface_name = interface_el.get('name')
- classname = iface_name + 'Adaptor'
- out.write("{0}::{0}(QObject* parent) : QDBusAbstractAdaptor(parent) {{}}\n".format(classname))
-
- out.write("void {0}::SetApi(Q{1}Item* api) {{\n".format(classname, prefix_class_item))
- with CodeBlock(out) as out:
- out.write("api_ = api;\n")
- for n in notifications:
- signame = n.get('name')
- signame = signame[:1].lower() + signame[1:]
- slotname = n.get('name') + '_qml'
- sig_signature = self.make_qml_signal_signature(n, iface_name, signame, True)
- slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, True)
- out.write("connect(api_, SIGNAL(" + sig_signature + "), this, SLOT(" + slot_signature + "));\n")
- out.write("LOG4CXX_TRACE(logger_, \"CONNECT SIGNALS: \" << __PRETTY_FUNCTION__ );\n")
- out.write("}\n\n")
-
- for (request,response) in request_responses:
- in_params = [ self.make_param_desc(x, iface_name) for x in request.findall('param') ]
- out_params = [ self.make_param_desc(x, iface_name) for x in response.findall('param') ]
-
- out.write("bool fill{0}{1}Reply(QDBusMessage& message, const QVariantMap& map) {{\n".format(classname, request.get('name')))
- with CodeBlock(out) as out:
- out.write("int retCode_out = 0;\n")
- out.write("GetArgFromMap(map, \"__retCode\", retCode_out);\n")
- out.write("QVariant retCode_arg = QVariant::fromValue(retCode_out);\n")
- out.write("message << retCode_arg;\n")
- out.write("QString userMessage_out;\n")
- out.write("GetArgFromMap(map, \"__message\", userMessage_out);\n")
- out.write("QVariant userMessage_arg = QVariant::fromValue(userMessage_out);\n")
- out.write("message << userMessage_arg;\n")
- for p in out_params:
- param_name = p.name
- param_type = self.qt_param_type(p)
- out.write("%s %s_out;\n" % (param_type, p.name))
- out.write("if (!GetArgFromMap(map, \"{0}\", {0}_out)) {{ return false; }}\n".format(p.name))
- self.write_param_validation(p, p.name + "_out", "return false", out)
- out.write("QVariant {0}_arg;\n".format(p.name))
- out.write("{0}_arg.setValue({0}_out);\n".format(p.name))
- out.write("message << {0}_arg;\n".format(p.name))
- out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(map));\n")
- out.write("LOG4CXX_TRACE(logger_, \"REPLY ASYNC: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return true;\n")
- out.write("}\n\n")
-
- out.write("{0} {{\n".format(self.make_method_signature(request, response, iface_name, True)))
- with CodeBlock(out) as out:
- out.write("LOG4CXX_TRACE(logger_, \"ENTER: \" << __PRETTY_FUNCTION__ );\n")
- out.write("int ret = 0;\n")
- return_statement = "return ret;\n"
- out.write("QVariantMap in_arg;\n");
- out.write("QVariant out_arg_v;\n");
- for param in in_params:
- self.write_param_validation(param, param.name + "_in", "RaiseDbusError(this, InvalidData); return ret", out)
- out.write("PutArgToMap(in_arg, \"" + param.name + "\", " + param.name + "_in);\n")
- out.write("LOG4CXX_DEBUG(logger_, \"Input arguments:\\n\" << in_arg);\n")
- method_name = request.get('name')[:1].lower() + request.get('name')[1:]
-
- out.write("dbusController->message = &message;\n")
- out.write("dbusController->fill = &fill{0}{1}Reply;\n".format(classname, request.get("name")))
-
- out.write("""if (!QMetaObject::invokeMethod(api_, "{0}", Qt::{1}Connection, Q_RETURN_ARG(QVariant, out_arg_v), Q_ARG(QVariant, QVariant(in_arg)))) {{\n""".format(method_name, invoke_type_connection))
- with CodeBlock(out) as out:
- out.write("RaiseDbusError(this, InvalidData);\n")
- out.write("LOG4CXX_ERROR(logger_, \"Can't invoke method " + method_name +"\");\n ")
- out.write("return ret;\n")
- out.write("}\n")
-
- out.write("dbusController->message = NULL;\n")
- out.write("dbusController->fill = NULL;\n")
- out.write("if (message.isDelayedReply()) {\n")
- with CodeBlock(out) as out:
- out.write("return ret;\n")
- out.write("}\n")
-
- out.write("QVariantMap out_arg;\n")
- out.write("if (out_arg_v.type() == QVariant::Map) {\n")
- with CodeBlock(out) as out:
- out.write("out_arg = out_arg_v.toMap();\n")
- out.write("};\n")
-
- out.write("int err;\n")
- out.write("""if (GetArgFromMap(out_arg, "__errno", err)) { RaiseDbusError(this, err); return ret; }\n""")
-
- out.write("int async_uid;\n")
- out.write("if (GetArgFromMap(out_arg, \"__async_uid\", async_uid)) {\n")
- with CodeBlock(out) as out:
- out.write("message.setDelayedReply(true);\n")
- out.write("dbusController->addMessage(message, &fill%s%sReply, async_uid);\n" % (classname, request.get('name')))
- out.write("LOG4CXX_TRACE(logger_, \"EXIT ASYNC: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return ret;\n");
- out.write("}\n\n")
-
- for param in out_params:
- out.write("if (!GetArgFromMap(out_arg, \"{0}\", {0}_out)) {{ RaiseDbusError(this, InvalidData); return ret; }}\n".format(param.name))
- self.write_param_validation(param, param.name + "_out", "RaiseDbusError(this, InvalidData); return ret", out)
-
- out.write("GetArgFromMap(out_arg, \"__retCode\", ret);\n")
- out.write("GetArgFromMap(out_arg, \"__message\", userMessage_out);\n")
- out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(out_arg));\n")
- out.write("LOG4CXX_TRACE(logger_, \"EXIT: \" << __PRETTY_FUNCTION__ );\n")
- out.write("return ret;\n")
- out.write("}\n\n")
-
- for n in notifications:
- slotname = n.get('name') + '_qml'
- slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, False, True)
- out.write(slot_signature + " {\n")
- params = n.findall('param')
- out.write(" LOG4CXX_TRACE(logger_, \"EMIT SIGNAL: \" << __PRETTY_FUNCTION__ );\n")
- out.write(" LOG4CXX_DEBUG(logger_, \"Arguments:\\n{\"")
- for p in params[0:-1]:
- param = self.make_param_desc(p, iface_name)
- out.write(" << \" " + param.name + ":\" << " + param.name + " << \",\"")
- for p in params[-1:]: # last param without comma in end line
- p = params[-1]
- param = self.make_param_desc(p, iface_name)
- out.write(" << \" " + param.name + ":\" << " + param.name)
- out.write(" << \" }\");\n")
- for p in params:
- param = self.make_param_desc(p, iface_name)
- param_type = self.qt_param_type(param)
- param_name = 'p_' + param.name
- if param.mandatory:
- if param.array or (param.type not in ['Integer', 'String', 'Float', 'Boolean'] and not param.enum):
- out.write(' ' + param_type + ' ' + param_name + ";\n")
- out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ")) {\n")
- out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
- out.write(" return;}\n")
- else:
- out.write(' ' + param_type + ' ' + param_name + ";\n")
- out.write(' ' + param_name + '.presence = !' + param.name + ".isNull();\n")
- out.write(' if (' + param_name + ".presence) {\n")
- out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ".val)) {\n")
- out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
- out.write(" return;\n }\n")
- out.write(" }\n")
- out.write(' emit ' + n.get('name') + '(')
- for i in range(len(params)):
- param = self.make_param_desc(params[i], iface_name)
- basic_type = (param.type in ['Integer', 'String', 'Float', 'Boolean']) or param.enum
- if param.array or (not param.mandatory) or (not basic_type):
- param_name = 'p_' + param.name
- else:
- param_name = param.name
- out.write(param_name)
- if i != len(params) - 1: out.write(', ')
- out.write(");\n")
- out.write("}\n\n")
-
-
- def make_dbus_adaptor_declarations(self, out):
- for interface_el in self.el_tree.findall('interface'):
- notifications = self.find_notifications_by_provider(interface_el, "hmi")
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
- if len(notifications) > 0 or len(request_responses) > 0:
- self.write_adaptor_declaration(interface_el, notifications, request_responses, out)
-
-
- def make_dbus_adaptor_definitions(self, out):
- for interface_el in self.el_tree.findall('interface'):
- notifications = self.find_notifications_by_provider(interface_el, "hmi")
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
- if len(notifications) > 0 or len(request_responses) > 0:
- self.write_adaptor_definition(interface_el, notifications, request_responses, out)
-
-
- def make_dbus_register_metatypes_declaraion(self, out):
- out.write("void RegisterDbusMetatypes();\n")
-
-
- def make_dbus_register_metatypes_definition(self, out):
- out.write("void RegisterDbusMetatypes() {\n")
- for (iface, name) in self.structs:
- struct_name = iface + '_' + name
- out.write('qDBusRegisterMetaType<' + struct_name + ">();\n")
- out.write('qDBusRegisterMetaType<OptionalArgument<' + struct_name + "> >();\n")
- out.write('qDBusRegisterMetaType<QList<' + struct_name + "> >();\n")
- out.write('qDBusRegisterMetaType<OptionalArgument<QList<' + struct_name + "> > >();\n")
- out.write("}\n")
-
-
- def make_api_adaptors_class(self, out):
- global prefix_class_item
- out.write("struct ApiAdaptors {\n")
- interfaces = self.el_tree.findall('interface')
- def filt(iface):
- return self.find_notifications_by_provider(iface, "hmi") or self.find_request_response_pairs_by_provider(iface, "hmi")
- interfaces = filter(filt, interfaces)
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- out.write(" " + name + "* " + name + "_;\n")
- out.write(" ApiAdaptors() :\n")
- for i in range(len(interfaces)):
- name = interfaces[i].get('name') + 'Adaptor'
- out.write(" " + name + "_(NULL)")
- if i <> len(interfaces) - 1: out.write(',')
- out.write("\n")
- out.write(" {}\n")
- out.write(" void Init(QObject* p) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- out.write(" " + name + "_ = new " + name + "(p);\n")
- out.write(" }\n")
- out.write(" void SetApi(QObject* p) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- chname = interface_el.get('name')
- out.write(" " + name + ("_->SetApi(p->findChild<Q%sItem*>(\"" % prefix_class_item) + chname + "\"));\n")
- out.write(" }\n")
- out.write(" void SetDBusController(DBusController* dc) {\n")
- for interface_el in interfaces:
- name = interface_el.get('name') + 'Adaptor'
- chname = interface_el.get('name')
- out.write(" " + name + "_->dbusController = dc;\n")
- out.write(" }\n")
- out.write("};\n\n")
-
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files qml_dbus.cc, qml_dbus.h will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'qml_dbus.h'
-source_name = 'qml_dbus.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file qml_dbus.h
- * @brief Generated QDbus adaptors header file
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
-header_out.write("#define SRC_COMPONENTS_DBUS_QML_DBUS_H_\n\n");
-header_out.write("#include <QtDBus/QDBusArgument>\n");
-header_out.write("#include <QtDBus/QDBusMessage>\n");
-header_out.write("#include <QtDBus/QDBusConnection>\n");
-header_out.write("#include <QtDBus/QDBusAbstractAdaptor>\n");
-header_out.write("#include <QtDBus/QDBusMetaType>\n");
-header_out.write("#include <Qt%s/Q%sItem>\n" % (prefix_class_item, prefix_class_item));
-header_out.write("#include \"qml_dbus_common.h\"\n\n");
-header_out.write("#include \"dbus_controller.h\"\n\n");
-impl.make_dbus_type_declarations(header_out)
-impl.make_dbus_adaptor_declarations(header_out)
-impl.make_dbus_register_metatypes_declaraion(header_out)
-impl.make_api_adaptors_class(header_out)
-impl.make_dbus_metatype_declarations(header_out)
-header_out.write("#endif // #ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file qml_dbus.cc
- * @brief Generated QDbus adaptors source file
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-""")
-source_out.write("#include \"" + header_name + "\"\n\n");
-source_out.write("#include \"utils/logger.h\"\n")
-source_out.write("#ifdef ENABLE_LOG\n")
-source_out.write("extern log4cxx::LoggerPtr logger_;\n")
-source_out.write("#endif // ENABLE_LOG\n\n")
-impl.make_dbus_type_definitions(source_out)
-impl.make_dbus_adaptor_definitions(source_out)
-impl.make_dbus_register_metatypes_definition(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_qml.py b/src/components/dbus/codegen/make_qml_dbus_qml.py
deleted file mode 100755
index 8d057dcda1..0000000000
--- a/src/components/dbus/codegen/make_qml_dbus_qml.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_qml.py
-# @brief Generator of QML to QDbus QML part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2013, 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.
-
-from os import path
-from os import makedirs
-from sys import argv
-from argparse import ArgumentParser
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser
-
-namespace = 'dbus_qml'
-qt_quick_version = '1.1'
-type_variant_name = 'variant'
-
-class Impl(FordXmlParser):
- def write_function(self, ifacename, request, response, out):
- name = request.get('name')
- name = name[:1].lower() + name[1:]
- out.write(" function " + name + "(params) {\n")
- out.write(""" console.debug("{0}Proxy::{1}")\n""".format(ifacename, name))
- out.write(" try {\n")
- out.write(" if(\"{0}\" in sdl{1})\n".format(name, ifacename))
- out.write(" return sdl{0}.{1}(" .format(ifacename, name))
- params = request.findall('param')
- for i in range(len(params)):
- out.write('params.' + params[i].get('name'))
- if i <> len(params) - 1:
- out.write(', ')
- out.write(")\n")
- out.write(" else\n")
- out.write(""" return { "__errno": Common.Result.UNSUPPORTED_REQUEST }\n""")
- out.write(" } catch(err) {\n")
- out.write(""" return { "__errno": err }\n""")
- out.write(" }\n")
- out.write(" }\n\n")
-
-
- def write_signal_param(self, param, out):
- if param.array or param.struct or not param.mandatory: typ = type_variant_name
- elif param.type == 'Integer' or param.enum: typ = 'int'
- elif param.type == 'String': typ = 'string'
- elif param.type == 'Boolean': typ = 'bool'
- elif param.type == 'Float': typ = 'double'
- else: typ = type_variant_name
- out.write(typ + ' ' + param.name)
-
-
- def write_signal(self, ifacename, notification, out):
- name = notification.get('name')
- name = name[:1].lower() + name[1:]
- out.write(" signal " + name + "(")
- params = notification.findall('param')
- for i in range(len(params)):
- self.write_signal_param(self.make_param_desc(params[i], ifacename), out)
- if i <> len(params) - 1:
- out.write(', ')
- out.write(")\n")
- name = notification.get('name')
- out.write(""" on{1}: console.debug("emitted {0}:{1}")\n""".format(ifacename, name))
-
-
- def write_qml(self, iface, out):
- global qt_quick_version
- name = iface.get('name')
- out.write("import QtQuick %s\n" % qt_quick_version)
- out.write("""import "Common.js" as Common\n""")
- out.write("import \"..\"\n\n")
- out.write("Item {\n")
- out.write(" " + name + " {\n")
- out.write(" id: sdl" + name + "\n")
- out.write(" }\n")
-
- notifications = impl.find_notifications_by_provider(interface_el, "hmi")
- request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
- for request, response in request_responses:
- self.write_function(name, request, response, out)
- for n in notifications:
- self.write_signal(name, n, out)
- out.write("}\n")
-
-
- def write_js_enum(self, enum, out):
- out.write("var " + enum.get('name') + " = {\n")
- lastval = -1
- elements = enum.findall('element')
- for i in range(len(elements)):
- element = elements[i]
- value = element.get('value')
- if value is None:
- value = lastval + 1
- else:
- value = int(value)
- lastval = value
- name = element.get('internal_name')
- if name is None:
- name = element.get('name')
- out.write(" " + name + ': ' + str(value))
- if len(elements) - 1 != i: out.write(',')
- out.write("\n")
- out.write("}\n\n")
-
-
-def write_header(out):
- out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
- out.write("""/**
- * Copyright (c) 2013, 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.
- */
-
-""")
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus QML part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files with pattern name <intarface name>Proxy.qml will be saved, e.g. BasicCommunicationProxy.qml, ButtonsProxy.qml VRProxy.qml")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- qt_quick_version = "1.1"
- type_variant_name = "variant"
-elif args.version == "5.1.0":
- qt_quick_version = "2.0"
- type_variant_name = "var"
-
-if not path.isdir(args.outdir):
- makedirs(args.outdir)
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root)
-
-for interface_el in in_tree_root.findall('interface'):
- notifications = impl.find_notifications_by_provider(interface_el, "hmi")
- request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
- if notifications or request_responses:
- filename = interface_el.get('name')+'Proxy.qml'
- outfile = open(args.outdir + '/' + filename, 'w')
- write_header(outfile)
- impl.write_qml(interface_el, outfile)
-
-enum_files = dict()
-for (iface, name), enum in impl.enums.items():
- if iface in enum_files:
- outfile = enum_files[iface]
- else:
- filename = iface+'.js'
- outfile = open(args.outdir + '/' + filename, 'w')
- write_header(outfile)
- outfile.write(".pragma library\n")
- enum_files[iface] = outfile
- impl.write_js_enum(enum, outfile)
-
-
diff --git a/src/components/dbus/codegen/make_qml_requests_cpp.py b/src/components/dbus/codegen/make_qml_requests_cpp.py
deleted file mode 100644
index 6674b8f5e2..0000000000
--- a/src/components/dbus/codegen/make_qml_requests_cpp.py
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-prefix_class_item = 'Declarative'
-invoke_type_connection = 'Direct'
-
-def defaultValue(param):
- if param.type == "Integer":
- return "0"
- elif param.type == "Float":
- return "0.0"
- elif param.type == "Boolean":
- return "false"
- elif param.enum:
- return "0"
-
-class Impl(FordXmlParser):
-
-
- def args_for_function_definition(self, params, out):
- if len(params) == 0:
- out.write('QJSValue hmi_callback')
- return
- for param in params:
- out.write('QVariant ' + param.get('name') + ', ')
- out.write('QJSValue hmi_callback')
-
-
- def make_requests_for_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- all_params = list()
- for param_el in request.findall('param'):
- all_params.append(param_el)
- with CodeBlock(out) as output:
- output.write("Q_INVOLABKE void " + interface_el.get('name') + "_" +request.get('name') + "(")
- impl.args_for_function_definition(all_params, out)
- output.write(");\n")
-
-
- def make_header_file(self, out):
- out.write("class RequestToSDL : public QObject\n")
- out.write("{\n")
- out.write(" public:\n")
- with CodeBlock(out) as output:
- output.write("explicit RequestToSDL(QObject *parent = 0);\n")
- output.write("~RequestToSDL();\n")
- impl.make_requests_for_header(out)
- out.write(" private:\n")
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- output.write('QDBusInterface *' + interface_el.get('name') + ';\n')
- out.write("};\n")
-
-
- def make_requests_for_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- out.write('void RequestToSDL::' + request.get('name') + '(QString name, ')
- for param_el in request.findall('param'):
- out.write('QVariant ' + param_el.get('name') + ', ')
- out.write('QJSValue hmi_callback) {\n')
- with CodeBlock(out) as output:
- output.write('QList<QVariant> args;\n')
- for param_el in request.findall('param'):
- output.write('args << ' + param_el.get('name') + ';\n')
- output.write('new ' + interface_el.get('name') + '_' + request.get('name') + '(' + interface_el.get('name') + ', name, args, hmi_callback);\n}\n')
-
-
-
- def make_source_file(self, out):
- out.write('#include "request_to_sdl.h"\n')
- out.write('\n')
- out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
- out.write('}\n\n')
- out.write('RequestToSDL::~RequestToSDL() {\n')
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + '->deleteLater();\n')
- output.write('this->deleteLater();\n')
- out.write('}\n\n')
- impl.make_requests_for_source(out)
-
-
-
-
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-if args.version == "4.8.5":
- prefix_class_item = 'Declarative'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'Quick'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'request_to_sdl.h'
-source_name = 'request_to_sdl.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""/**
- * @file request_to_sdl.h
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
-header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n\n");
-header_out.write("#include <QDBusConnection>\n");
-header_out.write("#include <QJSValue>\n");
-header_out.write("#include <QObject>\n");
-header_out.write("#include <QDBusInterface>\n");
-header_out.write('#include "hmi_requests.h"\n');
-
-impl.make_header_file(header_out)
-
-header_out.write("#endif SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""/**
- * @file request_to_sdl.cc
- * @brief Generated class that process requests from qtHMI
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2014, 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.
-
-""")
-
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_request_to_sdl.py b/src/components/dbus/codegen/make_request_to_sdl.py
deleted file mode 100755
index c8940f3eb7..0000000000
--- a/src/components/dbus/codegen/make_request_to_sdl.py
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# @file make_qml_dbus_cpp.py
-# @brief Generator of QML to QDbus C++ part
-#
-# This file is a part of HMI D-Bus layer.
-#
-# Copyright (c) 2014, 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.
-
-from argparse import ArgumentParser
-import os.path
-from sys import argv
-from xml.etree import ElementTree
-from copy import copy
-from ford_xml_parser import FordXmlParser, ParamDesc
-from code_formatter import CodeBlock
-
-class Impl(FordXmlParser):
-
- def args_for_function_definition(self, params, iface_name, out):
- for param_el in params:
- param = self.make_param_desc(param_el, iface_name)
- out.write('QVariant %s,' % (param.name))
- out.write('Q%sValue hmi_callback' % prefix_class_item)
-
- def make_requests_for_header(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- all_params = list()
- for param_el in request.findall('param'):
- all_params.append(param_el)
- with CodeBlock(out) as output:
- output.write("Q_INVOKABLE bool %s_%s(" % (interface_el.get('name'), request.get('name')))
- impl.args_for_function_definition(all_params, interface_el.get('name'), out)
- output.write(");\n")
-
-
- def make_header_file(self, out):
- out.write("class QDBusInterface;\n")
- out.write("class RequestToSDL : public QObject\n")
- out.write("{\n")
- out.write(' Q_OBJECT\n')
- out.write(" public:\n")
- with CodeBlock(out) as output:
- output.write("explicit RequestToSDL(QObject *parent = 0);\n")
- output.write("~RequestToSDL();\n")
- impl.make_requests_for_header(out)
- out.write(" private:\n")
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- output.write('QDBusInterface *%s;\n' % interface_el.get('name'))
- out.write("};\n")
-
-
- def qt_param_type(self, param):
- if not param.mandatory:
- param_copy = copy(param)
- param_copy.mandatory = True
- return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
- if param.array:
- param_copy = copy(param)
- param_copy.array = False
- if param.type == 'String':
- return "QStringList"
- return "QList< " + self.qt_param_type(param_copy) + " >"
- if param.type == 'Integer' or param.enum:
- return 'int'
- elif param.type == 'String':
- return 'QString'
- elif param.type == 'Boolean':
- return 'bool'
- elif param.type == 'Float':
- return 'double'
- elif param.struct:
- return "_".join(param.fulltype)
- else:
- raise RuntimeError('Unknown type: ' + param.type)
-
-
- def make_requests_for_source(self, out):
- for interface_el in self.el_tree.findall('interface'):
- request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
- for (request, response) in request_responses:
- request_name = request.get('name')
- iface_name = interface_el.get('name')
- request_full_name = iface_name + '_' + request_name
- out.write('bool RequestToSDL::' + request_full_name + '(')
- for param_el in request.findall('param'):
- out.write('QVariant %s, ' % (param_el.get('name')))
- out.write('Q%sValue hmi_callback) {\n' % prefix_class_item)
- with CodeBlock(out) as output:
- output.write('LOG4CXX_TRACE(logger_, "ENTER");\n')
- output.write('QList<QVariant> args;\n')
- for param_el in request.findall('param'):
- param = self.make_param_desc(param_el, iface_name)
- output.write('%s %s;\n' % (impl.qt_param_type(param), param.name + "_tmp"))
- output.write('if (VariantToValue(%s, %s)) {\n' % (param.name, param.name + '_tmp'))
- with CodeBlock(output) as out:
- self.write_param_validation(param, param.name + "_tmp",
- "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\");\nreturn false" % (param.name, request_full_name),
- out)
- out.write('args << QVariant::fromValue(%s);\n' % (param.name + '_tmp'))
- output.write('} else {\n')
- with CodeBlock(output) as out:
- out.write('LOG4CXX_ERROR(logger_, "%s in %s is NOT valid");\n' % (param.name, request_full_name))
- out.write('return false;\n')
- out.write('}\n')
- output.write('new requests::' + request_full_name + '(hmi_callback, ' + interface_el.get('name') + ' , args, '
- + '"' + request_name + '");\n')
- output.write('LOG4CXX_TRACE(logger_, "EXIT");\n')
- output.write('return true;\n')
- out.write('}\n\n')
-
-
- def write_param_validation(self, param, param_name, fail_statement, out, level=0):
- if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
- out.write("if (%s.presence) {\n" % param_name)
- param_copy = copy(param)
- param_copy.mandatory = True
- with CodeBlock(out) as out:
- self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
- out.write("}\n")
- elif param.array:
- if param.minSize > 0:
- out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.maxSize != None:
- out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
- with CodeBlock(out) as out:
- out.write("{0};\n".format(fail_statement))
- out.write("}\n")
- if param.restricted:
- out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
- with CodeBlock(out) as out:
- param_copy = copy(param)
- param_copy.array = False
- self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
- out.write("}\n")
- elif param.struct:
- for p in self.structs[param.fulltype]:
- self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
- elif param.type == "Integer" or param.type == "Float":
- conditions = []
- if (param.minValue != None):
- conditions.append("(%s < %s)" % (param_name, param.minValue))
- if (param.maxValue != None):
- conditions.append("(%s > %s)" % (param_name, param.maxValue))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % fail_statement)
- out.write("}\n")
- elif param.type == "String":
- conditions = []
- if (param.minLength > 0):
- conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
- if (param.maxLength > 0):
- conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
- if conditions:
- out.write('if (%s) {' % ' || '.join(conditions))
- with CodeBlock(out) as out:
- out.write('%s;\n' % (fail_statement))
- out.write("}\n")
-
- def make_source_file(self, out):
- out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
- with CodeBlock(out) as output:
- output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
- out.write('}\n\n')
- out.write('RequestToSDL::~RequestToSDL() {\n')
- with CodeBlock(out) as output:
- for interface_el in self.el_tree.findall('interface'):
- iface_name = interface_el.get('name')
- output.write(iface_name + '->deleteLater();\n')
- output.write('this->deleteLater();\n')
- out.write('}\n\n')
- impl.make_requests_for_source(out)
-
-arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
-arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
-arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
-arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
-args = arg_parser.parse_args()
-
-
-if args.version == "4.8.5":
- prefix_class_item = 'Script'
- invoke_type_connection = 'Direct'
-elif args.version == "5.1.0":
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-else:
- prefix_class_item = 'JS'
- invoke_type_connection = 'BlockingQueued'
-
-header_name = 'request_to_sdl.h'
-source_name = 'request_to_sdl.cc'
-
-in_tree = ElementTree.parse(args.infile)
-in_tree_root = in_tree.getroot()
-
-impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
-
-header_out = open(args.outdir + '/' + header_name, "w")
-source_out = open(args.outdir + '/' + source_name, "w")
-
-header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-header_out.write("""
-/*
- Copyright (c) 2014, 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.
-*/
-""")
-header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n")
-header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n\n")
-
-header_out.write("#include <QtCore/QObject>\n")
-header_out.write("#include <QtCore/QVariant>\n")
-header_out.write("#include <QtCore/QStringList>\n\n")
-header_out.write('#include "qml_dbus.h"\n\n')
-if args.version == "4.8.5":
- header_out.write("#include <QtScript/QScriptValue>\n")
-elif args.version == "5.1.0":
- header_out.write("#include <QtQml/QJSValue>\n")
-
-impl.make_header_file(header_out)
-header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
-
-
-source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
-source_out.write("""
-/*
- Copyright (c) 2014, 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.
-*/
-
-""")
-
-source_out.write('#include "request_to_sdl.h"\n')
-source_out.write("#include <QtDBus/QDBusConnection>\n")
-source_out.write("#include <QtDBus/QDBusInterface>\n")
-source_out.write('#include "hmi_requests.h"\n')
-source_out.write('#include "utils/logger.h"\n\n')
-source_out.write('CREATE_LOGGERPTR_GLOBAL(logger_, "DBusPlugin")\n\n')
-
-impl.make_source_file(source_out)
diff --git a/src/components/dbus/include/dbus/dbus_adapter.h b/src/components/dbus/include/dbus/dbus_adapter.h
deleted file mode 100644
index 42a2ac1140..0000000000
--- a/src/components/dbus/include/dbus/dbus_adapter.h
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright (c) 2013-2014, 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_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
-
-#include <string>
-#include "smart_objects/smart_object.h"
-#include "dbus/schema.h"
-#include "dbus/message_descriptions.h"
-
-struct DBusConnection;
-struct DBusMessage;
-struct DBusMessageIter;
-
-namespace dbus {
-
-/**
- * \brief class for work with DBus
- */
-class DBusAdapter {
- public:
- /**
- * \brief constructs DBus adapter
- * \param sdlServiceName core service name
- * \param sdlObjectPath core object path
- * \param hmiServiceName hmi service name
- */
- DBusAdapter(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath);
-
- /**
- * \brief destructs DBus adapter
- */
- virtual ~DBusAdapter();
-
- /**
- * \brief inits service
- * \return true if success
- */
- bool Init();
-
- /**
- * \brief return schema messages for DBus
- * \return schema
- */
- const DBusSchema& get_schema() const;
-
- protected:
- /**
- * \brief calls method on HMI
- * \param id id message
- * \param func_id id function in Ford protocol
- * \param name pair interface and name of method for call
- * \param obj params for call
- */
- void MethodCall(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends signal
- * \param id id message
- * \param func_id id function in Ford protocol
- * \param name pair interface and name of signal for call
- * \param obj params for signal
- */
- void Signal(const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief returns result of call method to HMI
- * \param id id message
- * \param obj params for return
- */
- void MethodReturn(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends error on message from HMI
- * \param id id message
- * \param msg message from HMI
- * \param name name of error
- * \param description description of error
- */
- void Error(uint id, const std::string& name, const std::string& description);
-
- /**
- * \brief adds a match rule
- * \param rule string rule in the DBus specification
- */
- void AddMatch(const std::string& rule);
-
- /**
- * \brief processes incoming message from DBus if queue isn't empty
- * and fill obj
- * \param obj object for send to core
- * \return true if message processed
- */
- bool Process(smart_objects::SmartObject& obj);
-
- /**
- * \brief saves link D-Bus serial to Ford message id
- * \param serial D-Bus message serial
- * \param ids pair correlation id and Ford message id
- */
- inline void SaveRequestToHMI(uint32_t serial,
- const std::pair<uint, MessageId>& ids);
-
- /**
- * \brief gets Ford message id by serial
- * \param serial D-Bus message serial
- * \return pair correlation id and Ford message id
- */
- inline std::pair<uint, MessageId> GetRequestToHMI(uint32_t serial);
-
- /**
- * \brief saves link D-Bus serial to Ford message id
- * \param serial D-Bus message serial
- * \param request D-Bus message from HMI
- */
- inline void SaveRequestFromHMI(uint32_t serial, DBusMessage* request);
-
- /**
- * \brief gets D-Bus message id by serial
- * \param serial DBus message serial
- * \return D-Bus message from HMI
- */
- inline DBusMessage* GetRequestFromHMI(uint32_t serial);
-
- std::string sdl_service_name_;
- std::string sdl_object_path_;
- std::string hmi_service_name_;
- std::string hmi_object_path_;
- DBusConnection* conn_;
-
- private:
- /**
- * \brief schema messages and arguments for DBus
- */
- const DBusSchema* schema_;
-
- /**
- * \brief mapping serial message DBus on message id Ford protocol
- */
- std::map<uint32_t, std::pair<uint, MessageId> > requests_to_hmi_;
-
- /**
- * \brief mapping message id Ford protocol on message DBus
- */
- std::map<uint32_t, DBusMessage*> requests_from_hmi_;
-
- /**
- * \brief processes incoming call of method and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessMethodCall(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming return of method and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessMethodReturn(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming error and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessError(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief processes incoming signal and fill obj
- * \param msg message from DBus
- * \param obj object for send to core
- * \return true if success
- */
- bool ProcessSignal(DBusMessage* msg, smart_objects::SmartObject& obj);
-
- /**
- * \brief sets arguments to message
- * \param msg DBus message
- * \param rules list of rules for arguments
- * \param args map of arguments
- * \return true if success
- */
- bool SetArguments(DBusMessage* msg,
- const ListArgs& rules,
- const smart_objects::SmartObject& args);
-
- /**
- * \brief Sets one argument to message
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool SetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool SetValue(DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets value for every element of argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param array values of argument
- * \return true if success
- */
- bool SetArrayValue(DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets struct value for argument
- * \param iter DBus message iter
- * \param rules description for argument
- * \param param structure
- * \return true if success
- */
- bool SetStructValue(DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief sets optional value for argument.
- * Optional param is struct bool, value
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of optional argument
- * \return true if success
- */
- bool SetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param);
-
- /**
- * \brief gets arguments from message
- * \param iter DBus message iterator
- * \param code response code (output)
- * \param message response message (output)
- * \return true if success
- */
- bool GetHeader(DBusMessageIter* iter, int* code, std::string* message);
-
- /**
- * \brief gets arguments from message with header
- * \param iter DBus message iterator
- * \param rules list of rules for arguments
- * \param args map of arguments
- * \return true if success
- */
- bool GetArguments(DBusMessageIter* iter,
- const ListArgs& rules,
- smart_objects::SmartObject& args);
-
- /**
- * \brief gets one argument from message
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param args map of arguments
- * \return true if success
- */
- bool GetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& args);
-
- /**
- * \brief gets value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of argument
- * \return true if success
- */
- bool GetValue(DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets value for every element of argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param array values of argument
- * \return true if success
- */
- bool GetArrayValue(DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets struct value for argument
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param structure
- * \return true if success
- */
- bool GetStructValue(DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief gets optional value for argument.
- * Optional param is struct bool, value
- * \param iter DBus message iterator
- * \param rules description for argument
- * \param param value of optional argument
- * \return true if success
- */
- bool GetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param);
-
- /**
- * \brief processes request on introspect
- * \param msg DBus message
- */
- void Introspect(DBusMessage* msg);
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message.h b/src/components/dbus/include/dbus/dbus_message.h
deleted file mode 100644
index 23e672d0fc..0000000000
--- a/src/components/dbus/include/dbus/dbus_message.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Copyright (c) 2014, 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_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
-
-#include <stdint.h>
-#include <string>
-
-#include <dbus/dbus.h>
-
-namespace dbus {
-
-enum ContainerType {
- kArray = DBUS_TYPE_ARRAY,
- kStruct = DBUS_TYPE_STRUCT,
- kDictEntry = DBUS_TYPE_DICT_ENTRY
-};
-
-class MessageRefKeeper {
- public:
- MessageRefKeeper();
- MessageRefKeeper(DBusMessage* message);
- ~MessageRefKeeper();
- MessageRefKeeper(const MessageRefKeeper& other);
- MessageRefKeeper& operator=(MessageRefKeeper other);
- DBusMessage* get() const;
- DBusMessage* Pass();
- void swap(MessageRefKeeper& other);
-
- private:
- DBusMessage* raw_message_;
-};
-
-class MessageRef {
- public:
- MessageRef(DBusMessage* message);
- ~MessageRef();
- std::string GetInterface() const;
- std::string GetMember() const;
-
- protected:
- MessageRefKeeper raw_message_ref_;
- friend class MessageReader;
- friend class MessageWriter;
-};
-
-class MessageReader {
- public:
- // Main constructor
- MessageReader(const MessageRef& message);
- bool has_failed() const;
- bool IsAtLastElement() const;
- bool HasNext() const;
-
- // Type checkers
- bool NextIsInvalid() const;
- bool NextIsBool() const;
- bool NextIsByte() const;
- bool NextIsInt16() const;
- bool NextIsUint16() const;
- bool NextIsInt32() const;
- bool NextIsUint32() const;
- bool NextIsInt64() const;
- bool NextIsUint64() const;
- bool NextIsDouble() const;
- bool NextIsString() const;
- bool NextIsArray() const;
- bool NextIsStruct() const;
- bool NextIsDictEntry() const;
-
- // Readers
- bool TakeBool();
- uint8_t TakeByte();
- int16_t TakeInt16();
- uint16_t TakeUint16();
- int32_t TakeInt32();
- uint32_t TakeUint32();
- int64_t TakeInt64();
- uint64_t TakeUint64();
- double TakeDouble();
- std::string TakeString();
-
- MessageReader TakeArrayReader();
- MessageReader TakeStructReader();
- MessageReader TakeDictEntryReader();
-
- private:
- typedef int DataType;
- // Container reader constructor
- MessageReader(MessageReader* reader, DataType container_data_type);
- void MoveToNext();
- void MarkFailed();
- DataType NextValueType() const;
- void ReadNextValue(DataType type, void* value);
-
- private:
- // Fields
- MessageReader* parent_reader_;
- bool failed_;
- DBusMessageIter iterator_;
-};
-
-class MessageWriter {
- public:
- // Methods
- // Main appending constructor
- MessageWriter(const MessageRef& message);
- // Container writer constructor
- MessageWriter(MessageWriter* parent,
- ContainerType type,
- const char* array_signature);
- ~MessageWriter();
- void PutBool(bool value);
- void PutByte(uint8_t value);
- void PutInt16(int16_t value);
- void PutUint16(uint16_t value);
- void PutInt32(int32_t value);
- void PutUint32(uint32_t value);
- void PutInt64(int64_t value);
- void PutUint64(uint64_t value);
- void PutDouble(double value);
- void PutString(const std::string& value);
-
- private:
- typedef int DataType;
- // Main constructor
- void WriteAndCheck(DataType value_type, const void* value);
- void CloseWriter();
-
- private:
- // Fields
- bool has_opened_subcontainer_;
- MessageWriter* parent_writer_;
- DBusMessageIter iterator_;
-
- // Disallow copy and assign
- MessageWriter(const MessageWriter& other);
- MessageWriter& operator=(const MessageWriter& other);
-};
-
-MessageRef MethodCall(const char* bus_name,
- const char* path,
- const char* interface,
- const char* method);
-MessageRef Signal(const char* path, const char* interface, const char* name);
-} // namespace dbus
-
-#include "dbus/dbus_message_inl.h"
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_inl.h b/src/components/dbus/include/dbus/dbus_message_inl.h
deleted file mode 100644
index ba9bfaa78d..0000000000
--- a/src/components/dbus/include/dbus/dbus_message_inl.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 2014, 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_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
-
-#include "dbus/dbus_message.h"
-
-namespace dbus {
-// MessageReader
-inline bool MessageReader::has_failed() const {
- return failed_;
-}
-
-inline bool MessageReader::IsAtLastElement() const {
- DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
- return dbus_message_iter_has_next(iter) == 0;
-}
-
-inline bool MessageReader::HasNext() const {
- return !failed_ && NextValueType() != DBUS_TYPE_INVALID;
-}
-
-inline bool MessageReader::NextIsInvalid() const {
- return NextValueType() == DBUS_TYPE_INVALID;
-}
-
-inline bool MessageReader::NextIsBool() const {
- return NextValueType() == DBUS_TYPE_BOOLEAN;
-}
-
-inline bool MessageReader::NextIsByte() const {
- return NextValueType() == DBUS_TYPE_BYTE;
-}
-
-inline bool MessageReader::NextIsInt16() const {
- return NextValueType() == DBUS_TYPE_INT16;
-}
-
-inline bool MessageReader::NextIsUint16() const {
- return NextValueType() == DBUS_TYPE_UINT16;
-}
-
-inline bool MessageReader::NextIsInt32() const {
- return NextValueType() == DBUS_TYPE_INT32;
-}
-
-inline bool MessageReader::NextIsUint32() const {
- return NextValueType() == DBUS_TYPE_UINT32;
-}
-
-inline bool MessageReader::NextIsInt64() const {
- return NextValueType() == DBUS_TYPE_INT64;
-}
-
-inline bool MessageReader::NextIsUint64() const {
- return NextValueType() == DBUS_TYPE_UINT64;
-}
-
-inline bool MessageReader::NextIsDouble() const {
- return NextValueType() == DBUS_TYPE_DOUBLE;
-}
-
-inline bool MessageReader::NextIsString() const {
- return NextValueType() == DBUS_TYPE_STRING;
-}
-
-inline bool MessageReader::NextIsArray() const {
- return NextValueType() == DBUS_TYPE_ARRAY;
-}
-
-inline bool MessageReader::NextIsStruct() const {
- return NextValueType() == DBUS_TYPE_STRUCT;
-}
-
-inline bool MessageReader::TakeBool() {
- dbus_bool_t value = 0;
- ReadNextValue(DBUS_TYPE_BOOLEAN, &value);
- return value != 0;
-}
-
-inline uint8_t MessageReader::TakeByte() {
- uint8_t value = 0;
- ReadNextValue(DBUS_TYPE_BYTE, &value);
- return value;
-}
-
-inline int16_t MessageReader::TakeInt16() {
- int16_t value = 0;
- ReadNextValue(DBUS_TYPE_INT16, &value);
- return value;
-}
-
-inline uint16_t MessageReader::TakeUint16() {
- uint16_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT16, &value);
- return value;
-}
-
-inline int32_t MessageReader::TakeInt32() {
- int32_t value = 0;
- ReadNextValue(DBUS_TYPE_INT32, &value);
- return value;
-}
-
-inline uint32_t MessageReader::TakeUint32() {
- uint32_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT32, &value);
- return value;
-}
-
-inline int64_t MessageReader::TakeInt64() {
- int64_t value = 0;
- ReadNextValue(DBUS_TYPE_INT64, &value);
- return value;
-}
-
-inline uint64_t MessageReader::TakeUint64() {
- uint64_t value = 0;
- ReadNextValue(DBUS_TYPE_UINT64, &value);
- return value;
-}
-
-inline double MessageReader::TakeDouble() {
- double value = 0.;
- ReadNextValue(DBUS_TYPE_DOUBLE, &value);
- return value;
-}
-
-inline std::string MessageReader::TakeString() {
- const char* value = "";
- ReadNextValue(DBUS_TYPE_STRING, &value);
- return value;
-}
-
-inline MessageReader::DataType MessageReader::NextValueType() const {
- DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
- return failed_ ? DBUS_TYPE_INVALID : dbus_message_iter_get_arg_type(iter);
-}
-
-// Message writer methods
-inline void MessageWriter::PutBool(bool value) {
- dbus_bool_t dbus_value = value;
- WriteAndCheck(DBUS_TYPE_BOOLEAN, &dbus_value);
-}
-
-inline void MessageWriter::PutByte(uint8_t value) {
- WriteAndCheck(DBUS_TYPE_BYTE, &value);
-}
-
-inline void MessageWriter::PutInt16(int16_t value) {
- WriteAndCheck(DBUS_TYPE_INT16, &value);
-}
-
-inline void MessageWriter::PutUint16(uint16_t value) {
- WriteAndCheck(DBUS_TYPE_UINT16, &value);
-}
-
-inline void MessageWriter::PutInt32(int32_t value) {
- WriteAndCheck(DBUS_TYPE_INT32, &value);
-}
-
-inline void MessageWriter::PutUint32(uint32_t value) {
- WriteAndCheck(DBUS_TYPE_UINT32, &value);
-}
-
-inline void MessageWriter::PutInt64(int64_t value) {
- WriteAndCheck(DBUS_TYPE_INT64, &value);
-}
-
-inline void MessageWriter::PutUint64(uint64_t value) {
- WriteAndCheck(DBUS_TYPE_UINT64, &value);
-}
-
-inline void MessageWriter::PutDouble(double value) {
- WriteAndCheck(DBUS_TYPE_DOUBLE, &value);
-}
-
-inline void MessageWriter::PutString(const std::string& value) {
- const char* pointer = value.c_str();
- WriteAndCheck(DBUS_TYPE_STRING, &pointer);
-}
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
diff --git a/src/components/dbus/include/dbus/schema.h b/src/components/dbus/include/dbus/schema.h
deleted file mode 100644
index 3dfe49cc95..0000000000
--- a/src/components/dbus/include/dbus/schema.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2013, 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_DBUS_INCLUDE_DBUS_SCHEMA_H_
-#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
-
-#include <string>
-#include <vector>
-#include <utility>
-
-#include "dbus/message_descriptions.h"
-#include "interfaces/HMI_API.h"
-
-namespace dbus {
-
-using ford_message_descriptions::ParameterDescription;
-using ford_message_descriptions::MessageDescription;
-
-struct Description;
-
-typedef hmi_apis::FunctionID::eType MessageId;
-typedef hmi_apis::messageType::eType MessageType;
-typedef std::pair<std::string, std::string> MessageName; // interface, message
-typedef std::vector<const ParameterDescription*> ListArgs;
-typedef std::vector<const Description*> Messages;
-
-/**
- * \brief Wrapper class for message description
- */
-class DBusSchema {
- public:
- explicit DBusSchema(const MessageDescription** array);
-
- /**
- * \brief gets message name by message id
- * \param id id message
- * \return name message
- */
- MessageName getMessageName(MessageId id) const;
-
- /**
- * \brief gets message id by message name
- * \param name name message
- * \return id message
- */
- MessageId getMessageId(const MessageName& name) const;
-
- /**
- * \brief gets list rules for arguments
- * \param id id message
- * \param type type message
- * \return list rules
- */
- ListArgs getListArgs(MessageId id, MessageType type) const;
-
- /**
- * \brief gets list rules for arguments
- * @param name name message
- * @param type type message
- * @return list rules
- */
- ListArgs getListArgs(const MessageName& name, MessageType type) const;
-
- private:
- Messages msgs_;
-};
-
-} // namespace dbus
-
-#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
diff --git a/src/components/dbus/src/dbus_adapter.cc b/src/components/dbus/src/dbus_adapter.cc
deleted file mode 100644
index 33d05a728b..0000000000
--- a/src/components/dbus/src/dbus_adapter.cc
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
- * Copyright (c) 2013-2014, 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 "dbus/dbus_adapter.h"
-#include <dbus/dbus.h>
-#include <sstream>
-#include "formatters/CSmartFactory.h"
-#include "utils/logger.h"
-#include "smart_objects/smart_object.h"
-#include "introspection_xml.cc"
-#include "message_descriptions.cc"
-
-using ford_message_descriptions::ParameterDescription;
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-extern char introspection_xml[];
-
-namespace dbus {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-std::vector<std::string>& split(const std::string& s,
- char delim,
- std::vector<std::string>& elems) {
- std::stringstream ss(s);
- std::string item;
- while (std::getline(ss, item, delim)) {
- elems.push_back(item);
- }
- return elems;
-}
-
-DBusAdapter::DBusAdapter(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath)
- : sdl_service_name_(sdlServiceName)
- , sdl_object_path_(sdlObjectPath)
- , hmi_service_name_(hmiServiceName)
- , hmi_object_path_(hmiObjectPath)
- , conn_(NULL)
- , schema_(new DBusSchema(ford_message_descriptions::message_descriptions)) {
-}
-
-DBusAdapter::~DBusAdapter() {
- dbus_shutdown();
- delete schema_;
-}
-
-bool DBusAdapter::Init() {
- DBusError err;
- int ret;
- dbus_error_init(&err);
- if (!dbus_threads_init_default()) {
- LOG4CXX_ERROR(logger_, "DBus: Can't initializes threads");
- return false;
- }
- conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- LOG4CXX_ERROR(logger_, "DBus: Connection Error " << err.message);
- dbus_error_free(&err);
- return false;
- }
- ret = dbus_bus_request_name(
- conn_, sdl_service_name_.c_str(), DBUS_NAME_FLAG_DO_NOT_QUEUE, &err);
- if (ret == -1 || dbus_error_is_set(&err)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't request name " << err.name);
- dbus_error_free(&err);
- return false;
- }
- if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) {
- LOG4CXX_ERROR(logger_,
- "DBus: Service '" << sdl_service_name_
- << "' is already running");
- return false;
- }
-
- LOG4CXX_INFO(logger_, "DBus: Success init dbus adaptor");
- return true;
-}
-
-bool DBusAdapter::Process(smart_objects::SmartObject& obj) {
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't initialized");
- return false;
- }
- DBusMessage* msg = dbus_connection_pop_message(conn_);
- if (msg != NULL) {
- switch (dbus_message_get_type(msg)) {
- case DBUS_MESSAGE_TYPE_METHOD_CALL:
- return ProcessMethodCall(msg, obj);
- case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- return ProcessMethodReturn(msg, obj);
- case DBUS_MESSAGE_TYPE_ERROR:
- return ProcessError(msg, obj);
- case DBUS_MESSAGE_TYPE_SIGNAL:
- return ProcessSignal(msg, obj);
- default:
- return false;
- }
- } else {
- dbus_connection_read_write(conn_, 50);
- }
- return false;
-}
-
-void DBusAdapter::MethodReturn(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Method return " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg = GetRequestFromHMI(id);
- if (!msg) {
- LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
- return;
- }
-
- DBusMessage* reply;
- reply = dbus_message_new_method_return(msg);
- if (NULL == reply) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::response);
- if (!SetArguments(reply, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, reply, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- return;
- }
- dbus_connection_flush(conn_);
- dbus_message_unref(reply);
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success return method");
-}
-
-void DBusAdapter::Error(uint id,
- const std::string& name,
- const std::string& description) {
- LOG4CXX_DEBUG(logger_, "Error " << name << ": " << description);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- DBusMessage* msg = GetRequestFromHMI(id);
- if (!msg) {
- LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
- return;
- }
-
- DBusMessage* error;
- error = dbus_message_new_error(msg, name.c_str(), description.c_str());
- if (NULL == error) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, error, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(error);
- dbus_message_unref(msg);
- return;
- }
- dbus_connection_flush(conn_);
- dbus_message_unref(error);
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success error");
-}
-
-void DBusAdapter::MethodCall(uint id,
- const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Method call " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg;
- msg = dbus_message_new_method_call(
- hmi_service_name_.c_str(),
- hmi_object_path_.c_str(),
- (hmi_service_name_ + "." + name.first).c_str(),
- name.second.c_str());
- if (NULL == msg) {
- LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::request);
- if (!SetArguments(msg, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(msg);
- return;
- }
-
- dbus_uint32_t serial;
- if (!dbus_connection_send(conn_, msg, &serial)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
- dbus_message_unref(msg);
- return;
- }
- SaveRequestToHMI(serial, std::make_pair(id, func_id));
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success call method");
-}
-
-void DBusAdapter::Signal(const MessageId func_id,
- const MessageName& name,
- const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Signal " << name.first << "." << name.second);
- if (conn_ == NULL) {
- LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
- return;
- }
-
- if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return;
- }
-
- DBusMessage* msg;
- msg = dbus_message_new_signal(sdl_object_path_.c_str(),
- (sdl_service_name_ + "." + name.first).c_str(),
- name.second.c_str());
- if (NULL == msg) {
- LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Message Null)");
- return;
- }
-
- const ListArgs& args =
- schema_->getListArgs(func_id, hmi_apis::messageType::notification);
- if (!SetArguments(msg, args, obj)) {
- LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
- dbus_message_unref(msg);
- return;
- }
-
- if (!dbus_connection_send(conn_, msg, NULL)) { // serial isn't required
- LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Out Of Memory)");
- dbus_message_unref(msg);
- return;
- }
- dbus_message_unref(msg);
- LOG4CXX_INFO(logger_, "DBus: Success emit signal");
-}
-
-void DBusAdapter::AddMatch(const std::string& rule) {
- LOG4CXX_INFO(logger_, "Subscription: " << rule);
- dbus_bus_add_match(conn_, rule.c_str(), NULL);
-}
-
-bool DBusAdapter::ProcessMethodCall(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- std::string method = dbus_message_get_member(msg);
- std::string interface = dbus_message_get_interface(msg);
- LOG4CXX_INFO(logger_, "DBus: name of method " << interface << " " << method);
-
- if (interface == "org.freedesktop.DBus.Introspectable" &&
- method == "Introspect") {
- LOG4CXX_INFO(logger_, "DBus: INTROSPECT");
- Introspect(msg);
- return false;
- }
-
- std::vector<std::string> elems;
- split(interface, '.', elems);
- MessageName name(elems.back(), method);
- MessageId m_id = schema_->getMessageId(name);
- if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method call from hmi");
- return false;
- }
-
- uint32_t serial = dbus_message_get_serial(msg);
- if (!serial) {
- LOG4CXX_ERROR(logger_, "DBus: Serial of request from HMI isn't defined");
- return false;
- }
-
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = serial;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::request;
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- const ListArgs args =
- schema_->getListArgs(name, hmi_apis::messageType::request);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- if (GetArguments(&iter, args, obj[sos::S_MSG_PARAMS])) {
- SaveRequestFromHMI(serial, msg);
- return true;
- }
- return false;
-}
-
-bool DBusAdapter::ProcessMethodReturn(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
- std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
- if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return false;
- }
-
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- ListArgs args =
- schema_->getListArgs(ids.second, hmi_apis::messageType::response);
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- int code = 0;
- std::string message;
- smart_objects::SmartObject description(smart_objects::SmartType_Map);
- bool ret = GetHeader(&iter, &code, &message) &&
- GetArguments(&iter, args, description);
-
- if (ret) {
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::response;
- obj[sos::S_PARAMS][sos::kCode] = code;
- obj[sos::S_PARAMS][sos::kMessage] = message;
- if (code != hmi_apis::Common_Result::SUCCESS) {
- MessageName name = schema_->getMessageName(ids.second);
- description["method"] = name.first + "." + name.second;
- obj[sos::S_PARAMS]["data"] = description;
- } else {
- obj[sos::S_MSG_PARAMS] = description;
- }
- }
-
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::ProcessError(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
- std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
- if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
- return false;
- }
-
- const char* error_name;
- bool ret = false;
- if ((error_name = dbus_message_get_error_name(msg)) != NULL) {
- smart_objects::SmartObject name(smart_objects::SmartType_String);
- name = error_name;
- ford_message_descriptions::ParameterDescription rule = {
- "description", ford_message_descriptions::String, true};
- ListArgs args;
- args.push_back(&rule);
- smart_objects::SmartObject description(smart_objects::SmartType_Map);
- description[rule.name] =
- smart_objects::SmartObject(smart_objects::SmartType_String);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- ret = GetArguments(&iter, args, description);
- MessageName method = schema_->getMessageName(ids.second);
-
- obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] =
- hmi_apis::messageType::error_response;
- obj[sos::S_PARAMS][sos::kCode] = name.asInt();
- obj[sos::S_PARAMS][sos::kMessage] = description[rule.name].asString();
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- obj[sos::S_PARAMS]["data"]["method"] = method.first + "." + method.second;
-
- LOG4CXX_WARN(logger_,
- "DBus: Call of method " << method.first << "." << method.second
- << " returned error " << name.asInt()
- << ": "
- << description[rule.name].asString());
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Type message isn't error");
- }
-
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::ProcessSignal(DBusMessage* msg,
- smart_objects::SmartObject& obj) {
- std::string method = dbus_message_get_member(msg);
- std::string interface = dbus_message_get_interface(msg);
- LOG4CXX_INFO(logger_, "DBus: name of signal " << method);
-
- std::vector<std::string> elems;
- split(interface, '.', elems);
- MessageName name(elems.back(), method);
- MessageId m_id = schema_->getMessageId(name);
- if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
- LOG4CXX_ERROR(logger_, "DBus: Invalid name signal");
- return false;
- }
-
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
- obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::notification;
- obj[sos::S_MSG_PARAMS] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
-
- const ListArgs args =
- schema_->getListArgs(name, hmi_apis::messageType::notification);
-
- DBusMessageIter iter;
- dbus_message_iter_init(msg, &iter);
- bool ret = GetArguments(&iter, args, obj[sos::S_MSG_PARAMS]);
- dbus_message_unref(msg);
- return ret;
-}
-
-bool DBusAdapter::SetArguments(DBusMessage* msg,
- const ListArgs& rules,
- const smart_objects::SmartObject& args) {
- DBusMessageIter iter;
- dbus_message_iter_init_append(msg, &iter);
- size_t size = rules.size();
- for (size_t i = 0; i < size; ++i) {
- const smart_objects::SmartObject& param = args.getElement(rules[i]->name);
- if (!SetOneArgument(&iter, rules[i], param)) {
- return false;
- }
- }
- return true;
-}
-
-bool DBusAdapter::SetOneArgument(DBusMessageIter* iter,
- const ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- if (rules->obligatory) {
- if (param.isValid()) {
- return SetValue(iter, rules, param);
- } else {
- LOG4CXX_WARN(logger_,
- "DBus: Argument '" << rules->name << "' is obligatory!");
- return false;
- }
- } else {
- return SetOptionalValue(iter, rules, param);
- }
-}
-
-bool DBusAdapter::SetValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- // LOG4CXX_DEBUG(logger_, "DBus: Set param " << rules->name << " = " <<
- // param.asString());
- int type = 0;
- void* value = 0;
- dbus_int32_t integerValue = 0;
- double floatValue = 0;
- dbus_bool_t booleanValue = false;
- std::string stringValue;
- const char* cStringValue;
- switch (rules->type) {
- case ford_message_descriptions::ParameterType::Array:
- return SetArrayValue(
- iter,
- reinterpret_cast<const ford_message_descriptions::ArrayDescription*>(
- rules),
- param);
- break;
- case ford_message_descriptions::ParameterType::Struct:
- return SetStructValue(
- iter,
- reinterpret_cast<const ford_message_descriptions::StructDescription*>(
- rules),
- param);
- break;
- case ford_message_descriptions::ParameterType::Enum:
- case ford_message_descriptions::ParameterType::Integer:
- type = DBUS_TYPE_INT32;
- integerValue = param.asInt();
- value = &integerValue;
- break;
- case ford_message_descriptions::ParameterType::Float:
- type = DBUS_TYPE_DOUBLE;
- floatValue = param.asDouble();
- value = &floatValue;
- break;
- case ford_message_descriptions::ParameterType::Boolean:
- type = DBUS_TYPE_BOOLEAN;
- booleanValue = param.asBool();
- value = &booleanValue;
- break;
- case ford_message_descriptions::ParameterType::String:
- type = DBUS_TYPE_STRING;
- stringValue = param.asString();
- cStringValue = stringValue.c_str();
- value = &cStringValue;
- break;
- default:
- LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
- return false;
- }
- return dbus_message_iter_append_basic(iter, type, value);
-}
-
-bool DBusAdapter::SetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- const smart_objects::SmartObject& param) {
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_STRUCT, NULL, &sub_iter)) {
- LOG4CXX_ERROR(
- logger_,
- "DBus: Can't open container type (STRUCT) for optional parameter");
- return false;
- }
-
- ford_message_descriptions::ParameterDescription flagRules = {
- "flag", ford_message_descriptions::Boolean, true};
- smart_objects::SmartObject flag(param.getType() !=
- smart_objects::SmartType_Invalid);
- if (!SetValue(&sub_iter, &flagRules, flag) ||
- !SetValue(&sub_iter, rules, param)) {
- return false;
- }
-
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(
- logger_,
- "DBus: Can't close container type (STRUCT) for optional parameter");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::SetArrayValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- const smart_objects::SmartObject& param) {
- smart_objects::SmartType type = param.getType();
- if (type != smart_objects::SmartType_Array &&
- type != smart_objects::SmartType_Invalid) {
- LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
- return false;
- }
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_ARRAY, rules->element_dbus_signature, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't open container type (ARRAY)");
- return false;
- }
- size_t size = param.length();
- for (size_t i = 0; i < size; ++i) {
- if (!SetValue(&sub_iter, rules->element, param[i])) {
- return false;
- }
- }
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't close container type (ARRAY)");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::SetStructValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- const smart_objects::SmartObject& structure) {
- smart_objects::SmartType type = structure.getType();
- if (type != smart_objects::SmartType_Map &&
- type != smart_objects::SmartType_Invalid) {
- LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
- return false;
- }
- DBusMessageIter sub_iter;
- if (!dbus_message_iter_open_container(
- iter, DBUS_TYPE_STRUCT, NULL, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't open container type (STRUCT)");
- return false;
- }
- const ParameterDescription** entry;
- entry = rules->parameters;
- while (*entry != NULL) {
- const smart_objects::SmartObject& param =
- structure.getElement((*entry)->name);
- if (!SetOneArgument(&sub_iter, *entry, param)) {
- return false;
- }
- entry++;
- }
- if (!dbus_message_iter_close_container(iter, &sub_iter)) {
- LOG4CXX_ERROR(logger_, "DBus: Can't close container type (STRUCT)");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::GetHeader(DBusMessageIter* iter,
- int* code,
- std::string* message) {
- // Get code of response
- dbus_int32_t intValue;
- int type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_INT32) {
- LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
- return false;
- }
- dbus_message_iter_get_basic(iter, &intValue);
- *code = intValue;
- LOG4CXX_DEBUG(logger_, "DBus: Code of response " << *code);
-
- dbus_message_iter_next(iter);
-
- // Get message of response
- type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_STRING) {
- LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
- return false;
- }
- const char* stringValue;
- dbus_message_iter_get_basic(iter, &stringValue);
- *message = stringValue;
- LOG4CXX_DEBUG(logger_, "DBus: message of response " << *message);
-
- dbus_message_iter_next(iter);
- return true;
-}
-
-bool DBusAdapter::GetArguments(DBusMessageIter* iter,
- const ListArgs& rules,
- smart_objects::SmartObject& args) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- size_t size = rules.size();
- for (size_t i = 0; i < size; ++i) {
- if (!GetOneArgument(iter, rules[i], args)) {
- return false;
- }
- dbus_message_iter_next(iter);
- }
- return true;
-}
-
-const DBusSchema& DBusAdapter::get_schema() const {
- return *schema_;
-}
-
-bool DBusAdapter::GetOneArgument(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& args) {
- if (rules->obligatory) {
- return GetValue(iter, rules, args[rules->name]);
- } else {
- return GetOptionalValue(iter, rules, args);
- }
-}
-
-bool DBusAdapter::GetValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param) {
- LOG4CXX_DEBUG(logger_, "DBus: Get param " << rules->name);
- int type = dbus_message_iter_get_arg_type(iter);
- switch (rules->type) {
- case ford_message_descriptions::ParameterType::Array:
- if (type == DBUS_TYPE_ARRAY) {
- return GetArrayValue(
- iter,
- // FIXME (dchmerev@luxoft.com): not portable, danger cast.
- reinterpret_cast<
- const ford_message_descriptions::ArrayDescription*>(rules),
- param);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Struct:
- if (type == DBUS_TYPE_STRUCT) {
- return GetStructValue(
- iter,
- reinterpret_cast<
- const ford_message_descriptions::StructDescription*>(rules),
- param);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Enum:
- case ford_message_descriptions::ParameterType::Integer:
- if (type == DBUS_TYPE_INT32) {
- dbus_int32_t integerValue;
- dbus_message_iter_get_basic(iter, &integerValue);
- smart_objects::SmartObject value(integerValue);
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = " << integerValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Float:
- if (type == DBUS_TYPE_DOUBLE) {
- double floatValue;
- dbus_message_iter_get_basic(iter, &floatValue);
- smart_objects::SmartObject value(floatValue);
- param = value;
- LOG4CXX_DEBUG(logger_, "DBus: " << rules->name << " = " << floatValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::Boolean:
- if (type == DBUS_TYPE_BOOLEAN) {
- dbus_bool_t booleanValue;
- dbus_message_iter_get_basic(iter, &booleanValue);
- smart_objects::SmartObject value(static_cast<bool>(booleanValue));
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = " << std::boolalpha
- << booleanValue);
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- case ford_message_descriptions::ParameterType::String:
- if (type == DBUS_TYPE_STRING) {
- const char* stringValue;
- dbus_message_iter_get_basic(iter, &stringValue);
- std::string strValue = stringValue;
- smart_objects::SmartObject value(strValue);
- param = value;
- LOG4CXX_DEBUG(logger_,
- "DBus: " << rules->name << " = \"" << strValue << "\"");
- } else {
- LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
- return false;
- }
- break;
- default:
- LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
- return false;
- }
- return true;
-}
-
-bool DBusAdapter::GetArrayValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ArrayDescription* rules,
- smart_objects::SmartObject& param) {
- smart_objects::SmartObject array(smart_objects::SmartType_Array);
-
- int i = 0;
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- while (dbus_message_iter_get_arg_type(&sub_iter) != DBUS_TYPE_INVALID) {
- if (!GetValue(&sub_iter, rules->element, array[i])) {
- return false;
- }
- dbus_message_iter_next(&sub_iter);
- i++;
- }
- param = array;
- return true;
-}
-
-bool DBusAdapter::GetStructValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::StructDescription* rules,
- smart_objects::SmartObject& param) {
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- const ParameterDescription** entry;
- entry = rules->parameters;
- smart_objects::SmartObject structure(smart_objects::SmartType_Map);
- while (*entry != NULL) {
- if (!GetOneArgument(&sub_iter, *entry, structure)) {
- return false;
- }
- dbus_message_iter_next(&sub_iter);
- entry++;
- }
- param = structure;
- return true;
-}
-
-bool DBusAdapter::GetOptionalValue(
- DBusMessageIter* iter,
- const ford_message_descriptions::ParameterDescription* rules,
- smart_objects::SmartObject& param) {
- int type = dbus_message_iter_get_arg_type(iter);
- if (type != DBUS_TYPE_STRUCT) {
- LOG4CXX_WARN(
- logger_,
- "DBus: Not expected type of argument. It is not optional parameter.");
- return false;
- }
-
- DBusMessageIter sub_iter;
- dbus_message_iter_recurse(iter, &sub_iter);
- ford_message_descriptions::ParameterDescription flagRules = {
- "flag", ford_message_descriptions::Boolean, true};
- smart_objects::SmartObject flag;
- if (!GetValue(&sub_iter, &flagRules, flag)) {
- return false;
- }
- if (flag.asBool()) {
- dbus_message_iter_next(&sub_iter);
- return GetValue(&sub_iter, rules, param[rules->name]);
- } else {
- return true;
- }
-}
-
-std::pair<uint, MessageId> DBusAdapter::GetRequestToHMI(uint32_t serial) {
- std::map<uint32_t, std::pair<uint, MessageId> >::iterator it;
- it = requests_to_hmi_.find(serial);
- if (it != requests_to_hmi_.end()) {
- std::pair<uint, MessageId> ids = it->second;
- requests_to_hmi_.erase(it);
- return ids;
- }
- return std::make_pair(0, hmi_apis::FunctionID::INVALID_ENUM);
-}
-
-void DBusAdapter::SaveRequestToHMI(uint32_t serial,
- const std::pair<uint, MessageId>& ids) {
- requests_to_hmi_.insert(std::make_pair(serial, ids));
-}
-
-void DBusAdapter::Introspect(DBusMessage* msg) {
- DBusMessage* reply;
-
- dbus_uint32_t serial = dbus_message_get_serial(msg);
- reply = dbus_message_new_method_return(msg);
- if (!reply) {
- LOG4CXX_WARN(logger_, "DBus: Failed return method for introspection");
- return;
- }
-
- DBusMessageIter iter;
- dbus_message_iter_init_append(reply, &iter);
- char* value = introspection_xml;
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &value);
- dbus_connection_send(conn_, reply, &serial);
- dbus_connection_flush(conn_);
- dbus_message_unref(reply);
- dbus_message_unref(msg);
-}
-
-void DBusAdapter::SaveRequestFromHMI(uint32_t serial, DBusMessage* request) {
- LOG4CXX_DEBUG(logger_, "Save correlation id (serial id) : " << serial);
- LOG4CXX_DEBUG(logger_, "D-Bus message: " << request);
- requests_from_hmi_.insert(std::make_pair(serial, request));
-}
-
-DBusMessage* DBusAdapter::GetRequestFromHMI(uint32_t serial) {
- LOG4CXX_DEBUG(logger_, "Get correlation id (serial id) : " << serial);
- std::map<uint32_t, DBusMessage*>::iterator it;
- it = requests_from_hmi_.find(serial);
- if (it != requests_from_hmi_.end()) {
- DBusMessage* msg = it->second;
- requests_from_hmi_.erase(it);
- LOG4CXX_DEBUG(logger_, "D-Bus message: " << msg);
- return msg;
- }
- return 0;
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message.cc b/src/components/dbus/src/dbus_message.cc
deleted file mode 100644
index b8a55896ce..0000000000
--- a/src/components/dbus/src/dbus_message.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Copyright (c) 2014, 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 "dbus/dbus_message.h"
-
-#include <algorithm>
-#include <cassert>
-
-#include <dbus/dbus.h>
-
-namespace dbus {
-
-MessageRefKeeper::MessageRefKeeper() : raw_message_(NULL) {}
-
-MessageRefKeeper::MessageRefKeeper(DBusMessage* message)
- : raw_message_(message) {
- assert(raw_message_);
- dbus_message_ref(raw_message_);
-}
-
-MessageRefKeeper::~MessageRefKeeper() {
- if (raw_message_) {
- dbus_message_unref(raw_message_);
- }
-}
-
-MessageRefKeeper::MessageRefKeeper(const MessageRefKeeper& other)
- : raw_message_(other.raw_message_) {
- assert(raw_message_);
- dbus_message_ref(raw_message_);
-}
-
-MessageRefKeeper& MessageRefKeeper::operator=(MessageRefKeeper other) {
- other.swap(*this);
- return *this;
-}
-
-DBusMessage* MessageRefKeeper::get() const {
- return raw_message_;
-}
-
-DBusMessage* MessageRefKeeper::Pass() {
- DBusMessage* message = raw_message_;
- raw_message_ = NULL;
- return message;
-}
-
-void MessageRefKeeper::swap(MessageRefKeeper& other) {
- std::swap(raw_message_, other.raw_message_);
-}
-
-MessageRef::MessageRef(DBusMessage* message) : raw_message_ref_(message) {}
-
-MessageRef::~MessageRef() {}
-
-std::string MessageRef::GetInterface() const {
- return dbus_message_get_interface(raw_message_ref_.get());
-}
-
-std::string MessageRef::GetMember() const {
- return dbus_message_get_member(raw_message_ref_.get());
-}
-
-// Message writer
-MessageReader::MessageReader(const MessageRef& message)
- : parent_reader_(NULL), failed_(false) {
- dbus_bool_t success =
- dbus_message_iter_init(message.raw_message_ref_.get(), &iterator_);
- if (!success) {
- MarkFailed();
- }
-}
-
-MessageReader::MessageReader(MessageReader* reader,
- DataType container_data_type)
- : parent_reader_(reader), failed_(reader->has_failed()) {
- assert(parent_reader_);
- if (!failed_) {
- if (reader->NextValueType() != container_data_type) {
- MarkFailed();
- } else {
- dbus_message_iter_recurse(&reader->iterator_, &iterator_);
- reader->MoveToNext();
- }
- }
-}
-
-bool MessageReader::NextIsDictEntry() const {
- return NextValueType() == DBUS_TYPE_DICT_ENTRY;
-}
-
-MessageReader MessageReader::TakeArrayReader() {
- return MessageReader(this, DBUS_TYPE_ARRAY);
-}
-
-MessageReader MessageReader::TakeStructReader() {
- return MessageReader(this, DBUS_TYPE_STRUCT);
-}
-
-MessageReader MessageReader::TakeDictEntryReader() {
- return MessageReader(this, DBUS_TYPE_DICT_ENTRY);
-}
-
-void MessageReader::MoveToNext() {
- if (!HasNext()) {
- MarkFailed();
- }
- dbus_message_iter_next(&iterator_);
-}
-
-void MessageReader::MarkFailed() {
- if (!failed_) {
- failed_ = true;
- if (parent_reader_) {
- parent_reader_->MarkFailed();
- }
- }
-}
-
-void MessageReader::ReadNextValue(MessageReader::DataType type, void* value) {
- assert(value);
- if (NextValueType() != type) {
- MarkFailed();
- } else if (!failed_) {
- dbus_message_iter_get_basic(&iterator_, value);
- MoveToNext();
- }
-}
-
-// DbusMessageWriter
-MessageWriter::MessageWriter(const MessageRef& message)
- : has_opened_subcontainer_(false), parent_writer_(NULL) {
- dbus_message_iter_init_append(message.raw_message_ref_.get(), &iterator_);
-}
-
-MessageWriter::MessageWriter(MessageWriter* parent,
- ContainerType container_type,
- const char* array_signature)
- : has_opened_subcontainer_(false), parent_writer_(parent) {
- assert(parent_writer_);
- // Only array writers require array_signature
- assert((container_type == kArray && array_signature != NULL) ||
- (container_type != kArray && array_signature == NULL));
- assert(!parent_writer_->has_opened_subcontainer_);
- bool enough_memory = dbus_message_iter_open_container(
- &parent_writer_->iterator_, container_type, array_signature, &iterator_);
- assert(enough_memory);
- parent_writer_->has_opened_subcontainer_ = true;
-}
-
-MessageWriter::~MessageWriter() {
- assert(!has_opened_subcontainer_);
- if (parent_writer_ != NULL) {
- CloseWriter();
- }
-}
-
-void MessageWriter::WriteAndCheck(MessageWriter::DataType value_type,
- const void* value) {
- assert(!has_opened_subcontainer_);
- dbus_bool_t enough_memory =
- dbus_message_iter_append_basic(&iterator_, value_type, value);
- assert(enough_memory);
-}
-
-void MessageWriter::CloseWriter() {
- assert(parent_writer_);
- assert(parent_writer_->has_opened_subcontainer_);
- dbus_bool_t enough_memory =
- dbus_message_iter_close_container(&parent_writer_->iterator_, &iterator_);
- assert(enough_memory);
- parent_writer_->has_opened_subcontainer_ = false;
-}
-
-// Construction functions
-
-MessageRef MethodCall(const char* bus_name,
- const char* path,
- const char* interface,
- const char* method) {
- return MessageRef(
- dbus_message_new_method_call(bus_name, path, interface, method));
-}
-
-MessageRef Signal(const char* path, const char* interface, const char* name) {
- return MessageRef(dbus_message_new_signal(path, interface, name));
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message_controller.cc b/src/components/dbus/src/dbus_message_controller.cc
deleted file mode 100644
index 59f08d6695..0000000000
--- a/src/components/dbus/src/dbus_message_controller.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, 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 "dbus/dbus_message_controller.h"
-#include "formatters/CSmartFactory.h"
-
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-namespace dbus {
-
-DBusMessageController::DBusMessageController(const std::string& sdlServiceName,
- const std::string& sdlObjectPath,
- const std::string& hmiServiceName,
- const std::string& hmiObjectPath)
- : DBusAdapter(sdlServiceName, sdlObjectPath, hmiServiceName, hmiObjectPath)
- , shutdown_(false) {}
-
-void DBusMessageController::SubscribeTo(const std::string& interface,
- const std::string& signal) {
- std::string rule = "type='signal'";
- rule.append(", sender='")
- .append(hmi_service_name_)
- .append("'")
- .append(", path='")
- .append(hmi_object_path_)
- .append("'")
- .append(", interface='")
- .append(hmi_service_name_)
- .append(".")
- .append(interface)
- .append("'")
- .append(", member='")
- .append(signal)
- .append("'");
- DBusAdapter::AddMatch(rule);
-}
-
-DBusMessageController::~DBusMessageController() {}
-
-void* DBusMessageController::MethodForReceiverThread(void*) {
- Run();
- return NULL;
-}
-
-bool DBusMessageController::Run() {
- while (!shutdown_) {
- smart_objects::SmartObject obj(smart_objects::SmartType_Map);
- obj[sos::S_PARAMS][sos::S_PROTOCOL_VERSION] = 2;
- obj[sos::S_PARAMS][sos::S_PROTOCOL_TYPE] = 1;
- if (DBusAdapter::Process(obj)) {
- SendMessageToCore(obj);
- }
- }
- return true;
-}
-
-void DBusMessageController::Shutdown() {
- shutdown_ = true;
-}
-
-} // namespace dbus
diff --git a/src/components/dbus/src/introspection_xml.cc b/src/components/dbus/src/introspection_xml.cc
deleted file mode 100644
index 210c232a4d..0000000000
--- a/src/components/dbus/src/introspection_xml.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// Warning! This file is generated by 'make_introspection_c.py'. Edit at your
-// own risk.
-/**
- * @file instrospections_xml.cc
- * @brief D-Bus introspection XML as C-string
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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.
-
-char introspection_xml[] = {
- 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x6e, 0x6f,
- 0x64, 0x65, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d,
- 0x2f, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f,
- 0x70, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x44, 0x2d, 0x42, 0x55, 0x53,
- 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x72,
- 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e,
- 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70,
- 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64,
- 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x73,
- 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x64, 0x62, 0x75,
- 0x73, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73,
- 0x70, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c,
- 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x2f,
- 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x68, 0x6d, 0x69,
- 0x22, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x66,
- 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64, 0x6c, 0x2e,
- 0x42, 0x61, 0x73, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x53, 0x44, 0x4c, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x52,
- 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x4e,
- 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61,
- 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x67,
- 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x6c,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x73, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x28, 0x62,
- 0x61, 0x73, 0x29, 0x69, 0x69, 0x62, 0x28, 0x62, 0x61, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x28, 0x62, 0x61, 0x69, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x74, 0x74, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x76, 0x72, 0x53, 0x79, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x73,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x73,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x56, 0x72,
- 0x47, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x72, 0x73, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x70,
- 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c,
- 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
- 0x41, 0x70, 0x70, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
- 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
- 0x65, 0x64, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6e,
- 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x74, 0x68, 0x6f,
- 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6c,
- 0x6f, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x50,
- 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x65,
- 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69,
- 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x20,
- 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x79, 0x6e, 0x63,
- 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74,
- 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65,
- 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69,
- 0x2e, 0x73, 0x64, 0x6c, 0x2e, 0x55, 0x49, 0x22, 0x3e, 0x3c, 0x73, 0x69,
- 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
- 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74,
- 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
- 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
- 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d,
- 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64,
- 0x6c, 0x2e, 0x53, 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x41, 0x63, 0x74,
- 0x69, 0x76, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x53, 0x44,
- 0x4c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28,
- 0x62, 0x62, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
- 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x69, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64,
- 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50,
- 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
- 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69,
- 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41,
- 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x69, 0x65, 0x6e,
- 0x64, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64,
- 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x73,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
- 0x67, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
- 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
- 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x28, 0x62, 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
- 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74,
- 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73,
- 0x74, 0x4f, 0x66, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
- 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74,
- 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
- 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f,
- 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
- 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43,
- 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
- 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
- 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c,
- 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x22, 0x47, 0x65, 0x74, 0x55, 0x52, 0x4c, 0x53, 0x22, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
- 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
- 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22,
- 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72,
- 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f,
- 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x72,
- 0x6c, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
- 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f,
- 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x73,
- 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
- 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3e,
- 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
- 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
- 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72,
- 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x76, 0x6f,
- 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76,
- 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
- 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29, 0x29, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74,
- 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
- 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
- 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
- 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
- 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22,
- 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
- 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61,
- 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6f,
- 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22,
- 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
- 0x3d, 0x22, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62,
- 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
- 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72,
- 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
- 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e,
- 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e,
- 0x3c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3e, 0x00}; \ No newline at end of file
diff --git a/src/components/dbus/src/message_descriptions.cc b/src/components/dbus/src/message_descriptions.cc
deleted file mode 100644
index 1a5e499a7f..0000000000
--- a/src/components/dbus/src/message_descriptions.cc
+++ /dev/null
@@ -1,10424 +0,0 @@
-// Warning! This file is generated by 'make_message_descriptions.py'. Edit at
-// your own risk.
-/**
- * @file message_descriptions.cc
- * @brief Generated HMI API message descriptions for D-Bus
- *
- * This file is a part of HMI D-Bus layer.
- */
-// Copyright (c) 2013, 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 "dbus/message_descriptions.h"
-
-namespace {
-
-struct Structs {
- static const ford_message_descriptions::ParameterDescription*
- Common__Coordinate__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DeviceInfo__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__UserFriendlyMessage__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__PermissionItem__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ServiceInfo__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TextField__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ButtonCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VehicleDataResult__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TouchCoord__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TouchEvent__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__PresetBankCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Image__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SoftButton__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TTSChunk__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HMIApplication__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__MenuParams__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Choice__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VrHelpItem__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TimeFormat__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TouchEventCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ImageResolution__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ScreenParams__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ImageField__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VideoStreamingFormat__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VideoConfig__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DisplayCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SoftButtonCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HMICapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__AudioPassThruCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TextFieldStruct__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__KeyboardProperties__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Turn__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VehicleType__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__GPSData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SingleTireStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DIDResult__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HeadLampStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__TireStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__BeltStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__BodyInformation__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DeviceStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ECallInfo__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__AirbagStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__EmergencyEvent__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ClusterModeStatus__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__MyKey__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RdsData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RadioControlData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RadioControlCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Temperature__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ClimateControlData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ClimateControlCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__ModuleData__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__DateTime__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__OASISAddress__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__LocationDetails__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__NavigationCapability__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__PhoneCapability__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__VideoStreamingCapability__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__SystemCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__RemoteControlCapabilities__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__Rectangle__parameters[];
- static const ford_message_descriptions::ParameterDescription*
- Common__HapticRect__parameters[];
-};
-
-const ford_message_descriptions::ParameterDescription
- Common__Coordinate__parameter1 = {
- "latitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Coordinate__parameter2 = {
- "longitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Coordinate__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Coordinate__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Coordinate__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter1 = {
- "name", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter2 = {
- "id", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter3 = {
- "transportType", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceInfo__parameter4 = {
- "isSDLAllowed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DeviceInfo__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceInfo__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter1 = {
- "messageCode", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter2 = {
- "ttsString", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter3 = {
- "label", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter4 = {
- "line1", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter5 = {
- "line2", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__UserFriendlyMessage__parameter6 = {
- "textBody", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__UserFriendlyMessage__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__UserFriendlyMessage__parameter6,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__PermissionItem__parameter1 = {
- "name", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__PermissionItem__parameter2 = {
- "id", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__PermissionItem__parameter3 = {
- "allowed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__PermissionItem__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PermissionItem__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PermissionItem__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PermissionItem__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ServiceInfo__parameter1 = {
- "url", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__ServiceInfo__parameter2 = {
- "policyAppId", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ServiceInfo__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ServiceInfo__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ServiceInfo__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter2 = {
- "characterSet", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter3 = {
- "width", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextField__parameter4 = {
- "rows", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TextField__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextField__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter2 = {
- "shortPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter3 = {
- "longPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__ButtonCapabilities__parameter4 = {
- "upDownAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ButtonCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ButtonCapabilities__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VehicleDataResult__parameter1 = {
- "dataType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleDataResult__parameter2 = {
- "resultCode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VehicleDataResult__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleDataResult__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleDataResult__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TouchCoord__parameter1 = {
- "x", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchCoord__parameter2 = {
- "y", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TouchCoord__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchCoord__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchCoord__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TouchEvent__parameter1 = {
- "id", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchEvent__parameter2_array = {
- "ts", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- Common__TouchEvent__parameter2 = {
- {"ts", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter2_array,
- "i"};
-const ford_message_descriptions::StructDescription
- Common__TouchEvent__parameter3_array = {
- {"c", ford_message_descriptions::Struct, true},
- Structs::Common__TouchCoord__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__TouchEvent__parameter3 = {
- {"c", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter3_array,
- "(ii)"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TouchEvent__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEvent__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__PresetBankCapabilities__parameter1 = {
- "onScreenPresetsAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__PresetBankCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PresetBankCapabilities__parameter1,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Image__parameter1 = {
- "value", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__Image__parameter2 = {
- "imageType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Image__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Image__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Image__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter1 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter2 = {
- "text", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Common__SoftButton__parameter3 = {
- {"image", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter4 = {
- "isHighlighted", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter5 = {
- "softButtonID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButton__parameter6 = {
- "systemAction", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__SoftButton__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButton__parameter6,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TTSChunk__parameter1 = {
- "text", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__TTSChunk__parameter2 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TTSChunk__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TTSChunk__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TTSChunk__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter1 = {
- "appName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter2 = {
- "ngnMediaScreenAppName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter3 = {
- "icon", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Common__HMIApplication__parameter4 = {
- {"deviceInfo", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter5 = {
- "policyAppID", ford_message_descriptions::String, true};
-const ford_message_descriptions::StructDescription
- Common__HMIApplication__parameter6_array = {
- {"ttsName", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter6 = {
- {"ttsName", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter6_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter7_array = {
- "vrSynonyms", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter7 = {
- {"vrSynonyms", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter7_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter8 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter9 = {
- "hmiDisplayLanguageDesired", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter10 = {
- "isMediaApplication", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter11_array = {
- "appType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter11 = {
- {"appType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter11_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter12 = {
- "greyOut", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__HMIApplication__parameter13_array = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__HMIApplication__parameter13 = {
- {"requestType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter13_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HMIApplication__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMIApplication__parameter13,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__MenuParams__parameter1 = {
- "parentID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__MenuParams__parameter2 = {
- "position", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__MenuParams__parameter3 = {
- "menuName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__MenuParams__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MenuParams__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MenuParams__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MenuParams__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter1 = {
- "choiceID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter2 = {
- "menuName", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription Common__Choice__parameter3 =
- {{"image", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter4 = {
- "secondaryText", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__Choice__parameter5 = {
- "tertiaryText", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription Common__Choice__parameter6 =
- {{"secondaryImage", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Choice__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Choice__parameter6,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VrHelpItem__parameter1 = {
- "text", ford_message_descriptions::String, true};
-const ford_message_descriptions::StructDescription
- Common__VrHelpItem__parameter2 = {
- {"image", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__VrHelpItem__parameter3 = {
- "position", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VrHelpItem__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VrHelpItem__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VrHelpItem__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VrHelpItem__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TimeFormat__parameter1 = {
- "hours", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TimeFormat__parameter2 = {
- "minutes", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__TimeFormat__parameter3 = {
- "seconds", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TimeFormat__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TimeFormat__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TimeFormat__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TimeFormat__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TouchEventCapabilities__parameter1 = {
- "pressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchEventCapabilities__parameter2 = {
- "multiTouchAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__TouchEventCapabilities__parameter3 = {
- "doublePressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TouchEventCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEventCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEventCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TouchEventCapabilities__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ImageResolution__parameter1 = {
- "resolutionWidth", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__ImageResolution__parameter2 = {
- "resolutionHeight", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ImageResolution__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageResolution__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageResolution__parameter2,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__ScreenParams__parameter1 = {
- {"resolution", ford_message_descriptions::Struct, true},
- Structs::Common__ImageResolution__parameters};
-const ford_message_descriptions::StructDescription
- Common__ScreenParams__parameter2 = {
- {"touchEventAvailable", ford_message_descriptions::Struct, false},
- Structs::Common__TouchEventCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ScreenParams__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ScreenParams__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ScreenParams__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ImageField__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ImageField__parameter2_array = {
- "imageTypeSupported", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__ImageField__parameter2 = {
- {"imageTypeSupported", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter2_array,
- "i"};
-const ford_message_descriptions::StructDescription
- Common__ImageField__parameter3 = {
- {"imageResolution", ford_message_descriptions::Struct, false},
- Structs::Common__ImageResolution__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ImageField__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ImageField__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingFormat__parameter1 = {
- "protocol", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingFormat__parameter2 = {
- "codec", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VideoStreamingFormat__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingFormat__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingFormat__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter1 = {
- "protocol", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter2 = {
- "codec", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter3 = {
- "width", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__VideoConfig__parameter4 = {
- "height", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VideoConfig__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoConfig__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter1 = {
- "displayType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- Common__DisplayCapabilities__parameter2_array = {
- {"textFields", ford_message_descriptions::Struct, true},
- Structs::Common__TextField__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter2 = {
- {"textFields", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter2_array,
- "(iiii)"};
-const ford_message_descriptions::StructDescription
- Common__DisplayCapabilities__parameter3_array = {
- {"imageFields", ford_message_descriptions::Struct, true},
- Structs::Common__ImageField__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter3 = {
- {"imageFields", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter3_array,
- "(i(bai)(b(ii)))"};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter4_array = {
- "mediaClockFormats", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter4 = {
- {"mediaClockFormats", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter4_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter5_array = {
- "imageCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter5 = {
- {"imageCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter5_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter6 = {
- "graphicSupported", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter7_array = {
- "templatesAvailable", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__DisplayCapabilities__parameter7 = {
- {"templatesAvailable", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter7_array,
- "s"};
-const ford_message_descriptions::StructDescription
- Common__DisplayCapabilities__parameter8 = {
- {"screenParams", ford_message_descriptions::Struct, false},
- Structs::Common__ScreenParams__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__DisplayCapabilities__parameter9 = {
- "numCustomPresetsAvailable", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DisplayCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DisplayCapabilities__parameter9,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter1 = {
- "shortPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter2 = {
- "longPressAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter3 = {
- "upDownAvailable", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__SoftButtonCapabilities__parameter4 = {
- "imageSupported", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__SoftButtonCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SoftButtonCapabilities__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HMICapabilities__parameter1 = {
- "navigation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__HMICapabilities__parameter2 = {
- "phoneCall", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HMICapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMICapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HMICapabilities__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__AudioPassThruCapabilities__parameter1 = {
- "samplingRate", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AudioPassThruCapabilities__parameter2 = {
- "bitsPerSample", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AudioPassThruCapabilities__parameter3 = {
- "audioType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__AudioPassThruCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AudioPassThruCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AudioPassThruCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AudioPassThruCapabilities__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TextFieldStruct__parameter1 = {
- "fieldName", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__TextFieldStruct__parameter2 = {
- "fieldText", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TextFieldStruct__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextFieldStruct__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TextFieldStruct__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter1 = {
- "language", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter2 = {
- "keyboardLayout", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter3 = {
- "keypressMode", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter4_array = {
- "limitedCharacterList", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__KeyboardProperties__parameter4 = {
- {"limitedCharacterList", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter4_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Common__KeyboardProperties__parameter5 = {
- "autoCompleteText", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__KeyboardProperties__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__KeyboardProperties__parameter5,
- NULL};
-
-const ford_message_descriptions::StructDescription Common__Turn__parameter1 = {
- {"navigationText", ford_message_descriptions::Struct, false},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::StructDescription Common__Turn__parameter2 = {
- {"turnIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Turn__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Turn__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Turn__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter1 = {
- "make", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter2 = {
- "model", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter3 = {
- "modelYear", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__VehicleType__parameter4 = {
- "trim", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VehicleType__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VehicleType__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter1 = {
- "longitudeDegrees", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter2 = {
- "latitudeDegrees", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter3 = {
- "utcYear", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter4 = {
- "utcMonth", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter5 = {
- "utcDay", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter6 = {
- "utcHours", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter7 = {
- "utcMinutes", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter8 = {
- "utcSeconds", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter9 = {
- "compassDirection", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter10 = {
- "pdop", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter11 = {
- "hdop", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter12 = {
- "vdop", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter13 = {
- "actual", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter14 = {
- "satellites", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter15 = {
- "dimension", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter16 = {
- "altitude", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter17 = {
- "heading", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- Common__GPSData__parameter18 = {
- "speed", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__GPSData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__GPSData__parameter18,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__SingleTireStatus__parameter1 = {
- "status", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__SingleTireStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__SingleTireStatus__parameter1,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DIDResult__parameter1 = {
- "resultCode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__DIDResult__parameter2 = {
- "didLocation", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Common__DIDResult__parameter3 = {
- "data", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DIDResult__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DIDResult__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DIDResult__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DIDResult__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HeadLampStatus__parameter1 = {
- "lowBeamsOn", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__HeadLampStatus__parameter2 = {
- "highBeamsOn", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__HeadLampStatus__parameter3 = {
- "ambientLightSensorStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HeadLampStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HeadLampStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HeadLampStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HeadLampStatus__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__TireStatus__parameter1 = {
- "pressureTelltale", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter2 = {
- {"leftFront", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter3 = {
- {"rightFront", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter4 = {
- {"leftRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter5 = {
- {"rightRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter6 = {
- {"innerLeftRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::StructDescription
- Common__TireStatus__parameter7 = {
- {"innerRightRear", ford_message_descriptions::Struct, false},
- Structs::Common__SingleTireStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__TireStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__TireStatus__parameter7,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter1 = {
- "driverBeltDeployed", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter2 = {
- "passengerBeltDeployed", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter3 = {
- "passengerBuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter4 = {
- "driverBuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter5 = {
- "leftRow2BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter6 = {
- "passengerChildDetected", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter7 = {
- "rightRow2BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter8 = {
- "middleRow2BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter9 = {
- "middleRow3BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter10 = {
- "leftRow3BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter11 = {
- "rightRow3BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter12 = {
- "leftRearInflatableBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter13 = {
- "rightRearInflatableBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter14 = {
- "middleRow1BeltDeployed", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__BeltStatus__parameter15 = {
- "middleRow1BuckleBelted", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__BeltStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BeltStatus__parameter15,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter1 = {
- "parkBrakeActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter2 = {
- "ignitionStableStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter3 = {
- "ignitionStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter4 = {
- "driverDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter5 = {
- "passengerDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter6 = {
- "rearLeftDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__BodyInformation__parameter7 = {
- "rearRightDoorAjar", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__BodyInformation__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__BodyInformation__parameter7,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter1 = {
- "voiceRecOn", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter2 = {
- "btIconOn", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter3 = {
- "callActive", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter4 = {
- "phoneRoaming", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter5 = {
- "textMsgAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter6 = {
- "battLevelStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter7 = {
- "stereoAudioOutputMuted", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter8 = {
- "monoAudioOutputMuted", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter9 = {
- "signalLevelStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter10 = {
- "primaryAudioSource", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__DeviceStatus__parameter11 = {
- "eCallEventActive", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__DeviceStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__DeviceStatus__parameter11,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ECallInfo__parameter1 = {
- "eCallNotificationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ECallInfo__parameter2 = {
- "auxECallNotificationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ECallInfo__parameter3 = {
- "eCallConfirmationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ECallInfo__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ECallInfo__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ECallInfo__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ECallInfo__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter1 = {
- "driverAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter2 = {
- "driverSideAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter3 = {
- "driverCurtainAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter4 = {
- "passengerAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter5 = {"passengerCurtainAirbagDeployed",
- ford_message_descriptions::Enum,
- true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter6 = {
- "driverKneeAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter7 = {
- "passengerSideAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__AirbagStatus__parameter8 = {
- "passengerKneeAirbagDeployed", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__AirbagStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__AirbagStatus__parameter8,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter1 = {
- "emergencyEventType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter2 = {
- "fuelCutoffStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter3 = {
- "rolloverEvent", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter4 = {
- "maximumChangeVelocity", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__EmergencyEvent__parameter5 = {
- "multipleEvents", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__EmergencyEvent__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__EmergencyEvent__parameter5,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter1 = {
- "powerModeActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter2 = {
- "powerModeQualificationStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter3 = {
- "carModeStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClusterModeStatus__parameter4 = {
- "powerModeStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ClusterModeStatus__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClusterModeStatus__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__MyKey__parameter1 = {
- "e911Override", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__MyKey__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__MyKey__parameter1,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter1 = {
- "PS", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter2 = {
- "RT", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter3 = {
- "CT", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter4 = {
- "PI", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter5 = {
- "PTY", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter6 = {
- "TP", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter7 = {
- "TA", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RdsData__parameter8 = {
- "REG", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RdsData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RdsData__parameter8,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter1 = {
- "frequencyInteger", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter2 = {
- "frequencyFraction", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter3 = {
- "band", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- Common__RadioControlData__parameter4 = {
- {"rdsData", ford_message_descriptions::Struct, false},
- Structs::Common__RdsData__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter5 = {
- "availableHDs", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter6 = {
- "hdChannel", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter7 = {
- "signalStrength", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter8 = {
- "signalChangeThreshold", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter9 = {
- "radioEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlData__parameter10 = {
- "state", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RadioControlData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlData__parameter10,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter1 = {
- "moduleName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter2 = {
- "radioEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter3 = {
- "radioBandAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter4 = {
- "radioFrequencyAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter5 = {
- "hdChannelAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter6 = {
- "rdsDataAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter7 = {
- "availableHDsAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter8 = {
- "stateAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter9 = {
- "signalStrengthAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__RadioControlCapabilities__parameter10 = {
- "signalChangeThresholdAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RadioControlCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RadioControlCapabilities__parameter10,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Temperature__parameter1 = {
- "unit", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Common__Temperature__parameter2 = {
- "value", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Temperature__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Temperature__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Temperature__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter1 = {
- "fanSpeed", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- Common__ClimateControlData__parameter2 = {
- {"currentTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__Temperature__parameters};
-const ford_message_descriptions::StructDescription
- Common__ClimateControlData__parameter3 = {
- {"desiredTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__Temperature__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter4 = {
- "acEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter5 = {
- "circulateAirEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter6 = {
- "autoModeEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter7 = {
- "defrostZone", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter8 = {
- "dualModeEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter9 = {
- "acMaxEnable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlData__parameter10 = {
- "ventilationMode", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ClimateControlData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlData__parameter10,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter1 = {
- "moduleName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter2 = {
- "currentTemperatureAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter3 = {
- "fanSpeedAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter4 = {
- "desiredTemperatureAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter5 = {
- "acEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter6 = {
- "acMaxEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter7 = {
- "circulateAirEnableAvailable",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter8 = {
- "autoModeEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter9 = {
- "dualModeEnableAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter10 = {
- "defrostZoneAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter11_array = {
- "defrostZone", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__ClimateControlCapabilities__parameter11 = {
- {"defrostZone", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter11_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter12 = {
- "ventilationModeAvailable", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__ClimateControlCapabilities__parameter13_array = {
- "ventilationMode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- Common__ClimateControlCapabilities__parameter13 = {
- {"ventilationMode", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter13_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ClimateControlCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ClimateControlCapabilities__parameter13,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__ModuleData__parameter1 = {
- "moduleType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- Common__ModuleData__parameter2 = {
- {"radioControlData", ford_message_descriptions::Struct, false},
- Structs::Common__RadioControlData__parameters};
-const ford_message_descriptions::StructDescription
- Common__ModuleData__parameter3 = {
- {"climateControlData", ford_message_descriptions::Struct, false},
- Structs::Common__ClimateControlData__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__ModuleData__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ModuleData__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ModuleData__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__ModuleData__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter1 = {
- "millisecond", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter2 = {
- "second", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter3 = {
- "minute", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter4 = {
- "hour", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter5 = {
- "day", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter6 = {
- "month", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter7 = {
- "year", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter8 = {
- "tz_hour", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Common__DateTime__parameter9 = {
- "tz_minute", ford_message_descriptions::Integer, false};
-/*const ford_message_descriptions::ParameterDescription*
- Structs::Common__DateTime__parameters[] = {
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter1,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter2,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter3,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter4,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter5,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter6,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter7,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter8,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter9,
- NULL };*/
-
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter1 = {
- "countryName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter2 = {
- "countryCode", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter3 = {
- "postalCode", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter4 = {
- "administrativeArea", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter5 = {
- "subAdministrativeArea", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter6 = {
- "locality", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter7 = {
- "subLocality", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter8 = {
- "thoroughfare", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__OASISAddress__parameter9 = {
- "subThoroughfare", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__OASISAddress__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__OASISAddress__parameter9,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__LocationDetails__parameter1 = {
- {"coordinate", ford_message_descriptions::Struct, false},
- Structs::Common__Coordinate__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter2 = {
- "locationName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter3_array = {
- "addressLines", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Common__LocationDetails__parameter3 = {
- {"addressLines", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter3_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter4 = {
- "locationDescription", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Common__LocationDetails__parameter5 = {
- "phoneNumber", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Common__LocationDetails__parameter6 = {
- {"locationImage", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- Common__LocationDetails__parameter7 = {
- {"searchAddress", ford_message_descriptions::Struct, false},
- Structs::Common__OASISAddress__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__LocationDetails__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__LocationDetails__parameter7,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__NavigationCapability__parameter1 = {
- "sendLocationEnabled", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- Common__NavigationCapability__parameter2 = {
- "getWayPointsEnabled", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__NavigationCapability__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__NavigationCapability__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__NavigationCapability__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__PhoneCapability__parameter1 = {
- "dialNumberEnabled", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__PhoneCapability__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__PhoneCapability__parameter1,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__VideoStreamingCapability__parameter1 = {
- {"preferredResolution", ford_message_descriptions::Struct, false},
- Structs::Common__ImageResolution__parameters};
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingCapability__parameter2 = {
- "maxBitrate", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- Common__VideoStreamingCapability__parameter3_array = {
- {"supportedFormats", ford_message_descriptions::Struct, true},
- Structs::Common__VideoStreamingFormat__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__VideoStreamingCapability__parameter3 = {
- {"supportedFormats", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter3_array,
- "(ii)"};
-const ford_message_descriptions::ParameterDescription
- Common__VideoStreamingCapability__parameter4 = {
- "hapticSpatialDataSupported",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__VideoStreamingCapability__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__VideoStreamingCapability__parameter4,
- NULL};
-
-const ford_message_descriptions::StructDescription
- Common__SystemCapabilities__parameter1 = {
- {"navigationCapability", ford_message_descriptions::Struct, false},
- Structs::Common__NavigationCapability__parameters};
-const ford_message_descriptions::StructDescription
- Common__SystemCapabilities__parameter2 = {
- {"phoneCapability", ford_message_descriptions::Struct, false},
- Structs::Common__PhoneCapability__parameters};
-const ford_message_descriptions::StructDescription
- Common__SystemCapabilities__parameter3 = {
- {"videoStreamingCapability", ford_message_descriptions::Struct, false},
- Structs::Common__VideoStreamingCapability__parameters};
-/*const ford_message_descriptions::ParameterDescription*
- Structs::Common__SystemCapabilities__parameters[] = {
- (const
- ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter1,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter2,
- (const
- ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter3,
- NULL };*/
-
-const ford_message_descriptions::StructDescription
- Common__RemoteControlCapabilities__parameter1_array = {
- {"climateControlCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ClimateControlCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__RemoteControlCapabilities__parameter1 = {
- {"climateControlCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter1_array,
- "(s(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bai)(bb)(bai))"};
-const ford_message_descriptions::StructDescription
- Common__RemoteControlCapabilities__parameter2_array = {
- {"radioControlCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__RadioControlCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__RemoteControlCapabilities__parameter2 = {
- {"radioControlCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter2_array,
- "(s(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb))"};
-const ford_message_descriptions::StructDescription
- Common__RemoteControlCapabilities__parameter3_array = {
- {"buttonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Common__RemoteControlCapabilities__parameter3 = {
- {"buttonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter3_array,
- "(ibbb)"};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__RemoteControlCapabilities__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__RemoteControlCapabilities__parameter3,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter1 = {
- "x", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter2 = {
- "y", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter3 = {
- "width", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Common__Rectangle__parameter4 = {
- "height", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__Rectangle__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__Rectangle__parameter4,
- NULL};
-
-const ford_message_descriptions::ParameterDescription
- Common__HapticRect__parameter1 = {
- "id", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- Common__HapticRect__parameter2 = {
- {"rect", ford_message_descriptions::Struct, true},
- Structs::Common__Rectangle__parameters};
-const ford_message_descriptions::ParameterDescription*
- Structs::Common__HapticRect__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HapticRect__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Common__HapticRect__parameter2,
- NULL};
-
-const ford_message_descriptions::ParameterDescription*
- Buttons__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__GetCapabilities__request = {
- "Buttons",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Buttons_GetCapabilities,
- Buttons__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::StructDescription
- Buttons__GetCapabilities__response__parameter1_array = {
- {"capabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- Buttons__GetCapabilities__response__parameter1 = {
- {"capabilities", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__GetCapabilities__response__parameter1_array,
- "(ibbb)"};
-const ford_message_descriptions::StructDescription
- Buttons__GetCapabilities__response__parameter2 = {
- {"presetBankCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__PresetBankCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- Buttons__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__GetCapabilities__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__GetCapabilities__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__GetCapabilities__response = {
- "Buttons",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Buttons_GetCapabilities,
- Buttons__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter2 = {
- "mode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter3 = {
- "customButtonID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonEvent__notification__parameter4 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Buttons__OnButtonEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__OnButtonEvent__notification = {
- "Buttons",
- "OnButtonEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Buttons_OnButtonEvent,
- Buttons__OnButtonEvent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter2 = {
- "mode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter3 = {
- "customButtonID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonPress__notification__parameter4 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- Buttons__OnButtonPress__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonPress__notification__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__OnButtonPress__notification = {
- "Buttons",
- "OnButtonPress",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Buttons_OnButtonPress,
- Buttons__OnButtonPress__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonSubscription__notification__parameter1 = {
- "name", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonSubscription__notification__parameter2 = {
- "isSubscribed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- Buttons__OnButtonSubscription__notification__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Buttons__OnButtonSubscription__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- Buttons__OnButtonSubscription__notification = {
- "Buttons",
- "OnButtonSubscription",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Buttons_OnButtonSubscription,
- Buttons__OnButtonSubscription__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnReady__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnReady__notification = {
- "BasicCommunication",
- "OnReady",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnReady,
- BasicCommunication__OnReady__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnStartDeviceDiscovery__notification__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnStartDeviceDiscovery__notification = {
- "BasicCommunication",
- "OnStartDeviceDiscovery",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery,
- BasicCommunication__OnStartDeviceDiscovery__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnUpdateDeviceList__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnUpdateDeviceList__notification = {
- "BasicCommunication",
- "OnUpdateDeviceList",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList,
- BasicCommunication__OnUpdateDeviceList__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPhoneCall__notification__parameter1 = {
- "isActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnPhoneCall__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPhoneCall__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnPhoneCall__notification = {
- "BasicCommunication",
- "OnPhoneCall",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnPhoneCall,
- BasicCommunication__OnPhoneCall__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnEmergencyEvent__notification__parameter1 = {
- "enabled", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnEmergencyEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnEmergencyEvent__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnEmergencyEvent__notification = {
- "BasicCommunication",
- "OnEmergencyEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnEmergencyEvent,
- BasicCommunication__OnEmergencyEvent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnResumeAudioSource__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnResumeAudioSource__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnResumeAudioSource__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnResumeAudioSource__notification = {
- "BasicCommunication",
- "OnResumeAudioSource",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource,
- BasicCommunication__OnResumeAudioSource__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSDLPersistenceComplete__notification__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSDLPersistenceComplete__notification = {
- "BasicCommunication",
- "OnSDLPersistenceComplete",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete,
- BasicCommunication__OnSDLPersistenceComplete__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__UpdateAppList__request__parameter1_array = {
- {"applications", ford_message_descriptions::Struct, true},
- Structs::Common__HMIApplication__parameters};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__UpdateAppList__request__parameter1 = {
- {"applications", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateAppList__request__parameter1_array,
- "(s(bs)(bs)(ss(bi)(bb))s(ba(si))(bas)iib(bai)(bb)(bai))"};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateAppList__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateAppList__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateAppList__request = {
- "BasicCommunication",
- "UpdateAppList",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_UpdateAppList,
- BasicCommunication__UpdateAppList__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateAppList__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateAppList__response = {
- "BasicCommunication",
- "UpdateAppList",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_UpdateAppList,
- BasicCommunication__UpdateAppList__response__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__UpdateDeviceList__request__parameter1_array = {
- {"deviceList", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__UpdateDeviceList__request__parameter1 = {
- {"deviceList", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateDeviceList__request__parameter1_array,
- "(ss(bi)(bb))"};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateDeviceList__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__UpdateDeviceList__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateDeviceList__request = {
- "BasicCommunication",
- "UpdateDeviceList",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList,
- BasicCommunication__UpdateDeviceList__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__UpdateDeviceList__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__UpdateDeviceList__response = {
- "BasicCommunication",
- "UpdateDeviceList",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList,
- BasicCommunication__UpdateDeviceList__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnFileRemoved__notification__parameter1 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnFileRemoved__notification__parameter2 = {
- "fileType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnFileRemoved__notification__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnFileRemoved__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnFileRemoved__notification = {
- "BasicCommunication",
- "OnFileRemoved",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
- BasicCommunication__OnFileRemoved__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__AllowDeviceToConnect__request__parameter1 = {
- {"device", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__AllowDeviceToConnect__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__AllowDeviceToConnect__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__AllowDeviceToConnect__request = {
- "BasicCommunication",
- "AllowDeviceToConnect",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_AllowDeviceToConnect,
- BasicCommunication__AllowDeviceToConnect__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__AllowDeviceToConnect__response__parameter1 = {
- "allow", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__AllowDeviceToConnect__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__AllowDeviceToConnect__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__AllowDeviceToConnect__response = {
- "BasicCommunication",
- "AllowDeviceToConnect",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_AllowDeviceToConnect,
- BasicCommunication__AllowDeviceToConnect__response__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnDeviceChosen__notification__parameter1 = {
- {"deviceInfo", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnDeviceChosen__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnDeviceChosen__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnDeviceChosen__notification = {
- "BasicCommunication",
- "OnDeviceChosen",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen,
- BasicCommunication__OnDeviceChosen__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnFindApplications__notification__parameter1 = {
- {"deviceInfo", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnFindApplications__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnFindApplications__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnFindApplications__notification = {
- "BasicCommunication",
- "OnFindApplications",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnFindApplications,
- BasicCommunication__OnFindApplications__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__ActivateApp__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__ActivateApp__request__parameter2 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__ActivateApp__request__parameter3 = {
- "level", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__ActivateApp__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__ActivateApp__request = {
- "BasicCommunication",
- "ActivateApp",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- BasicCommunication__ActivateApp__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__ActivateApp__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__ActivateApp__response = {
- "BasicCommunication",
- "ActivateApp",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- BasicCommunication__ActivateApp__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppActivated__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppActivated__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppActivated__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppActivated__notification = {
- "BasicCommunication",
- "OnAppActivated",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppActivated,
- BasicCommunication__OnAppActivated__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppDeactivated__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppDeactivated__notification__parameter2 = {
- "reason", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppDeactivated__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppDeactivated__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppDeactivated__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppDeactivated__notification = {
- "BasicCommunication",
- "OnAppDeactivated",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated,
- BasicCommunication__OnAppDeactivated__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnAppRegistered__notification__parameter1 = {
- {"application", ford_message_descriptions::Struct, true},
- Structs::Common__HMIApplication__parameters};
-const ford_message_descriptions::StructDescription
- BasicCommunication__OnAppRegistered__notification__parameter2_array = {
- {"ttsName", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__OnAppRegistered__notification__parameter2 = {
- {"ttsName", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter2_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppRegistered__notification__parameter3_array = {
- "vrSynonyms", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__OnAppRegistered__notification__parameter3 = {
- {"vrSynonyms", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter3_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppRegistered__notification__parameter4 = {
- "resumeVrGrammars", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppRegistered__notification__parameter5 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppRegistered__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppRegistered__notification = {
- "BasicCommunication",
- "OnAppRegistered",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered,
- BasicCommunication__OnAppRegistered__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppUnregistered__notification__parameter1 = {
- "unexpectedDisconnect", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnAppUnregistered__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAppUnregistered__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppUnregistered__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnAppUnregistered__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAppUnregistered__notification = {
- "BasicCommunication",
- "OnAppUnregistered",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered,
- BasicCommunication__OnAppUnregistered__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnExitApplication__notification__parameter1 = {
- "reason", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnExitApplication__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnExitApplication__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnExitApplication__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnExitApplication__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnExitApplication__notification = {
- "BasicCommunication",
- "OnExitApplication",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnExitApplication,
- BasicCommunication__OnExitApplication__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnExitAllApplications__notification__parameter1 = {
- "reason", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnExitAllApplications__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnExitAllApplications__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnExitAllApplications__notification = {
- "BasicCommunication",
- "OnExitAllApplications",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications,
- BasicCommunication__OnExitAllApplications__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnAwakeSDL__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnAwakeSDL__notification = {
- "BasicCommunication",
- "OnAwakeSDL",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL,
- BasicCommunication__OnAwakeSDL__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__MixingAudioSupported__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__MixingAudioSupported__request = {
- "BasicCommunication",
- "MixingAudioSupported",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
- BasicCommunication__MixingAudioSupported__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__MixingAudioSupported__response__parameter1 = {
- "attenuatedSupported", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__MixingAudioSupported__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__MixingAudioSupported__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__MixingAudioSupported__response = {
- "BasicCommunication",
- "MixingAudioSupported",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
- BasicCommunication__MixingAudioSupported__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PlayTone__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PlayTone__notification__parameter2 = {
- "methodName", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__PlayTone__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PlayTone__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PlayTone__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__PlayTone__notification = {
- "BasicCommunication",
- "PlayTone",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_PlayTone,
- BasicCommunication__PlayTone__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__DialNumber__request__parameter1 = {
- "number", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__DialNumber__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DialNumber__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__DialNumber__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__DialNumber__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DialNumber__request = {
- "BasicCommunication",
- "DialNumber",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_DialNumber,
- BasicCommunication__DialNumber__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DialNumber__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DialNumber__response = {
- "BasicCommunication",
- "DialNumber",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_DialNumber,
- BasicCommunication__DialNumber__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter1 = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter2 = {
- "url", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter3 = {
- "fileType", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter4 = {
- "offset", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter5 = {
- "length", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter6 = {
- "timeout", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter7 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemRequest__notification__parameter8 = {
- "appID", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSystemRequest__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSystemRequest__notification = {
- "BasicCommunication",
- "OnSystemRequest",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSystemRequest,
- BasicCommunication__OnSystemRequest__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__SystemRequest__request__parameter1 = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__SystemRequest__request__parameter2 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__SystemRequest__request__parameter3 = {
- "appID", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__SystemRequest__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__SystemRequest__request = {
- "BasicCommunication",
- "SystemRequest",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_SystemRequest,
- BasicCommunication__SystemRequest__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__SystemRequest__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__SystemRequest__response = {
- "BasicCommunication",
- "SystemRequest",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_SystemRequest,
- BasicCommunication__SystemRequest__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PolicyUpdate__request__parameter1 = {
- "file", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PolicyUpdate__request__parameter2 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__PolicyUpdate__request__parameter3_array = {
- "retry", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- BasicCommunication__PolicyUpdate__request__parameter3 = {
- {"retry", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter3_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__PolicyUpdate__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__PolicyUpdate__request = {
- "BasicCommunication",
- "PolicyUpdate",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_PolicyUpdate,
- BasicCommunication__PolicyUpdate__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__PolicyUpdate__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__PolicyUpdate__response = {
- "BasicCommunication",
- "PolicyUpdate",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_PolicyUpdate,
- BasicCommunication__PolicyUpdate__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSDLClose__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSDLClose__notification = {
- "BasicCommunication",
- "OnSDLClose",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSDLClose,
- BasicCommunication__OnSDLClose__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter1 = {
- "offset", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter2 = {
- "length", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter3 = {
- "fileSize", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter4 = {
- "FileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter5 = {
- "syncFileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter6 = {
- "fileType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnPutFile__notification__parameter7 = {
- "persistentFile", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnPutFile__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnPutFile__notification = {
- "BasicCommunication",
- "OnPutFile",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnPutFile,
- BasicCommunication__OnPutFile__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__GetSystemInfo__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__GetSystemInfo__request = {
- "BasicCommunication",
- "GetSystemInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_GetSystemInfo,
- BasicCommunication__GetSystemInfo__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__GetSystemInfo__response__parameter1 = {
- "ccpu_version", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__GetSystemInfo__response__parameter2 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__GetSystemInfo__response__parameter3 = {
- "wersCountryCode", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__GetSystemInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__GetSystemInfo__response = {
- "BasicCommunication",
- "GetSystemInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_GetSystemInfo,
- BasicCommunication__GetSystemInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnSystemInfoChanged__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnSystemInfoChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnSystemInfoChanged__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnSystemInfoChanged__notification = {
- "BasicCommunication",
- "OnSystemInfoChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged,
- BasicCommunication__OnSystemInfoChanged__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnIgnitionCycleOver__notification__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnIgnitionCycleOver__notification = {
- "BasicCommunication",
- "OnIgnitionCycleOver",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver,
- BasicCommunication__OnIgnitionCycleOver__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__DecryptCertificate__request__parameter1 = {
- "fileName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DecryptCertificate__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__DecryptCertificate__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DecryptCertificate__request = {
- "BasicCommunication",
- "DecryptCertificate",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::BasicCommunication_DecryptCertificate,
- BasicCommunication__DecryptCertificate__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__DecryptCertificate__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__DecryptCertificate__response = {
- "BasicCommunication",
- "DecryptCertificate",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::BasicCommunication_DecryptCertificate,
- BasicCommunication__DecryptCertificate__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnEventChanged__notification__parameter1 = {
- "eventName", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- BasicCommunication__OnEventChanged__notification__parameter2 = {
- "isActive", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- BasicCommunication__OnEventChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnEventChanged__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&BasicCommunication__OnEventChanged__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- BasicCommunication__OnEventChanged__notification = {
- "BasicCommunication",
- "OnEventChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::BasicCommunication_OnEventChanged,
- BasicCommunication__OnEventChanged__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__IsReady__request = {
- "VR",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_IsReady,
- VR__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- VR__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription VR__IsReady__response = {
- "VR",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_IsReady,
- VR__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__Started__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__Started__notification =
- {"VR",
- "Started",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_Started,
- VR__Started__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__Stopped__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__Stopped__notification =
- {"VR",
- "Stopped",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_Stopped,
- VR__Stopped__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter2_array = {
- "vrCommands", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- VR__AddCommand__request__parameter2 = {
- {"vrCommands", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter2_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter3 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter4 = {
- "grammarID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__AddCommand__request__parameter5 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- VR__AddCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__AddCommand__request__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription VR__AddCommand__request = {
- "VR",
- "AddCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_AddCommand,
- VR__AddCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__AddCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__AddCommand__response = {
- "VR",
- "AddCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_AddCommand,
- VR__AddCommand__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter2 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter3 = {
- "grammarID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__DeleteCommand__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VR__DeleteCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__DeleteCommand__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription VR__DeleteCommand__request =
- {"VR",
- "DeleteCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_DeleteCommand,
- VR__DeleteCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__DeleteCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__DeleteCommand__response = {"VR",
- "DeleteCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_DeleteCommand,
- VR__DeleteCommand__response__parameters};
-
-const ford_message_descriptions::StructDescription
- VR__PerformInteraction__request__parameter1_array = {
- {"helpPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter1 = {
- {"helpPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::StructDescription
- VR__PerformInteraction__request__parameter2_array = {
- {"initialPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter2 = {
- {"initialPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter2_array,
- "(si)"};
-const ford_message_descriptions::StructDescription
- VR__PerformInteraction__request__parameter3_array = {
- {"timeoutPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter3 = {
- {"timeoutPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter3_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- VR__PerformInteraction__request__parameter4 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__PerformInteraction__request__parameter5_array = {
- "grammarID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VR__PerformInteraction__request__parameter5 = {
- {"grammarID", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter5_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VR__PerformInteraction__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__request__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__PerformInteraction__request = {
- "VR",
- "PerformInteraction",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_PerformInteraction,
- VR__PerformInteraction__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__PerformInteraction__response__parameter1 = {
- "choiceID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- VR__PerformInteraction__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__PerformInteraction__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__PerformInteraction__response = {
- "VR",
- "PerformInteraction",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_PerformInteraction,
- VR__PerformInteraction__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__OnCommand__notification__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VR__OnCommand__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VR__OnCommand__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__OnCommand__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__OnCommand__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__OnCommand__notification = {"VR",
- "OnCommand",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_OnCommand,
- VR__OnCommand__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__ChangeRegistration__request__parameter1_array = {
- "vrSynonyms", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- VR__ChangeRegistration__request__parameter1 = {
- {"vrSynonyms", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter1_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- VR__ChangeRegistration__request__parameter2 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- VR__ChangeRegistration__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VR__ChangeRegistration__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VR__ChangeRegistration__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__ChangeRegistration__request = {
- "VR",
- "ChangeRegistration",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_ChangeRegistration,
- VR__ChangeRegistration__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__ChangeRegistration__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__ChangeRegistration__response = {
- "VR",
- "ChangeRegistration",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_ChangeRegistration,
- VR__ChangeRegistration__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__OnLanguageChange__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VR__OnLanguageChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__OnLanguageChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__OnLanguageChange__notification = {
- "VR",
- "OnLanguageChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VR_OnLanguageChange,
- VR__OnLanguageChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__GetSupportedLanguages__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetSupportedLanguages__request = {
- "VR",
- "GetSupportedLanguages",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_GetSupportedLanguages,
- VR__GetSupportedLanguages__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__GetSupportedLanguages__response__parameter1_array = {
- "languages", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- VR__GetSupportedLanguages__response__parameter1 = {
- {"languages", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetSupportedLanguages__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VR__GetSupportedLanguages__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetSupportedLanguages__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetSupportedLanguages__response = {
- "VR",
- "GetSupportedLanguages",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_GetSupportedLanguages,
- VR__GetSupportedLanguages__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__GetLanguage__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription VR__GetLanguage__request = {
- "VR",
- "GetLanguage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_GetLanguage,
- VR__GetLanguage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__GetLanguage__response__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VR__GetLanguage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetLanguage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription VR__GetLanguage__response =
- {"VR",
- "GetLanguage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_GetLanguage,
- VR__GetLanguage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VR__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetCapabilities__request = {"VR",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VR_GetCapabilities,
- VR__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VR__GetCapabilities__response__parameter1_array = {
- "vrCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- VR__GetCapabilities__response__parameter1 = {
- {"vrCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetCapabilities__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VR__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VR__GetCapabilities__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VR__GetCapabilities__response = {"VR",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VR_GetCapabilities,
- VR__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetCapabilities__request = {"TTS",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_GetCapabilities,
- TTS__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__GetCapabilities__response__parameter1_array = {
- "speechCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- TTS__GetCapabilities__response__parameter1 = {
- {"speechCapabilities", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- TTS__GetCapabilities__response__parameter2_array = {
- "prerecordedSpeechCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- TTS__GetCapabilities__response__parameter2 = {
- {"prerecordedSpeechCapabilities",
- ford_message_descriptions::Array,
- true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter2_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- TTS__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetCapabilities__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetCapabilities__response = {
- "TTS",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_GetCapabilities,
- TTS__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__Started__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__Started__notification =
- {"TTS",
- "Started",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_Started,
- TTS__Started__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__Stopped__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__Stopped__notification =
- {"TTS",
- "Stopped",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_Stopped,
- TTS__Stopped__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__IsReady__request = {
- "TTS",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_IsReady,
- TTS__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription TTS__IsReady__response = {
- "TTS",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_IsReady,
- TTS__IsReady__response__parameters};
-
-const ford_message_descriptions::StructDescription
- TTS__Speak__request__parameter1_array = {
- {"ttsChunks", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__Speak__request__parameter1 = {
- {"ttsChunks", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- TTS__Speak__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- TTS__Speak__request__parameter3 = {
- "speakType", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- TTS__Speak__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__Speak__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription TTS__Speak__request = {
- "TTS",
- "Speak",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_Speak,
- TTS__Speak__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__Speak__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__Speak__response = {
- "TTS",
- "Speak",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_Speak,
- TTS__Speak__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__StopSpeaking__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__StopSpeaking__request =
- {"TTS",
- "StopSpeaking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_StopSpeaking,
- TTS__StopSpeaking__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__StopSpeaking__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__StopSpeaking__response = {"TTS",
- "StopSpeaking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_StopSpeaking,
- TTS__StopSpeaking__response__parameters};
-
-const ford_message_descriptions::StructDescription
- TTS__ChangeRegistration__request__parameter1_array = {
- {"ttsName", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__ChangeRegistration__request__parameter1 = {
- {"ttsName", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- TTS__ChangeRegistration__request__parameter2 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- TTS__ChangeRegistration__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__ChangeRegistration__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__ChangeRegistration__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__ChangeRegistration__request = {
- "TTS",
- "ChangeRegistration",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_ChangeRegistration,
- TTS__ChangeRegistration__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__ChangeRegistration__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__ChangeRegistration__response = {
- "TTS",
- "ChangeRegistration",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_ChangeRegistration,
- TTS__ChangeRegistration__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__OnLanguageChange__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__OnLanguageChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__OnLanguageChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__OnLanguageChange__notification = {
- "TTS",
- "OnLanguageChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_OnLanguageChange,
- TTS__OnLanguageChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__GetSupportedLanguages__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetSupportedLanguages__request = {
- "TTS",
- "GetSupportedLanguages",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_GetSupportedLanguages,
- TTS__GetSupportedLanguages__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__GetSupportedLanguages__response__parameter1_array = {
- "languages", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- TTS__GetSupportedLanguages__response__parameter1 = {
- {"languages", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetSupportedLanguages__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- TTS__GetSupportedLanguages__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetSupportedLanguages__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__GetSupportedLanguages__response = {
- "TTS",
- "GetSupportedLanguages",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_GetSupportedLanguages,
- TTS__GetSupportedLanguages__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__GetLanguage__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription TTS__GetLanguage__request =
- {"TTS",
- "GetLanguage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_GetLanguage,
- TTS__GetLanguage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__GetLanguage__response__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__GetLanguage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__GetLanguage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription TTS__GetLanguage__response =
- {"TTS",
- "GetLanguage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_GetLanguage,
- TTS__GetLanguage__response__parameters};
-
-const ford_message_descriptions::StructDescription
- TTS__SetGlobalProperties__request__parameter1_array = {
- {"helpPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__SetGlobalProperties__request__parameter1 = {
- {"helpPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter1_array,
- "(si)"};
-const ford_message_descriptions::StructDescription
- TTS__SetGlobalProperties__request__parameter2_array = {
- {"timeoutPrompt", ford_message_descriptions::Struct, true},
- Structs::Common__TTSChunk__parameters};
-const ford_message_descriptions::ArrayDescription
- TTS__SetGlobalProperties__request__parameter2 = {
- {"timeoutPrompt", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter2_array,
- "(si)"};
-const ford_message_descriptions::ParameterDescription
- TTS__SetGlobalProperties__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__SetGlobalProperties__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__SetGlobalProperties__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__SetGlobalProperties__request = {
- "TTS",
- "SetGlobalProperties",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::TTS_SetGlobalProperties,
- TTS__SetGlobalProperties__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- TTS__SetGlobalProperties__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- TTS__SetGlobalProperties__response = {
- "TTS",
- "SetGlobalProperties",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::TTS_SetGlobalProperties,
- TTS__SetGlobalProperties__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- TTS__OnResetTimeout__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- TTS__OnResetTimeout__notification__parameter2 = {
- "methodName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- TTS__OnResetTimeout__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__OnResetTimeout__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&TTS__OnResetTimeout__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- TTS__OnResetTimeout__notification = {
- "TTS",
- "OnResetTimeout",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::TTS_OnResetTimeout,
- TTS__OnResetTimeout__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__Alert__request__parameter1_array = {
- {"alertStrings", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Alert__request__parameter1 = {
- {"alertStrings", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter1_array,
- "(is)"};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter2 = {
- "duration", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__Alert__request__parameter3_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Alert__request__parameter3 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter3_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter4 = {
- "progressIndicator", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter5 = {
- "alertType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__Alert__request__parameter6 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__Alert__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__request__parameter6,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Alert__request = {
- "UI",
- "Alert",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_Alert,
- UI__Alert__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__Alert__response__parameter1 = {
- "tryAgainTime", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- UI__Alert__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Alert__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Alert__response = {
- "UI",
- "Alert",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_Alert,
- UI__Alert__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter1_array = {
- {"showStrings", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Show__request__parameter1 = {
- {"showStrings", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter1_array,
- "(is)"};
-const ford_message_descriptions::ParameterDescription
- UI__Show__request__parameter2 = {
- "alignment", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter3 = {
- {"graphic", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter4 = {
- {"secondaryGraphic", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- UI__Show__request__parameter5_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__Show__request__parameter5 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter5_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- UI__Show__request__parameter6_array = {
- "customPresets", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- UI__Show__request__parameter6 = {
- {"customPresets", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter6_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- UI__Show__request__parameter7 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__Show__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Show__request__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Show__request = {
- "UI",
- "Show",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_Show,
- UI__Show__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__Show__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__Show__response = {
- "UI",
- "Show",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_Show,
- UI__Show__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__AddCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__AddCommand__request__parameter2 = {
- {"menuParams", ford_message_descriptions::Struct, false},
- Structs::Common__MenuParams__parameters};
-const ford_message_descriptions::StructDescription
- UI__AddCommand__request__parameter3 = {
- {"cmdIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__AddCommand__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__AddCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddCommand__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription UI__AddCommand__request = {
- "UI",
- "AddCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_AddCommand,
- UI__AddCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__AddCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__AddCommand__response = {
- "UI",
- "AddCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_AddCommand,
- UI__AddCommand__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__DeleteCommand__request__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__DeleteCommand__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteCommand__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteCommand__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteCommand__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription UI__DeleteCommand__request =
- {"UI",
- "DeleteCommand",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_DeleteCommand,
- UI__DeleteCommand__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteCommand__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__DeleteCommand__response = {"UI",
- "DeleteCommand",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_DeleteCommand,
- UI__DeleteCommand__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__AddSubMenu__request__parameter1 = {
- "menuID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__AddSubMenu__request__parameter2 = {
- {"menuParams", ford_message_descriptions::Struct, true},
- Structs::Common__MenuParams__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__AddSubMenu__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__AddSubMenu__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddSubMenu__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddSubMenu__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__AddSubMenu__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription UI__AddSubMenu__request = {
- "UI",
- "AddSubMenu",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_AddSubMenu,
- UI__AddSubMenu__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__AddSubMenu__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__AddSubMenu__response = {
- "UI",
- "AddSubMenu",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_AddSubMenu,
- UI__AddSubMenu__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__DeleteSubMenu__request__parameter1 = {
- "menuID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__DeleteSubMenu__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteSubMenu__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteSubMenu__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__DeleteSubMenu__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription UI__DeleteSubMenu__request =
- {"UI",
- "DeleteSubMenu",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_DeleteSubMenu,
- UI__DeleteSubMenu__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__DeleteSubMenu__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__DeleteSubMenu__response = {"UI",
- "DeleteSubMenu",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_DeleteSubMenu,
- UI__DeleteSubMenu__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__PerformInteraction__request__parameter1 = {
- {"initialText", ford_message_descriptions::Struct, false},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::StructDescription
- UI__PerformInteraction__request__parameter2_array = {
- {"choiceSet", ford_message_descriptions::Struct, true},
- Structs::Common__Choice__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__PerformInteraction__request__parameter2 = {
- {"choiceSet", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter2_array,
- "(i(bs)(b(si))(bs)(bs)(b(si)))"};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter3 = {
- "vrHelpTitle", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- UI__PerformInteraction__request__parameter4_array = {
- {"vrHelp", ford_message_descriptions::Struct, true},
- Structs::Common__VrHelpItem__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__PerformInteraction__request__parameter4 = {
- {"vrHelp", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter4_array,
- "(s(b(si))i)"};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter5 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter6 = {
- "interactionLayout", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__request__parameter7 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__PerformInteraction__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__request__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformInteraction__request = {
- "UI",
- "PerformInteraction",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_PerformInteraction,
- UI__PerformInteraction__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__response__parameter1 = {
- "choiceID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- UI__PerformInteraction__response__parameter2 = {
- "manualTextEntry", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__PerformInteraction__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformInteraction__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformInteraction__response = {
- "UI",
- "PerformInteraction",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_PerformInteraction,
- UI__PerformInteraction__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__SetMediaClockTimer__request__parameter1 = {
- {"startTime", ford_message_descriptions::Struct, false},
- Structs::Common__TimeFormat__parameters};
-const ford_message_descriptions::StructDescription
- UI__SetMediaClockTimer__request__parameter2 = {
- {"endTime", ford_message_descriptions::Struct, false},
- Structs::Common__TimeFormat__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__SetMediaClockTimer__request__parameter3 = {
- "updateMode", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__SetMediaClockTimer__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetMediaClockTimer__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetMediaClockTimer__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetMediaClockTimer__request = {
- "UI",
- "SetMediaClockTimer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetMediaClockTimer,
- UI__SetMediaClockTimer__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SetMediaClockTimer__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetMediaClockTimer__response = {
- "UI",
- "SetMediaClockTimer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetMediaClockTimer,
- UI__SetMediaClockTimer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__SetGlobalProperties__request__parameter1 = {
- "vrHelpTitle", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- UI__SetGlobalProperties__request__parameter2_array = {
- {"vrHelp", ford_message_descriptions::Struct, true},
- Structs::Common__VrHelpItem__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SetGlobalProperties__request__parameter2 = {
- {"vrHelp", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter2_array,
- "(s(b(si))i)"};
-const ford_message_descriptions::ParameterDescription
- UI__SetGlobalProperties__request__parameter3 = {
- "menuTitle", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- UI__SetGlobalProperties__request__parameter4 = {
- {"menuIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- UI__SetGlobalProperties__request__parameter5 = {
- {"keyboardProperties", ford_message_descriptions::Struct, false},
- Structs::Common__KeyboardProperties__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__SetGlobalProperties__request__parameter6 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetGlobalProperties__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetGlobalProperties__request__parameter6,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetGlobalProperties__request = {
- "UI",
- "SetGlobalProperties",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetGlobalProperties,
- UI__SetGlobalProperties__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SetGlobalProperties__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetGlobalProperties__response = {
- "UI",
- "SetGlobalProperties",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetGlobalProperties,
- UI__SetGlobalProperties__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnCommand__notification__parameter1 = {
- "cmdID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnCommand__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnCommand__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnCommand__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnCommand__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnCommand__notification = {"UI",
- "OnCommand",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnCommand,
- UI__OnCommand__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnSystemContext__notification__parameter1 = {
- "systemContext", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnSystemContext__notification__parameter2 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- UI__OnSystemContext__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnSystemContext__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnSystemContext__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnSystemContext__notification = {
- "UI",
- "OnSystemContext",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnSystemContext,
- UI__OnSystemContext__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetCapabilities__request = {"UI",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_GetCapabilities,
- UI__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter1 = {
- {"displayCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__DisplayCapabilities__parameters};
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter2 = {
- {"audioPassThruCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__AudioPassThruCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__GetCapabilities__response__parameter3 = {
- "hmiZoneCapabilities", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter4_array = {
- {"softButtonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__GetCapabilities__response__parameter4 = {
- {"softButtonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter4_array,
- "(bbbb)"};
-const ford_message_descriptions::StructDescription
- UI__GetCapabilities__response__parameter5 = {
- {"hmiCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__HMICapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- UI__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetCapabilities__response__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetCapabilities__response = {"UI",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_GetCapabilities,
- UI__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter1 = {
- "appName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter2 = {
- "ngnMediaScreenAppName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter3 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter4_array = {
- "appHMIType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- UI__ChangeRegistration__request__parameter4 = {
- {"appHMIType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter4_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- UI__ChangeRegistration__request__parameter5 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__ChangeRegistration__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ChangeRegistration__request__parameter5,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ChangeRegistration__request = {
- "UI",
- "ChangeRegistration",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ChangeRegistration,
- UI__ChangeRegistration__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__ChangeRegistration__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__ChangeRegistration__response = {
- "UI",
- "ChangeRegistration",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ChangeRegistration,
- UI__ChangeRegistration__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnLanguageChange__notification__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnLanguageChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnLanguageChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnLanguageChange__notification = {
- "UI",
- "OnLanguageChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnLanguageChange,
- UI__OnLanguageChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__GetSupportedLanguages__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetSupportedLanguages__request = {
- "UI",
- "GetSupportedLanguages",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_GetSupportedLanguages,
- UI__GetSupportedLanguages__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__GetSupportedLanguages__response__parameter1_array = {
- "languages", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- UI__GetSupportedLanguages__response__parameter1 = {
- {"languages", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetSupportedLanguages__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- UI__GetSupportedLanguages__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetSupportedLanguages__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__GetSupportedLanguages__response = {
- "UI",
- "GetSupportedLanguages",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_GetSupportedLanguages,
- UI__GetSupportedLanguages__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__GetLanguage__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__GetLanguage__request = {
- "UI",
- "GetLanguage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_GetLanguage,
- UI__GetLanguage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__GetLanguage__response__parameter1 = {
- "language", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- UI__GetLanguage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__GetLanguage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__GetLanguage__response =
- {"UI",
- "GetLanguage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_GetLanguage,
- UI__GetLanguage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnDriverDistraction__notification__parameter1 = {
- "state", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnDriverDistraction__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnDriverDistraction__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnDriverDistraction__notification = {
- "UI",
- "OnDriverDistraction",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnDriverDistraction,
- UI__OnDriverDistraction__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__SetAppIcon__request__parameter1 = {
- {"syncFileName", ford_message_descriptions::Struct, true},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__SetAppIcon__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetAppIcon__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetAppIcon__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetAppIcon__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription UI__SetAppIcon__request = {
- "UI",
- "SetAppIcon",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetAppIcon,
- UI__SetAppIcon__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SetAppIcon__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__SetAppIcon__response = {
- "UI",
- "SetAppIcon",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetAppIcon,
- UI__SetAppIcon__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__SetDisplayLayout__request__parameter1 = {
- "displayLayout", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- UI__SetDisplayLayout__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__SetDisplayLayout__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetDisplayLayout__request = {"UI",
- "SetDisplayLayout",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SetDisplayLayout,
- UI__SetDisplayLayout__request__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter1 = {
- {"displayCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__DisplayCapabilities__parameters};
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter2_array = {
- {"buttonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__ButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SetDisplayLayout__response__parameter2 = {
- {"buttonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter2_array,
- "(ibbb)"};
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter3_array = {
- {"softButtonCapabilities", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButtonCapabilities__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SetDisplayLayout__response__parameter3 = {
- {"softButtonCapabilities", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter3_array,
- "(bbbb)"};
-const ford_message_descriptions::StructDescription
- UI__SetDisplayLayout__response__parameter4 = {
- {"presetBankCapabilities", ford_message_descriptions::Struct, false},
- Structs::Common__PresetBankCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- UI__SetDisplayLayout__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SetDisplayLayout__response__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SetDisplayLayout__response = {
- "UI",
- "SetDisplayLayout",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SetDisplayLayout,
- UI__SetDisplayLayout__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ShowCustomForm__request__parameter1 = {
- "customFormID", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- UI__ShowCustomForm__request__parameter2 = {
- "parentFormID", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__ShowCustomForm__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ShowCustomForm__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ShowCustomForm__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ShowCustomForm__request = {"UI",
- "ShowCustomForm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ShowCustomForm,
- UI__ShowCustomForm__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ShowCustomForm__response__parameter1 = {
- "info", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__ShowCustomForm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ShowCustomForm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ShowCustomForm__response = {"UI",
- "ShowCustomForm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ShowCustomForm,
- UI__ShowCustomForm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnKeyboardInput__notification__parameter1 = {
- "event", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnKeyboardInput__notification__parameter2 = {
- "data", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__OnKeyboardInput__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnKeyboardInput__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnKeyboardInput__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnKeyboardInput__notification = {
- "UI",
- "OnKeyboardInput",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnKeyboardInput,
- UI__OnKeyboardInput__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnTouchEvent__notification__parameter1 = {
- "type", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::StructDescription
- UI__OnTouchEvent__notification__parameter2_array = {
- {"event", ford_message_descriptions::Struct, true},
- Structs::Common__TouchEvent__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__OnTouchEvent__notification__parameter2 = {
- {"event", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnTouchEvent__notification__parameter2_array,
- "(iaia(ii))"};
-const ford_message_descriptions::ParameterDescription*
- UI__OnTouchEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnTouchEvent__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnTouchEvent__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnTouchEvent__notification = {
- "UI",
- "OnTouchEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnTouchEvent,
- UI__OnTouchEvent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter1 = {
- "numTicks", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter2 = {
- "position", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter3 = {
- "sliderHeader", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter4_array = {
- "sliderFooter", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- UI__Slider__request__parameter4 = {
- {"sliderFooter", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter4_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter5 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__Slider__request__parameter6 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__Slider__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__request__parameter6,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Slider__request = {
- "UI",
- "Slider",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_Slider,
- UI__Slider__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__Slider__response__parameter1 = {
- "sliderPosition", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- UI__Slider__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__Slider__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__Slider__response = {
- "UI",
- "Slider",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_Slider,
- UI__Slider__response__parameters};
-
-const ford_message_descriptions::StructDescription
- UI__ScrollableMessage__request__parameter1 = {
- {"messageText", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ParameterDescription
- UI__ScrollableMessage__request__parameter2 = {
- "timeout", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__ScrollableMessage__request__parameter3_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__ScrollableMessage__request__parameter3 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter3_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- UI__ScrollableMessage__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__ScrollableMessage__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ScrollableMessage__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__ScrollableMessage__request = {
- "UI",
- "ScrollableMessage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ScrollableMessage,
- UI__ScrollableMessage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__ScrollableMessage__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__ScrollableMessage__response = {
- "UI",
- "ScrollableMessage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ScrollableMessage,
- UI__ScrollableMessage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__PerformAudioPassThru__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__PerformAudioPassThru__request__parameter2_array = {
- {"audioPassThruDisplayTexts", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__PerformAudioPassThru__request__parameter2 = {
- {"audioPassThruDisplayTexts", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter2_array,
- "(is)"};
-const ford_message_descriptions::ParameterDescription
- UI__PerformAudioPassThru__request__parameter3 = {
- "maxDuration", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__PerformAudioPassThru__request__parameter4 = {
- "muteAudio", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- UI__PerformAudioPassThru__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__PerformAudioPassThru__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformAudioPassThru__request = {
- "UI",
- "PerformAudioPassThru",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_PerformAudioPassThru,
- UI__PerformAudioPassThru__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__PerformAudioPassThru__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__PerformAudioPassThru__response = {
- "UI",
- "PerformAudioPassThru",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_PerformAudioPassThru,
- UI__PerformAudioPassThru__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__EndAudioPassThru__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__EndAudioPassThru__request = {"UI",
- "EndAudioPassThru",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_EndAudioPassThru,
- UI__EndAudioPassThru__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__EndAudioPassThru__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__EndAudioPassThru__response = {
- "UI",
- "EndAudioPassThru",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_EndAudioPassThru,
- UI__EndAudioPassThru__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__IsReady__request = {
- "UI",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_IsReady,
- UI__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- UI__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__IsReady__response = {
- "UI",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_IsReady,
- UI__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__ClosePopUp__request__parameter1 = {
- "methodName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription*
- UI__ClosePopUp__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__ClosePopUp__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription UI__ClosePopUp__request = {
- "UI",
- "ClosePopUp",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_ClosePopUp,
- UI__ClosePopUp__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__ClosePopUp__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription UI__ClosePopUp__response = {
- "UI",
- "ClosePopUp",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_ClosePopUp,
- UI__ClosePopUp__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnResetTimeout__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- UI__OnResetTimeout__notification__parameter2 = {
- "methodName", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnResetTimeout__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnResetTimeout__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnResetTimeout__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnResetTimeout__notification = {
- "UI",
- "OnResetTimeout",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnResetTimeout,
- UI__OnResetTimeout__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__OnRecordStart__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- UI__OnRecordStart__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__OnRecordStart__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__OnRecordStart__notification = {
- "UI",
- "OnRecordStart",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::UI_OnRecordStart,
- UI__OnRecordStart__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- UI__SendHapticData__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- UI__SendHapticData__request__parameter2_array = {
- {"hapticRectData", ford_message_descriptions::Struct, true},
- Structs::Common__HapticRect__parameters};
-const ford_message_descriptions::ArrayDescription
- UI__SendHapticData__request__parameter2 = {
- {"hapticRectData", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SendHapticData__request__parameter2_array,
- "(i(dddd))"};
-const ford_message_descriptions::ParameterDescription*
- UI__SendHapticData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SendHapticData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&UI__SendHapticData__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- UI__SendHapticData__request = {"UI",
- "SendHapticData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::UI_SendHapticData,
- UI__SendHapticData__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- UI__SendHapticData__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- UI__SendHapticData__response = {"UI",
- "SendHapticData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::UI_SendHapticData,
- UI__SendHapticData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__IsReady__request = {"Navigation",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_IsReady,
- Navigation__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__IsReady__response = {"Navigation",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_IsReady,
- Navigation__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter2 = {
- "longitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter3 = {
- "latitudeDegrees", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter4 = {
- "locationName", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter5 = {
- "locationDescription", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter6_array = {
- "addressLines", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Navigation__SendLocation__request__parameter6 = {
- {"addressLines", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter6_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- Navigation__SendLocation__request__parameter7 = {
- "phoneNumber", ford_message_descriptions::String, false};
-const ford_message_descriptions::StructDescription
- Navigation__SendLocation__request__parameter8 = {
- {"locationImage", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription*
- Navigation__SendLocation__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SendLocation__request__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SendLocation__request = {
- "Navigation",
- "SendLocation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_SendLocation,
- Navigation__SendLocation__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__SendLocation__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SendLocation__response = {
- "Navigation",
- "SendLocation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_SendLocation,
- Navigation__SendLocation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__DialNumber__request__parameter1 = {
- "number", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__DialNumber__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__DialNumber__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__DialNumber__request = {
- "Navigation",
- "DialNumber",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_DialNumber,
- Navigation__DialNumber__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__DialNumber__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__DialNumber__response = {
- "Navigation",
- "DialNumber",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_DialNumber,
- Navigation__DialNumber__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter1_array = {
- {"navigationTexts", ford_message_descriptions::Struct, true},
- Structs::Common__TextFieldStruct__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__ShowConstantTBT__request__parameter1 = {
- {"navigationTexts", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter1_array,
- "(is)"};
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter2 = {
- {"turnIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter3 = {
- {"nextTurnIcon", ford_message_descriptions::Struct, false},
- Structs::Common__Image__parameters};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter4 = {
- "distanceToManeuver", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter5 = {
- "distanceToManeuverScale", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter6 = {
- "maneuverComplete", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::StructDescription
- Navigation__ShowConstantTBT__request__parameter7_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__ShowConstantTBT__request__parameter7 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter7_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- Navigation__ShowConstantTBT__request__parameter8 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__ShowConstantTBT__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__ShowConstantTBT__request = {
- "Navigation",
- "ShowConstantTBT",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_ShowConstantTBT,
- Navigation__ShowConstantTBT__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__ShowConstantTBT__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__ShowConstantTBT__response = {
- "Navigation",
- "ShowConstantTBT",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_ShowConstantTBT,
- Navigation__ShowConstantTBT__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__AlertManeuver__request__parameter1_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__AlertManeuver__request__parameter1 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__AlertManeuver__request__parameter1_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- Navigation__AlertManeuver__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__AlertManeuver__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__AlertManeuver__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__AlertManeuver__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__AlertManeuver__request = {
- "Navigation",
- "AlertManeuver",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_AlertManeuver,
- Navigation__AlertManeuver__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__AlertManeuver__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__AlertManeuver__response = {
- "Navigation",
- "AlertManeuver",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_AlertManeuver,
- Navigation__AlertManeuver__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__UpdateTurnList__request__parameter1_array = {
- {"turnList", ford_message_descriptions::Struct, true},
- Structs::Common__Turn__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__UpdateTurnList__request__parameter1 = {
- {"turnList", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter1_array,
- "((b(is))(b(si)))"};
-const ford_message_descriptions::StructDescription
- Navigation__UpdateTurnList__request__parameter2_array = {
- {"softButtons", ford_message_descriptions::Struct, true},
- Structs::Common__SoftButton__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__UpdateTurnList__request__parameter2 = {
- {"softButtons", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter2_array,
- "(i(bs)(b(si))(bb)ii)"};
-const ford_message_descriptions::ParameterDescription
- Navigation__UpdateTurnList__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__UpdateTurnList__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__UpdateTurnList__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UpdateTurnList__request = {
- "Navigation",
- "UpdateTurnList",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_UpdateTurnList,
- Navigation__UpdateTurnList__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__UpdateTurnList__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UpdateTurnList__response = {
- "Navigation",
- "UpdateTurnList",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_UpdateTurnList,
- Navigation__UpdateTurnList__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__OnTBTClientState__notification__parameter1 = {
- "state", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnTBTClientState__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnTBTClientState__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnTBTClientState__notification = {
- "Navigation",
- "OnTBTClientState",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnTBTClientState,
- Navigation__OnTBTClientState__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__SetVideoConfig__request__parameter1 = {
- {"config", ford_message_descriptions::Struct, true},
- Structs::Common__VideoConfig__parameters};
-const ford_message_descriptions::ParameterDescription
- Navigation__SetVideoConfig__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__SetVideoConfig__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SetVideoConfig__request = {
- "Navigation",
- "SetVideoConfig",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_SetVideoConfig,
- Navigation__SetVideoConfig__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__SetVideoConfig__response__parameter1_array = {
- "rejectedParams", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- Navigation__SetVideoConfig__response__parameter1 = {
- {"rejectedParams", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__response__parameter1_array,
- "s"};
-const ford_message_descriptions::ParameterDescription*
- Navigation__SetVideoConfig__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__SetVideoConfig__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SetVideoConfig__response = {
- "Navigation",
- "SetVideoConfig",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_SetVideoConfig,
- Navigation__SetVideoConfig__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StartStream__request__parameter1 = {
- "url", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__StartStream__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartStream__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartStream__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartStream__request = {
- "Navigation",
- "StartStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StartStream,
- Navigation__StartStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartStream__response = {
- "Navigation",
- "StartStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StartStream,
- Navigation__StartStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StopStream__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StopStream__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopStream__request = {
- "Navigation",
- "StopStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StopStream,
- Navigation__StopStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopStream__response = {
- "Navigation",
- "StopStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StopStream,
- Navigation__StopStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StartAudioStream__request__parameter1 = {
- "url", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__StartAudioStream__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartAudioStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartAudioStream__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StartAudioStream__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartAudioStream__request = {
- "Navigation",
- "StartAudioStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StartAudioStream,
- Navigation__StartAudioStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StartAudioStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StartAudioStream__response = {
- "Navigation",
- "StartAudioStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StartAudioStream,
- Navigation__StartAudioStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__StopAudioStream__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopAudioStream__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__StopAudioStream__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopAudioStream__request = {
- "Navigation",
- "StopAudioStream",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_StopAudioStream,
- Navigation__StopAudioStream__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__StopAudioStream__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__StopAudioStream__response = {
- "Navigation",
- "StopAudioStream",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_StopAudioStream,
- Navigation__StopAudioStream__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__OnAudioDataStreaming__notification__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnAudioDataStreaming__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnAudioDataStreaming__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnAudioDataStreaming__notification = {
- "Navigation",
- "OnAudioDataStreaming",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnAudioDataStreaming,
- Navigation__OnAudioDataStreaming__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__OnVideoDataStreaming__notification__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnVideoDataStreaming__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnVideoDataStreaming__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnVideoDataStreaming__notification = {
- "Navigation",
- "OnVideoDataStreaming",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnVideoDataStreaming,
- Navigation__OnVideoDataStreaming__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__GetWayPoints__request__parameter1 = {
- "wayPointType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- Navigation__GetWayPoints__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- Navigation__GetWayPoints__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__GetWayPoints__request = {
- "Navigation",
- "GetWayPoints",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_GetWayPoints,
- Navigation__GetWayPoints__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- Navigation__GetWayPoints__response__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::StructDescription
- Navigation__GetWayPoints__response__parameter2_array = {
- {"wayPoints", ford_message_descriptions::Struct, true},
- Structs::Common__LocationDetails__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__GetWayPoints__response__parameter2 = {
- {"wayPoints", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__response__parameter2_array,
- "((b(dd))(bs)(bas)(bs)(bs)(b(si))(b((bs)(bs)(bs)(bs)(bs)(bs)(bs)(bs)("
- "bs))))"};
-const ford_message_descriptions::ParameterDescription*
- Navigation__GetWayPoints__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__GetWayPoints__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__GetWayPoints__response = {
- "Navigation",
- "GetWayPoints",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_GetWayPoints,
- Navigation__GetWayPoints__response__parameters};
-
-const ford_message_descriptions::StructDescription
- Navigation__OnWayPointChange__notification__parameter1_array = {
- {"wayPoints", ford_message_descriptions::Struct, true},
- Structs::Common__LocationDetails__parameters};
-const ford_message_descriptions::ArrayDescription
- Navigation__OnWayPointChange__notification__parameter1 = {
- {"wayPoints", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnWayPointChange__notification__parameter1_array,
- "((b(dd))(bs)(bas)(bs)(bs)(b(si))(b((bs)(bs)(bs)(bs)(bs)(bs)(bs)(bs)("
- "bs))))"};
-const ford_message_descriptions::ParameterDescription*
- Navigation__OnWayPointChange__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&Navigation__OnWayPointChange__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__OnWayPointChange__notification = {
- "Navigation",
- "OnWayPointChange",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::Navigation_OnWayPointChange,
- Navigation__OnWayPointChange__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__SubscribeWayPoints__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SubscribeWayPoints__request = {
- "Navigation",
- "SubscribeWayPoints",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints,
- Navigation__SubscribeWayPoints__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__SubscribeWayPoints__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__SubscribeWayPoints__response = {
- "Navigation",
- "SubscribeWayPoints",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_SubscribeWayPoints,
- Navigation__SubscribeWayPoints__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__UnsubscribeWayPoints__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UnsubscribeWayPoints__request = {
- "Navigation",
- "UnsubscribeWayPoints",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints,
- Navigation__UnsubscribeWayPoints__request__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- Navigation__UnsubscribeWayPoints__response__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- Navigation__UnsubscribeWayPoints__response = {
- "Navigation",
- "UnsubscribeWayPoints",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints,
- Navigation__UnsubscribeWayPoints__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__IsReady__request = {"VehicleInfo",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_IsReady,
- VehicleInfo__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__IsReady__response = {
- "VehicleInfo",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_IsReady,
- VehicleInfo__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVehicleType__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleType__request = {
- "VehicleInfo",
- "GetVehicleType",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
- VehicleInfo__GetVehicleType__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleType__response__parameter1 = {
- {"vehicleType", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleType__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVehicleType__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleType__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleType__response = {
- "VehicleInfo",
- "GetVehicleType",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
- VehicleInfo__GetVehicleType__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__ReadDID__request__parameter1 = {
- "ecuName", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__ReadDID__request__parameter2_array = {
- "didLocation", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__ReadDID__request__parameter2 = {
- {"didLocation", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter2_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__ReadDID__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__ReadDID__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__ReadDID__request = {"VehicleInfo",
- "ReadDID",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_ReadDID,
- VehicleInfo__ReadDID__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__ReadDID__response__parameter1_array = {
- {"didResult", ford_message_descriptions::Struct, true},
- Structs::Common__DIDResult__parameters};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__ReadDID__response__parameter1 = {
- {"didResult", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__response__parameter1_array,
- "(ii(bs))"};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__ReadDID__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__ReadDID__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__ReadDID__response = {
- "VehicleInfo",
- "ReadDID",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_ReadDID,
- VehicleInfo__ReadDID__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__request__parameter1 = {
- "ecuName", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__request__parameter2 = {
- "dtcMask", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDTCs__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDTCs__request = {"VehicleInfo",
- "GetDTCs",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetDTCs,
- VehicleInfo__GetDTCs__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__response__parameter1 = {
- "ecuHeader", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDTCs__response__parameter2_array = {
- "dtc", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__GetDTCs__response__parameter2 = {
- {"dtc", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter2_array,
- "s"};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDTCs__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDTCs__response = {
- "VehicleInfo",
- "GetDTCs",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetDTCs,
- VehicleInfo__GetDTCs__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter1 = {
- "targetID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter2 = {
- "messageLength", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter3_array = {
- "messageData", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__DiagnosticMessage__request__parameter3 = {
- {"messageData", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter3_array,
- "i"};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__request__parameter4 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__DiagnosticMessage__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter4,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__DiagnosticMessage__request = {
- "VehicleInfo",
- "DiagnosticMessage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
- VehicleInfo__DiagnosticMessage__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__DiagnosticMessage__response__parameter1_array = {
- "messageDataResult", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ArrayDescription
- VehicleInfo__DiagnosticMessage__response__parameter1 = {
- {"messageDataResult", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__response__parameter1_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__DiagnosticMessage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__DiagnosticMessage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__DiagnosticMessage__response = {
- "VehicleInfo",
- "DiagnosticMessage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
- VehicleInfo__DiagnosticMessage__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter1 = {
- "gps", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter2 = {
- "speed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter3 = {
- "rpm", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter4 = {
- "fuelLevel", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter7 = {
- "externalTemperature", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter8 = {
- "prndl", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter9 = {
- "tirePressure", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter10 = {
- "odometer", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter11 = {
- "beltStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter12 = {
- "bodyInformation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter13 = {
- "deviceStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter14 = {
- "driverBraking", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter15 = {
- "wiperStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter16 = {
- "headLampStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter17 = {
- "engineTorque", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter18 = {
- "accPedalPosition", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter19 = {
- "steeringWheelAngle", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter20 = {
- "eCallInfo", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter21 = {
- "airbagStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter22 = {
- "emergencyEvent", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter23 = {
- "clusterModeStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVehicleData__request__parameter24 = {
- "myKey", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__SubscribeVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter24,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVehicleData__request = {
- "VehicleInfo",
- "SubscribeVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
- VehicleInfo__SubscribeVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter2 = {
- {"speed", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter3 = {
- {"rpm", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter4 = {
- {"fuelLevel", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter5 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter6 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter7 = {
- {"externalTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter8 = {
- {"prndl", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter9 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter10 = {
- {"odometer", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter11 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter12 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter13 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter14 = {
- {"driverBraking", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter15 = {
- {"wiperStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter16 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter17 = {
- {"engineTorque", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter18 = {
- {"accPedalPosition", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter19 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter20 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter21 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter22 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter23 = {
- {"clusterModes", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeVehicleData__response__parameter24 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__SubscribeVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter24,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVehicleData__response = {
- "VehicleInfo",
- "SubscribeVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
- VehicleInfo__SubscribeVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter2 = {
- "gps", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter3 = {
- "speed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter4 = {
- "rpm", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter5 = {
- "fuelLevel", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter6 = {
- "fuelLevel_State", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter7 = {
- "instantFuelConsumption", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter8 = {
- "externalTemperature", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter9 = {
- "prndl", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter10 = {
- "tirePressure", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter11 = {
- "odometer", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter12 = {
- "beltStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter13 = {
- "bodyInformation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter14 = {
- "deviceStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter15 = {
- "driverBraking", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter16 = {
- "wiperStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter17 = {
- "headLampStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter18 = {
- "engineTorque", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter21 = {
- "eCallInfo", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter22 = {
- "airbagStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter23 = {
- "emergencyEvent", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter24 = {
- "clusterModeStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVehicleData__request__parameter25 = {
- "myKey", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__UnsubscribeVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVehicleData__request = {
- "VehicleInfo",
- "UnsubscribeVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
- VehicleInfo__UnsubscribeVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter2 = {
- {"speed", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter3 = {
- {"rpm", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter4 = {
- {"fuelLevel", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter5 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter6 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter7 = {
- {"externalTemperature", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter8 = {
- {"prndl", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter9 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter10 = {
- {"odometer", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter11 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter12 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter13 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter14 = {
- {"driverBraking", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter15 = {
- {"wiperStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter16 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter17 = {
- {"engineTorque", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter18 = {
- {"accPedalPosition", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter19 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter20 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter21 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter22 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter23 = {
- {"clusterModes", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeVehicleData__response__parameter24 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__UnsubscribeVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter24,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVehicleData__response = {
- "VehicleInfo",
- "UnsubscribeVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
- VehicleInfo__UnsubscribeVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter1 = {
- "gps", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter2 = {
- "speed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter3 = {
- "rpm", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter4 = {
- "fuelLevel", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter7 = {
- "externalTemperature", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter8 = {
- "vin", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter9 = {
- "prndl", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter10 = {
- "tirePressure", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter11 = {
- "odometer", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter12 = {
- "beltStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter13 = {
- "bodyInformation", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter14 = {
- "deviceStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter15 = {
- "driverBraking", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter16 = {
- "wiperStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter17 = {
- "headLampStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter18 = {
- "engineTorque", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter21 = {
- "eCallInfo", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter22 = {
- "airbagStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter23 = {
- "emergencyEvent", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter24 = {
- "clusterModeStatus", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__request__parameter25 = {
- "myKey", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__GetVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleData__request = {
- "VehicleInfo",
- "GetVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
- VehicleInfo__GetVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter2 = {
- "speed", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter3 = {
- "rpm", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter4 = {
- "fuelLevel", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter7 = {
- "externalTemperature", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter8 = {
- "vin", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter9 = {
- "prndl", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter10 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter11 = {
- "odometer", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter12 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter13 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter14 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter15 = {
- "driverBraking", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter16 = {
- "wiperStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter17 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter18 = {
- "engineTorque", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVehicleData__response__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Float, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter21 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter22 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter23 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter24 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, false},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetVehicleData__response__parameter25 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__GetVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVehicleData__response = {
- "VehicleInfo",
- "GetVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
- VehicleInfo__GetVehicleData__response__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter1 = {
- {"gps", ford_message_descriptions::Struct, false},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter2 = {
- "speed", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter3 = {
- "rpm", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter4 = {
- "fuelLevel", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter5 = {
- "fuelLevel_State", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter6 = {
- "instantFuelConsumption", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter7 = {
- "externalTemperature", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter8 = {
- "vin", ford_message_descriptions::String, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter9 = {
- "prndl", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter10 = {
- {"tirePressure", ford_message_descriptions::Struct, false},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter11 = {
- "odometer", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter12 = {
- {"beltStatus", ford_message_descriptions::Struct, false},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter13 = {
- {"bodyInformation", ford_message_descriptions::Struct, false},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter14 = {
- {"deviceStatus", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter15 = {
- "driverBraking", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter16 = {
- "wiperStatus", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter17 = {
- {"headLampStatus", ford_message_descriptions::Struct, false},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter18 = {
- "engineTorque", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter19 = {
- "accPedalPosition", ford_message_descriptions::Float, false};
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVehicleData__notification__parameter20 = {
- "steeringWheelAngle", ford_message_descriptions::Float, false};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter21 = {
- {"eCallInfo", ford_message_descriptions::Struct, false},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter22 = {
- {"airbagStatus", ford_message_descriptions::Struct, false},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter23 = {
- {"emergencyEvent", ford_message_descriptions::Struct, false},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter24 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, false},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnVehicleData__notification__parameter25 = {
- {"myKey", ford_message_descriptions::Struct, false},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription* VehicleInfo__OnVehicleData__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter8,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter9,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter10,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter11,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter12,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter13,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter14,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter15,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter16,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter17,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter18,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter19,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter20,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter21,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter22,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter23,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter24,
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter25,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnVehicleData__notification = {
- "VehicleInfo",
- "OnVehicleData",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnVehicleData,
- VehicleInfo__OnVehicleData__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetGpsData__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetGpsData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetGpsData__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetGpsData__request = {
- "VehicleInfo",
- "GetGpsData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData,
- VehicleInfo__GetGpsData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetGpsData__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetGpsData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetGpsData__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetGpsData__response = {
- "VehicleInfo",
- "GetGpsData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetGpsData,
- VehicleInfo__GetGpsData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSpeed__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSpeed__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSpeed__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSpeed__request = {
- "VehicleInfo",
- "GetSpeed",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed,
- VehicleInfo__GetSpeed__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSpeed__response__parameter1 = {
- "speed", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSpeed__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSpeed__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSpeed__response = {
- "VehicleInfo",
- "GetSpeed",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetSpeed,
- VehicleInfo__GetSpeed__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetRpm__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetRpm__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetRpm__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetRpm__request = {"VehicleInfo",
- "GetRpm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetRpm,
- VehicleInfo__GetRpm__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetRpm__response__parameter1 = {
- "rpm", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetRpm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetRpm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetRpm__response = {"VehicleInfo",
- "GetRpm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetRpm,
- VehicleInfo__GetRpm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevel__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevel__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevel__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevel__request = {
- "VehicleInfo",
- "GetFuelLevel",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel,
- VehicleInfo__GetFuelLevel__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevel__response__parameter1 = {
- "fuelLevel", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevel__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevel__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevel__response = {
- "VehicleInfo",
- "GetFuelLevel",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevel,
- VehicleInfo__GetFuelLevel__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevelState__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevelState__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevelState__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevelState__request = {
- "VehicleInfo",
- "GetFuelLevelState",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- VehicleInfo__GetFuelLevelState__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetFuelLevelState__response__parameter1 = {
- "fuelLevel_State", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetFuelLevelState__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetFuelLevelState__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetFuelLevelState__response = {
- "VehicleInfo",
- "GetFuelLevelState",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
- VehicleInfo__GetFuelLevelState__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetInstantFuelConsumption__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetInstantFuelConsumption__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetInstantFuelConsumption__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetInstantFuelConsumption__request = {
- "VehicleInfo",
- "GetInstantFuelConsumption",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- VehicleInfo__GetInstantFuelConsumption__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetInstantFuelConsumption__response__parameter1 = {
- "instantFuelConsumption", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetInstantFuelConsumption__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetInstantFuelConsumption__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetInstantFuelConsumption__response = {
- "VehicleInfo",
- "GetInstantFuelConsumption",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
- VehicleInfo__GetInstantFuelConsumption__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetExternalTemperature__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetExternalTemperature__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetExternalTemperature__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetExternalTemperature__request = {
- "VehicleInfo",
- "GetExternalTemperature",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- VehicleInfo__GetExternalTemperature__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetExternalTemperature__response__parameter1 = {
- "externalTemperature", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetExternalTemperature__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetExternalTemperature__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetExternalTemperature__response = {
- "VehicleInfo",
- "GetExternalTemperature",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
- VehicleInfo__GetExternalTemperature__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVin__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVin__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVin__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVin__request = {"VehicleInfo",
- "GetVin",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetVin,
- VehicleInfo__GetVin__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetVin__response__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetVin__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetVin__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetVin__response = {"VehicleInfo",
- "GetVin",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetVin,
- VehicleInfo__GetVin__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetPrndl__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetPrndl__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetPrndl__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetPrndl__request = {
- "VehicleInfo",
- "GetPrndl",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl,
- VehicleInfo__GetPrndl__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetPrndl__response__parameter1 = {
- "prndl", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetPrndl__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetPrndl__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetPrndl__response = {
- "VehicleInfo",
- "GetPrndl",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetPrndl,
- VehicleInfo__GetPrndl__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetTirePressure__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetTirePressure__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetTirePressure__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetTirePressure__request = {
- "VehicleInfo",
- "GetTirePressure",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure,
- VehicleInfo__GetTirePressure__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetTirePressure__response__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetTirePressure__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetTirePressure__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetTirePressure__response = {
- "VehicleInfo",
- "GetTirePressure",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetTirePressure,
- VehicleInfo__GetTirePressure__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetOdometer__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetOdometer__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetOdometer__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetOdometer__request = {
- "VehicleInfo",
- "GetOdometer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer,
- VehicleInfo__GetOdometer__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetOdometer__response__parameter1 = {
- "odometer", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetOdometer__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetOdometer__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetOdometer__response = {
- "VehicleInfo",
- "GetOdometer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetOdometer,
- VehicleInfo__GetOdometer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetBeltStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBeltStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBeltStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBeltStatus__request = {
- "VehicleInfo",
- "GetBeltStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus,
- VehicleInfo__GetBeltStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetBeltStatus__response__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBeltStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBeltStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBeltStatus__response = {
- "VehicleInfo",
- "GetBeltStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetBeltStatus,
- VehicleInfo__GetBeltStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetBodyInformation__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBodyInformation__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBodyInformation__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBodyInformation__request = {
- "VehicleInfo",
- "GetBodyInformation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- VehicleInfo__GetBodyInformation__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetBodyInformation__response__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetBodyInformation__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetBodyInformation__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetBodyInformation__response = {
- "VehicleInfo",
- "GetBodyInformation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
- VehicleInfo__GetBodyInformation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDeviceStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDeviceStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDeviceStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDeviceStatus__request = {
- "VehicleInfo",
- "GetDeviceStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus,
- VehicleInfo__GetDeviceStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetDeviceStatus__response__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDeviceStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDeviceStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDeviceStatus__response = {
- "VehicleInfo",
- "GetDeviceStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus,
- VehicleInfo__GetDeviceStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDriverBraking__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDriverBraking__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDriverBraking__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDriverBraking__request = {
- "VehicleInfo",
- "GetDriverBraking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking,
- VehicleInfo__GetDriverBraking__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetDriverBraking__response__parameter1 = {
- "driverBraking", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetDriverBraking__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetDriverBraking__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetDriverBraking__response = {
- "VehicleInfo",
- "GetDriverBraking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetDriverBraking,
- VehicleInfo__GetDriverBraking__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetWiperStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetWiperStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetWiperStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetWiperStatus__request = {
- "VehicleInfo",
- "GetWiperStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus,
- VehicleInfo__GetWiperStatus__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetWiperStatus__response__parameter1 = {
- "wiperStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetWiperStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetWiperStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetWiperStatus__response = {
- "VehicleInfo",
- "GetWiperStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetWiperStatus,
- VehicleInfo__GetWiperStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetHeadLampStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetHeadLampStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetHeadLampStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetHeadLampStatus__request = {
- "VehicleInfo",
- "GetHeadLampStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- VehicleInfo__GetHeadLampStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetHeadLampStatus__response__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetHeadLampStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetHeadLampStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetHeadLampStatus__response = {
- "VehicleInfo",
- "GetHeadLampStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
- VehicleInfo__GetHeadLampStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetEngineTorque__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEngineTorque__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEngineTorque__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEngineTorque__request = {
- "VehicleInfo",
- "GetEngineTorque",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque,
- VehicleInfo__GetEngineTorque__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetEngineTorque__response__parameter1 = {
- "engineTorque", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEngineTorque__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEngineTorque__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEngineTorque__response = {
- "VehicleInfo",
- "GetEngineTorque",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetEngineTorque,
- VehicleInfo__GetEngineTorque__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetAccPedalPosition__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAccPedalPosition__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAccPedalPosition__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAccPedalPosition__request = {
- "VehicleInfo",
- "GetAccPedalPosition",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition,
- VehicleInfo__GetAccPedalPosition__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetAccPedalPosition__response__parameter1 = {
- "accPedalPosition", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAccPedalPosition__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAccPedalPosition__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAccPedalPosition__response = {
- "VehicleInfo",
- "GetAccPedalPosition",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition,
- VehicleInfo__GetAccPedalPosition__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSteeringWheelAngle__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSteeringWheelAngle__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSteeringWheelAngle__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSteeringWheelAngle__request = {
- "VehicleInfo",
- "GetSteeringWheelAngle",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- VehicleInfo__GetSteeringWheelAngle__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetSteeringWheelAngle__response__parameter1 = {
- "steeringWheelAngle", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetSteeringWheelAngle__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetSteeringWheelAngle__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetSteeringWheelAngle__response = {
- "VehicleInfo",
- "GetSteeringWheelAngle",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
- VehicleInfo__GetSteeringWheelAngle__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetECallInfo__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetECallInfo__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetECallInfo__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetECallInfo__request = {
- "VehicleInfo",
- "GetECallInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo,
- VehicleInfo__GetECallInfo__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetECallInfo__response__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetECallInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetECallInfo__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetECallInfo__response = {
- "VehicleInfo",
- "GetECallInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetECallInfo,
- VehicleInfo__GetECallInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetAirbagStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAirbagStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAirbagStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAirbagStatus__request = {
- "VehicleInfo",
- "GetAirbagStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus,
- VehicleInfo__GetAirbagStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetAirbagStatus__response__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetAirbagStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetAirbagStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetAirbagStatus__response = {
- "VehicleInfo",
- "GetAirbagStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus,
- VehicleInfo__GetAirbagStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetEmergencyEvent__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEmergencyEvent__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEmergencyEvent__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEmergencyEvent__request = {
- "VehicleInfo",
- "GetEmergencyEvent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent,
- VehicleInfo__GetEmergencyEvent__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetEmergencyEvent__response__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetEmergencyEvent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetEmergencyEvent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetEmergencyEvent__response = {
- "VehicleInfo",
- "GetEmergencyEvent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent,
- VehicleInfo__GetEmergencyEvent__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetClusterModeStatus__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetClusterModeStatus__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetClusterModeStatus__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetClusterModeStatus__request = {
- "VehicleInfo",
- "GetClusterModeStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- VehicleInfo__GetClusterModeStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetClusterModeStatus__response__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetClusterModeStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetClusterModeStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetClusterModeStatus__response = {
- "VehicleInfo",
- "GetClusterModeStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
- VehicleInfo__GetClusterModeStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__GetMyKey__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetMyKey__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetMyKey__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetMyKey__request = {
- "VehicleInfo",
- "GetMyKey",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey,
- VehicleInfo__GetMyKey__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__GetMyKey__response__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__GetMyKey__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__GetMyKey__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__GetMyKey__response = {
- "VehicleInfo",
- "GetMyKey",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_GetMyKey,
- VehicleInfo__GetMyKey__response__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnGpsData__notification__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__GPSData__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnGpsData__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnGpsData__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnGpsData__notification = {
- "VehicleInfo",
- "OnGpsData",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnGpsData,
- VehicleInfo__OnGpsData__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnSpeed__notification__parameter1 = {
- "speed", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnSpeed__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnSpeed__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnSpeed__notification = {
- "VehicleInfo",
- "OnSpeed",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnSpeed,
- VehicleInfo__OnSpeed__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnRpm__notification__parameter1 = {
- "rpm", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnRpm__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnRpm__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnRpm__notification = {
- "VehicleInfo",
- "OnRpm",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnRpm,
- VehicleInfo__OnRpm__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnFuelLevel__notification__parameter1 = {
- "fuelLevel", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnFuelLevel__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnFuelLevel__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnFuelLevel__notification = {
- "VehicleInfo",
- "OnFuelLevel",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnFuelLevel,
- VehicleInfo__OnFuelLevel__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnFuelLevelState__notification__parameter1 = {
- "fuelLevel_State", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnFuelLevelState__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnFuelLevelState__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnFuelLevelState__notification = {
- "VehicleInfo",
- "OnFuelLevelState",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState,
- VehicleInfo__OnFuelLevelState__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnInstantFuelConsumption__notification__parameter1 = {
- "instantFuelConsumption", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnInstantFuelConsumption__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnInstantFuelConsumption__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnInstantFuelConsumption__notification = {
- "VehicleInfo",
- "OnInstantFuelConsumption",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption,
- VehicleInfo__OnInstantFuelConsumption__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnExternalTemperature__notification__parameter1 = {
- "externalTemperature", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnExternalTemperature__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnExternalTemperature__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnExternalTemperature__notification = {
- "VehicleInfo",
- "OnExternalTemperature",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature,
- VehicleInfo__OnExternalTemperature__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnVin__notification__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnVin__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnVin__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnVin__notification = {
- "VehicleInfo",
- "OnVin",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnVin,
- VehicleInfo__OnVin__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnPrndl__notification__parameter1 = {
- "prndl", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnPrndl__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnPrndl__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnPrndl__notification = {
- "VehicleInfo",
- "OnPrndl",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnPrndl,
- VehicleInfo__OnPrndl__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnTirePressure__notification__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__TireStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnTirePressure__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnTirePressure__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnTirePressure__notification = {
- "VehicleInfo",
- "OnTirePressure",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnTirePressure,
- VehicleInfo__OnTirePressure__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnOdometer__notification__parameter1 = {
- "odometer", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnOdometer__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnOdometer__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnOdometer__notification = {
- "VehicleInfo",
- "OnOdometer",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnOdometer,
- VehicleInfo__OnOdometer__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnBeltStatus__notification__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__BeltStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnBeltStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnBeltStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnBeltStatus__notification = {
- "VehicleInfo",
- "OnBeltStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnBeltStatus,
- VehicleInfo__OnBeltStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnBodyInformation__notification__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__BodyInformation__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnBodyInformation__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnBodyInformation__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnBodyInformation__notification = {
- "VehicleInfo",
- "OnBodyInformation",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnBodyInformation,
- VehicleInfo__OnBodyInformation__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnDeviceStatus__notification__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnDeviceStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnDeviceStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnDeviceStatus__notification = {
- "VehicleInfo",
- "OnDeviceStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus,
- VehicleInfo__OnDeviceStatus__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnDriverBraking__notification__parameter1 = {
- "driverBraking", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnDriverBraking__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnDriverBraking__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnDriverBraking__notification = {
- "VehicleInfo",
- "OnDriverBraking",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnDriverBraking,
- VehicleInfo__OnDriverBraking__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnWiperStatus__notification__parameter1 = {
- "wiperStatus", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnWiperStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnWiperStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnWiperStatus__notification = {
- "VehicleInfo",
- "OnWiperStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnWiperStatus,
- VehicleInfo__OnWiperStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnHeadLampStatus__notification__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__HeadLampStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnHeadLampStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnHeadLampStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnHeadLampStatus__notification = {
- "VehicleInfo",
- "OnHeadLampStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus,
- VehicleInfo__OnHeadLampStatus__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnEngineTorque__notification__parameter1 = {
- "engineTorque", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnEngineTorque__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnEngineTorque__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnEngineTorque__notification = {
- "VehicleInfo",
- "OnEngineTorque",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnEngineTorque,
- VehicleInfo__OnEngineTorque__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnAccPedalPosition__notification__parameter1 = {
- "accPedalPosition", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnAccPedalPosition__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnAccPedalPosition__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnAccPedalPosition__notification = {
- "VehicleInfo",
- "OnAccPedalPosition",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition,
- VehicleInfo__OnAccPedalPosition__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__OnSteeringWheelAngle__notification__parameter1 = {
- "steeringWheelAngle", ford_message_descriptions::Float, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnSteeringWheelAngle__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnSteeringWheelAngle__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnSteeringWheelAngle__notification = {
- "VehicleInfo",
- "OnSteeringWheelAngle",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle,
- VehicleInfo__OnSteeringWheelAngle__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnECallInfo__notification__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__ECallInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnECallInfo__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnECallInfo__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnECallInfo__notification = {
- "VehicleInfo",
- "OnECallInfo",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnECallInfo,
- VehicleInfo__OnECallInfo__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnAirbagStatus__notification__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__AirbagStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnAirbagStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnAirbagStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnAirbagStatus__notification = {
- "VehicleInfo",
- "OnAirbagStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnAirbagStatus,
- VehicleInfo__OnAirbagStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnEmergencyEvent__notification__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__EmergencyEvent__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnEmergencyEvent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnEmergencyEvent__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnEmergencyEvent__notification = {
- "VehicleInfo",
- "OnEmergencyEvent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnEmergencyEvent,
- VehicleInfo__OnEmergencyEvent__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnClusterModeStatus__notification__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__ClusterModeStatus__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnClusterModeStatus__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnClusterModeStatus__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnClusterModeStatus__notification = {
- "VehicleInfo",
- "OnClusterModeStatus",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnClusterModeStatus,
- VehicleInfo__OnClusterModeStatus__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__OnMyKey__notification__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__MyKey__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__OnMyKey__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__OnMyKey__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__OnMyKey__notification = {
- "VehicleInfo",
- "OnMyKey",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::VehicleInfo_OnMyKey,
- VehicleInfo__OnMyKey__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeGps__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeGps__request = {
- "VehicleInfo",
- "SubscribeGps",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps,
- VehicleInfo__SubscribeGps__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeGps__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeGps__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeGps__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeGps__response = {
- "VehicleInfo",
- "SubscribeGps",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeGps,
- VehicleInfo__SubscribeGps__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeGps__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeGps__request = {
- "VehicleInfo",
- "UnsubscribeGps",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps,
- VehicleInfo__UnsubscribeGps__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeGps__response__parameter1 = {
- {"gps", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeGps__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeGps__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeGps__response = {
- "VehicleInfo",
- "UnsubscribeGps",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps,
- VehicleInfo__UnsubscribeGps__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSpeed__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSpeed__request = {
- "VehicleInfo",
- "SubscribeSpeed",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed,
- VehicleInfo__SubscribeSpeed__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeSpeed__response__parameter1 = {
- {"speed", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSpeed__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeSpeed__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSpeed__response = {
- "VehicleInfo",
- "SubscribeSpeed",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed,
- VehicleInfo__SubscribeSpeed__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSpeed__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSpeed__request = {
- "VehicleInfo",
- "UnsubscribeSpeed",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed,
- VehicleInfo__UnsubscribeSpeed__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeSpeed__response__parameter1 = {
- {"speed", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSpeed__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeSpeed__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSpeed__response = {
- "VehicleInfo",
- "UnsubscribeSpeed",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed,
- VehicleInfo__UnsubscribeSpeed__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeRpm__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeRpm__request = {
- "VehicleInfo",
- "SubscribeRpm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm,
- VehicleInfo__SubscribeRpm__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeRpm__response__parameter1 = {
- {"rpm", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeRpm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeRpm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeRpm__response = {
- "VehicleInfo",
- "SubscribeRpm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeRpm,
- VehicleInfo__SubscribeRpm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeRpm__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeRpm__request = {
- "VehicleInfo",
- "UnsubscribeRpm",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm,
- VehicleInfo__UnsubscribeRpm__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeRpm__response__parameter1 = {
- {"rpm", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeRpm__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeRpm__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeRpm__response = {
- "VehicleInfo",
- "UnsubscribeRpm",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm,
- VehicleInfo__UnsubscribeRpm__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel__request = {
- "VehicleInfo",
- "SubscribeFuelLevel",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel,
- VehicleInfo__SubscribeFuelLevel__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeFuelLevel__response__parameter1 = {
- {"fuelLevel", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeFuelLevel__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel__response = {
- "VehicleInfo",
- "SubscribeFuelLevel",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel,
- VehicleInfo__SubscribeFuelLevel__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel__request = {
- "VehicleInfo",
- "UnsubscribeFuelLevel",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- VehicleInfo__UnsubscribeFuelLevel__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeFuelLevel__response__parameter1 = {
- {"fuelLevel", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeFuelLevel__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel__response = {
- "VehicleInfo",
- "UnsubscribeFuelLevel",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
- VehicleInfo__UnsubscribeFuelLevel__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel_State__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel_State__request = {
- "VehicleInfo",
- "SubscribeFuelLevel_State",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- VehicleInfo__SubscribeFuelLevel_State__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeFuelLevel_State__response__parameter1 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeFuelLevel_State__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeFuelLevel_State__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeFuelLevel_State__response = {
- "VehicleInfo",
- "SubscribeFuelLevel_State",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
- VehicleInfo__SubscribeFuelLevel_State__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel_State__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel_State__request = {
- "VehicleInfo",
- "UnsubscribeFuelLevel_State",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- VehicleInfo__UnsubscribeFuelLevel_State__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeFuelLevel_State__response__parameter1 = {
- {"fuelLevel_State", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeFuelLevel_State__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeFuelLevel_State__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeFuelLevel_State__response = {
- "VehicleInfo",
- "UnsubscribeFuelLevel_State",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
- VehicleInfo__UnsubscribeFuelLevel_State__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeInstantFuelConsumption__request__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeInstantFuelConsumption__request = {
- "VehicleInfo",
- "SubscribeInstantFuelConsumption",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- VehicleInfo__SubscribeInstantFuelConsumption__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeInstantFuelConsumption__response__parameter1 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeInstantFuelConsumption__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeInstantFuelConsumption__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeInstantFuelConsumption__response = {
- "VehicleInfo",
- "SubscribeInstantFuelConsumption",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
- VehicleInfo__SubscribeInstantFuelConsumption__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeInstantFuelConsumption__request__parameters[] = {
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeInstantFuelConsumption__request = {
- "VehicleInfo",
- "UnsubscribeInstantFuelConsumption",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- VehicleInfo__UnsubscribeInstantFuelConsumption__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameter1 = {
- {"instantFuelConsumption", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeInstantFuelConsumption__response = {
- "VehicleInfo",
- "UnsubscribeInstantFuelConsumption",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
- VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeExternalTemperature__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeExternalTemperature__request = {
- "VehicleInfo",
- "SubscribeExternalTemperature",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- VehicleInfo__SubscribeExternalTemperature__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeExternalTemperature__response__parameter1 = {
- {"externalTemperature", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeExternalTemperature__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeExternalTemperature__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeExternalTemperature__response = {
- "VehicleInfo",
- "SubscribeExternalTemperature",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
- VehicleInfo__SubscribeExternalTemperature__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeExternalTemperature__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeExternalTemperature__request = {
- "VehicleInfo",
- "UnsubscribeExternalTemperature",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- VehicleInfo__UnsubscribeExternalTemperature__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeExternalTemperature__response__parameter1 = {
- {"externalTemperature", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeExternalTemperature__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeExternalTemperature__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeExternalTemperature__response = {
- "VehicleInfo",
- "UnsubscribeExternalTemperature",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
- VehicleInfo__UnsubscribeExternalTemperature__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribePrndl__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribePrndl__request = {
- "VehicleInfo",
- "SubscribePrndl",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl,
- VehicleInfo__SubscribePrndl__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribePrndl__response__parameter1 = {
- {"prndl", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribePrndl__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribePrndl__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribePrndl__response = {
- "VehicleInfo",
- "SubscribePrndl",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribePrndl,
- VehicleInfo__SubscribePrndl__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribePrndl__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribePrndl__request = {
- "VehicleInfo",
- "UnsubscribePrndl",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl,
- VehicleInfo__UnsubscribePrndl__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribePrndl__response__parameter1 = {
- {"prndl", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribePrndl__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribePrndl__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribePrndl__response = {
- "VehicleInfo",
- "UnsubscribePrndl",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl,
- VehicleInfo__UnsubscribePrndl__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeVin__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVin__request = {
- "VehicleInfo",
- "SubscribeVin",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin,
- VehicleInfo__SubscribeVin__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__SubscribeVin__response__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeVin__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeVin__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeVin__response = {
- "VehicleInfo",
- "SubscribeVin",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeVin,
- VehicleInfo__SubscribeVin__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeVin__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVin__request = {
- "VehicleInfo",
- "UnsubscribeVin",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin,
- VehicleInfo__UnsubscribeVin__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- VehicleInfo__UnsubscribeVin__response__parameter1 = {
- "vin", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeVin__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeVin__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeVin__response = {
- "VehicleInfo",
- "UnsubscribeVin",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin,
- VehicleInfo__UnsubscribeVin__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeTirePressure__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeTirePressure__request = {
- "VehicleInfo",
- "SubscribeTirePressure",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- VehicleInfo__SubscribeTirePressure__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeTirePressure__response__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeTirePressure__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeTirePressure__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeTirePressure__response = {
- "VehicleInfo",
- "SubscribeTirePressure",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
- VehicleInfo__SubscribeTirePressure__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeTirePressure__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeTirePressure__request = {
- "VehicleInfo",
- "UnsubscribeTirePressure",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- VehicleInfo__UnsubscribeTirePressure__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeTirePressure__response__parameter1 = {
- {"tirePressure", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeTirePressure__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeTirePressure__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeTirePressure__response = {
- "VehicleInfo",
- "UnsubscribeTirePressure",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
- VehicleInfo__UnsubscribeTirePressure__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeOdometer__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeOdometer__request = {
- "VehicleInfo",
- "SubscribeOdometer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer,
- VehicleInfo__SubscribeOdometer__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeOdometer__response__parameter1 = {
- {"odometer", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeOdometer__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeOdometer__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeOdometer__response = {
- "VehicleInfo",
- "SubscribeOdometer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer,
- VehicleInfo__SubscribeOdometer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeOdometer__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeOdometer__request = {
- "VehicleInfo",
- "UnsubscribeOdometer",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer,
- VehicleInfo__UnsubscribeOdometer__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeOdometer__response__parameter1 = {
- {"odometer", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeOdometer__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeOdometer__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeOdometer__response = {
- "VehicleInfo",
- "UnsubscribeOdometer",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer,
- VehicleInfo__UnsubscribeOdometer__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBeltStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBeltStatus__request = {
- "VehicleInfo",
- "SubscribeBeltStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- VehicleInfo__SubscribeBeltStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeBeltStatus__response__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBeltStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeBeltStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBeltStatus__response = {
- "VehicleInfo",
- "SubscribeBeltStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
- VehicleInfo__SubscribeBeltStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBeltStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBeltStatus__request = {
- "VehicleInfo",
- "UnsubscribeBeltStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- VehicleInfo__UnsubscribeBeltStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeBeltStatus__response__parameter1 = {
- {"beltStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBeltStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeBeltStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBeltStatus__response = {
- "VehicleInfo",
- "UnsubscribeBeltStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
- VehicleInfo__UnsubscribeBeltStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBodyInformation__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBodyInformation__request = {
- "VehicleInfo",
- "SubscribeBodyInformation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- VehicleInfo__SubscribeBodyInformation__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeBodyInformation__response__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeBodyInformation__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeBodyInformation__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeBodyInformation__response = {
- "VehicleInfo",
- "SubscribeBodyInformation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
- VehicleInfo__SubscribeBodyInformation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBodyInformation__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBodyInformation__request = {
- "VehicleInfo",
- "UnsubscribeBodyInformation",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- VehicleInfo__UnsubscribeBodyInformation__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeBodyInformation__response__parameter1 = {
- {"bodyInformation", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeBodyInformation__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeBodyInformation__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeBodyInformation__response = {
- "VehicleInfo",
- "UnsubscribeBodyInformation",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
- VehicleInfo__UnsubscribeBodyInformation__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDeviceStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDeviceStatus__request = {
- "VehicleInfo",
- "SubscribeDeviceStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- VehicleInfo__SubscribeDeviceStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeDeviceStatus__response__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDeviceStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeDeviceStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDeviceStatus__response = {
- "VehicleInfo",
- "SubscribeDeviceStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
- VehicleInfo__SubscribeDeviceStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDeviceStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDeviceStatus__request = {
- "VehicleInfo",
- "UnsubscribeDeviceStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- VehicleInfo__UnsubscribeDeviceStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeDeviceStatus__response__parameter1 = {
- {"deviceStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDeviceStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeDeviceStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDeviceStatus__response = {
- "VehicleInfo",
- "UnsubscribeDeviceStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
- VehicleInfo__UnsubscribeDeviceStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDriverBraking__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDriverBraking__request = {
- "VehicleInfo",
- "SubscribeDriverBraking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- VehicleInfo__SubscribeDriverBraking__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeDriverBraking__response__parameter1 = {
- {"driverBraking", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeDriverBraking__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeDriverBraking__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeDriverBraking__response = {
- "VehicleInfo",
- "SubscribeDriverBraking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
- VehicleInfo__SubscribeDriverBraking__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDriverBraking__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDriverBraking__request = {
- "VehicleInfo",
- "UnsubscribeDriverBraking",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- VehicleInfo__UnsubscribeDriverBraking__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeDriverBraking__response__parameter1 = {
- {"driverBraking", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeDriverBraking__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeDriverBraking__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeDriverBraking__response = {
- "VehicleInfo",
- "UnsubscribeDriverBraking",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
- VehicleInfo__UnsubscribeDriverBraking__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeWiperStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeWiperStatus__request = {
- "VehicleInfo",
- "SubscribeWiperStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- VehicleInfo__SubscribeWiperStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeWiperStatus__response__parameter1 = {
- {"wiperStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeWiperStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeWiperStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeWiperStatus__response = {
- "VehicleInfo",
- "SubscribeWiperStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
- VehicleInfo__SubscribeWiperStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeWiperStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeWiperStatus__request = {
- "VehicleInfo",
- "UnsubscribeWiperStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- VehicleInfo__UnsubscribeWiperStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeWiperStatus__response__parameter1 = {
- {"wiperStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeWiperStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeWiperStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeWiperStatus__response = {
- "VehicleInfo",
- "UnsubscribeWiperStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
- VehicleInfo__UnsubscribeWiperStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeHeadLampStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeHeadLampStatus__request = {
- "VehicleInfo",
- "SubscribeHeadLampStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- VehicleInfo__SubscribeHeadLampStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeHeadLampStatus__response__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeHeadLampStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeHeadLampStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeHeadLampStatus__response = {
- "VehicleInfo",
- "SubscribeHeadLampStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
- VehicleInfo__SubscribeHeadLampStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeHeadLampStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeHeadLampStatus__request = {
- "VehicleInfo",
- "UnsubscribeHeadLampStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- VehicleInfo__UnsubscribeHeadLampStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeHeadLampStatus__response__parameter1 = {
- {"headLampStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeHeadLampStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeHeadLampStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeHeadLampStatus__response = {
- "VehicleInfo",
- "UnsubscribeHeadLampStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
- VehicleInfo__UnsubscribeHeadLampStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEngineTorque__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEngineTorque__request = {
- "VehicleInfo",
- "SubscribeEngineTorque",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- VehicleInfo__SubscribeEngineTorque__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeEngineTorque__response__parameter1 = {
- {"engineTorque", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEngineTorque__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeEngineTorque__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEngineTorque__response = {
- "VehicleInfo",
- "SubscribeEngineTorque",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
- VehicleInfo__SubscribeEngineTorque__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEngineTorque__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEngineTorque__request = {
- "VehicleInfo",
- "UnsubscribeEngineTorque",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- VehicleInfo__UnsubscribeEngineTorque__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeEngineTorque__response__parameter1 = {
- {"engineTorque", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEngineTorque__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeEngineTorque__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEngineTorque__response = {
- "VehicleInfo",
- "UnsubscribeEngineTorque",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
- VehicleInfo__UnsubscribeEngineTorque__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAccPedalPosition__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAccPedalPosition__request = {
- "VehicleInfo",
- "SubscribeAccPedalPosition",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- VehicleInfo__SubscribeAccPedalPosition__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeAccPedalPosition__response__parameter1 = {
- {"accPedalPosition", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAccPedalPosition__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeAccPedalPosition__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAccPedalPosition__response = {
- "VehicleInfo",
- "SubscribeAccPedalPosition",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
- VehicleInfo__SubscribeAccPedalPosition__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAccPedalPosition__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAccPedalPosition__request = {
- "VehicleInfo",
- "UnsubscribeAccPedalPosition",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- VehicleInfo__UnsubscribeAccPedalPosition__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeAccPedalPosition__response__parameter1 = {
- {"accPedalPosition", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAccPedalPosition__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeAccPedalPosition__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAccPedalPosition__response = {
- "VehicleInfo",
- "UnsubscribeAccPedalPosition",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
- VehicleInfo__UnsubscribeAccPedalPosition__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSteeringWheelAngle__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSteeringWheelAngle__request = {
- "VehicleInfo",
- "SubscribeSteeringWheelAngle",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- VehicleInfo__SubscribeSteeringWheelAngle__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeSteeringWheelAngle__response__parameter1 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeSteeringWheelAngle__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeSteeringWheelAngle__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeSteeringWheelAngle__response = {
- "VehicleInfo",
- "SubscribeSteeringWheelAngle",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
- VehicleInfo__SubscribeSteeringWheelAngle__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSteeringWheelAngle__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSteeringWheelAngle__request = {
- "VehicleInfo",
- "UnsubscribeSteeringWheelAngle",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- VehicleInfo__UnsubscribeSteeringWheelAngle__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameter1 = {
- {"steeringWheelAngle", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeSteeringWheelAngle__response = {
- "VehicleInfo",
- "UnsubscribeSteeringWheelAngle",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
- VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeECallInfo__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeECallInfo__request = {
- "VehicleInfo",
- "SubscribeECallInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- VehicleInfo__SubscribeECallInfo__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeECallInfo__response__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeECallInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeECallInfo__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeECallInfo__response = {
- "VehicleInfo",
- "SubscribeECallInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
- VehicleInfo__SubscribeECallInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeECallInfo__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeECallInfo__request = {
- "VehicleInfo",
- "UnsubscribeECallInfo",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- VehicleInfo__UnsubscribeECallInfo__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeECallInfo__response__parameter1 = {
- {"eCallInfo", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeECallInfo__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeECallInfo__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeECallInfo__response = {
- "VehicleInfo",
- "UnsubscribeECallInfo",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
- VehicleInfo__UnsubscribeECallInfo__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAirbagStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAirbagStatus__request = {
- "VehicleInfo",
- "SubscribeAirbagStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- VehicleInfo__SubscribeAirbagStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeAirbagStatus__response__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeAirbagStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeAirbagStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeAirbagStatus__response = {
- "VehicleInfo",
- "SubscribeAirbagStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
- VehicleInfo__SubscribeAirbagStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAirbagStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAirbagStatus__request = {
- "VehicleInfo",
- "UnsubscribeAirbagStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- VehicleInfo__UnsubscribeAirbagStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeAirbagStatus__response__parameter1 = {
- {"airbagStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeAirbagStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeAirbagStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeAirbagStatus__response = {
- "VehicleInfo",
- "UnsubscribeAirbagStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
- VehicleInfo__UnsubscribeAirbagStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEmergencyEvent__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEmergencyEvent__request = {
- "VehicleInfo",
- "SubscribeEmergencyEvent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- VehicleInfo__SubscribeEmergencyEvent__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeEmergencyEvent__response__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeEmergencyEvent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeEmergencyEvent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeEmergencyEvent__response = {
- "VehicleInfo",
- "SubscribeEmergencyEvent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
- VehicleInfo__SubscribeEmergencyEvent__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEmergencyEvent__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEmergencyEvent__request = {
- "VehicleInfo",
- "UnsubscribeEmergencyEvent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- VehicleInfo__UnsubscribeEmergencyEvent__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeEmergencyEvent__response__parameter1 = {
- {"emergencyEvent", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeEmergencyEvent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeEmergencyEvent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeEmergencyEvent__response = {
- "VehicleInfo",
- "UnsubscribeEmergencyEvent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
- VehicleInfo__UnsubscribeEmergencyEvent__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeClusterModeStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeClusterModeStatus__request = {
- "VehicleInfo",
- "SubscribeClusterModeStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- VehicleInfo__SubscribeClusterModeStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeClusterModeStatus__response__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeClusterModeStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeClusterModeStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeClusterModeStatus__response = {
- "VehicleInfo",
- "SubscribeClusterModeStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
- VehicleInfo__SubscribeClusterModeStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeClusterModeStatus__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeClusterModeStatus__request = {
- "VehicleInfo",
- "UnsubscribeClusterModeStatus",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- VehicleInfo__UnsubscribeClusterModeStatus__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeClusterModeStatus__response__parameter1 = {
- {"clusterModeStatus", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeClusterModeStatus__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeClusterModeStatus__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeClusterModeStatus__response = {
- "VehicleInfo",
- "UnsubscribeClusterModeStatus",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
- VehicleInfo__UnsubscribeClusterModeStatus__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeMyKey__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeMyKey__request = {
- "VehicleInfo",
- "SubscribeMyKey",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey,
- VehicleInfo__SubscribeMyKey__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__SubscribeMyKey__response__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__SubscribeMyKey__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__SubscribeMyKey__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__SubscribeMyKey__response = {
- "VehicleInfo",
- "SubscribeMyKey",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey,
- VehicleInfo__SubscribeMyKey__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeMyKey__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeMyKey__request = {
- "VehicleInfo",
- "UnsubscribeMyKey",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey,
- VehicleInfo__UnsubscribeMyKey__request__parameters};
-
-const ford_message_descriptions::StructDescription
- VehicleInfo__UnsubscribeMyKey__response__parameter1 = {
- {"myKey", ford_message_descriptions::Struct, true},
- Structs::Common__VehicleDataResult__parameters};
-const ford_message_descriptions::ParameterDescription*
- VehicleInfo__UnsubscribeMyKey__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&VehicleInfo__UnsubscribeMyKey__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- VehicleInfo__UnsubscribeMyKey__response = {
- "VehicleInfo",
- "UnsubscribeMyKey",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey,
- VehicleInfo__UnsubscribeMyKey__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__ActivateApp__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__ActivateApp__request =
- {"SDL",
- "ActivateApp",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_ActivateApp,
- SDL__ActivateApp__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter1 = {
- "isSDLAllowed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::StructDescription
- SDL__ActivateApp__response__parameter2 = {
- {"device", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter3 = {
- "isPermissionsConsentNeeded", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter4 = {
- "isAppPermissionsRevoked", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::StructDescription
- SDL__ActivateApp__response__parameter5_array = {
- {"appRevokedPermissions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__ActivateApp__response__parameter5 = {
- {"appRevokedPermissions", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter5_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter6 = {
- "isAppRevoked", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- SDL__ActivateApp__response__parameter7 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- SDL__ActivateApp__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__ActivateApp__response__parameter7,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__ActivateApp__response =
- {"SDL",
- "ActivateApp",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_ActivateApp,
- SDL__ActivateApp__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetUserFriendlyMessage__request__parameter1_array = {
- "messageCodes", ford_message_descriptions::String, true};
-const ford_message_descriptions::ArrayDescription
- SDL__GetUserFriendlyMessage__request__parameter1 = {
- {"messageCodes", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter1_array,
- "s"};
-const ford_message_descriptions::ParameterDescription
- SDL__GetUserFriendlyMessage__request__parameter2 = {
- "language", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetUserFriendlyMessage__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetUserFriendlyMessage__request = {
- "SDL",
- "GetUserFriendlyMessage",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetUserFriendlyMessage,
- SDL__GetUserFriendlyMessage__request__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__GetUserFriendlyMessage__response__parameter1_array = {
- {"messages", ford_message_descriptions::Struct, true},
- Structs::Common__UserFriendlyMessage__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__GetUserFriendlyMessage__response__parameter1 = {
- {"messages", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__response__parameter1_array,
- "(s(bs)(bs)(bs)(bs)(bs))"};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetUserFriendlyMessage__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetUserFriendlyMessage__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetUserFriendlyMessage__response = {
- "SDL",
- "GetUserFriendlyMessage",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetUserFriendlyMessage,
- SDL__GetUserFriendlyMessage__response__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__OnAllowSDLFunctionality__notification__parameter1 = {
- {"device", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAllowSDLFunctionality__notification__parameter2 = {
- "allowed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAllowSDLFunctionality__notification__parameter3 = {
- "source", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnAllowSDLFunctionality__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnAllowSDLFunctionality__notification = {
- "SDL",
- "OnAllowSDLFunctionality",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality,
- SDL__OnAllowSDLFunctionality__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnReceivedPolicyUpdate__notification__parameter1 = {
- "policyfile", ford_message_descriptions::String, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnReceivedPolicyUpdate__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnReceivedPolicyUpdate__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnReceivedPolicyUpdate__notification = {
- "SDL",
- "OnReceivedPolicyUpdate",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate,
- SDL__OnReceivedPolicyUpdate__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- SDL__OnPolicyUpdate__notification__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnPolicyUpdate__notification = {
- "SDL",
- "OnPolicyUpdate",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnPolicyUpdate,
- SDL__OnPolicyUpdate__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetListOfPermissions__request__parameter1 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetListOfPermissions__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetListOfPermissions__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetListOfPermissions__request = {
- "SDL",
- "GetListOfPermissions",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetListOfPermissions,
- SDL__GetListOfPermissions__request__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__GetListOfPermissions__response__parameter1_array = {
- {"allowedFunctions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__GetListOfPermissions__response__parameter1 = {
- {"allowedFunctions", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetListOfPermissions__response__parameter1_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetListOfPermissions__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetListOfPermissions__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetListOfPermissions__response = {
- "SDL",
- "GetListOfPermissions",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetListOfPermissions,
- SDL__GetListOfPermissions__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionConsent__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, false};
-const ford_message_descriptions::StructDescription
- SDL__OnAppPermissionConsent__notification__parameter2_array = {
- {"consentedFunctions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__OnAppPermissionConsent__notification__parameter2 = {
- {"consentedFunctions", ford_message_descriptions::Array, true},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter2_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionConsent__notification__parameter3 = {
- "source", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnAppPermissionConsent__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnAppPermissionConsent__notification = {
- "SDL",
- "OnAppPermissionConsent",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnAppPermissionConsent,
- SDL__OnAppPermissionConsent__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter1 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter2 = {
- "isAppPermissionsRevoked", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::StructDescription
- SDL__OnAppPermissionChanged__notification__parameter3_array = {
- {"appRevokedPermissions", ford_message_descriptions::Struct, true},
- Structs::Common__PermissionItem__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__OnAppPermissionChanged__notification__parameter3 = {
- {"appRevokedPermissions", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter3_array,
- "(si(bb))"};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter4 = {
- "appRevoked", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter5 = {
- "appPermissionsConsentNeeded",
- ford_message_descriptions::Boolean,
- false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter6 = {
- "appUnauthorized", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter7 = {
- "priority", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription
- SDL__OnAppPermissionChanged__notification__parameter8_array = {
- "requestType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ArrayDescription
- SDL__OnAppPermissionChanged__notification__parameter8 = {
- {"requestType", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter8_array,
- "i"};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnAppPermissionChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter3,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter4,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter5,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter6,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter7,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter8,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnAppPermissionChanged__notification = {
- "SDL",
- "OnAppPermissionChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnAppPermissionChanged,
- SDL__OnAppPermissionChanged__notification__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__OnSDLConsentNeeded__notification__parameter1 = {
- {"device", ford_message_descriptions::Struct, true},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnSDLConsentNeeded__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnSDLConsentNeeded__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnSDLConsentNeeded__notification = {
- "SDL",
- "OnSDLConsentNeeded",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnSDLConsentNeeded,
- SDL__OnSDLConsentNeeded__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- SDL__UpdateSDL__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription SDL__UpdateSDL__request = {
- "SDL",
- "UpdateSDL",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_UpdateSDL,
- SDL__UpdateSDL__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__UpdateSDL__response__parameter1 = {
- "result", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__UpdateSDL__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__UpdateSDL__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__UpdateSDL__response = {
- "SDL",
- "UpdateSDL",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_UpdateSDL,
- SDL__UpdateSDL__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- SDL__GetStatusUpdate__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetStatusUpdate__request = {"SDL",
- "GetStatusUpdate",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetStatusUpdate,
- SDL__GetStatusUpdate__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetStatusUpdate__response__parameter1 = {
- "status", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetStatusUpdate__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetStatusUpdate__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__GetStatusUpdate__response = {
- "SDL",
- "GetStatusUpdate",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetStatusUpdate,
- SDL__GetStatusUpdate__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnStatusUpdate__notification__parameter1 = {
- "status", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnStatusUpdate__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnStatusUpdate__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnStatusUpdate__notification = {
- "SDL",
- "OnStatusUpdate",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnStatusUpdate,
- SDL__OnStatusUpdate__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnSystemError__notification__parameter1 = {
- "error", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnSystemError__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnSystemError__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnSystemError__notification = {
- "SDL",
- "OnSystemError",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnSystemError,
- SDL__OnSystemError__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__AddStatisticsInfo__notification__parameter1 = {
- "statisticType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__AddStatisticsInfo__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__AddStatisticsInfo__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__AddStatisticsInfo__notification = {
- "SDL",
- "AddStatisticsInfo",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_AddStatisticsInfo,
- SDL__AddStatisticsInfo__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__GetURLS__request__parameter1 = {
- "service", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetURLS__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetURLS__request__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__GetURLS__request = {
- "SDL",
- "GetURLS",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::SDL_GetURLS,
- SDL__GetURLS__request__parameters};
-
-const ford_message_descriptions::StructDescription
- SDL__GetURLS__response__parameter1_array = {
- {"urls", ford_message_descriptions::Struct, true},
- Structs::Common__ServiceInfo__parameters};
-const ford_message_descriptions::ArrayDescription
- SDL__GetURLS__response__parameter1 = {
- {"urls", ford_message_descriptions::Array, false},
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetURLS__response__parameter1_array,
- "(s(bs))"};
-const ford_message_descriptions::ParameterDescription*
- SDL__GetURLS__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__GetURLS__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription SDL__GetURLS__response = {
- "SDL",
- "GetURLS",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::SDL_GetURLS,
- SDL__GetURLS__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- SDL__OnDeviceStateChanged__notification__parameter1 = {
- "deviceState", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- SDL__OnDeviceStateChanged__notification__parameter2 = {
- "deviceInternalId", ford_message_descriptions::String, true};
-const ford_message_descriptions::StructDescription
- SDL__OnDeviceStateChanged__notification__parameter3 = {
- {"deviceId", ford_message_descriptions::Struct, false},
- Structs::Common__DeviceInfo__parameters};
-const ford_message_descriptions::ParameterDescription*
- SDL__OnDeviceStateChanged__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- SDL__OnDeviceStateChanged__notification = {
- "SDL",
- "OnDeviceStateChanged",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::SDL_OnDeviceStateChanged,
- SDL__OnDeviceStateChanged__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- RC__IsReady__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription RC__IsReady__request = {
- "RC",
- "IsReady",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_IsReady,
- RC__IsReady__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__IsReady__response__parameter1 = {
- "available", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- RC__IsReady__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__IsReady__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription RC__IsReady__response = {
- "RC",
- "IsReady",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_IsReady,
- RC__IsReady__response__parameters};
-
-const ford_message_descriptions::ParameterDescription*
- RC__GetCapabilities__request__parameters[] = {NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetCapabilities__request = {"RC",
- "GetCapabilities",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_GetCapabilities,
- RC__GetCapabilities__request__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__GetCapabilities__response__parameter1 = {
- {"remoteControlCapability", ford_message_descriptions::Struct, false},
- Structs::Common__RemoteControlCapabilities__parameters};
-const ford_message_descriptions::ParameterDescription*
- RC__GetCapabilities__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetCapabilities__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetCapabilities__response = {"RC",
- "GetCapabilities",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_GetCapabilities,
- RC__GetCapabilities__response__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__SetInteriorVehicleData__request__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription
- RC__SetInteriorVehicleData__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- RC__SetInteriorVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__SetInteriorVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__SetInteriorVehicleData__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__SetInteriorVehicleData__request = {
- "RC",
- "SetInteriorVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_SetInteriorVehicleData,
- RC__SetInteriorVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__SetInteriorVehicleData__response__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription*
- RC__SetInteriorVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__SetInteriorVehicleData__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__SetInteriorVehicleData__response = {
- "RC",
- "SetInteriorVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_SetInteriorVehicleData,
- RC__SetInteriorVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__request__parameter1 = {
- "moduleType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__request__parameter2 = {
- "subscribe", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__request__parameter3 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleData__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter2,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter3,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleData__request = {
- "RC",
- "GetInteriorVehicleData",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_GetInteriorVehicleData,
- RC__GetInteriorVehicleData__request__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__GetInteriorVehicleData__response__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleData__response__parameter2 = {
- "isSubscribed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleData__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__response__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleData__response__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleData__response = {
- "RC",
- "GetInteriorVehicleData",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_GetInteriorVehicleData,
- RC__GetInteriorVehicleData__response__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleDataConsent__request__parameter1 = {
- "moduleType", ford_message_descriptions::Enum, true};
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleDataConsent__request__parameter2 = {
- "appID", ford_message_descriptions::Integer, true};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleDataConsent__request__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleDataConsent__request__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleDataConsent__request__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleDataConsent__request = {
- "RC",
- "GetInteriorVehicleDataConsent",
- hmi_apis::messageType::request,
- hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
- RC__GetInteriorVehicleDataConsent__request__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__GetInteriorVehicleDataConsent__response__parameter1 = {
- "allowed", ford_message_descriptions::Boolean, true};
-const ford_message_descriptions::ParameterDescription*
- RC__GetInteriorVehicleDataConsent__response__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__GetInteriorVehicleDataConsent__response__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__GetInteriorVehicleDataConsent__response = {
- "RC",
- "GetInteriorVehicleDataConsent",
- hmi_apis::messageType::response,
- hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
- RC__GetInteriorVehicleDataConsent__response__parameters};
-
-const ford_message_descriptions::StructDescription
- RC__OnInteriorVehicleData__notification__parameter1 = {
- {"moduleData", ford_message_descriptions::Struct, true},
- Structs::Common__ModuleData__parameters};
-const ford_message_descriptions::ParameterDescription*
- RC__OnInteriorVehicleData__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__OnInteriorVehicleData__notification__parameter1,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__OnInteriorVehicleData__notification = {
- "RC",
- "OnInteriorVehicleData",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::RC_OnInteriorVehicleData,
- RC__OnInteriorVehicleData__notification__parameters};
-
-const ford_message_descriptions::ParameterDescription
- RC__OnRemoteControlSettings__notification__parameter1 = {
- "allowed", ford_message_descriptions::Boolean, false};
-const ford_message_descriptions::ParameterDescription
- RC__OnRemoteControlSettings__notification__parameter2 = {
- "accessMode", ford_message_descriptions::Enum, false};
-const ford_message_descriptions::ParameterDescription*
- RC__OnRemoteControlSettings__notification__parameters[] = {
- (const ford_message_descriptions::
- ParameterDescription*)&RC__OnRemoteControlSettings__notification__parameter1,
- (const ford_message_descriptions::
- ParameterDescription*)&RC__OnRemoteControlSettings__notification__parameter2,
- NULL};
-const ford_message_descriptions::MessageDescription
- RC__OnRemoteControlSettings__notification = {
- "RC",
- "OnRemoteControlSettings",
- hmi_apis::messageType::notification,
- hmi_apis::FunctionID::RC_OnRemoteControlSettings,
- RC__OnRemoteControlSettings__notification__parameters};
-}
-
-namespace ford_message_descriptions {
-
-const MessageDescription* message_descriptions[] = {
- &Buttons__GetCapabilities__request,
- &Buttons__GetCapabilities__response,
- &Buttons__OnButtonEvent__notification,
- &Buttons__OnButtonPress__notification,
- &Buttons__OnButtonSubscription__notification,
- &BasicCommunication__OnReady__notification,
- &BasicCommunication__OnStartDeviceDiscovery__notification,
- &BasicCommunication__OnUpdateDeviceList__notification,
- &BasicCommunication__OnPhoneCall__notification,
- &BasicCommunication__OnEmergencyEvent__notification,
- &BasicCommunication__OnResumeAudioSource__notification,
- &BasicCommunication__OnSDLPersistenceComplete__notification,
- &BasicCommunication__UpdateAppList__request,
- &BasicCommunication__UpdateAppList__response,
- &BasicCommunication__UpdateDeviceList__request,
- &BasicCommunication__UpdateDeviceList__response,
- &BasicCommunication__OnFileRemoved__notification,
- &BasicCommunication__AllowDeviceToConnect__request,
- &BasicCommunication__AllowDeviceToConnect__response,
- &BasicCommunication__OnDeviceChosen__notification,
- &BasicCommunication__OnFindApplications__notification,
- &BasicCommunication__ActivateApp__request,
- &BasicCommunication__ActivateApp__response,
- &BasicCommunication__OnAppActivated__notification,
- &BasicCommunication__OnAppDeactivated__notification,
- &BasicCommunication__OnAppRegistered__notification,
- &BasicCommunication__OnAppUnregistered__notification,
- &BasicCommunication__OnExitApplication__notification,
- &BasicCommunication__OnExitAllApplications__notification,
- &BasicCommunication__OnAwakeSDL__notification,
- &BasicCommunication__MixingAudioSupported__request,
- &BasicCommunication__MixingAudioSupported__response,
- &BasicCommunication__PlayTone__notification,
- &BasicCommunication__DialNumber__request,
- &BasicCommunication__DialNumber__response,
- &BasicCommunication__OnSystemRequest__notification,
- &BasicCommunication__SystemRequest__request,
- &BasicCommunication__SystemRequest__response,
- &BasicCommunication__PolicyUpdate__request,
- &BasicCommunication__PolicyUpdate__response,
- &BasicCommunication__OnSDLClose__notification,
- &BasicCommunication__OnPutFile__notification,
- &BasicCommunication__GetSystemInfo__request,
- &BasicCommunication__GetSystemInfo__response,
- &BasicCommunication__OnSystemInfoChanged__notification,
- &BasicCommunication__OnIgnitionCycleOver__notification,
- &BasicCommunication__DecryptCertificate__request,
- &BasicCommunication__DecryptCertificate__response,
- &BasicCommunication__OnEventChanged__notification,
- &VR__IsReady__request,
- &VR__IsReady__response,
- &VR__Started__notification,
- &VR__Stopped__notification,
- &VR__AddCommand__request,
- &VR__AddCommand__response,
- &VR__DeleteCommand__request,
- &VR__DeleteCommand__response,
- &VR__PerformInteraction__request,
- &VR__PerformInteraction__response,
- &VR__OnCommand__notification,
- &VR__ChangeRegistration__request,
- &VR__ChangeRegistration__response,
- &VR__OnLanguageChange__notification,
- &VR__GetSupportedLanguages__request,
- &VR__GetSupportedLanguages__response,
- &VR__GetLanguage__request,
- &VR__GetLanguage__response,
- &VR__GetCapabilities__request,
- &VR__GetCapabilities__response,
- &TTS__GetCapabilities__request,
- &TTS__GetCapabilities__response,
- &TTS__Started__notification,
- &TTS__Stopped__notification,
- &TTS__IsReady__request,
- &TTS__IsReady__response,
- &TTS__Speak__request,
- &TTS__Speak__response,
- &TTS__StopSpeaking__request,
- &TTS__StopSpeaking__response,
- &TTS__ChangeRegistration__request,
- &TTS__ChangeRegistration__response,
- &TTS__OnLanguageChange__notification,
- &TTS__GetSupportedLanguages__request,
- &TTS__GetSupportedLanguages__response,
- &TTS__GetLanguage__request,
- &TTS__GetLanguage__response,
- &TTS__SetGlobalProperties__request,
- &TTS__SetGlobalProperties__response,
- &TTS__OnResetTimeout__notification,
- &UI__Alert__request,
- &UI__Alert__response,
- &UI__Show__request,
- &UI__Show__response,
- &UI__AddCommand__request,
- &UI__AddCommand__response,
- &UI__DeleteCommand__request,
- &UI__DeleteCommand__response,
- &UI__AddSubMenu__request,
- &UI__AddSubMenu__response,
- &UI__DeleteSubMenu__request,
- &UI__DeleteSubMenu__response,
- &UI__PerformInteraction__request,
- &UI__PerformInteraction__response,
- &UI__SetMediaClockTimer__request,
- &UI__SetMediaClockTimer__response,
- &UI__SetGlobalProperties__request,
- &UI__SetGlobalProperties__response,
- &UI__OnCommand__notification,
- &UI__OnSystemContext__notification,
- &UI__GetCapabilities__request,
- &UI__GetCapabilities__response,
- &UI__ChangeRegistration__request,
- &UI__ChangeRegistration__response,
- &UI__OnLanguageChange__notification,
- &UI__GetSupportedLanguages__request,
- &UI__GetSupportedLanguages__response,
- &UI__GetLanguage__request,
- &UI__GetLanguage__response,
- &UI__OnDriverDistraction__notification,
- &UI__SetAppIcon__request,
- &UI__SetAppIcon__response,
- &UI__SetDisplayLayout__request,
- &UI__SetDisplayLayout__response,
- &UI__ShowCustomForm__request,
- &UI__ShowCustomForm__response,
- &UI__OnKeyboardInput__notification,
- &UI__OnTouchEvent__notification,
- &UI__Slider__request,
- &UI__Slider__response,
- &UI__ScrollableMessage__request,
- &UI__ScrollableMessage__response,
- &UI__PerformAudioPassThru__request,
- &UI__PerformAudioPassThru__response,
- &UI__EndAudioPassThru__request,
- &UI__EndAudioPassThru__response,
- &UI__IsReady__request,
- &UI__IsReady__response,
- &UI__ClosePopUp__request,
- &UI__ClosePopUp__response,
- &UI__OnResetTimeout__notification,
- &UI__OnRecordStart__notification,
- &UI__SendHapticData__request,
- &UI__SendHapticData__response,
- &Navigation__IsReady__request,
- &Navigation__IsReady__response,
- &Navigation__SendLocation__request,
- &Navigation__SendLocation__response,
- &Navigation__DialNumber__request,
- &Navigation__DialNumber__response,
- &Navigation__ShowConstantTBT__request,
- &Navigation__ShowConstantTBT__response,
- &Navigation__AlertManeuver__request,
- &Navigation__AlertManeuver__response,
- &Navigation__UpdateTurnList__request,
- &Navigation__UpdateTurnList__response,
- &Navigation__OnTBTClientState__notification,
- &Navigation__SetVideoConfig__request,
- &Navigation__SetVideoConfig__response,
- &Navigation__StartStream__request,
- &Navigation__StartStream__response,
- &Navigation__StopStream__request,
- &Navigation__StopStream__response,
- &Navigation__StartAudioStream__request,
- &Navigation__StartAudioStream__response,
- &Navigation__StopAudioStream__request,
- &Navigation__StopAudioStream__response,
- &Navigation__OnAudioDataStreaming__notification,
- &Navigation__OnVideoDataStreaming__notification,
- &Navigation__GetWayPoints__request,
- &Navigation__GetWayPoints__response,
- &Navigation__OnWayPointChange__notification,
- &Navigation__SubscribeWayPoints__request,
- &Navigation__SubscribeWayPoints__response,
- &Navigation__UnsubscribeWayPoints__request,
- &Navigation__UnsubscribeWayPoints__response,
- &VehicleInfo__IsReady__request,
- &VehicleInfo__IsReady__response,
- &VehicleInfo__GetVehicleType__request,
- &VehicleInfo__GetVehicleType__response,
- &VehicleInfo__ReadDID__request,
- &VehicleInfo__ReadDID__response,
- &VehicleInfo__GetDTCs__request,
- &VehicleInfo__GetDTCs__response,
- &VehicleInfo__DiagnosticMessage__request,
- &VehicleInfo__DiagnosticMessage__response,
- &VehicleInfo__SubscribeVehicleData__request,
- &VehicleInfo__SubscribeVehicleData__response,
- &VehicleInfo__UnsubscribeVehicleData__request,
- &VehicleInfo__UnsubscribeVehicleData__response,
- &VehicleInfo__GetVehicleData__request,
- &VehicleInfo__GetVehicleData__response,
- &VehicleInfo__OnVehicleData__notification,
- &VehicleInfo__GetGpsData__request,
- &VehicleInfo__GetGpsData__response,
- &VehicleInfo__GetSpeed__request,
- &VehicleInfo__GetSpeed__response,
- &VehicleInfo__GetRpm__request,
- &VehicleInfo__GetRpm__response,
- &VehicleInfo__GetFuelLevel__request,
- &VehicleInfo__GetFuelLevel__response,
- &VehicleInfo__GetFuelLevelState__request,
- &VehicleInfo__GetFuelLevelState__response,
- &VehicleInfo__GetInstantFuelConsumption__request,
- &VehicleInfo__GetInstantFuelConsumption__response,
- &VehicleInfo__GetExternalTemperature__request,
- &VehicleInfo__GetExternalTemperature__response,
- &VehicleInfo__GetVin__request,
- &VehicleInfo__GetVin__response,
- &VehicleInfo__GetPrndl__request,
- &VehicleInfo__GetPrndl__response,
- &VehicleInfo__GetTirePressure__request,
- &VehicleInfo__GetTirePressure__response,
- &VehicleInfo__GetOdometer__request,
- &VehicleInfo__GetOdometer__response,
- &VehicleInfo__GetBeltStatus__request,
- &VehicleInfo__GetBeltStatus__response,
- &VehicleInfo__GetBodyInformation__request,
- &VehicleInfo__GetBodyInformation__response,
- &VehicleInfo__GetDeviceStatus__request,
- &VehicleInfo__GetDeviceStatus__response,
- &VehicleInfo__GetDriverBraking__request,
- &VehicleInfo__GetDriverBraking__response,
- &VehicleInfo__GetWiperStatus__request,
- &VehicleInfo__GetWiperStatus__response,
- &VehicleInfo__GetHeadLampStatus__request,
- &VehicleInfo__GetHeadLampStatus__response,
- &VehicleInfo__GetEngineTorque__request,
- &VehicleInfo__GetEngineTorque__response,
- &VehicleInfo__GetAccPedalPosition__request,
- &VehicleInfo__GetAccPedalPosition__response,
- &VehicleInfo__GetSteeringWheelAngle__request,
- &VehicleInfo__GetSteeringWheelAngle__response,
- &VehicleInfo__GetECallInfo__request,
- &VehicleInfo__GetECallInfo__response,
- &VehicleInfo__GetAirbagStatus__request,
- &VehicleInfo__GetAirbagStatus__response,
- &VehicleInfo__GetEmergencyEvent__request,
- &VehicleInfo__GetEmergencyEvent__response,
- &VehicleInfo__GetClusterModeStatus__request,
- &VehicleInfo__GetClusterModeStatus__response,
- &VehicleInfo__GetMyKey__request,
- &VehicleInfo__GetMyKey__response,
- &VehicleInfo__OnGpsData__notification,
- &VehicleInfo__OnSpeed__notification,
- &VehicleInfo__OnRpm__notification,
- &VehicleInfo__OnFuelLevel__notification,
- &VehicleInfo__OnFuelLevelState__notification,
- &VehicleInfo__OnInstantFuelConsumption__notification,
- &VehicleInfo__OnExternalTemperature__notification,
- &VehicleInfo__OnVin__notification,
- &VehicleInfo__OnPrndl__notification,
- &VehicleInfo__OnTirePressure__notification,
- &VehicleInfo__OnOdometer__notification,
- &VehicleInfo__OnBeltStatus__notification,
- &VehicleInfo__OnBodyInformation__notification,
- &VehicleInfo__OnDeviceStatus__notification,
- &VehicleInfo__OnDriverBraking__notification,
- &VehicleInfo__OnWiperStatus__notification,
- &VehicleInfo__OnHeadLampStatus__notification,
- &VehicleInfo__OnEngineTorque__notification,
- &VehicleInfo__OnAccPedalPosition__notification,
- &VehicleInfo__OnSteeringWheelAngle__notification,
- &VehicleInfo__OnECallInfo__notification,
- &VehicleInfo__OnAirbagStatus__notification,
- &VehicleInfo__OnEmergencyEvent__notification,
- &VehicleInfo__OnClusterModeStatus__notification,
- &VehicleInfo__OnMyKey__notification,
- &VehicleInfo__SubscribeGps__request,
- &VehicleInfo__SubscribeGps__response,
- &VehicleInfo__UnsubscribeGps__request,
- &VehicleInfo__UnsubscribeGps__response,
- &VehicleInfo__SubscribeSpeed__request,
- &VehicleInfo__SubscribeSpeed__response,
- &VehicleInfo__UnsubscribeSpeed__request,
- &VehicleInfo__UnsubscribeSpeed__response,
- &VehicleInfo__SubscribeRpm__request,
- &VehicleInfo__SubscribeRpm__response,
- &VehicleInfo__UnsubscribeRpm__request,
- &VehicleInfo__UnsubscribeRpm__response,
- &VehicleInfo__SubscribeFuelLevel__request,
- &VehicleInfo__SubscribeFuelLevel__response,
- &VehicleInfo__UnsubscribeFuelLevel__request,
- &VehicleInfo__UnsubscribeFuelLevel__response,
- &VehicleInfo__SubscribeFuelLevel_State__request,
- &VehicleInfo__SubscribeFuelLevel_State__response,
- &VehicleInfo__UnsubscribeFuelLevel_State__request,
- &VehicleInfo__UnsubscribeFuelLevel_State__response,
- &VehicleInfo__SubscribeInstantFuelConsumption__request,
- &VehicleInfo__SubscribeInstantFuelConsumption__response,
- &VehicleInfo__UnsubscribeInstantFuelConsumption__request,
- &VehicleInfo__UnsubscribeInstantFuelConsumption__response,
- &VehicleInfo__SubscribeExternalTemperature__request,
- &VehicleInfo__SubscribeExternalTemperature__response,
- &VehicleInfo__UnsubscribeExternalTemperature__request,
- &VehicleInfo__UnsubscribeExternalTemperature__response,
- &VehicleInfo__SubscribePrndl__request,
- &VehicleInfo__SubscribePrndl__response,
- &VehicleInfo__UnsubscribePrndl__request,
- &VehicleInfo__UnsubscribePrndl__response,
- &VehicleInfo__SubscribeVin__request,
- &VehicleInfo__SubscribeVin__response,
- &VehicleInfo__UnsubscribeVin__request,
- &VehicleInfo__UnsubscribeVin__response,
- &VehicleInfo__SubscribeTirePressure__request,
- &VehicleInfo__SubscribeTirePressure__response,
- &VehicleInfo__UnsubscribeTirePressure__request,
- &VehicleInfo__UnsubscribeTirePressure__response,
- &VehicleInfo__SubscribeOdometer__request,
- &VehicleInfo__SubscribeOdometer__response,
- &VehicleInfo__UnsubscribeOdometer__request,
- &VehicleInfo__UnsubscribeOdometer__response,
- &VehicleInfo__SubscribeBeltStatus__request,
- &VehicleInfo__SubscribeBeltStatus__response,
- &VehicleInfo__UnsubscribeBeltStatus__request,
- &VehicleInfo__UnsubscribeBeltStatus__response,
- &VehicleInfo__SubscribeBodyInformation__request,
- &VehicleInfo__SubscribeBodyInformation__response,
- &VehicleInfo__UnsubscribeBodyInformation__request,
- &VehicleInfo__UnsubscribeBodyInformation__response,
- &VehicleInfo__SubscribeDeviceStatus__request,
- &VehicleInfo__SubscribeDeviceStatus__response,
- &VehicleInfo__UnsubscribeDeviceStatus__request,
- &VehicleInfo__UnsubscribeDeviceStatus__response,
- &VehicleInfo__SubscribeDriverBraking__request,
- &VehicleInfo__SubscribeDriverBraking__response,
- &VehicleInfo__UnsubscribeDriverBraking__request,
- &VehicleInfo__UnsubscribeDriverBraking__response,
- &VehicleInfo__SubscribeWiperStatus__request,
- &VehicleInfo__SubscribeWiperStatus__response,
- &VehicleInfo__UnsubscribeWiperStatus__request,
- &VehicleInfo__UnsubscribeWiperStatus__response,
- &VehicleInfo__SubscribeHeadLampStatus__request,
- &VehicleInfo__SubscribeHeadLampStatus__response,
- &VehicleInfo__UnsubscribeHeadLampStatus__request,
- &VehicleInfo__UnsubscribeHeadLampStatus__response,
- &VehicleInfo__SubscribeEngineTorque__request,
- &VehicleInfo__SubscribeEngineTorque__response,
- &VehicleInfo__UnsubscribeEngineTorque__request,
- &VehicleInfo__UnsubscribeEngineTorque__response,
- &VehicleInfo__SubscribeAccPedalPosition__request,
- &VehicleInfo__SubscribeAccPedalPosition__response,
- &VehicleInfo__UnsubscribeAccPedalPosition__request,
- &VehicleInfo__UnsubscribeAccPedalPosition__response,
- &VehicleInfo__SubscribeSteeringWheelAngle__request,
- &VehicleInfo__SubscribeSteeringWheelAngle__response,
- &VehicleInfo__UnsubscribeSteeringWheelAngle__request,
- &VehicleInfo__UnsubscribeSteeringWheelAngle__response,
- &VehicleInfo__SubscribeECallInfo__request,
- &VehicleInfo__SubscribeECallInfo__response,
- &VehicleInfo__UnsubscribeECallInfo__request,
- &VehicleInfo__UnsubscribeECallInfo__response,
- &VehicleInfo__SubscribeAirbagStatus__request,
- &VehicleInfo__SubscribeAirbagStatus__response,
- &VehicleInfo__UnsubscribeAirbagStatus__request,
- &VehicleInfo__UnsubscribeAirbagStatus__response,
- &VehicleInfo__SubscribeEmergencyEvent__request,
- &VehicleInfo__SubscribeEmergencyEvent__response,
- &VehicleInfo__UnsubscribeEmergencyEvent__request,
- &VehicleInfo__UnsubscribeEmergencyEvent__response,
- &VehicleInfo__SubscribeClusterModeStatus__request,
- &VehicleInfo__SubscribeClusterModeStatus__response,
- &VehicleInfo__UnsubscribeClusterModeStatus__request,
- &VehicleInfo__UnsubscribeClusterModeStatus__response,
- &VehicleInfo__SubscribeMyKey__request,
- &VehicleInfo__SubscribeMyKey__response,
- &VehicleInfo__UnsubscribeMyKey__request,
- &VehicleInfo__UnsubscribeMyKey__response,
- &SDL__ActivateApp__request,
- &SDL__ActivateApp__response,
- &SDL__GetUserFriendlyMessage__request,
- &SDL__GetUserFriendlyMessage__response,
- &SDL__OnAllowSDLFunctionality__notification,
- &SDL__OnReceivedPolicyUpdate__notification,
- &SDL__OnPolicyUpdate__notification,
- &SDL__GetListOfPermissions__request,
- &SDL__GetListOfPermissions__response,
- &SDL__OnAppPermissionConsent__notification,
- &SDL__OnAppPermissionChanged__notification,
- &SDL__OnSDLConsentNeeded__notification,
- &SDL__UpdateSDL__request,
- &SDL__UpdateSDL__response,
- &SDL__GetStatusUpdate__request,
- &SDL__GetStatusUpdate__response,
- &SDL__OnStatusUpdate__notification,
- &SDL__OnSystemError__notification,
- &SDL__AddStatisticsInfo__notification,
- &SDL__GetURLS__request,
- &SDL__GetURLS__response,
- &SDL__OnDeviceStateChanged__notification,
- &RC__IsReady__request,
- &RC__IsReady__response,
- &RC__GetCapabilities__request,
- &RC__GetCapabilities__response,
- &RC__SetInteriorVehicleData__request,
- &RC__SetInteriorVehicleData__response,
- &RC__GetInteriorVehicleData__request,
- &RC__GetInteriorVehicleData__response,
- &RC__GetInteriorVehicleDataConsent__request,
- &RC__GetInteriorVehicleDataConsent__response,
- &RC__OnInteriorVehicleData__notification,
- &RC__OnRemoteControlSettings__notification,
- NULL};
-}
diff --git a/src/components/dbus/src/schema.cc b/src/components/dbus/src/schema.cc
deleted file mode 100644
index 3107d9ce6c..0000000000
--- a/src/components/dbus/src/schema.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2013, 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 "dbus/schema.h"
-
-#include <algorithm>
-#include <functional>
-
-namespace dbus {
-
-struct Description {
- MessageId id;
- MessageName name;
- MessageType type;
- ListArgs args;
-};
-
-struct IsId : public std::unary_function<const Description*, bool> {
- explicit IsId(MessageId id) : id_(id) {}
- bool operator()(const Description* desc) {
- return desc->id == id_;
- }
-
- private:
- MessageId id_;
-};
-
-struct IsName : public std::unary_function<const Description*, bool> {
- explicit IsName(const MessageName& name) : name_(name) {}
- bool operator()(const Description* desc) {
- return desc->name == name_;
- }
-
- private:
- MessageName name_;
-};
-
-struct IsIdType : public std::unary_function<const Description*, bool> {
- explicit IsIdType(const MessageId& id, const MessageType& type)
- : id_(id), type_(type) {}
- bool operator()(const Description* desc) {
- return desc->id == id_ && desc->type == type_;
- }
-
- private:
- MessageId id_;
- MessageType type_;
-};
-
-struct IsNameType : public std::unary_function<const Description*, bool> {
- explicit IsNameType(const MessageName& name, const MessageType& type)
- : name_(name), type_(type) {}
- bool operator()(const Description* desc) {
- return desc->name == name_ && desc->type == type_;
- }
-
- private:
- MessageName name_;
- MessageType type_;
-};
-
-DBusSchema::DBusSchema(const MessageDescription** array) {
- const MessageDescription** msg = array;
- while (*msg != NULL) {
- Description* desc = new Description();
- desc->id = (*msg)->function_id;
- desc->name = std::make_pair((*msg)->interface, (*msg)->name);
- desc->type = (*msg)->message_type;
- const ParameterDescription** param;
- param = (*msg)->parameters;
- while (*param != NULL) {
- desc->args.push_back(*param);
- param++;
- }
- msgs_.push_back(desc);
- msg++;
- }
-}
-
-MessageName DBusSchema::getMessageName(MessageId id) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsId(id));
- if (msgs_.end() != it) {
- return (*it)->name;
- }
- return MessageName();
-}
-
-MessageId DBusSchema::getMessageId(const MessageName& name) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsName(name));
- if (msgs_.end() != it) {
- return (*it)->id;
- }
- return hmi_apis::FunctionID::eType::INVALID_ENUM;
-}
-
-ListArgs DBusSchema::getListArgs(MessageId id, MessageType type) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsIdType(id, type));
- if (msgs_.end() != it) {
- return (*it)->args;
- }
- return ListArgs();
-}
-
-ListArgs DBusSchema::getListArgs(const MessageName& name,
- MessageType type) const {
- Messages::const_iterator it =
- std::find_if(msgs_.begin(), msgs_.end(), IsNameType(name, type));
- if (msgs_.end() != it) {
- return (*it)->args;
- }
- return ListArgs();
-}
-
-} // namespace dbus_schema
diff --git a/src/components/dbus/test/dbus_message_controller_test.cc b/src/components/dbus/test/dbus_message_controller_test.cc
deleted file mode 100644
index c06e144f9b..0000000000
--- a/src/components/dbus/test/dbus_message_controller_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * Copyright (c) 2013, 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 <pthread.h>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-#include "dbus/mock_dbus_message_controller.h"
-#include "dbus/mock_subscriber.h"
-
-using ::testing::_;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-ACTION_P(SignalTest, test) {
- if (test->thread_id != pthread_self()) {
- pthread_mutex_lock(&test->test_mutex);
- pthread_cond_signal(&test->test_cond);
- pthread_mutex_unlock(&test->test_mutex);
- } else {
- test->one_thread = true;
- }
-}
-
-class DBusMessageControllerTest : public ::testing::Test {
- public:
- volatile bool one_thread;
- pthread_t thread_id;
- static pthread_mutex_t test_mutex;
- static pthread_cond_t test_cond;
-
- protected:
- MockDBusMessageController* controller_;
- MockSubscriber* subscriber_;
-
- static void SetUpTestCase() {}
-
- static void TearDownTestCase() {}
-
- virtual void SetUp() {
- const std::string kService = "sdl.core.test_api";
- const std::string kPath = "/dbus_test";
- controller_ = new MockDBusMessageController(kService, kPath);
- subscriber_ = new MockSubscriber(kService, kPath);
- ASSERT_TRUE(controller_->Init());
- ASSERT_TRUE(subscriber_->Start());
- }
-
- void TearDown() OVERRIDE {
- delete controller_;
- delete subscriber_;
- }
-
- bool waitCond(int seconds) {
- if (one_thread)
- return true;
- timespec elapsed;
- clock_gettime(CLOCK_REALTIME, &elapsed);
- elapsed.tv_sec += seconds;
- return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) !=
- ETIMEDOUT;
- }
-};
-
-pthread_mutex_t DBusMessageControllerTest::test_mutex;
-pthread_cond_t DBusMessageControllerTest::test_cond;
-
-TEST_F(DBusMessageControllerTest, Receive) {
- std::string text = "Test message for call method DBus";
- EXPECT_CALL(*controller_, Recv(text)).Times(1).WillOnce(SignalTest(this));
- subscriber_->Send(text);
- EXPECT_TRUE(waitCond(1));
-}
-
-TEST_F(DBusMessageControllerTest, DISABLED_Send) {
- const std::string kText = "Test message for signal DBus";
- // EXPECT_CALL(*subscriber_, Receive(kText)).Times(1);
- controller_->Send(kText);
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h b/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h
deleted file mode 100644
index 30410a6c7e..0000000000
--- a/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2014, 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_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
-#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
-
-#include <pthread.h>
-#include "dbus/dbus_message_controller.h"
-
-namespace test {
-namespace components {
-namespace dbus_test {
-
-class MockDBusMessageController : public ::dbus::DBusMessageController {
- public:
- MOCK_METHOD1(Recv, void(std::string&));
-
- MockDBusMessageController(const std::string& serviceName,
- const std::string& path)
- : DBusMessageController(serviceName, path), thread_() {}
-
- virtual void processResponse(std::string method, Json::Value& root) {}
- virtual void processRequest(Json::Value& root) {}
- virtual void processNotification(Json::Value& root) {}
-
- bool Init() {
- return ::hmi_message_handler::DBusMessageController::Init() &&
- pthread_create(&thread_, 0, &Run, this) == 0;
- }
-
- private:
- pthread_t thread_;
- static void* Run(void* data) {
- if (NULL != data) {
- static_cast<MockDBusMessageController*>(data)
- ->MethodForReceiverThread(nullptr);
- }
- return 0;
- }
-};
-
-} // namespace dbus_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/dbus/test/schema_test.cc b/src/components/dbus/test/schema_test.cc
deleted file mode 100644
index 37831279b9..0000000000
--- a/src/components/dbus/test/schema_test.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * \file test_schema.cc
- * \brief
- *
- * Copyright (c) 2013, 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 "dbus/schema.h"
-
-using dbus::DBusSchema;
-using dbus::MessageId;
-using dbus::MessageName;
-using dbus::MessageType;
-using dbus::ListArgs;
-using ford_message_descriptions::ParameterDescription;
-
-namespace test {
-namespace components {
-namespace dbus {
-
-class DBusSchemaTest : public ::testing::Test {
- protected:
- static void SetUpTestCase() {
- schema_ = new DBusSchema(ford_message_descriptions::message_descriptions);
- }
-
- static void TearDownTestCase() {
- delete schema_;
- }
-
- static const DBusSchema* schema_;
- static const int test_negative_value = -3;
-};
-
-const DBusSchema* DBusSchemaTest::schema_ = 0;
-
-TEST_F(DBusSchemaTest, GetName) {
- const MessageId kId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- const MessageName kExpName("Buttons", "GetCapabilities");
- MessageName name = schema_->getMessageName(kId);
- EXPECT_EQ(kExpName, name);
-
- const MessageId kIdWrong = static_cast<const MessageId>(test_negative_value);
- const MessageName kExpNameWrong("", "");
- name = schema_->getMessageName(kIdWrong);
- EXPECT_EQ(kExpNameWrong, name);
-}
-
-TEST_F(DBusSchemaTest, GetId) {
- const MessageName kName("Buttons", "GetCapabilities");
- const MessageId kExpId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- MessageId id = schema_->getMessageId(kName);
- EXPECT_EQ(kExpId, id);
-
- const MessageName kNameWrong("TestInterface", "TestMessage");
- const MessageId kExpIdWrong = hmi_apis::FunctionID::INVALID_ENUM;
- id = schema_->getMessageId(kNameWrong);
- EXPECT_EQ(kExpIdWrong, id);
-}
-
-TEST_F(DBusSchemaTest, GetListArg) {
- const MessageName kName("Buttons", "GetCapabilities");
- const MessageType kType = hmi_apis::messageType::response;
- const MessageId kId = hmi_apis::FunctionID::Buttons_GetCapabilities;
- ListArgs argsName = schema_->getListArgs(kName, kType);
- const ParameterDescription** params =
- ford_message_descriptions::message_descriptions[1]->parameters;
- EXPECT_EQ(params[0], argsName[0]);
- EXPECT_EQ(params[1], argsName[1]);
-
- ListArgs argsId = schema_->getListArgs(kId, kType);
- EXPECT_EQ(params[0], argsId[0]);
- EXPECT_EQ(params[1], argsId[1]);
-
- const MessageId kIdWrong = static_cast<const MessageId>(test_negative_value);
- const MessageName kNameWrong("TestInterface", "TestMessage");
- const MessageType kTypeWrong =
- static_cast<const MessageType>(test_negative_value);
- const ListArgs kExpListWrong;
- argsName = schema_->getListArgs(kNameWrong, kTypeWrong);
- EXPECT_EQ(kExpListWrong, argsName);
-
- argsId = schema_->getListArgs(kIdWrong, kTypeWrong);
- EXPECT_EQ(kExpListWrong, argsId);
-}
-
-} // namespace dbus
-} // namespace components
-} // namespace test
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.h b/src/components/formatters/include/formatters/CFormatterJsonBase.h
index 1df706839f..66ffa0c1c5 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonBase.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonBase.h
@@ -38,9 +38,9 @@
#include "smart_objects/smart_object.h"
#include "json/json.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
namespace meta_formatter_error_code {
/**
@@ -99,7 +99,7 @@ class CFormatterJsonBase {
*/
static void jsonValueToObj(
const Json::Value& value,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
* @brief The method constructs a JSON object from the input SmartObject
@@ -109,11 +109,11 @@ class CFormatterJsonBase {
*input SmartObject.
*/
static void objToJsonValue(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
Json::Value& value);
};
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
index f22b1216ab..d2fdf87957 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
@@ -40,9 +40,9 @@
#include "formatters/CSmartFactory.h"
#include "formatters/meta_formatter.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Class is used to convert SmartObjects to JSON string and vice versa.
@@ -69,7 +69,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @brief Extracts a message type from the SmartObject
*/
static const std::string getMessageType(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj);
/**
* @brief Extracts a message type from the root JSON object.
@@ -117,7 +117,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
static const int32_t kMessageTypeNotFound;
static const int32_t kCorrelationIdNotFound;
- typedef NsSmartDeviceLink::NsJSONHandler::Formatters::
+ typedef ns_smart_device_link::ns_json_handler::formatters::
meta_formatter_error_code::tMetaFormatterErrorCode
tMetaFormatterErrorCode;
@@ -129,7 +129,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @return true if success, false otherwise
*/
static bool toString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& outStr);
/**
@@ -142,7 +142,7 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
template <typename FunctionId, typename MessageType>
static int32_t fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out);
+ ns_smart_device_link::ns_smart_objects::SmartObject& out);
/**
* @brief Converts to string the smart object against the given schema
@@ -154,17 +154,17 @@ class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
std::string& outStr);
};
// ----------------------------------------------------------------------------
template <typename FunctionId, typename MessageType>
-int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
+int32_t formatters::CFormatterJsonSDLRPCv1::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
try {
@@ -189,7 +189,7 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
MessageType messageType = MessageType::INVALID_ENUM;
if (kSuccess == result) {
- if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum(
type, &messageType)) {
// If MessageType is not found than FunctionId and CorrelationId can not
// be found either
@@ -199,14 +199,14 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
if (kSuccess == result) {
- if (!NsSmartObjects::EnumConversionHelper<FunctionId>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<FunctionId>::StringToEnum(
root[type][S_NAME].asString(), &functionId)) {
result = kFunctionIdNotFound;
functionId = FunctionId::INVALID_ENUM;
}
}
- namespace S = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace S = ns_smart_device_link::ns_json_handler::strings;
if (!(result & kMessageTypeNotFound)) {
jsonValueToObj(root[type][S_PARAMETERS], out[S::S_MSG_PARAMS]);
@@ -234,6 +234,6 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
index 8260a35959..e248954552 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
@@ -38,9 +38,9 @@
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Class is used to convert SmartObjects to JSON string and vice versa.
@@ -64,7 +64,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
CFormatterJsonSDLRPCv2(const CFormatterJsonSDLRPCv2&);
public:
- typedef NsSmartDeviceLink::NsJSONHandler::Formatters::
+ typedef ns_smart_device_link::ns_json_handler::formatters::
meta_formatter_error_code::tMetaFormatterErrorCode
tMetaFormatterErrorCode;
@@ -76,7 +76,7 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, false otherwise
*/
static bool toString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& outStr);
/**
@@ -91,10 +91,11 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, otherwise - false
*/
template <typename FunctionId, typename MessageType>
- static bool fromString(const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
- FunctionId functionId,
- MessageType messageType);
+ static bool fromString(
+ const std::string& str,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
+ FunctionId functionId,
+ MessageType messageType);
/**
* @brief Creates a SmartObject from a JSON string.
@@ -113,11 +114,12 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return true if success, otherwise - false
*/
template <typename FunctionId, typename MessageType>
- static bool fromString(const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
- FunctionId functionId,
- MessageType messageType,
- int32_t correlationId);
+ static bool fromString(
+ const std::string& str,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
+ FunctionId functionId,
+ MessageType messageType,
+ int32_t correlationId);
/**
* @brief Converts to string the smart object against the given schema
@@ -129,15 +131,15 @@ class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
* @return formatting error code
*/
static tMetaFormatterErrorCode MetaFormatToString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
std::string& outStr);
};
template <typename FunctionId, typename MessageType>
inline bool CFormatterJsonSDLRPCv2::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
FunctionId functionId,
MessageType messageType) {
bool result = true;
@@ -146,7 +148,7 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
Json::Value root;
Json::Reader reader;
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
bool result = reader.parse(str, root);
if (true == result) {
@@ -167,12 +169,12 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
template <typename FunctionId, typename MessageType>
inline bool CFormatterJsonSDLRPCv2::fromString(
const std::string& str,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ ns_smart_device_link::ns_smart_objects::SmartObject& out,
FunctionId functionId,
MessageType messageType,
int32_t correlationId) {
bool result = fromString(str, out, functionId, messageType);
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
if (true == result) {
out[strings::S_PARAMS][strings::S_CORRELATION_ID] = correlationId;
@@ -182,6 +184,6 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
}
}
}
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h
index 9fed89253b..a48eab2a6b 100644
--- a/src/components/formatters/include/formatters/CSmartFactory.h
+++ b/src/components/formatters/include/formatters/CSmartFactory.h
@@ -40,8 +40,8 @@
#include <map>
#include <string>
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
/**
* @brief String constants used by SmartFactory.
*/
@@ -82,6 +82,10 @@ extern const std::string S_PROTOCOL_TYPE;
extern const std::string S_CORRELATION_ID;
/**
+ * @brief String constant for RPC_MSG_VERSION.
+ */
+extern const std::string S_RPC_MSG_VERSION;
+/**
* @brief String constant for "code" param name.
*/
extern const std::string kCode;
@@ -149,8 +153,10 @@ class CSmartFactory {
*
* @return True if operation was successful or false otherwise.
*/
- bool attachSchema(NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const bool RemoveFakeParameters);
+ bool attachSchema(
+ ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Attach schema to the struct SmartObject.
@@ -160,8 +166,9 @@ class CSmartFactory {
*
* @return True if operation was successful of false otherwise.
*/
- bool AttachSchema(const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object);
+ bool AttachSchema(
+ const StructIdEnum struct_id,
+ ns_smart_device_link::ns_smart_objects::SmartObject& object);
/**
* @brief Create new SmartObject with attached function SmartSchema.
@@ -176,7 +183,7 @@ class CSmartFactory {
* SmartObject) function returns empty SmartObject with
* null type.
*/
- NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartObject CreateSmartObject(
const FunctionIdEnum function_id, const MessageTypeEnum message_type);
/**
@@ -191,7 +198,7 @@ class CSmartFactory {
* SmartObject) function returns empty SmartObject with
* null type.
*/
- NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartObject CreateSmartObject(
const StructIdEnum struct_id);
/**
@@ -210,7 +217,7 @@ class CSmartFactory {
*/
bool GetSchema(const FunctionIdEnum function_id,
const MessageTypeEnum message_type,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result);
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result);
/**
* @brief Get SmartSchema for specific struct.
@@ -227,7 +234,7 @@ class CSmartFactory {
* found or false otherwise.
*/
bool GetSchema(const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result);
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result);
protected:
/**
@@ -237,7 +244,7 @@ class CSmartFactory {
* functions.
*/
typedef std::map<SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ ns_smart_device_link::ns_smart_objects::CSmartSchema>
FuncionsSchemesMap;
/**
@@ -247,7 +254,7 @@ class CSmartFactory {
* structs.
*/
typedef std::map<StructIdEnum,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ ns_smart_device_link::ns_smart_objects::CSmartSchema>
StructsSchemesMap;
/**
@@ -268,8 +275,9 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CSmartFactory(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const bool RemoveFakeParameters) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (false == object.keyExists(strings::S_PARAMS))
return false;
if (false == object[strings::S_PARAMS].keyExists(strings::S_MESSAGE_TYPE))
@@ -295,7 +303,9 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
}
object.setSchema(schemaIterator->second);
- schemaIterator->second.applySchema(object, RemoveFakeParameters);
+
+ schemaIterator->second.applySchema(
+ object, RemoveFakeParameters, MessageVersion);
return true;
}
@@ -303,7 +313,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::AttachSchema(
const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& object) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& object) {
typename StructsSchemesMap::iterator structs_iterator =
structs_schemes_.find(struct_id);
@@ -318,7 +328,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::AttachSchema(
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
-NsSmartDeviceLink::NsSmartObjects::SmartObject
+ns_smart_device_link::ns_smart_objects::SmartObject
CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
const FunctionIdEnum function_id, const MessageTypeEnum message_type) {
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
@@ -328,34 +338,34 @@ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
functions_schemes_.find(key);
if (schema_iterator != functions_schemes_.end()) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject function_object(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ ns_smart_device_link::ns_smart_objects::SmartObject function_object(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
function_object.setSchema(schema_iterator->second);
schema_iterator->second.applySchema(function_object, false);
return function_object;
}
- return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ return ns_smart_device_link::ns_smart_objects::SmartObject();
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
-NsSmartDeviceLink::NsSmartObjects::SmartObject
+ns_smart_device_link::ns_smart_objects::SmartObject
CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CreateSmartObject(
const StructIdEnum struct_id) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject struct_object(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ ns_smart_device_link::ns_smart_objects::SmartObject struct_object(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
if (AttachSchema(struct_id, struct_object)) {
return struct_object;
}
- return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ return ns_smart_device_link::ns_smart_objects::SmartObject();
}
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
const FunctionIdEnum function_id,
const MessageTypeEnum message_type,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result) {
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result) {
SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
message_type);
@@ -373,7 +383,7 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::GetSchema(
const StructIdEnum struct_id,
- NsSmartDeviceLink::NsSmartObjects::CSmartSchema& result) {
+ ns_smart_device_link::ns_smart_objects::CSmartSchema& result) {
typename StructsSchemesMap::iterator structs_iterator =
structs_schemes_.find(struct_id);
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index 3d921ea901..842e176976 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -45,9 +45,9 @@
#include "CFormatterJsonBase.h"
#include "formatters/CSmartFactory.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Formatter for JSON RPC format.
@@ -108,7 +108,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*
* @return true if success, false otherwise.
*/
- static bool ToString(const NsSmartObjects::SmartObject& obj,
+ static bool ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str);
/**
@@ -125,7 +125,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*/
template <typename FunctionId, typename MessageType>
static int32_t FromString(const std::string& str,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
private:
/**
@@ -223,7 +223,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
*/
template <typename FunctionId>
static int32_t ParseFunctionId(const Json::Value& method_value,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
/**
* @brief Set method.
@@ -237,7 +237,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if function id was extracted successfully and set as a
* value of "method" field.
*/
- static bool SetMethod(const NsSmartObjects::SmartObject& params,
+ static bool SetMethod(const ns_smart_objects::SmartObject& params,
Json::Value& method_container);
/**
@@ -252,7 +252,7 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if request/response id was extracted successfully and set
* as a value of "id" field.
*/
- static bool SetId(const NsSmartObjects::SmartObject& params,
+ static bool SetId(const ns_smart_objects::SmartObject& params,
Json::Value& id_container);
/**
@@ -267,18 +267,18 @@ class FormatterJsonRpc : public CFormatterJsonBase {
* @return true if message string was extracted successfully and set
* as a value of "message" field.
*/
- static bool SetMessage(const NsSmartObjects::SmartObject& params,
+ static bool SetMessage(const ns_smart_objects::SmartObject& params,
Json::Value& id_container);
};
template <typename FunctionId, typename MessageType>
int32_t FormatterJsonRpc::FromString(const std::string& str,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
try {
Json::Value root;
Json::Reader reader;
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
if (false == reader.parse(str, root)) {
result = kParsingError | kMethodNotSpecified | kUnknownMethod |
@@ -309,7 +309,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
result |= ParseFunctionId<FunctionId>(root[kMethod], out);
}
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
} else {
const Json::Value& id_value = root[kId];
@@ -323,7 +323,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
id_value.asDouble();
} else if (true == id_value.isNull()) {
out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Null);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Null);
} else {
result |= kInvalidFormat | kInvalidId;
}
@@ -332,14 +332,14 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
message_type_string = kRequest;
result |= ParseFunctionId<FunctionId>(root[kMethod], out);
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
} else {
Json::Value method_container;
bool method_container_found = false;
if (true == root.isMember(kResult)) {
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
message_type_string = kResponse;
response_value = root[kResult];
@@ -348,7 +348,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
method_container_found = true;
} else if (true == root.isMember(kError)) {
out[strings::S_MSG_PARAMS] =
- NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ ns_smart_objects::SmartObject(ns_smart_objects::SmartType_Map);
message_type_string = kErrorResponse;
response_value = root[kError];
response_value_found = true;
@@ -382,7 +382,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
if (0 == (result & kUnknownMessageType)) {
MessageType message_type;
- if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<MessageType>::StringToEnum(
message_type_string, &message_type)) {
result |= kUnknownMessageType;
} else {
@@ -469,7 +469,7 @@ int32_t FormatterJsonRpc::FromString(const std::string& str,
template <typename FunctionId>
int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
int32_t result = kSuccess;
if (false == method_value.isString()) {
@@ -477,11 +477,11 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
} else {
FunctionId function_id;
- if (!NsSmartObjects::EnumConversionHelper<FunctionId>::CStringToEnum(
+ if (!ns_smart_objects::EnumConversionHelper<FunctionId>::CStringToEnum(
method_value.asCString(), &function_id)) {
result |= kUnknownMethod;
} else {
- namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ namespace strings = ns_smart_device_link::ns_json_handler::strings;
out[strings::S_PARAMS][strings::S_FUNCTION_ID] = function_id;
}
@@ -490,8 +490,8 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
diff --git a/src/components/formatters/include/formatters/generic_json_formatter.h b/src/components/formatters/include/formatters/generic_json_formatter.h
index 2b5d95fd4a..c9b9431ee5 100644
--- a/src/components/formatters/include/formatters/generic_json_formatter.h
+++ b/src/components/formatters/include/formatters/generic_json_formatter.h
@@ -37,9 +37,9 @@
#include "CFormatterJsonBase.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
class GenericJsonFormatter : public CFormatterJsonBase {
public:
@@ -49,7 +49,7 @@ class GenericJsonFormatter : public CFormatterJsonBase {
* @param obj Input SmartObject.
* @param out_str Resulting JSON string.
*/
- static void ToString(const NsSmartObjects::SmartObject& obj,
+ static void ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str);
/**
@@ -61,11 +61,11 @@ class GenericJsonFormatter : public CFormatterJsonBase {
* @return true if success, false otherwise.
*/
static bool FromString(const std::string& str,
- NsSmartObjects::SmartObject& out);
+ ns_smart_objects::SmartObject& out);
};
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
index 20abb3b848..36e39301f6 100644
--- a/src/components/formatters/include/formatters/meta_formatter.h
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -39,9 +39,9 @@
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
/**
* @brief Formats to string the smart object against given schema for given
@@ -66,13 +66,13 @@ class CMetaFormatter {
* @return true if successful, false - otherwise
*/
static bool CreateObjectByPattern(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
+ ns_smart_device_link::ns_smart_objects::SmartObject& result_object);
};
-} // namespace NsSmartDeviceLink
-} // namespace NsSmartDeviceLink::NsJSONHandler
-} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+} // namespace ns_smart_device_link
+} // namespace ns_smart_device_link::ns_json_handler
+} // namespace ns_smart_device_link::ns_json_handler::formatters
#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc
index 0a85a93d21..af8668543a 100644
--- a/src/components/formatters/src/CFormatterJsonBase.cc
+++ b/src/components/formatters/src/CFormatterJsonBase.cc
@@ -35,13 +35,13 @@
#include "formatters/CFormatterJsonBase.h"
#include "utils/convert_utils.h"
-void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
+void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
jsonValueToObj(const Json::Value& value,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj) {
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj) {
try {
if (value.type() == Json::objectValue) {
- obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ obj = ns_smart_device_link::ns_smart_objects::SmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartType_Map);
Json::Value::Members members = value.getMemberNames();
@@ -49,8 +49,8 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
jsonValueToObj(value[members[i]], obj[members[i]]);
}
} else if (value.type() == Json::arrayValue) {
- obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
- NsSmartDeviceLink::NsSmartObjects::SmartType_Array);
+ obj = ns_smart_device_link::ns_smart_objects::SmartObject(
+ ns_smart_device_link::ns_smart_objects::SmartType_Array);
for (uint32_t i = 0; i < value.size(); i++) {
jsonValueToObj(value[i], obj[i]);
@@ -72,11 +72,13 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
// ----------------------------------------------------------------------------
-void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
- objToJsonValue(const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
- Json::Value& item) {
+void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::
+ objToJsonValue(
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
+ Json::Value& item) {
try {
- if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == obj.getType()) {
+ if (ns_smart_device_link::ns_smart_objects::SmartType_Array ==
+ obj.getType()) {
item = Json::arrayValue;
for (uint32_t i = 0; i < obj.length(); i++) {
@@ -86,7 +88,7 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
item.append(value);
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Map ==
obj.getType()) {
item = Json::objectValue;
std::set<std::string> keys = obj.enumerate();
@@ -100,19 +102,19 @@ void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::
item[*key] = value;
}
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Boolean ==
obj.getType()) {
item = obj.asBool();
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Integer ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Integer ==
obj.getType()) {
item = utils::ConvertInt64ToLongLongInt(obj.asInt());
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_UInteger ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_UInteger ==
obj.getType()) {
item = utils::ConvertUInt64ToLongLongUInt(obj.asUInt());
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Double ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Double ==
obj.getType()) {
item = obj.asDouble();
- } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Null ==
+ } else if (ns_smart_device_link::ns_smart_objects::SmartType_Null ==
obj.getType()) {
item = Json::nullValue;
} else {
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
index b776b9abd8..121fd43131 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc
@@ -34,12 +34,12 @@
#include "formatters/meta_formatter.h"
#include "utils/convert_utils.h"
-namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace strings = ns_smart_device_link::ns_json_handler::strings;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
index 9e177ea4a8..ffbb644cc6 100644
--- a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc
@@ -31,12 +31,12 @@
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/meta_formatter.h"
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
-namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
+namespace strings = ns_smart_device_link::ns_json_handler::strings;
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
// ----------------------------------------------------------------------------
diff --git a/src/components/formatters/src/CSmartFactory.cc b/src/components/formatters/src/CSmartFactory.cc
index 6b0808fbfa..c1ee9133ca 100644
--- a/src/components/formatters/src/CSmartFactory.cc
+++ b/src/components/formatters/src/CSmartFactory.cc
@@ -34,19 +34,27 @@
#include "formatters/CSmartFactory.h"
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS(
+const std::string ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS(
"msg_params");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS("params");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID(
+const std::string ns_smart_device_link::ns_json_handler::strings::S_PARAMS(
+ "params");
+const std::string ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID(
"function_id");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE(
- "message_type");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION(
- "protocol_version");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE(
- "protocol_type");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID(
- "correlation_id");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::kCode("code");
-const std::string NsSmartDeviceLink::NsJSONHandler::strings::kMessage(
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE(
+ "message_type");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION(
+ "protocol_version");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE(
+ "protocol_type");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID(
+ "correlation_id");
+const std::string
+ ns_smart_device_link::ns_json_handler::strings::S_RPC_MSG_VERSION(
+ "rpc_msg_version");
+const std::string ns_smart_device_link::ns_json_handler::strings::kCode("code");
+const std::string ns_smart_device_link::ns_json_handler::strings::kMessage(
"message");
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc
index e349ced4d6..d50d04d0e9 100644
--- a/src/components/formatters/src/formatter_json_rpc.cc
+++ b/src/components/formatters/src/formatter_json_rpc.cc
@@ -35,11 +35,11 @@
#include "formatters/formatter_json_rpc.h"
#include "utils/convert_utils.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
-namespace strings = NsJSONHandler::strings;
+namespace strings = ns_json_handler::strings;
const char* FormatterJsonRpc::kRequest = "request";
const char* FormatterJsonRpc::kResponse = "response";
@@ -56,7 +56,7 @@ const char* FormatterJsonRpc::kCode = "code";
const char* FormatterJsonRpc::kData = "data";
const char* FormatterJsonRpc::kMessage = "message";
-bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
+bool FormatterJsonRpc::ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str) {
bool result = true;
try {
@@ -64,17 +64,17 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
root[kJsonRpc] = kJsonRpcExpectedValue;
- NsSmartObjects::SmartObject formatted_object(obj);
+ ns_smart_objects::SmartObject formatted_object(obj);
Json::Value msg_params_json(Json::objectValue);
formatted_object.getSchema().unapplySchema(formatted_object);
bool is_message_params = formatted_object.keyExists(strings::S_MSG_PARAMS);
bool empty_message_params = true;
if (true == is_message_params) {
- const NsSmartObjects::SmartObject& msg_params =
+ const ns_smart_objects::SmartObject& msg_params =
formatted_object.getElement(strings::S_MSG_PARAMS);
- result = (NsSmartObjects::SmartType_Map == msg_params.getType());
+ result = (ns_smart_objects::SmartType_Map == msg_params.getType());
if (true == result) {
objToJsonValue(msg_params, msg_params_json);
}
@@ -86,15 +86,16 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
if (false == formatted_object.keyExists(strings::S_PARAMS)) {
result = false;
} else {
- const NsSmartObjects::SmartObject& params =
+ const ns_smart_objects::SmartObject& params =
formatted_object.getElement(strings::S_PARAMS);
- if (NsSmartObjects::SmartType_Map != params.getType()) {
+ if (ns_smart_objects::SmartType_Map != params.getType()) {
result = false;
} else {
- const NsSmartObjects::SmartObject& message_type_object =
+ const ns_smart_objects::SmartObject& message_type_object =
params.getElement(strings::S_MESSAGE_TYPE);
- if (NsSmartObjects::SmartType_String != message_type_object.getType()) {
+ if (ns_smart_objects::SmartType_String !=
+ message_type_object.getType()) {
result = false;
} else {
const std::string message_type = message_type_object.asString();
@@ -113,10 +114,10 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
if (false == params.keyExists(strings::kCode)) {
result = false;
} else {
- const NsSmartObjects::SmartObject& code =
+ const ns_smart_objects::SmartObject& code =
params.getElement(strings::kCode);
- if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ if (ns_smart_objects::SmartType_Integer != code.getType()) {
result = false;
} else {
root[kResult][kCode] =
@@ -131,9 +132,9 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
result = result && SetMethod(params, root[kError][kData]);
result = result && SetMessage(params, root[kError]);
- const NsSmartObjects::SmartObject& code =
+ const ns_smart_objects::SmartObject& code =
params.getElement(strings::kCode);
- if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ if (ns_smart_objects::SmartType_Integer != code.getType()) {
result = false;
} else {
root[kError][kCode] =
@@ -151,15 +152,15 @@ bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject& obj,
return result;
}
-bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetMethod(const ns_smart_objects::SmartObject& params,
Json::Value& method_container) {
bool result = false;
if (true == params.keyExists(strings::S_FUNCTION_ID)) {
- const NsSmartObjects::SmartObject& function_id =
+ const ns_smart_objects::SmartObject& function_id =
params.getElement(strings::S_FUNCTION_ID);
- if (NsSmartObjects::SmartType_String == function_id.getType()) {
+ if (ns_smart_objects::SmartType_String == function_id.getType()) {
method_container[kMethod] = function_id.asString();
result = true;
}
@@ -168,15 +169,15 @@ bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject& params,
return result;
}
-bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetId(const ns_smart_objects::SmartObject& params,
Json::Value& id_container) {
bool result = false;
if (true == params.keyExists(strings::S_CORRELATION_ID)) {
- const NsSmartObjects::SmartObject& id =
+ const ns_smart_objects::SmartObject& id =
params.getElement(strings::S_CORRELATION_ID);
- if (NsSmartObjects::SmartType_Integer == id.getType()) {
+ if (ns_smart_objects::SmartType_Integer == id.getType()) {
id_container[kId] = utils::ConvertUInt64ToLongLongUInt(id.asUInt());
result = true;
}
@@ -185,15 +186,15 @@ bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject& params,
return result;
}
-bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params,
+bool FormatterJsonRpc::SetMessage(const ns_smart_objects::SmartObject& params,
Json::Value& message_container) {
bool result = false;
if (true == params.keyExists(strings::kMessage)) {
- const NsSmartObjects::SmartObject& message =
+ const ns_smart_objects::SmartObject& message =
params.getElement(strings::kMessage);
- if (NsSmartObjects::SmartType_String == message.getType()) {
+ if (ns_smart_objects::SmartType_String == message.getType()) {
message_container[kMessage] = message.asString();
result = true;
}
@@ -202,6 +203,6 @@ bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject& params,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/generic_json_formatter.cc b/src/components/formatters/src/generic_json_formatter.cc
index 7789a915c2..07b03484d2 100644
--- a/src/components/formatters/src/generic_json_formatter.cc
+++ b/src/components/formatters/src/generic_json_formatter.cc
@@ -34,11 +34,11 @@
#include "formatters/generic_json_formatter.h"
-namespace NsSmartDeviceLink {
-namespace NsJSONHandler {
-namespace Formatters {
+namespace ns_smart_device_link {
+namespace ns_json_handler {
+namespace formatters {
-void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
+void GenericJsonFormatter::ToString(const ns_smart_objects::SmartObject& obj,
std::string& out_str) {
Json::Value json_root;
objToJsonValue(obj, json_root);
@@ -46,7 +46,7 @@ void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
}
bool GenericJsonFormatter::FromString(const std::string& str,
- NsSmartObjects::SmartObject& out) {
+ ns_smart_objects::SmartObject& out) {
Json::Value json_root;
Json::Reader reader;
bool result = reader.parse(str, json_root);
@@ -58,6 +58,6 @@ bool GenericJsonFormatter::FromString(const std::string& str,
return result;
}
-} // namespace Formatters
-} // namespace NsJSONHandler
-} // namespace NsSmartDeviceLink
+} // namespace formatters
+} // namespace ns_json_handler
+} // namespace ns_smart_device_link
diff --git a/src/components/formatters/src/meta_formatter.cc b/src/components/formatters/src/meta_formatter.cc
index fafb84e938..82dd611498 100644
--- a/src/components/formatters/src/meta_formatter.cc
+++ b/src/components/formatters/src/meta_formatter.cc
@@ -38,15 +38,15 @@
#include "formatters/meta_formatter.h"
-namespace formatter_ns = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace formatter_ns = ns_smart_device_link::ns_json_handler::formatters;
+namespace smart_objects_ns = ns_smart_device_link::ns_smart_objects;
//---------------------------------------------------------------
bool formatter_ns::CMetaFormatter::CreateObjectByPattern(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
- const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
- NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object) {
+ const ns_smart_device_link::ns_smart_objects::SmartObject& object,
+ const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema,
+ ns_smart_device_link::ns_smart_objects::SmartObject& result_object) {
if (smart_objects_ns::SmartType_Invalid == result_object.getType()) {
return false;
}
diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc
index ff1f60b8df..1cd9c55bbc 100644
--- a/src/components/formatters/test/CFormatterJsonBase_test.cc
+++ b/src/components/formatters/test/CFormatterJsonBase_test.cc
@@ -42,8 +42,8 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
TEST(CFormatterJsonBaseTest, JSonStringValueToSmartObj_ExpectSuccessful) {
// Arrange value
diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc
index 3713d076e2..3aba109e58 100644
--- a/src/components/formatters/test/CSmartFactory_test.cc
+++ b/src/components/formatters/test/CSmartFactory_test.cc
@@ -68,7 +68,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -82,7 +82,7 @@ TEST(CSmartFactoryTest,
EXPECT_FALSE(SmartType::SmartType_Map == obj.getType());
EXPECT_TRUE(SmartType::SmartType_Null == obj.getType());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -104,7 +104,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -127,7 +127,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OUT_OF_RANGE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OUT_OF_RANGE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -150,7 +150,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -174,7 +174,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -198,7 +198,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -236,7 +236,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -253,7 +253,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -270,7 +270,7 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(1u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -287,7 +287,7 @@ TEST(CSmartFactoryTest,
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -304,12 +304,12 @@ TEST(CSmartFactoryTest,
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -328,13 +328,13 @@ TEST(
obj["image"]["position"] = 100;
// Check object "image"
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -352,13 +352,13 @@ TEST(
obj["image"]["position"] = 100;
// Check object "image"
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
// Check global object
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -377,13 +377,13 @@ TEST(
obj["image"]["position"] = 100;
// Check object "image"
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj["image"].validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -402,7 +402,7 @@ TEST(
EXPECT_EQ(2u, keys.size());
// Check global object
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -422,7 +422,7 @@ TEST(
EXPECT_EQ(3u, keys.size());
// Check global object
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_EQ(errors::eType::INVALID_VALUE, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
index a4d40b4478..fe9d2ec0e1 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
@@ -43,7 +43,7 @@ TEST(CFormatterJsonSDLRPCv1Test, EmptySmartObjectToString) {
SmartObject srcObj;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -74,7 +74,7 @@ TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER,
srcObj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
@@ -108,7 +108,7 @@ TEST(CFormatterJsonSDLRPCv1Test,
srcObj[S_MSG_PARAMS][""] = "";
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -341,7 +341,7 @@ TEST(CFormatterJsonSDLRPCv1Test, StringRequestToSmObj) {
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
@@ -487,7 +487,7 @@ TEST(CFormatterJsonSDLRPCv1Test, StringNotificationToSmartObject) {
inputJsonString, obj);
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
index c7e6f61674..628e9956bb 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
@@ -42,7 +42,7 @@ TEST(CFormatterJsonSDLRPCv2Test, EmptySmartObjectToString) {
SmartObject srcObj;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -67,7 +67,7 @@ TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER,
srcObj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
@@ -94,7 +94,7 @@ TEST(CFormatterJsonSDLRPCv2Test,
srcObj[S_MSG_PARAMS][""] = "";
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, srcObj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -270,7 +270,7 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithoutCorIdToSmObj) {
EXPECT_EQ(true, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_EQ(errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
@@ -317,7 +317,7 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithCorIdToSmObj) {
EXPECT_EQ(true, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
@@ -384,7 +384,7 @@ TEST(CFormatterJsonSDLRPCv2Test, StringNotificationToSmartObject) {
corId);
EXPECT_EQ(true, result);
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(errors::eType::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
index e882bed618..f397accbd4 100644
--- a/src/components/formatters/test/formatter_json_rpc_test.cc
+++ b/src/components/formatters/test/formatter_json_rpc_test.cc
@@ -49,9 +49,9 @@ namespace test {
namespace components {
namespace formatters_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_json_handler::strings;
void CompactJson(std::string& str) {
Json::Value root;
@@ -150,7 +150,7 @@ TEST(FormatterJsonRPCTest, UpperBoundValuesInSystemRequest_ToString_Success) {
hmi_apis::HMI_API factory;
EXPECT_TRUE(factory.attachSchema(obj, false));
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, obj.validate(&report));
+ EXPECT_EQ(errors::OK, obj.validate(&report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string result;
// Convert SmartObject to Json string
diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc
index 41ecfd9ee3..97840eb110 100644
--- a/src/components/formatters/test/generic_json_formatter_test.cc
+++ b/src/components/formatters/test/generic_json_formatter_test.cc
@@ -38,8 +38,8 @@ namespace components {
namespace formatters {
TEST(GenericJsonFormatter, ToString) {
- namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
- namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ namespace smartobj = ns_smart_device_link::ns_smart_objects;
+ namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
smartobj::SmartObject obj;
std::string result;
@@ -93,8 +93,8 @@ TEST(GenericJsonFormatter, ToString) {
}
TEST(GenericJsonFormatter, FromString) {
- namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
- namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ namespace smartobj = ns_smart_device_link::ns_smart_objects;
+ namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
smartobj::SmartObject result;
diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
index 8f5ee96ce5..4b1ca94b98 100644
--- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
+++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
@@ -52,9 +52,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler;
+using namespace ns_smart_device_link::ns_json_handler::strings;
using namespace hmi_apis;
namespace TestType {
@@ -107,9 +107,9 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
protected:
typedef std::map<const StructIdentifiersTest::eType,
- utils::SharedPtr<ISchemaItem> > TStructsSchemaItems;
+ std::shared_ptr<ISchemaItem> > TStructsSchemaItems;
- static utils::SharedPtr<ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static std::shared_ptr<ISchemaItem> ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
const StructIdentifiersTest::eType struct_id);
@@ -147,10 +147,10 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items);
- static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_1(
+ static std::shared_ptr<ISchemaItem> InitStructSchemaItem_Common_1(
TStructsSchemaItems& struct_schema_items);
- static utils::SharedPtr<ISchemaItem> InitStructSchemaItem_Common_2();
+ static std::shared_ptr<ISchemaItem> InitStructSchemaItem_Common_2();
};
} // namespace formatters
diff --git a/src/components/formatters/test/include/formatters/create_smartSchema.h b/src/components/formatters/test/include/formatters/create_smartSchema.h
index 4d7a217317..73ff9ba77b 100644
--- a/src/components/formatters/test/include/formatters/create_smartSchema.h
+++ b/src/components/formatters/test/include/formatters/create_smartSchema.h
@@ -40,9 +40,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace FunctionIDTest {
enum eType {
diff --git a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
index a58f69e386..0ee21d092c 100644
--- a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
+++ b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
@@ -51,24 +51,24 @@ class CMetaFormatterTestHelper : public ::testing::Test {
virtual void TearDown();
void AnyObjectToJsonString(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& obj,
std::string& result_string);
void FillObjectIdenticalToSchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void FillObjectIdenticalToSchemaWithoutNoMandatoriesParams(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void CompareObjects(
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& first,
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& second);
+ const ns_smart_device_link::ns_smart_objects::SmartObject& first,
+ const ns_smart_device_link::ns_smart_objects::SmartObject& second);
void FillObjectWithDefaultValues(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
void FillObjectWithoutSomeMandatoryFields(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+ ns_smart_device_link::ns_smart_objects::SmartObject& obj);
// Members
std::set<FunctionIDTest::eType> function_id_items_;
diff --git a/src/components/formatters/test/src/SmartFactoryTestHelper.cc b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
index 2dd76f85f8..d48f9f58a0 100644
--- a/src/components/formatters/test/src/SmartFactoryTestHelper.cc
+++ b/src/components/formatters/test/src/SmartFactoryTestHelper.cc
@@ -148,7 +148,7 @@ CSmartFactoryTest::CSmartFactoryTest()
void CSmartFactoryTest::InitStructSchemes(
TStructsSchemaItems& struct_schema_items) {
- utils::SharedPtr<ISchemaItem> struct_schema_item_Common_1 =
+ std::shared_ptr<ISchemaItem> struct_schema_item_Common_1 =
InitStructSchemaItem_Common_1(struct_schema_items);
struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_1,
struct_schema_item_Common_1));
@@ -156,7 +156,7 @@ void CSmartFactoryTest::InitStructSchemes(
std::make_pair(StructIdentifiersTest::Common_1,
CSmartSchema(struct_schema_item_Common_1)));
- utils::SharedPtr<ISchemaItem> struct_schema_item_Common_2 =
+ std::shared_ptr<ISchemaItem> struct_schema_item_Common_2 =
InitStructSchemaItem_Common_2();
struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_2,
struct_schema_item_Common_2));
@@ -187,7 +187,7 @@ void CSmartFactoryTest::InitFunctionSchemes(
CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
CObjectSchemaItem::Members root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members),
true);
@@ -269,7 +269,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function1_response(
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items) {
// Function parameter available.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -333,7 +333,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function2_response(
const std::set<FunctionIdTest::eType>& function_id_items,
const std::set<MessageTypeTest::eType>& message_type_items) {
// Function parameter available.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -399,7 +399,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
// Function parameter available.
//
// Must be true if VR is present and ready to communicate with SDL.
- utils::SharedPtr<ISchemaItem> available_SchemaItem =
+ std::shared_ptr<ISchemaItem> available_SchemaItem =
CBoolSchemaItem::create(TSchemaItemParameter<bool>());
CObjectSchemaItem::Members schema_members;
@@ -431,12 +431,12 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response(
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
-utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
+std::shared_ptr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
TStructsSchemaItems& struct_schema_items) {
// Struct member text.
//
// Text to display
- utils::SharedPtr<ISchemaItem> text_SchemaItem =
+ std::shared_ptr<ISchemaItem> text_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
TSchemaItemParameter<size_t>(500),
TSchemaItemParameter<std::string>());
@@ -444,14 +444,14 @@ utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
// Struct member image.
//
// Image struct
- utils::SharedPtr<ISchemaItem> image_SchemaItem =
+ std::shared_ptr<ISchemaItem> image_SchemaItem =
ProvideObjectSchemaItemForStruct(struct_schema_items,
StructIdentifiersTest::Common_2);
// Struct member position.
//
// Position to display item
- utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ std::shared_ptr<ISchemaItem> position_SchemaItem =
TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
TSchemaItemParameter<int32_t>(500),
TSchemaItemParameter<int32_t>());
@@ -472,19 +472,19 @@ utils::SharedPtr<ISchemaItem> CSmartFactoryTest::InitStructSchemaItem_Common_1(
return CObjectSchemaItem::create(schema_members);
}
-utils::SharedPtr<ISchemaItem>
+std::shared_ptr<ISchemaItem>
CSmartFactoryTest::InitStructSchemaItem_Common_2() {
// Struct member text.
//
// Text to display
- utils::SharedPtr<ISchemaItem> text_SchemaItem =
+ std::shared_ptr<ISchemaItem> text_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
TSchemaItemParameter<size_t>(500),
TSchemaItemParameter<std::string>());
// Struct member position.
//
// Position to display item
- utils::SharedPtr<ISchemaItem> position_SchemaItem =
+ std::shared_ptr<ISchemaItem> position_SchemaItem =
TNumberSchemaItem<int32_t>::create(TSchemaItemParameter<int32_t>(1),
TSchemaItemParameter<int32_t>(500),
TSchemaItemParameter<int32_t>());
@@ -497,7 +497,7 @@ CSmartFactoryTest::InitStructSchemaItem_Common_2() {
return CObjectSchemaItem::create(schema_members);
}
-utils::SharedPtr<ISchemaItem>
+std::shared_ptr<ISchemaItem>
CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
TStructsSchemaItems& struct_schema_items,
const StructIdentifiersTest::eType struct_id) {
@@ -506,5 +506,6 @@ CSmartFactoryTest::ProvideObjectSchemaItemForStruct(
if (it != struct_schema_items.end()) {
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::
+ create();
}
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
index 1497fbf281..3602fc3de7 100644
--- a/src/components/formatters/test/src/create_smartSchema.cc
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -35,9 +35,9 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
+using namespace ns_smart_device_link::ns_smart_objects;
template <>
const EnumConversionHelper<FunctionIDTest::eType>::EnumToCStringMap
diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc
index 897c8d364d..b322510f6c 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -36,8 +36,8 @@ namespace test {
namespace components {
namespace formatters {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsJSONHandler::Formatters;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_json_handler::formatters;
void CMetaFormatterTestHelper::SetUp() {
function_id_items_.insert(FunctionIDTest::RegisterAppInterface);
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index 9fb233b446..8fafee1ac5 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -43,7 +43,6 @@ include_directories (
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}
${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/dbus/include/
${CMAKE_SOURCE_DIR}/
${LOG4CXX_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/hmi_message_handler/include
@@ -56,14 +55,6 @@ set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-if (HMIADAPTER STREQUAL "dbus")
- set(EXCLUDE_PATHS messagebroker_adapter.cc)
- set(DBUS_ADAPTER DBus)
-else()
- set(EXCLUDE_PATHS dbus_message_adapter.cc)
- set(DBUS_ADAPTER)
-endif ()
-
list(APPEND EXCLUDE_PATHS
mqueue_adapter.cc
)
@@ -72,7 +63,6 @@ collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
set(LIBRARIES
Utils
- ${DBUS_ADAPTER}
${RTLIB}
)
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
deleted file mode 100644
index beb7a9ad1d..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2013, 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_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
-
-#include <string>
-#include "hmi_message_handler/hmi_message_adapter_impl.h"
-#include "dbus/dbus_message_controller.h"
-#include "smart_objects/smart_object.h"
-
-namespace hmi_message_handler {
-
-/**
- * \brief adapter for DBus
- */
-class DBusMessageAdapter : public HMIMessageAdapterImpl,
- public dbus::DBusMessageController {
- public:
- typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
- explicit DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler);
- ~DBusMessageAdapter();
- void SendMessageToHMI(MessageSharedPointer message);
-
- /**
- * \brief subscribes to signals
- */
- void SubscribeTo();
-
- private:
- static const std::string SDL_SERVICE_NAME;
- static const std::string SDL_OBJECT_PATH;
- static const std::string HMI_SERVICE_NAME;
- static const std::string HMI_OBJECT_PATH;
-
- /**
- * \brief sends request to HMI
- * \param obj request
- */
- void Request(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends notification to HMI
- * \param obj notification
- */
- void Notification(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends response to HMI
- * \param obj response
- */
- void Response(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends error response to HMI
- * \param obj error
- */
- void ErrorResponse(const smart_objects::SmartObject& obj);
-
- /**
- * \brief sends message to core
- * \param obj
- */
- void SendMessageToCore(const smart_objects::SmartObject& obj);
-};
-
-} // namespace hmi_message_handler
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
index 60dc50ad7a..0a2e3e0f99 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
@@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "json/json.h"
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "websocket_session.h"
using namespace boost::beast::websocket;
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
index 9692c4aef4..4d177d250f 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
@@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "json/json.h"
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/threads/thread.h"
#include "utils/threads/message_loop_thread.h"
#include "utils/message_queue.h"
@@ -152,7 +152,7 @@ class WebsocketSession : public std::enable_shared_from_this<WebsocketSession> {
std::string GetComponentName(std::string& method);
protected:
- sync_primitives::atomic_bool stop;
+ std::atomic_bool stop;
private:
void onMessageReceived(Json::Value message);
diff --git a/src/components/hmi_message_handler/mock_hmi_message_handler.h b/src/components/hmi_message_handler/mock_hmi_message_handler.h
index d9060088ff..f4ed601bed 100644
--- a/src/components/hmi_message_handler/mock_hmi_message_handler.h
+++ b/src/components/hmi_message_handler/mock_hmi_message_handler.h
@@ -50,9 +50,9 @@ class MockHMIMessageHandler : public ::hmi_message_handler::HMIMessageHandler {
MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter));
MOCK_CONST_METHOD0(get_settings, const HMIMessageHandlerSettings&());
MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message));
};
} // namespace hmi_message_handler_test
diff --git a/src/components/hmi_message_handler/src/dbus_message_adapter.cc b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
deleted file mode 100644
index 5b0b11e557..0000000000
--- a/src/components/hmi_message_handler/src/dbus_message_adapter.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2013, 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 "hmi_message_handler/dbus_message_adapter.h"
-#include <sstream>
-#include "utils/logger.h"
-#include "formatters/CSmartFactory.h"
-#include "smart_objects/smart_object.h"
-
-namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-
-namespace hmi_message_handler {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-const std::string DBusMessageAdapter::SDL_SERVICE_NAME = "com.ford.sdl.core";
-const std::string DBusMessageAdapter::SDL_OBJECT_PATH = "/";
-const std::string DBusMessageAdapter::HMI_SERVICE_NAME = "com.ford.sdl.hmi";
-const std::string DBusMessageAdapter::HMI_OBJECT_PATH = "/";
-
-std::vector<std::string>& split(const std::string& s,
- char delim,
- std::vector<std::string>& elems) {
- std::stringstream ss(s);
- std::string item;
- while (std::getline(ss, item, delim)) {
- elems.push_back(item);
- }
- return elems;
-}
-
-DBusMessageAdapter::DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler)
- : HMIMessageAdapterImpl(hmi_msg_handler)
- , DBusMessageController(SDL_SERVICE_NAME,
- SDL_OBJECT_PATH,
- HMI_SERVICE_NAME,
- HMI_OBJECT_PATH) {
- LOG4CXX_INFO(logger_, "Created DBusMessageAdapter");
-}
-
-DBusMessageAdapter::~DBusMessageAdapter() {}
-
-void DBusMessageAdapter::SendMessageToHMI(MessageSharedPointer message) {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::sendMessageToHMI");
-
- const smart_objects::SmartObject& smart = message->smart_object();
- switch (smart[sos::S_PARAMS][sos::S_MESSAGE_TYPE].asInt()) {
- case hmi_apis::messageType::request:
- Request(smart);
- break;
- case hmi_apis::messageType::notification:
- Notification(smart);
- break;
- case hmi_apis::messageType::response:
- Response(smart);
- break;
- case hmi_apis::messageType::error_response:
- ErrorResponse(smart);
- break;
- case hmi_apis::messageType::INVALID_ENUM:
- default:
- LOG4CXX_WARN(logger_, "Message type is invalid");
- }
-}
-
-void DBusMessageAdapter::SubscribeTo() {
- LOG4CXX_INFO(logger_, "DBusMessageAdapter::subscribeTo");
- DBusMessageController::SubscribeTo("Buttons", "OnButtonEvent");
- DBusMessageController::SubscribeTo("Buttons", "OnButtonPress");
- DBusMessageController::SubscribeTo("UI", "OnCommand");
- DBusMessageController::SubscribeTo("UI", "OnDriverDistraction");
- DBusMessageController::SubscribeTo("UI", "OnSystemContext");
- DBusMessageController::SubscribeTo("UI", "OnLanguageChange");
- DBusMessageController::SubscribeTo("UI", "OnKeyboardInput");
- DBusMessageController::SubscribeTo("UI", "OnTouchEvent");
- DBusMessageController::SubscribeTo("UI", "OnResetTimeout");
- DBusMessageController::SubscribeTo("TTS", "OnResetTimeout");
- DBusMessageController::SubscribeTo("VR", "Started");
- DBusMessageController::SubscribeTo("VR", "Stopped");
- DBusMessageController::SubscribeTo("VR", "OnCommand");
- DBusMessageController::SubscribeTo("VR", "OnLanguageChange");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnReady");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnAppDeactivated");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnStartDeviceDiscovery");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnUpdateDeviceList");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnFindApplications");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnAppActivated");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnExitApplication");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnExitAllApplications");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnDeviceChosen");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnIgnitionCycleOver");
- DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemRequest");
- DBusMessageController::SubscribeTo("BasicCommunication",
- "OnSystemInfoChanged");
- DBusMessageController::SubscribeTo("TTS", "Started");
- DBusMessageController::SubscribeTo("TTS", "Stopped");
- DBusMessageController::SubscribeTo("TTS", "OnLanguageChange");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnGpsData");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnSpeed");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnRpm");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevel");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevelState");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnInstantFuelConsumption");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnExternalTemperature");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnVin");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnPrndl");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnTirePressure");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnOdometer");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnBeltStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnBodyInformation");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnDeviceStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnDriverBraking");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnWiperStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnHeadLampStatus");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnEngineTorque");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnAccPedalPosition");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnSteeringWheelAngle");
- DBusMessageController::SubscribeTo("VehicleInfo", "OnMyKey");
- DBusMessageController::SubscribeTo("Navigation", "OnTBTClientState");
- DBusMessageController::SubscribeTo("Navigation", "OnWayPointChange");
- DBusMessageController::SubscribeTo("SDL", "OnAllowSDLFunctionality");
- DBusMessageController::SubscribeTo("SDL", "OnReceivedPolicyUpdate");
- DBusMessageController::SubscribeTo("SDL", "OnPolicyUpdate");
- DBusMessageController::SubscribeTo("SDL", "OnAppPermissionConsent");
- DBusMessageController::SubscribeTo("SDL", "OnSystemError");
- DBusMessageController::SubscribeTo("SDL", "AddStatisticsInfo");
- DBusMessageController::SubscribeTo("SDL", "OnDeviceStateChanged");
-
- LOG4CXX_INFO(logger_, "Subscribed to notifications.");
-}
-
-void DBusMessageAdapter::SendMessageToCore(
- const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (!handler()) {
- LOG4CXX_WARN(logger_, "DBusMessageAdapter hasn't handler");
- return;
- }
-
- MessageSharedPointer message = new application_manager::Message(
- protocol_handler::MessagePriority::kDefault); // todo: ykazakov constant
- // is a temp solution to
- // finish
- // merge
- // MessagePriority::FromServiceType(message.servicetype)
- // shall be used instead
- message->set_protocol_version(
- protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
- message->set_smart_object(obj);
- handler()->OnMessageReceived(message);
- LOG4CXX_INFO(logger_, "Successfully sent to observer");
-}
-
-void DBusMessageAdapter::Request(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- MethodCall(id, func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::Notification(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- Signal(func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::Response(const smart_objects::SmartObject& obj) {
- LOG4CXX_AUTO_TRACE(logger_);
- dbus::MessageId func_id = static_cast<dbus::MessageId>(
- obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
- dbus::MessageName name = get_schema().getMessageName(func_id);
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- MethodReturn(id, func_id, name, obj[sos::S_MSG_PARAMS]);
-}
-
-void DBusMessageAdapter::ErrorResponse(const smart_objects::SmartObject& obj) {
- LOG4CXX_DEBUG(logger_, "Error");
- std::string error = obj[sos::S_PARAMS][sos::kCode].asString();
- std::string description = obj[sos::S_PARAMS][sos::kMessage].asString();
- uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
- Error(id, error, description);
-}
-
-} // namespace hmi_message_handler
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/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 53a0d84362..d400cca335 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -55,7 +55,7 @@ void MessageBrokerAdapter::SendMessageToHMI(
hmi_message_handler::MessageSharedPointer message) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!message.valid()) {
+ if (message.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Can`t send not valid message");
return;
}
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
index 9e855c563e..6d30d6ee51 100644
--- a/src/components/hmi_message_handler/test/CMakeLists.txt
+++ b/src/components/hmi_message_handler/test/CMakeLists.txt
@@ -56,7 +56,7 @@ collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
if (HMIADAPTER STREQUAL "messagebroker")
GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
- list(APPEND LIBRARIES ${BOOST_LIBS_DIRECTORY}/libboost_system.so)
+ list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
endif()
create_test(hmi_message_handler_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
index eead7106c6..73fe76640d 100644
--- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
@@ -31,8 +31,6 @@
*/
#include "gtest/gtest.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "hmi_message_handler/hmi_message_handler_impl.h"
#include "hmi_message_handler/mock_hmi_message_adapter_impl.h"
@@ -45,7 +43,7 @@ namespace hmi_message_handler_test {
using ::testing::Return;
using hmi_message_handler::HMIMessageHandlerImpl;
-typedef utils::SharedPtr<MockHMIMessageAdapterImpl>
+typedef std::shared_ptr<MockHMIMessageAdapterImpl>
MockHMIMessageAdapterImplSPtr;
TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
@@ -60,7 +58,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
;
MockHMIMessageAdapterImplSPtr message_adapter_impl =
- utils::MakeShared<MockHMIMessageAdapterImpl>(message_handler);
+ std::make_shared<MockHMIMessageAdapterImpl>(message_handler);
EXPECT_EQ(message_handler, message_adapter_impl->get_handler());
@@ -71,7 +69,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
TEST(HMIMessageAdapterImplTest, Handler_NULLPointer_CorrectReturnedPointer) {
HMIMessageHandler* message_handler = NULL;
MockHMIMessageAdapterImplSPtr message_adapter_impl =
- utils::MakeShared<MockHMIMessageAdapterImpl>(message_handler);
+ std::make_shared<MockHMIMessageAdapterImpl>(message_handler);
EXPECT_EQ(NULL, message_adapter_impl->get_handler());
}
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index fd459ea094..e66f900299 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -86,7 +86,7 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
hmi_message_handler::MessageSharedPointer CreateMessage() {
// The ServiceType doesn't really matter
- return new application_manager::Message(
+ return std::make_shared<application_manager::Message>(
protocol_handler::MessagePriority::FromServiceType(
protocol_handler::ServiceType::kInvalidServiceType));
}
@@ -104,7 +104,7 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest,
OnErrorSending_NotEmptyMessage_ExpectOnErrorSendingProceeded) {
// Arrange
- utils::SharedPtr<application_manager::Message> message = CreateMessage();
+ std::shared_ptr<application_manager::Message> message = CreateMessage();
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(message));
// Act
@@ -113,7 +113,7 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest, OnErrorSending_InvalidObserver_Cancelled) {
// Arrange
- utils::SharedPtr<application_manager::Message> message = CreateMessage();
+ std::shared_ptr<application_manager::Message> message = CreateMessage();
hmi_handler_->set_message_observer(NULL);
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(_)).Times(0);
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 0888e1fc90..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>
@@ -42,7 +43,7 @@
#include "application_manager/command_factory.h"
#include "connection_handler/connection_handler.h"
#include "utils/data_accessor.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_observable.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager_settings.h"
@@ -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
@@ -260,30 +273,15 @@ class ApplicationManager {
*
**/
virtual void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) = 0;
+ const std::shared_ptr<Application> app) = 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
+ * @brief Checks if driver distraction state is valid, creates message
+ * which is sent to the application if allowed, otherwise it is added
+ * to a list of postponed messages.
+ * @param application contains registered application.
*/
- 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;
+ virtual void SendDriverDistractionState(ApplicationSharedPtr application) = 0;
/**
* @brief Checks if Application is subscribed for way points
@@ -322,6 +320,19 @@ class ApplicationManager {
virtual mobile_api::HMILevel::eType GetDefaultHmiLevel(
ApplicationConstSharedPtr application) const = 0;
+
+ /**
+ * @brief Checks if required transport for resumption is available
+ *
+ * The required transport can be configured through smartDeviceLink.ini file.
+ *
+ * @param application an instance of the app to check
+ * @return true if the app is connected through one of the required
+ * transports, false otherwise
+ */
+ virtual bool CheckResumptionRequiredTransportAvailable(
+ ApplicationConstSharedPtr application) const = 0;
+
/**
* @brief hmi_capabilities return capabilities of hmi
* @return capabilities of hmi
@@ -391,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
@@ -405,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
@@ -436,7 +437,7 @@ class ApplicationManager {
virtual void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info,
int value) = 0;
- virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ virtual ApplicationSharedPtr RegisterApplication(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration) = 0;
virtual void SendUpdateAppList() = 0;
@@ -465,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(
@@ -676,28 +675,13 @@ class ApplicationManager {
* @return new regular HMI state
*/
virtual HmiStatePtr CreateRegularState(
- utils::SharedPtr<Application> app,
+ std::shared_ptr<Application> app,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
mobile_apis::VideoStreamingState::eType video_state,
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
@@ -728,6 +712,9 @@ class ApplicationManager {
std::vector<std::string>& rejected_params) = 0;
virtual const ApplicationManagerSettings& get_settings() const = 0;
+ // Extract the app ID to use internally based on the UseFullAppID .ini setting
+ virtual std::string GetCorrectMobileIDFromMessage(
+ const commands::MessageSharedPtr& message) const = 0;
virtual event_engine::EventDispatcher& event_dispatcher() = 0;
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index e745a831c6..8fdca4125f 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -38,6 +38,8 @@
#include <stdint.h>
#include <string>
+#include <map>
+#include <vector>
namespace application_manager {
class ApplicationManagerSettings : public RequestControlerSettings,
@@ -48,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;
@@ -80,6 +84,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const std::string& video_stream_file() const = 0;
virtual const std::string& audio_stream_file() const = 0;
+ virtual bool use_full_app_id() const = 0;
virtual bool use_db_for_resumption() const = 0;
virtual const uint32_t& app_resumption_save_persistent_data_timeout()
const = 0;
@@ -87,6 +92,13 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_resuming_timeout() const = 0;
virtual uint16_t attempts_to_open_resumption_db() const = 0;
virtual uint16_t open_attempt_timeout_ms_resumption_db() const = 0;
+ virtual const std::map<std::string, std::vector<std::string> >&
+ transport_required_for_resumption_map() const = 0;
+ virtual const std::string& navigation_lowbandwidth_resumption_level()
+ const = 0;
+ virtual const std::string& projection_lowbandwidth_resumption_level()
+ const = 0;
+ virtual const std::string& media_lowbandwidth_resumption_level() const = 0;
virtual void set_config_file_name(const std::string& fileName) = 0;
virtual const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const = 0;
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index b8946a63f4..ee9274ead7 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -52,7 +52,7 @@
using namespace ::rpc::policy_table_interface_base;
namespace policy {
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyHandlerInterface {
public:
@@ -124,7 +124,7 @@ class PolicyHandlerInterface {
virtual void add_listener(PolicyHandlerObserver* listener) = 0;
virtual void remove_listener(PolicyHandlerObserver* listener) = 0;
- virtual utils::SharedPtr<usage_statistics::StatisticsManager>
+ virtual std::shared_ptr<usage_statistics::StatisticsManager>
GetStatisticManager() const = 0;
virtual void SendOnAppPermissionsChanged(
diff --git a/src/components/include/connection_handler/connection_handler.h b/src/components/include/connection_handler/connection_handler.h
index 352f886aed..bfaacf5fc1 100644
--- a/src/components/include/connection_handler/connection_handler.h
+++ b/src/components/include/connection_handler/connection_handler.h
@@ -40,6 +40,7 @@
#include "connection_handler/connection.h"
#include "connection_handler/devices_discovery_starter.h"
#include "utils/macro.h"
+#include "utils/data_accessor.h"
/**
* \namespace connection_handler
@@ -51,6 +52,14 @@ enum CloseSessionReason { kCommon = 0, kFlood, kMalformed, kUnauthorizedApp };
class ConnectionHandlerObserver;
+// The SessionConnectionMap keeps track of the primary and secondary transports
+// associated with a session ID
+typedef struct {
+ transport_manager::ConnectionUID primary_transport;
+ transport_manager::ConnectionUID secondary_transport;
+} SessionTransports;
+typedef std::map<uint8_t, SessionTransports> SessionConnectionMap;
+
/**
* \class ConnectionHandler
* \brief SmartDeviceLink ConnectionHandler interface class
@@ -202,6 +211,43 @@ class ConnectionHandler {
virtual DevicesDiscoveryStarter& get_device_discovery_starter() = 0;
/**
+ * \brief Add a session. This is meant to be called from Connection class.
+ * \param primary_transport_id the primary connection ID to associate with the
+ * newly created session
+ * \return new session id, or 0 if failed
+ **/
+ virtual uint32_t AddSession(
+ const transport_manager::ConnectionUID primary_transport_id) = 0;
+
+ /**
+ * \brief Remove a session. This is meant to be called from Connection class.
+ * \param session_id ID of the session to remove
+ * \return true if successful, false otherwise
+ **/
+ virtual bool RemoveSession(uint8_t session_id) = 0;
+
+ virtual DataAccessor<SessionConnectionMap> session_connection_map() = 0;
+
+ /**
+ * \brief Associate a secondary transport ID with a session
+ * \param session_id the session ID
+ * \param connection_id the new secondary connection ID to associate with the
+ * session
+ * \return the SessionTransports (newly) associated with the session
+ **/
+ virtual SessionTransports SetSecondaryTransportID(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id) = 0;
+
+ /**
+ * \brief Retrieve the session transports associated with a session
+ * \param session_id the session ID
+ * \return the SessionTransports associated with the session
+ **/
+ virtual const SessionTransports GetSessionTransports(
+ uint8_t session_id) const = 0;
+
+ /**
* \brief Invoked when observer's OnServiceStartedCallback is completed
* \param session_key the key of started session passed to
* OnServiceStartedCallback().
@@ -217,6 +263,28 @@ class ConnectionHandler {
bool result,
std::vector<std::string>& rejected_params) = 0;
+ /**
+ * \brief Called when secondary transport with given session ID is established
+ * \param primary_connection_handle Set to identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * \param session_id session ID taken from Register Secondary Transport frame
+ * \return true if successful
+ **/
+ virtual bool OnSecondaryTransportStarted(
+ transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id) = 0;
+
+ /**
+ * \brief Called when secondary transport shuts down
+ * \param primary_connection_handle Identifier of primary connection
+ * \param secondary_connection_handle Identifier of secondary connection
+ * transport
+ **/
+ virtual void OnSecondaryTransportEnded(
+ const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
index b4c04c17c9..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.
@@ -157,6 +144,23 @@ class ConnectionHandlerObserver {
virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const = 0;
#endif // ENABLE_SECURITY
+
+ /**
+ * \brief Called when secondary transport for a particular app is started.
+ * \param device_handle Device identifier on which the secondary transport is
+ * started.
+ * \param session_key session ID representing the app
+ */
+ virtual void OnSecondaryTransportStartedCallback(
+ const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key) = 0;
+
+ /**
+ * \brief Called when secondary transport for a particular app is terminated.
+ * \param session_key session ID representing the app
+ */
+ virtual void OnSecondaryTransportEndedCallback(const int32_t session_key) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
index 0676615b53..e7ba2619ee 100644
--- a/src/components/include/hmi_message_handler/hmi_message_observer.h
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -33,8 +33,6 @@
#ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
-#include "utils/shared_ptr.h"
-
namespace application_manager {
class Message;
}
@@ -45,9 +43,9 @@ class HMIMessageObserver {
public:
virtual ~HMIMessageObserver() {}
virtual void OnMessageReceived(
- utils::SharedPtr<application_manager::Message> message) = 0;
+ std::shared_ptr<application_manager::Message> message) = 0;
virtual void OnErrorSending(
- utils::SharedPtr<application_manager::Message> message) = 0;
+ std::shared_ptr<application_manager::Message> message) = 0;
};
}
diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h
index 91c20a1986..3f70f78a97 100644
--- a/src/components/include/hmi_message_handler/hmi_message_sender.h
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -36,7 +36,7 @@
#include "application_manager/message.h"
namespace hmi_message_handler {
-typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
+typedef std::shared_ptr<application_manager::Message> MessageSharedPointer;
class HMIMessageSender {
public:
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/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
index 83038472cd..57f6d2f802 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -46,7 +46,7 @@
namespace policy {
class PolicySettings;
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyManager : public usage_statistics::StatisticsManager {
public:
@@ -609,7 +609,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param access_remote pointer to new access_remote instance
*/
virtual void set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) = 0;
+ std::shared_ptr<AccessRemote> access_remote) = 0;
/**
* @brief Checks if there is existing URL in the EndpointUrls vector with
diff --git a/src/components/include/policy/policy_external/policy/policy_settings.h b/src/components/include/policy/policy_external/policy/policy_settings.h
index def9fca05a..7eca5129ad 100644
--- a/src/components/include/policy/policy_external/policy/policy_settings.h
+++ b/src/components/include/policy/policy_external/policy/policy_settings.h
@@ -31,6 +31,8 @@ class PolicySettings {
*/
virtual const std::string& policies_snapshot_file_name() const = 0;
+ virtual bool use_full_app_id() const = 0;
+
/**
* @brief Returns system files folder path
*/
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
index bd29b2942e..ee0bae7118 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -46,7 +46,7 @@
namespace policy {
class PolicySettings;
-typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+typedef std::shared_ptr<utils::Callable> StatusNotifier;
class PolicyManager : public usage_statistics::StatisticsManager {
public:
@@ -589,7 +589,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param access_remote pointer to new access_remote instance
*/
virtual void set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) = 0;
+ std::shared_ptr<AccessRemote> access_remote) = 0;
/**
* @brief Checks if there is existing URL in the EndpointUrls vector with
diff --git a/src/components/include/policy/policy_regular/policy/policy_settings.h b/src/components/include/policy/policy_regular/policy/policy_settings.h
index def9fca05a..35a2d54c3a 100644
--- a/src/components/include/policy/policy_regular/policy/policy_settings.h
+++ b/src/components/include/policy/policy_regular/policy/policy_settings.h
@@ -36,6 +36,8 @@ class PolicySettings {
*/
virtual const std::string& system_files_path() const = 0;
+ virtual bool use_full_app_id() const = 0;
+
virtual ~PolicySettings() {}
};
} // namespace policy
diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h
index 6f80aeec2b..56bd5cebd6 100644
--- a/src/components/include/protocol/bson_object_keys.h
+++ b/src/components/include/protocol/bson_object_keys.h
@@ -42,6 +42,12 @@ extern const char* height;
extern const char* width;
extern const char* video_protocol;
extern const char* video_codec;
+extern const char* secondary_transports;
+extern const char* audio_service_transports;
+extern const char* video_service_transports;
+extern const char* tcp_ip_address;
+extern const char* tcp_port;
+extern const char* reason;
} // namespace strings
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
index 00d57a9bf5..1c95020a96 100644
--- a/src/components/include/protocol/common.h
+++ b/src/components/include/protocol/common.h
@@ -167,6 +167,22 @@ enum {
*/
FRAME_DATA_END_SERVICE_NACK = 0x06,
/**
+ *\brief Register Secondary Transport frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT = 0x07,
+ /**
+ *\brief Register Secondary Transport acknowledgement frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK = 0x08,
+ /**
+ *\brief Register Secondary Transport not acknowledgement frame
+ */
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK = 0x09,
+ /**
+ *\brief Transport Event Update frame
+ */
+ FRAME_DATA_TRANSPORT_EVENT_UPDATE = 0xFD,
+ /**
*\brief Service data ACK frame
*/
FRAME_DATA_SERVICE_DATA_ACK = 0xFE,
diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h
index 99cb73ce67..5171d42593 100644
--- a/src/components/include/protocol/raw_message.h
+++ b/src/components/include/protocol/raw_message.h
@@ -33,7 +33,7 @@
#define SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+#include <memory>
#include "protocol/service_type.h"
#include "protocol/message_priority.h"
@@ -114,6 +114,6 @@ class RawMessage {
bool waiting_;
DISALLOW_COPY_AND_ASSIGN(RawMessage);
};
-typedef utils::SharedPtr<RawMessage> RawMessagePtr;
+typedef std::shared_ptr<RawMessage> RawMessagePtr;
} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index 1da8d61e52..d65902030b 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -100,7 +100,15 @@ class ProtocolHandler {
*/
virtual void SendEndSession(int32_t connection_id, uint8_t session_id) = 0;
- virtual void SendEndService(int32_t connection_id,
+ /**
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
+ virtual void SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) = 0;
@@ -117,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 e1107cb2a9..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
/**
@@ -51,6 +45,28 @@ class ProtocolHandlerSettings {
*/
virtual const std::vector<int>& force_unprotected_service() const = 0;
#endif // ENABLE_SECURITY
+
+ /**
+ * @brief Returns true multiple transports is enabled
+ */
+ virtual const bool multiple_transports_enabled() const = 0;
+
+ /**
+ * @brief Returns list of secondary transports available
+ * for the named primary transport
+ */
+ virtual const std::vector<std::string>& secondary_transports_for_bluetooth()
+ const = 0;
+ virtual const std::vector<std::string>& secondary_transports_for_usb()
+ const = 0;
+ virtual const std::vector<std::string>& secondary_transports_for_wifi()
+ const = 0;
+
+ /**
+ * @brief Returns list of allowed transports for the named service
+ */
+ virtual const std::vector<std::string>& audio_service_transports() const = 0;
+ virtual const std::vector<std::string>& video_service_transports() const = 0;
};
} // namespace protocol_handler
#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_SETTINGS_H_
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index 7a5dcf287c..e71557fecf 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -59,6 +59,7 @@ enum { HASH_ID_NOT_SUPPORTED = 0, HASH_ID_WRONG = 0xFFFF0000 };
* @brief Struct with data containing attributes of starting session
**/
struct SessionContext {
+ transport_manager::ConnectionUID primary_connection_id_;
transport_manager::ConnectionUID connection_id_;
uint8_t initial_session_id_;
uint8_t new_session_id_;
@@ -71,7 +72,8 @@ struct SessionContext {
* @brief Constructor
*/
SessionContext()
- : connection_id_(0)
+ : primary_connection_id_(0)
+ , connection_id_(0)
, initial_session_id_(0)
, new_session_id_(0)
, service_type_(protocol_handler::kInvalidServiceType)
@@ -81,6 +83,8 @@ struct SessionContext {
/**
* @brief Constructor
+ * @param primary_connection_id Connection identifier of the primary
+ * connection in which the session is started
* @param connection_id_ Connection identifier within which session is
* started.
* @param session_id Session ID specified to OnSessionStartedCallback()
@@ -91,13 +95,15 @@ struct SessionContext {
* @param is_protected Whether service will be protected
* @param is_new_service Whether service was already established
**/
- SessionContext(transport_manager::ConnectionUID connection_id,
+ SessionContext(transport_manager::ConnectionUID primary_connection_id,
+ transport_manager::ConnectionUID connection_id,
uint8_t session_id,
uint8_t new_session_id,
protocol_handler::ServiceType service_type,
uint32_t hash_id,
const bool is_protected)
- : connection_id_(connection_id)
+ : primary_connection_id_(primary_connection_id)
+ , connection_id_(connection_id)
, initial_session_id_(session_id)
, new_session_id_(new_session_id)
, service_type_(service_type)
@@ -119,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.
@@ -161,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
@@ -205,6 +173,24 @@ class SessionObserver {
virtual void OnMalformedMessageCallback(const uint32_t& connection_key) = 0;
/**
+ * @brief Converts connection handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param connection_handle A connection identifier
+ * @return string representation of the transport of the device
+ */
+ virtual const std::string TransportTypeProfileStringFromConnHandle(
+ transport_manager::ConnectionUID connection_handle) const = 0;
+
+ /**
+ * @brief Converts device handle to transport type string used in
+ * smartDeviceLink.ini file, e.g. "TCP_WIFI"
+ * @param device_handle A device handle
+ * @return string representation of the transport of the device
+ */
+ virtual const std::string TransportTypeProfileStringFromDeviceHandle(
+ transport_manager::DeviceHandle device_handle) const = 0;
+
+ /**
* \brief Creates unique identifier of session (can be used as hash)
* from given connection identifier
* within which session exists and session number.
diff --git a/src/components/include/protocol_handler/telemetry_observer.h b/src/components/include/protocol_handler/telemetry_observer.h
index a76fbce717..b2bf94de35 100644
--- a/src/components/include/protocol_handler/telemetry_observer.h
+++ b/src/components/include/protocol_handler/telemetry_observer.h
@@ -45,12 +45,12 @@ class PHTelemetryObserver {
RawMessagePtr raw_msg;
uint32_t message_id;
uint8_t connection_key;
- TimevalStruct begin;
- TimevalStruct end;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
};
- virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time) = 0;
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m) = 0;
+ virtual void StartMessageProcess(
+ uint32_t message_id, const date_time::TimeDuration& start_time) = 0;
+ virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m) = 0;
virtual ~PHTelemetryObserver() {}
};
} // protocol_handler
diff --git a/src/components/include/security_manager/security_query.h b/src/components/include/security_manager/security_query.h
index cdad1c746c..8aa5b60853 100644
--- a/src/components/include/security_manager/security_query.h
+++ b/src/components/include/security_manager/security_query.h
@@ -37,7 +37,7 @@
#include <cstddef>
#include <vector>
#include <string>
-#include "utils/shared_ptr.h"
+#include <memory>
namespace security_manager {
/**
@@ -189,6 +189,6 @@ class SecurityQuery {
/**
*\brief SmartPointer wrapper
*/
-typedef utils::SharedPtr<SecurityQuery> SecurityQueryPtr;
+typedef std::shared_ptr<SecurityQuery> SecurityQueryPtr;
} // namespace security_manager
#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
diff --git a/src/components/include/test/application_manager/mock_app_extension.h b/src/components/include/test/application_manager/mock_app_extension.h
index eb8fcd51cf..5898bc9b72 100644
--- a/src/components/include/test/application_manager/mock_app_extension.h
+++ b/src/components/include/test/application_manager/mock_app_extension.h
@@ -47,11 +47,11 @@ static unsigned MockAppExtensionUID = 123;
class MockAppExtension : public application_manager::AppExtension {
public:
MockAppExtension() : AppExtension(MockAppExtensionUID) {}
- MOCK_METHOD1(
- SaveResumptionData,
- void(NsSmartDeviceLink::NsSmartObjects::SmartObject& resumption_data));
+ MOCK_METHOD1(SaveResumptionData,
+ void(ns_smart_device_link::ns_smart_objects::SmartObject&
+ resumption_data));
MOCK_METHOD1(ProcessResumption,
- void(const NsSmartDeviceLink::NsSmartObjects::SmartObject&
+ void(const ns_smart_device_link::ns_smart_objects::SmartObject&
resumption_data));
};
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 09957dbde0..c4405b0ffd 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -121,7 +121,9 @@ class MockApplicationManager : public application_manager::ApplicationManager {
mobile_apis::HMILevel::eType to));
MOCK_METHOD1(
SendHMIStatusNotification,
- void(const utils::SharedPtr<application_manager::Application> app));
+ void(const std::shared_ptr<application_manager::Application> app));
+ MOCK_METHOD1(SendDriverDistractionState,
+ void(application_manager::ApplicationSharedPtr app));
MOCK_METHOD1(RemoveHMIFakeParameters,
void(application_manager::commands::MessageSharedPtr& message));
MOCK_CONST_METHOD1(
@@ -131,10 +133,14 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&());
MOCK_CONST_METHOD0(hmi_capabilities,
const application_manager::HMICapabilities&());
+ MOCK_CONST_METHOD1(
+ CheckResumptionRequiredTransportAvailable,
+ bool(application_manager::ApplicationConstSharedPtr application));
MOCK_METHOD2(ProcessQueryApp,
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,
@@ -155,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());
@@ -166,7 +170,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
void(mobile_apis::VehicleDataType::eType vehicle_info,
int value));
MOCK_METHOD1(RegisterApplication,
- application_manager::ApplicationSharedPtr(const utils::SharedPtr<
+ application_manager::ApplicationSharedPtr(const std::shared_ptr<
smart_objects::SmartObject>& request_for_registration));
MOCK_METHOD0(SendUpdateAppList, void());
MOCK_METHOD2(MarkAppsGreyOut,
@@ -175,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(
@@ -251,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));
@@ -267,17 +263,16 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
MOCK_CONST_METHOD0(get_settings,
const application_manager::ApplicationManagerSettings&());
+ MOCK_CONST_METHOD1(
+ GetCorrectMobileIDFromMessage,
+ std::string(
+ const application_manager::commands::MessageSharedPtr& message));
MOCK_METHOD0(event_dispatcher,
application_manager::event_engine::EventDispatcher&());
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,
@@ -313,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 25cf994566..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&());
@@ -87,6 +89,7 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(named_audio_pipe_path, const std::string&());
MOCK_CONST_METHOD0(video_stream_file, const std::string&());
MOCK_CONST_METHOD0(audio_stream_file, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
MOCK_CONST_METHOD0(use_db_for_resumption, bool());
MOCK_CONST_METHOD0(app_resumption_save_persistent_data_timeout,
const uint32_t&());
@@ -95,6 +98,13 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_resuming_timeout, const uint32_t&());
MOCK_CONST_METHOD0(attempts_to_open_resumption_db, uint16_t());
MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t());
+ MOCK_CONST_METHOD0(transport_required_for_resumption_map,
+ std::map<std::string, std::vector<std::string> >&());
+ MOCK_CONST_METHOD0(navigation_lowbandwidth_resumption_level,
+ const std::string&());
+ MOCK_CONST_METHOD0(projection_lowbandwidth_resumption_level,
+ const std::string&());
+ MOCK_CONST_METHOD0(media_lowbandwidth_resumption_level, const std::string&());
MOCK_METHOD1(set_config_file_name, void(const std::string& fileName));
// The following line won't really compile, as the return
// type has multiple template arguments. To fix it, use a
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index ffa9222c8e..cb47147074 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
@@ -112,7 +112,7 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener));
MOCK_CONST_METHOD0(GetStatisticManager,
- utils::SharedPtr<usage_statistics::StatisticsManager>());
+ std::shared_ptr<usage_statistics::StatisticsManager>());
MOCK_CONST_METHOD2(CheckSystemAction,
bool(mobile_apis::SystemAction::eType system_action,
const std::string& policy_app_id));
diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h
index f1416c999e..2de3a0f9a7 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler.h
@@ -51,6 +51,7 @@ using connection_handler::ConnectionHandle;
using connection_handler::DeviceHandle;
using connection_handler::CloseSessionReason;
using connection_handler::DevicesDiscoveryStarter;
+using connection_handler::SessionTransports;
class MockConnectionHandler : public connection_handler::ConnectionHandler {
public:
@@ -84,13 +85,6 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
void(uint32_t connection_key, uint8_t session_id));
MOCK_METHOD2(BindProtocolVersionWithSession,
void(uint32_t connection_key, uint8_t protocol_version));
-
- // DEPRECATED
- MOCK_CONST_METHOD4(GetDataOnSessionKey,
- int32_t(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id));
MOCK_CONST_METHOD4(GetDataOnSessionKey,
int32_t(uint32_t key,
uint32_t* app_id,
@@ -103,10 +97,31 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&());
MOCK_CONST_METHOD1(GetConnectedDevicesMAC,
void(std::vector<std::string>& macs));
+ MOCK_METHOD1(
+ AddSession,
+ uint32_t(const transport_manager::ConnectionUID primary_transport_id));
+ MOCK_METHOD1(RemoveSession, bool(uint8_t session_id));
+ MOCK_METHOD0(session_connection_map,
+ DataAccessor<connection_handler::SessionConnectionMap>());
+ MOCK_METHOD2(SetSecondaryTransportID,
+ SessionTransports(
+ uint8_t session_id,
+ transport_manager::ConnectionUID secondary_transport_id));
+ MOCK_CONST_METHOD1(GetSessionTransports,
+ const SessionTransports(uint8_t session_id));
MOCK_METHOD3(NotifyServiceStartedResult,
void(uint32_t session_key,
bool result,
std::vector<std::string>& rejected_params));
+ MOCK_METHOD3(
+ OnSecondaryTransportStarted,
+ bool(transport_manager::ConnectionUID& primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle,
+ const uint8_t session_id));
+ MOCK_METHOD2(
+ OnSecondaryTransportEnded,
+ void(const transport_manager::ConnectionUID primary_connection_handle,
+ const transport_manager::ConnectionUID secondary_connection_handle));
};
} // namespace connection_handler_test
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 a96498028d..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,
@@ -74,6 +69,11 @@ class MockConnectionHandlerObserver
const connection_handler::Device& device_to));
MOCK_METHOD1(OnDeviceSwitchingFinish, void(const std::string& device_uid));
MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id));
+ MOCK_METHOD2(OnSecondaryTransportStartedCallback,
+ void(const connection_handler::DeviceHandle device_handle,
+ const int32_t session_key));
+ MOCK_METHOD1(OnSecondaryTransportEndedCallback,
+ void(const int32_t session_key));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
index 859d164231..17ec69ccf8 100644
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
@@ -45,9 +45,9 @@ class MockHMIMessageObserver : public hmi_message_handler::HMIMessageObserver,
public utils::Singleton<MockHMIMessageObserver> {
public:
MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
+ void(std::shared_ptr<application_manager::Message> message));
virtual ~MockHMIMessageObserver() {}
};
diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
index 02931114f0..a4d50d7cc2 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
@@ -106,7 +106,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
MOCK_METHOD2(Init,
bool(const std::string& file_name,
const PolicySettings* settings));
- MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
@@ -231,7 +231,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
bool(const std::string& device_id,
const std::string& policy_app_id,
policy::Permissions& permission));
- MOCK_CONST_METHOD0(GetPT, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GetPT, std::shared_ptr<policy_table::Table>());
MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo());
MOCK_CONST_METHOD0(GetCertificate, std::string());
MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
index ea259fc916..aeabf8fdcb 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -163,7 +163,7 @@ class MockPolicyManager : public PolicyManager {
bool(const std::string& policy_app_id,
std::vector<std::string>* modules));
MOCK_METHOD1(set_access_remote,
- void(utils::SharedPtr<AccessRemote> access_remote));
+ void(std::shared_ptr<AccessRemote> access_remote));
MOCK_METHOD0(CleanupUnpairedDevices, bool());
MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
index eafc1df4fe..fe051aaae0 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
@@ -49,6 +49,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
MOCK_CONST_METHOD0(system_files_path, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
};
} // namespace policy_test
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
index d216957eb0..440000dbff 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
@@ -84,7 +84,7 @@ class MockCacheManagerInterface : public CacheManagerInterface {
MOCK_METHOD2(Init,
bool(const std::string& file_name,
const PolicySettings* settings));
- MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
@@ -202,7 +202,7 @@ class MockCacheManagerInterface : public CacheManagerInterface {
bool(const std::string& device_id,
const std::string& policy_app_id,
policy::Permissions& permission));
- MOCK_CONST_METHOD0(pt, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(pt, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(GetHMITypes,
const policy_table::AppHMITypes*(const std::string& app_id));
MOCK_CONST_METHOD0(GetCertificate, std::string());
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
index 952b264caf..0e06e9c1a3 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -162,7 +162,7 @@ class MockPolicyManager : public PolicyManager {
bool(const std::string& policy_app_id,
std::vector<std::string>* modules));
MOCK_METHOD1(set_access_remote,
- void(utils::SharedPtr<AccessRemote> access_remote));
+ void(std::shared_ptr<AccessRemote> access_remote));
MOCK_METHOD0(CleanupUnpairedDevices, bool());
MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
index 438e697c51..6e0acae33c 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
@@ -49,6 +49,7 @@ class MockPolicySettings : public ::policy::PolicySettings {
MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
MOCK_CONST_METHOD0(system_files_path, const std::string&());
+ MOCK_CONST_METHOD0(use_full_app_id, bool());
};
} // namespace policy_test
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 e667911944..f6db0c7097 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h
@@ -55,20 +55,14 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler {
void(uint32_t connection_key, int32_t number_of_frames));
MOCK_METHOD2(SendHeartBeat, void(int32_t connection_id, uint8_t session_id));
MOCK_METHOD2(SendEndSession, void(int32_t connection_id, uint8_t session_id));
- MOCK_METHOD3(SendEndService,
- void(int32_t connection_id,
+ MOCK_METHOD4(SendEndService,
+ void(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type));
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_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
index 8ddeded889..2ed9c47e9d 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
@@ -60,6 +60,17 @@ class MockProtocolHandlerSettings
MOCK_CONST_METHOD0(force_protected_service, const std::vector<int>&());
MOCK_CONST_METHOD0(force_unprotected_service, const std::vector<int>&());
#endif
+ MOCK_CONST_METHOD0(multiple_transports_enabled, const bool());
+ MOCK_CONST_METHOD0(secondary_transports_for_bluetooth,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(secondary_transports_for_usb,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(secondary_transports_for_wifi,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(audio_service_transports,
+ const std::vector<std::string>&());
+ MOCK_CONST_METHOD0(video_service_transports,
+ const std::vector<std::string>&());
};
} // namespace protocol_handler_test
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 ae32f35948..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,
@@ -76,6 +69,12 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
void(const uint32_t& connection_key));
MOCK_METHOD1(OnMalformedMessageCallback,
void(const uint32_t& connection_key));
+ MOCK_CONST_METHOD1(
+ TransportTypeProfileStringFromConnHandle,
+ const std::string(transport_manager::ConnectionUID connection_handle));
+ MOCK_CONST_METHOD1(
+ TransportTypeProfileStringFromDeviceHandle,
+ const std::string(transport_manager::DeviceHandle device_handle));
MOCK_CONST_METHOD2(
KeyFromPair,
uint32_t(transport_manager::ConnectionUID connection_handle,
@@ -89,11 +88,6 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
uint32_t* app_id,
std::list<int32_t>* sessions_list,
transport_manager::DeviceHandle* device_id));
- DEPRECATED MOCK_CONST_METHOD4(GetDataOnSessionKey,
- int32_t(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id));
MOCK_CONST_METHOD5(GetDataOnDeviceID,
int32_t(transport_manager::DeviceHandle device_handle,
diff --git a/src/components/include/test/protocol_handler/mock_telemetry_observer.h b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
index 1c87de4d5a..82c42775fa 100644
--- a/src/components/include/test/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
@@ -44,8 +44,9 @@ namespace protocol_handler_test {
class MockPHTelemetryObserver : public PHTelemetryObserver {
public:
MOCK_METHOD2(StartMessageProcess,
- void(uint32_t message_id, const TimevalStruct& start_time));
- MOCK_METHOD1(EndMessageProcess, void(utils::SharedPtr<MessageMetric> m));
+ void(uint32_t message_id,
+ const date_time::TimeDuration& start_time));
+ MOCK_METHOD1(EndMessageProcess, void(std::shared_ptr<MessageMetric> m));
};
} // namespace protocol_handler_test
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_listener.h b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
index f4c4fdcf68..133dabe732 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_listener.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
@@ -85,6 +85,8 @@ class MockTransportManagerListener : public TransportManagerListener {
void(const DeviceUID& device_uid_from,
const DeviceUID& device_uid_to));
MOCK_METHOD1(OnDeviceSwitchingFinish, void(const DeviceUID& device_uid));
+ MOCK_METHOD1(OnTransportConfigUpdated,
+ void(const std::map<std::string, std::string>& configs));
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index 88112df003..3e7c8f36f7 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -61,6 +61,8 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(iap_hub_connection_wait_timeout, uint32_t());
MOCK_CONST_METHOD0(app_transport_change_timer, uint32_t());
MOCK_CONST_METHOD0(app_transport_change_timer_addition, uint32_t());
+ MOCK_CONST_METHOD0(transport_manager_tcp_adapter_network_interface,
+ std::string&());
};
} // namespace transport_manager_test
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
index c37c41d4f8..eff0abdcd3 100644
--- a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
@@ -103,6 +103,8 @@ class MockTransportAdapter
void(const ::transport_manager::DeviceUID& device_handle));
MOCK_CONST_METHOD0(GetSwitchableDevices,
transport_manager::SwitchableDevices());
+ MOCK_CONST_METHOD0(GetTransportConfiguration,
+ transport_manager::transport_adapter::TransportConfig());
#ifdef TELEMETRY_MONITOR
MOCK_METHOD0(GetTelemetryObserver,
::transport_manager::TMTelemetryObserver*());
diff --git a/src/components/include/transport_manager/error.h b/src/components/include/transport_manager/error.h
index 022ddf0e38..ba357dd54b 100644
--- a/src/components/include/transport_manager/error.h
+++ b/src/components/include/transport_manager/error.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
#include <string>
-#include <utils/shared_ptr.h>
+#include <memory>
namespace transport_manager {
@@ -79,7 +79,7 @@ class BaseError {
private:
std::string description_;
};
-typedef utils::SharedPtr<BaseError> BaseErrorPtr;
+typedef std::shared_ptr<BaseError> BaseErrorPtr;
/**
* @brief Error that originates during device search.
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 148e715050..1ac1424477 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -35,9 +35,10 @@
#include <string>
#include <vector>
+#include <memory>
#include "transport_manager/common.h"
-#include "utils/shared_ptr.h"
+
#include "utils/macro.h"
namespace transport_manager {
@@ -160,7 +161,7 @@ class Device {
**/
bool keep_on_disconnect_;
};
-typedef utils::SharedPtr<Device> DeviceSptr;
+typedef std::shared_ptr<Device> DeviceSptr;
typedef std::vector<DeviceSptr> DeviceVector;
} // namespace transport_adapter
} // namespace transport_manager
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 7f6d347535..ebbf7dae28 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -41,8 +41,6 @@
#include <list>
#include <map>
-#include "utils/shared_ptr.h"
-
#include "transport_manager/transport_adapter/device.h"
#include "transport_manager/common.h"
#include "transport_manager/error.h"
@@ -59,17 +57,16 @@ 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,
+ IOS_USB_HOST_MODE,
+ IOS_USB_DEVICE_MODE,
+ IOS_CARPLAY_WIRELESS, // running on iAP over Carplay wireless transport
UNKNOWN
};
@@ -86,6 +83,18 @@ typedef std::map<DeviceUID, DeviceSptr> DeviceMap;
*/
typedef std::list<TransportAdapterListener*> TransportAdapterListenerList;
+/**
+ * @brief Type definition for transport's configuration information
+ */
+typedef std::map<std::string, std::string> TransportConfig;
+
+/**
+ * @brief TransportConfig keys
+ */
+extern const char* tc_enabled;
+extern const char* tc_tcp_port;
+extern const char* tc_tcp_ip_address;
+
class TransportAdapter {
public:
/**
@@ -312,6 +321,12 @@ class TransportAdapter {
virtual void DeviceSwitched(const DeviceUID& device_handle) = 0;
virtual SwitchableDevices GetSwitchableDevices() const = 0;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const = 0;
+
#ifdef TELEMETRY_MONITOR
/**
* @brief Return Time metric observer
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 18f4ccb2d1..fd1d693067 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
@@ -57,7 +57,8 @@ enum class EventTypeEnum {
ON_RECEIVED_FAIL,
ON_COMMUNICATION_ERROR,
ON_UNEXPECTED_DISCONNECT,
- ON_TRANSPORT_SWITCH_REQUESTED
+ ON_TRANSPORT_SWITCH_REQUESTED,
+ ON_TRANSPORT_CONFIG_UPDATED
};
class TransportAdapterEvent {
@@ -87,30 +88,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/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
index d336eade45..6c3f6e2eaa 100644
--- a/src/components/include/transport_manager/transport_manager_listener.h
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -33,6 +33,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
+#include <map>
#include <vector>
#include "transport_manager/common.h"
#include "transport_manager/info.h"
@@ -193,6 +194,14 @@ class TransportManagerListener {
virtual void OnTMMessageSendFailed(
const DataSendError& error,
const ::protocol_handler::RawMessagePtr message) = 0;
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ virtual void OnTransportConfigUpdated(
+ const std::map<std::string, std::string>& configs) = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h
index ca6c573a06..08b2b77c30 100644
--- a/src/components/include/transport_manager/transport_manager_listener_empty.h
+++ b/src/components/include/transport_manager/transport_manager_listener_empty.h
@@ -187,6 +187,14 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnTMMessageSendFailed(
const DataSendError& error,
const ::protocol_handler::RawMessagePtr message) OVERRIDE {}
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ void OnTransportConfigUpdated(
+ const std::map<std::string, std::string>& configs) OVERRIDE {}
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index feb3fa2c02..3912bbe747 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -63,6 +63,12 @@ class TransportManagerSettings : public TransportManagerMMESettings {
* the transport change timeout value.
*/
virtual uint32_t app_transport_change_timer_addition() const = 0;
+
+ /**
+ * @brief Returns the network interface name for TCP transport adapter
+ */
+ virtual const std::string& transport_manager_tcp_adapter_network_interface()
+ const = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/utils/atomic_object.h b/src/components/include/utils/atomic_object.h
deleted file mode 100644
index 257fcfbe3a..0000000000
--- a/src/components/include/utils/atomic_object.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2015, 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_ATOMIC_OBJECT_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
-
-#include "utils/rwlock.h"
-#include "utils/conditional_variable.h"
-#include "utils/macro.h"
-
-namespace sync_primitives {
-
-/**
- * @brief Allows to safely change stored value from different threads.
- *
- * The usage example:
- *
- * threads::Atomic<int> i;
- *
- * i = 5; // here SDL is able to guarantee that this value will be safely
- * // assigned even in multi threaded environment.
- */
-template <typename T>
-class Atomic {
- public:
- /**
- * @brief Atomic allows to construct atomic object.
- * The operation is not atomic.
- *
- * @param value the value to initialize object with.
- */
- Atomic(const T& value) : value_(value) {}
-
- /**
- * @brief operator = thread safe setter for stored value.
- *
- * @param val value to assign.
- *
- * @return mofified value.
- */
- T& operator=(const T& val) {
- sync_primitives::AutoWriteLock lock(rw_lock_);
- value_ = val;
- return value_;
- }
-
- /**
- * @brief operator T thread safe getter
- *
- * return stored value.
- */
- operator T() const {
- sync_primitives::AutoReadLock lock(rw_lock_);
- return value_;
- }
-
- /**
- * @brief operator T thread safe getter
- *
- * return stored value.
- */
- template <typename U>
- operator U() const {
- sync_primitives::AutoReadLock lock(rw_lock_);
- return static_cast<U>(value_);
- }
-
- private:
- T value_;
- mutable sync_primitives::RWLock rw_lock_;
-};
-
-typedef Atomic<int> atomic_int;
-typedef Atomic<int32_t> atomic_int32;
-typedef Atomic<uint32_t> atomic_uint32;
-typedef Atomic<int64_t> atomic_int64;
-typedef Atomic<uint64_t> atomic_uint64;
-typedef Atomic<size_t> atomic_size_t;
-typedef Atomic<bool> atomic_bool;
-
-} // namespace sync_primitives
-
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_OBJECT_H_
diff --git a/src/components/include/utils/conditional_variable.h b/src/components/include/utils/conditional_variable.h
index f54a22e993..a29f255dbf 100644
--- a/src/components/include/utils/conditional_variable.h
+++ b/src/components/include/utils/conditional_variable.h
@@ -32,24 +32,13 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
-#if defined(OS_POSIX)
-#include <pthread.h>
-#else
-#error Please implement conditional variable for your OS
-#endif
#include <stdint.h>
+#include <boost/thread/condition_variable.hpp>
+#include "utils/lock.h"
#include "utils/macro.h"
namespace sync_primitives {
-class AutoLock;
-class Lock;
-
-namespace impl {
-#if defined(OS_POSIX)
-typedef pthread_cond_t PlatformConditionalVariable;
-#endif
-} // namespace impl
/*
* Conditional variable wrapper
@@ -82,11 +71,11 @@ class ConditionalVariable {
// Wait forever or up to milliseconds time limit
bool Wait(AutoLock& auto_lock);
- bool Wait(Lock& lock);
+ bool Wait(BaseLock& lock);
WaitStatus WaitFor(AutoLock& auto_lock, uint32_t milliseconds);
private:
- impl::PlatformConditionalVariable cond_var_;
+ boost::condition_variable_any cond_var_;
private:
DISALLOW_COPY_AND_ASSIGN(ConditionalVariable);
diff --git a/src/components/include/utils/data_accessor.h b/src/components/include/utils/data_accessor.h
index 645886592c..1be7c3ab53 100644
--- a/src/components/include/utils/data_accessor.h
+++ b/src/components/include/utils/data_accessor.h
@@ -32,16 +32,14 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
-#include <iostream>
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
-// This class is for thread-safe access to data
+// This class is for thread-safe const access to data
template <class T>
class DataAccessor {
public:
DataAccessor(const T& data,
- const std::shared_ptr<sync_primitives::Lock>& lock)
+ const std::shared_ptr<sync_primitives::BaseLock>& lock)
: data_(data), lock_(lock), counter_(new uint32_t(0)) {
lock_->Acquire();
}
@@ -66,8 +64,8 @@ class DataAccessor {
void* operator new(size_t size);
const T& data_;
// Require that the lock lives at least as long as the DataAccessor
- const std::shared_ptr<sync_primitives::Lock> lock_;
- utils::SharedPtr<uint32_t> counter_;
+ const std::shared_ptr<sync_primitives::BaseLock> lock_;
+ std::shared_ptr<uint32_t> counter_;
};
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_
diff --git a/src/components/include/utils/date_time.h b/src/components/include/utils/date_time.h
index f8f8e3d6ce..17b4fafe38 100644
--- a/src/components/include/utils/date_time.h
+++ b/src/components/include/utils/date_time.h
@@ -32,69 +32,70 @@
#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
#define SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
-#if defined(OS_POSIX)
-#include <sys/time.h>
-typedef struct timeval TimevalStruct;
-#endif
#include <stdint.h>
+#include "boost/date_time/posix_time/posix_time_duration.hpp"
namespace date_time {
+// skip boost namespacing for all this
+// NOTE that it's called posix_time for its functionality, not for any
+// platform-dependence
+typedef boost::posix_time::time_duration TimeDuration;
+// Capture from boost's namespaces
+using boost::posix_time::microseconds;
+using boost::posix_time::milliseconds;
+using boost::posix_time::seconds;
+
enum TimeCompare { LESS, EQUAL, GREATER };
-class DateTime {
- public:
- static const int32_t MILLISECONDS_IN_SECOND = 1000;
- static const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
- static const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
- static const int32_t SECONDS_IN_HOUR = 3600;
- static const int32_t MICROSECONDS_IN_SECOND =
- MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
- static const int32_t NANOSECONDS_IN_MILLISECOND =
- MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
+// public defines for external usage
+const int32_t MILLISECONDS_IN_SECOND = 1000;
+const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
+const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
+const int32_t SECONDS_IN_HOUR = 3600;
+const int32_t MICROSECONDS_IN_SECOND =
+ MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
+const int32_t NANOSECONDS_IN_MILLISECOND =
+ MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
+
+TimeDuration getCurrentTime();
- static TimevalStruct getCurrentTime();
+// empty duration
+TimeDuration TimeDurationZero();
- // return SECONDS count
- static int64_t getSecs(const TimevalStruct& time);
+// return SECONDS count
+int64_t getSecs(const TimeDuration& t);
- // return MILLISECONDS count
- static int64_t getmSecs(const TimevalStruct& time);
- // return MICROSECONDS count
- static int64_t getuSecs(const TimevalStruct& time);
+// return MILLISECONDS count
+int64_t getmSecs(const TimeDuration& t);
+// return MICROSECONDS count
+int64_t getuSecs(const TimeDuration& t);
- // return MILLISECONDS count between sinceTime value and current time
- static int64_t calculateTimeSpan(const TimevalStruct& sinceTime);
+// get just the MILLISECONDS count (< 1000)
+int64_t get_just_mSecs(const TimeDuration& t);
- // return MILLISECONDS count between time1 and time2
- static int64_t calculateTimeDiff(const TimevalStruct& time1,
- const TimevalStruct& time2);
+// get just the MICROSECONDS count (< 1000)
+int64_t get_just_uSecs(const TimeDuration& t);
- /**
- * @brief Adds milliseconds to time struct
- * @param time contains time struct
- * @param milliseconds contains value which need to
- * add to time struct
- **/
- static void AddMilliseconds(TimevalStruct& time, uint32_t milliseconds);
+// return MILLISECONDS count between sinceTime value and current time
+int64_t calculateTimeSpan(const TimeDuration& sinceTime);
- static TimevalStruct Sub(const TimevalStruct& time1,
- const TimevalStruct& time2);
+// return MILLISECONDS count between time1 and time2
+int64_t calculateTimeDiff(const TimeDuration& time1, const TimeDuration& time2);
- static TimeCompare compareTime(const TimevalStruct& time1,
- const TimevalStruct& time2);
+/**
+ * @brief Adds milliseconds to time struct
+ * @param time contains time struct
+ * @param milliseconds contains value which need to
+ * add to time struct
+ **/
+void AddMilliseconds(TimeDuration& time, uint32_t milliseconds);
- static bool Greater(const TimevalStruct& time1, const TimevalStruct& time2);
- static bool Less(const TimevalStruct& time1, const TimevalStruct& time2);
- static bool Equal(const TimevalStruct& time1, const TimevalStruct& time2);
+TimeCompare compareTime(const TimeDuration& time1, const TimeDuration& time2);
- private:
- static TimevalStruct ConvertionUsecs(const TimevalStruct& time);
-};
+bool Greater(const TimeDuration& time1, const TimeDuration& time2);
+bool Less(const TimeDuration& time1, const TimeDuration& time2);
+bool Equal(const TimeDuration& time1, const TimeDuration& time2);
} // namespace date_time
-bool operator<(const TimevalStruct& time1, const TimevalStruct& time2);
-bool operator==(const TimevalStruct& time1, const TimevalStruct& time2);
-const TimevalStruct operator-(const TimevalStruct& time1,
- const TimevalStruct& time2);
#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
diff --git a/src/components/include/utils/lock.h b/src/components/include/utils/lock.h
index 081e651b13..bfa1ef1770 100644
--- a/src/components/include/utils/lock.h
+++ b/src/components/include/utils/lock.h
Binary files differ
diff --git a/src/components/include/utils/make_shared.h b/src/components/include/utils/make_shared.h
deleted file mode 100644
index 9d40d646a6..0000000000
--- a/src/components/include/utils/make_shared.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2015, 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_MAKE_SHARED_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
-
-#include <new>
-/**
- * @brief The functions set below allows to create shared pointer in a safe way.
- * There are up to 5 parameters could be passed as the constructor parameters.
- *
- * @example
- * struct A {
- * A(int){}
- * A(int, double) {}
- * A(int, double, std::string) {}
- * }
- * SharedPtr<A> shared1(MakeShared<A>(5);
- * SharedPtr<A> shared2(MakeShared<A>(5, 5.5);
- * SharedPtr<A> shared3(MakeShared<A>(5, 5.5, std::string("MyStr"));
- *
- * The profit in using MakeShared instead of simple allocation with operator new
- *is evident.
- * Firstly it allows us to centralize allocation place, secondly it allows us to
- *use
- * safe operator new overloading (no throwable one).
- */
-namespace utils {
-template <typename T>
-class SharedPtr;
-
-namespace {
-template <typename T>
-SharedPtr<T> Initialize(T* object) {
- return object == NULL ? SharedPtr<T>() : SharedPtr<T>(object);
-}
-}
-
-template <typename T>
-SharedPtr<T> MakeShared() {
- T* t = new (std::nothrow) T;
- return Initialize(t);
-}
-
-template <typename T, typename Arg1>
-SharedPtr<T> MakeShared(Arg1& arg1) {
- T* t = new (std::nothrow) T(arg1);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2) {
- T* t = new (std::nothrow) T(arg1, arg2);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2, typename Arg3>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4>
-SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5>
-SharedPtr<T> MakeShared(
- Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5,
- typename Arg6>
-SharedPtr<T> MakeShared(
- Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5, Arg6& arg6) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1>
-SharedPtr<T> MakeShared(const Arg1& arg1) {
- T* t = new (std::nothrow) T(arg1);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2>
-SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2) {
- T* t = new (std::nothrow) T(arg1, arg2);
- return Initialize(t);
-}
-
-template <typename T, typename Arg1, typename Arg2, typename Arg3>
-SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4,
- const Arg5& arg5) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5);
- return Initialize(t);
-}
-
-template <typename T,
- typename Arg1,
- typename Arg2,
- typename Arg3,
- typename Arg4,
- typename Arg5,
- typename Arg6>
-SharedPtr<T> MakeShared(const Arg1& arg1,
- const Arg2& arg2,
- const Arg3& arg3,
- const Arg4& arg4,
- const Arg5& arg5,
- const Arg6& arg6) {
- T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6);
- return Initialize(t);
-}
-
-} // namespace utils;
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_
diff --git a/src/components/include/utils/messagemeter.h b/src/components/include/utils/messagemeter.h
index 42b658ad6b..1148a65b57 100644
--- a/src/components/include/utils/messagemeter.h
+++ b/src/components/include/utils/messagemeter.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_INCLUDE_UTILS_MESSAGEMETER_H_
#include <cstddef>
-#include <set>
#include <map>
+#include <set>
#include "utils/date_time.h"
namespace utils {
@@ -82,20 +82,19 @@ class MessageMeter {
void ClearIdentifiers();
void set_time_range(const size_t time_range_msecs);
- void set_time_range(const TimevalStruct& time_range);
- TimevalStruct time_range() const;
+ void set_time_range(const date_time::TimeDuration& time_range);
+ date_time::TimeDuration time_range() const;
private:
- TimevalStruct time_range_;
- typedef std::multiset<TimevalStruct> Timings;
+ date_time::TimeDuration time_range_;
+ typedef std::multiset<date_time::TimeDuration> Timings;
typedef std::map<Id, Timings> TimingMap;
TimingMap timing_map_;
};
template <class Id>
-MessageMeter<Id>::MessageMeter()
- : time_range_(TimevalStruct{0, 0}) {
- time_range_.tv_sec = 1;
+MessageMeter<Id>::MessageMeter() {
+ time_range_ = date_time::seconds(1);
}
template <class Id>
@@ -106,7 +105,7 @@ size_t MessageMeter<Id>::TrackMessage(const Id& id) {
template <class Id>
size_t MessageMeter<Id>::TrackMessages(const Id& id, const size_t count) {
Timings& timings = timing_map_[id];
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
for (size_t i = 0; i < count; ++i) {
// Adding to the end is amortized constant
timings.insert(timings.end(), current_time);
@@ -124,8 +123,8 @@ size_t MessageMeter<Id>::Frequency(const Id& id) {
if (timings.empty()) {
return 0u;
}
- const TimevalStruct actual_begin_time = date_time::DateTime::Sub(
- date_time::DateTime::getCurrentTime(), time_range_);
+ const date_time::TimeDuration actual_begin_time =
+ (date_time::getCurrentTime() - time_range_);
timings.erase(timings.begin(), timings.upper_bound(actual_begin_time));
return timings.size();
}
@@ -142,21 +141,15 @@ void MessageMeter<Id>::ClearIdentifiers() {
template <class Id>
void MessageMeter<Id>::set_time_range(const size_t time_range_msecs) {
- // TODO(EZamakhov): move to date_time::DateTime
- const size_t secs =
- time_range_msecs / date_time::DateTime::MILLISECONDS_IN_SECOND;
- time_range_.tv_sec = secs;
- const size_t mSecs =
- time_range_msecs % date_time::DateTime::MILLISECONDS_IN_SECOND;
- time_range_.tv_usec =
- mSecs * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ time_range_ = date_time::milliseconds(time_range_msecs);
}
template <class Id>
-void MessageMeter<Id>::set_time_range(const TimevalStruct& time_range) {
+void MessageMeter<Id>::set_time_range(
+ const date_time::TimeDuration& time_range) {
time_range_ = time_range;
}
template <class Id>
-TimevalStruct MessageMeter<Id>::time_range() const {
+date_time::TimeDuration MessageMeter<Id>::time_range() const {
return time_range_;
}
} // namespace utils
diff --git a/src/components/include/utils/semantic_version.h b/src/components/include/utils/semantic_version.h
new file mode 100644
index 0000000000..244ae82177
--- /dev/null
+++ b/src/components/include/utils/semantic_version.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2018, Livio
+ * 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_SEMANTIC_VERSION_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_SEMANTIC_VERSION_H_
+
+#include <string>
+namespace utils {
+
+struct SemanticVersion {
+ SemanticVersion(uint16_t major = 0, uint16_t minor = 0, uint16_t patch = 0) {
+ major_version_ = major;
+ minor_version_ = minor;
+ patch_version_ = patch;
+ }
+
+ SemanticVersion(const SemanticVersion& other) {
+ major_version_ = other.major_version_;
+ minor_version_ = other.minor_version_;
+ patch_version_ = other.patch_version_;
+ }
+
+ SemanticVersion(const std::string& versionString)
+ : major_version_(0), minor_version_(0), patch_version_(0) {
+ unsigned int major_int, minor_int, patch_int;
+ int readElements = sscanf(
+ versionString.c_str(), "%u.%u.%u", &major_int, &minor_int, &patch_int);
+ if (readElements != 3) {
+ // LOG4CXX_WARN(logger_,
+ // "Error while parsing version string: " << versionString);
+ } else {
+ major_version_ = static_cast<uint8_t>(major_int);
+ minor_version_ = static_cast<uint8_t>(minor_int);
+ patch_version_ = static_cast<uint8_t>(patch_int);
+ }
+ }
+
+ static inline int16_t cmp(const SemanticVersion& version1,
+ const SemanticVersion& version2) {
+ int16_t diff =
+ static_cast<int16_t>(version1.major_version_ - version2.major_version_);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.minor_version_ -
+ version2.minor_version_);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.patch_version_ -
+ version2.patch_version_);
+ }
+ }
+ return diff;
+ }
+
+ bool operator==(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) == 0;
+ }
+ bool operator<(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) < 0;
+ }
+ bool operator>(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) > 0;
+ }
+ bool operator<=(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) <= 0;
+ }
+ bool operator>=(const SemanticVersion& other) const {
+ return SemanticVersion::cmp(*this, other) >= 0;
+ }
+ static inline SemanticVersion* min(SemanticVersion& version1,
+ SemanticVersion& version2) {
+ return (version1 < version2) ? &version1 : &version2;
+ }
+
+ const std::string toString() const {
+ std::string result = "";
+ result += std::to_string(major_version_);
+ result += ".";
+ result += std::to_string(minor_version_);
+ result += ".";
+ result += std::to_string(patch_version_);
+ return result;
+ }
+
+ bool isValid() const {
+ return major_version_ > 0 || minor_version_ > 0 || patch_version_ > 0;
+ }
+
+ uint16_t major_version_ = 0;
+ uint16_t minor_version_ = 0;
+ uint16_t patch_version_ = 0;
+};
+
+extern const SemanticVersion version_4_5;
+}
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H \ No newline at end of file
diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h
deleted file mode 100644
index 064bb36b4a..0000000000
--- a/src/components/include/utils/shared_ptr.h
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 2013, 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_SHARED_PTR_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdint.h>
-
-#include "utils/macro.h"
-#include "utils/atomic.h"
-
-namespace utils {
-
-/**
- * @brief Shared pointer.
- *
- * Pointer to an object with reference counting.
- * Object will be automatically deallocated when last shared
- * pointer is destroyed.
- *
- * @tparam ObjectType Type of wrapped object.
- **/
-template <typename ObjectType>
-class SharedPtr {
- static void DummyDeleter(ObjectType* object_to_delete) {
- delete object_to_delete;
- }
-
- public:
- // std smart pointer compatibility
- typedef ObjectType element_type;
- typedef void (*Deleter)(ObjectType*);
- /**
- * @brief Constructor.
- *
- * Initialize shared pointer with wrapped object.
- * Reference counter will be initialized to 1.
- *
- * @param Object Wrapped object.
- **/
- SharedPtr(ObjectType* Object);
-
- SharedPtr(ObjectType* Object, Deleter deleter)
- : mObject(Object)
- , mReferenceCounter(new uint32_t(1))
- , deleter_(deleter) {}
-
- SharedPtr();
-
- /**
- * @brief Copy constructor.
- *
- * Initialize shared pointer with another shared pointer.
- * Reference counter will be incremented.
- *
- * @param Other Other shared pointer.
- **/
- SharedPtr(const SharedPtr<ObjectType>& Other);
-
- /**
- * @brief Copy constructor.
- *
- * Initialize shared pointer with another shared pointer.
- * Reference counter will be incremented.
- *
- * @tparam OtherObjectType Type of other object pointer. This
- * allows creating a shared pointer to an
- * intstance of a base class from a shared
- * pointer to an instance of a class
- * inherited from this base class.
- * If OtherObjectType is not implicitly
- * convertible to ObjectType it will
- * cause a compile error.
- *
- * @param Other Other shared pointer.
- **/
- template <typename OtherObjectType>
- SharedPtr(const SharedPtr<OtherObjectType>& Other);
-
- /**
- * @brief Destructor.
- *
- * Decrement reference counter and destroy wrapped object
- * if reference counter reaches zero.
- **/
- ~SharedPtr();
-
- /**
- * @brief Assignment operator.
- *
- * Drop reference to currently referenced object and add
- * reference to assigned object.
- *
- * @param Other Shared pointer to an object
- * that must be referenced.
- *
- * @return Reference to this shared pointer.
- **/
- SharedPtr<ObjectType>& operator=(const SharedPtr<ObjectType>& Other);
-
- bool operator==(const SharedPtr<ObjectType>& Other) const;
-
- bool operator<(const SharedPtr<ObjectType>& other) const;
-
- /**
- * @brief Assignment operator.
- *
- * Drop reference to currently referenced object and add
- * reference to assigned object.
- *
- * @tparam OtherObjectType Type of other object pointer. This
- * allows creating a shared pointer to an
- * intstance of a base class from a shared
- * pointer to an instance of a class
- * inherited from this base class.
- * If OtherObjectType is not implicitly
- * convertible to ObjectType it will
- * cause a compile error.
- *
- * @param Other Shared pointer to an object
- * that must be referenced.
- *
- * @return Reference to this shared pointer.
- **/
- template <typename OtherObjectType>
- SharedPtr<ObjectType>& operator=(const SharedPtr<OtherObjectType>& Other);
-
- template <typename OtherObjectType>
- static SharedPtr<OtherObjectType> static_pointer_cast(
- const SharedPtr<ObjectType>& pointer);
-
- template <typename OtherObjectType>
- static SharedPtr<OtherObjectType> dynamic_pointer_cast(
- const SharedPtr<ObjectType>& pointer);
-
- /**
- * @brief Member access operator.
- *
- * @return Wrapped object.
- **/
- ObjectType* operator->() const;
-
- ObjectType& operator*() const;
- operator bool() const;
- void reset();
- void reset(ObjectType* other);
- ObjectType* get() const;
-
-#ifdef BUILD_TESTS
- inline const uint32_t* get_ReferenceCounter() const {
- return mReferenceCounter;
- }
-#endif // BUILD_TESTS
-
- /**
- * @return true if mObject not NULL
- */
- bool valid() const;
-
- private:
- void reset_impl(ObjectType* other);
-
- // TSharedPtr needs access to other TSharedPtr private members
- // for shared pointers type casts.
- template <typename OtherObjectType>
- friend class SharedPtr;
-
- /**
- * @brief Drop reference to wrapped object.
- *
- * If reference counter reaches zero object and its reference
- * counter will be deallocated.
- **/
- void dropReference();
-
- /**
- * @brief Wrapped object.
- **/
- ObjectType* mObject;
-
- /**
- * @brief Pointer to reference counter.
- **/
- uint32_t* mReferenceCounter;
-
- Deleter deleter_;
- void release();
-};
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(ObjectType* Object)
- : mObject(NULL)
- , mReferenceCounter(new uint32_t(1))
- , deleter_(DummyDeleter) {
- DCHECK(Object != NULL);
- mObject = Object;
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr()
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(
- const SharedPtr<ObjectType>& Other)
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {
- *this = Other;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-inline utils::SharedPtr<ObjectType>::SharedPtr(
- const SharedPtr<OtherObjectType>& Other)
- : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {
- *this = Other;
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>::~SharedPtr() {
- dropReference();
-}
-
-template <typename ObjectType>
-inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=(
- const SharedPtr<ObjectType>& Other) {
- return operator=<ObjectType>(Other);
-}
-
-template <typename ObjectType>
-inline bool utils::SharedPtr<ObjectType>::operator==(
- const SharedPtr<ObjectType>& Other) const {
- return (mObject == Other.mObject);
-}
-
-template <typename ObjectType>
-inline bool utils::SharedPtr<ObjectType>::operator<(
- const SharedPtr<ObjectType>& other) const {
- return (mObject < other.mObject);
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=(
- const SharedPtr<OtherObjectType>& Other) {
- dropReference();
-
- mObject = Other.mObject;
- mReferenceCounter = Other.mReferenceCounter;
-
- if (0 != mReferenceCounter) {
- atomic_post_inc(mReferenceCounter);
- }
-
- return *this;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-utils::SharedPtr<OtherObjectType> utils::SharedPtr<
- ObjectType>::static_pointer_cast(const SharedPtr<ObjectType>& pointer) {
- SharedPtr<OtherObjectType> casted_pointer;
- casted_pointer.mObject = static_cast<OtherObjectType*>(pointer.mObject);
- casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
-
- if (0 != casted_pointer.mReferenceCounter) {
- atomic_post_inc(casted_pointer.mReferenceCounter);
- }
-
- return casted_pointer;
-}
-
-template <typename ObjectType>
-template <typename OtherObjectType>
-utils::SharedPtr<OtherObjectType> utils::SharedPtr<
- ObjectType>::dynamic_pointer_cast(const SharedPtr<ObjectType>& pointer) {
- SharedPtr<OtherObjectType> casted_pointer;
- casted_pointer.mObject = dynamic_cast<OtherObjectType*>(pointer.mObject);
- if (NULL != casted_pointer.mObject) {
- casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
-
- if (0 != casted_pointer.mReferenceCounter) {
- atomic_post_inc(casted_pointer.mReferenceCounter);
- }
- }
-
- return casted_pointer;
-}
-
-template <typename ObjectType>
-ObjectType* utils::SharedPtr<ObjectType>::operator->() const {
- DCHECK(mObject);
- return mObject;
-}
-
-template <typename ObjectType>
-ObjectType& utils::SharedPtr<ObjectType>::operator*() const {
- DCHECK(mObject);
- return *mObject;
-}
-
-template <typename ObjectType>
-utils::SharedPtr<ObjectType>::operator bool() const {
- return valid();
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset() {
- reset_impl(0);
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset(ObjectType* other) {
- DCHECK(other != NULL);
- reset_impl(other);
-}
-
-template <typename ObjectType>
-void SharedPtr<ObjectType>::release() {
- deleter_(mObject);
- mObject = 0;
-
- delete mReferenceCounter;
- mReferenceCounter = 0;
-}
-
-template <typename ObjectType>
-void utils::SharedPtr<ObjectType>::reset_impl(ObjectType* other) {
- dropReference();
- mObject = other;
- mReferenceCounter = new uint32_t(1);
-}
-
-template <typename ObjectType>
-inline void SharedPtr<ObjectType>::dropReference() {
- if (0 != mReferenceCounter) {
- if (1 == atomic_post_dec(mReferenceCounter)) {
- release();
- }
- }
-}
-
-template <typename ObjectType>
-ObjectType* SharedPtr<ObjectType>::get() const {
- return mObject;
-}
-
-template <typename ObjectType>
-inline bool SharedPtr<ObjectType>::valid() const {
- if (mReferenceCounter && (0 < *mReferenceCounter)) {
- return (mObject != NULL);
- }
- return false;
-}
-
-} // namespace utils
-
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
-
-// vim: set ts=2 sw=2 et:
diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h
index 15023f02dd..add7fc38b8 100644
--- a/src/components/include/utils/threads/message_loop_thread.h
+++ b/src/components/include/utils/threads/message_loop_thread.h
@@ -40,7 +40,7 @@
#include "utils/macro.h"
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
-#include "utils/shared_ptr.h"
+
#include "utils/lock.h"
namespace threads {
diff --git a/src/components/dbus/test/dbus_adapter_test.cc b/src/components/include/utils/typed_enum_print.h
index 74a6de1aa9..e2b903c948 100644
--- a/src/components/dbus/test/dbus_adapter_test.cc
+++ b/src/components/include/utils/typed_enum_print.h
@@ -1,8 +1,5 @@
/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,27 +30,23 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <gtest/gtest.h>
-#include "dbus/dbus_adapter.h"
-
-using ::dbus::DBusAdapter;
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
-namespace test {
-namespace components {
-namespace dbus {
+#include <type_traits>
+#include <ostream>
-class DBusAdapterTest : public ::testing::Test {};
+namespace utils {
-TEST_F(DBusAdapterTest, Initialization) {
- const std::string kSdlServiceName = "test.ford.sdl.core";
- const std::string kSdlObjectPath = "/";
- const std::string kHmiServiceName = "test.ford.sdl.hmi";
- const std::string kHmiObjectPath = "/";
- ::dbus::DBusAdapter adapter(
- kSdlServiceName, kSdlObjectPath, kHmiServiceName, kHmiObjectPath);
- EXPECT_TRUE(adapter.Init());
+// 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 dbus
-} // namespace components
-} // namespace test
+} // namespace utils
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_TYPED_ENUM_PRINT_H_
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
index 1ea481f11a..3cf1082e90 100644
--- a/src/components/interfaces/CMakeLists.txt
+++ b/src/components/interfaces/CMakeLists.txt
@@ -38,37 +38,14 @@ include_directories (
${CMAKE_BINARY_DIR}
)
-generate_interface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
+generate_interface("v4_protocol_v1_2_no_extra.xml" "ns_smart_device_link_rpc::V1" "sdlrpcv1")
add_library(v4_protocol_v1_2_no_extra ${CMAKE_CURRENT_BINARY_DIR}/v4_protocol_v1_2_no_extra_schema.cc)
generate_interface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
add_library(MOBILE_API ${CMAKE_CURRENT_BINARY_DIR}/MOBILE_API_schema.cc)
-if(HMI_JSON_API)
- generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
- add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
-endif()
-
-if(HMI_DBUS_API)
- generate_interface("QT_HMI_API.xml" "hmi_apis" "jsonrpc")
-
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h"
- )
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h"
- )
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
- COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h")
-
- add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
-endif()
+generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
+add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
target_link_libraries(v4_protocol_v1_2_no_extra Utils)
target_link_libraries(MOBILE_API Utils)
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index f08709bb2b..b4d4d2c850 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -4,9 +4,6 @@
* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
- * Copyright (c) 2017 Xevo Inc.
- * All rights reserved.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@@ -80,6 +77,7 @@
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
<element name="OK"/>
+ <element name="PLAY_PAUSE"/>
<element name="SEEKLEFT"/>
<element name="SEEKRIGHT"/>
<element name="TUNEUP"/>
@@ -335,6 +333,20 @@
<element name="CLEAR" />
<description>Clears the media clock timer (previously done through Show->mediaClock)</description>
</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="SystemContext">
<description>Enumeration that describes possible contexts the application might be in on HU.</description>
@@ -730,6 +742,33 @@
</enum>
<!--IVI part-->
+<enum name="ElectronicParkBrakeStatus">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+</enum>
<enum name="FuelType">
<element name="GASOLINE" />
<element name="DIESEL" />
@@ -930,6 +969,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">
@@ -942,6 +983,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">
@@ -1042,6 +1091,7 @@
<element name="VEHICLEDATA_STEERINGWHEEL" />
<element name="VEHICLEDATA_FUELRANGE" />
<element name="VEHICLEDATA_ENGINEOILLIFE" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" />
</enum>
<enum name="WiperStatus">
@@ -1095,21 +1145,35 @@
<enum name="SamplingRate">
<description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="RATE_8KHZ"/>
- <element name="16KHZ" internal_name="RATE_16KHZ"/>
- <element name="22KHZ" internal_name="RATE_22KHZ"/>
- <element name="44KHZ" internal_name="RATE_44KHZ"/>
+ <element name="8KHZ" internal_name="RATE_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="RATE_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="RATE_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="RATE_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </element>
</enum>
<enum name="BitsPerSample">
<description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="RATE_8_BIT"/>
- <element name="16_BIT" internal_name="RATE_16_BIT"/>
+ <element name="8_BIT" internal_name="RATE_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="RATE_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
</enum>
<enum name="AudioType">
<description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
+ <element name="PCM">
+ <description>Linear PCM.</description>
+ </element>
</enum>
<enum name="KeyboardLayout">
@@ -1454,21 +1518,21 @@
<element name="UPDATING" />
<element name="UPDATE_NEEDED"/>
</enum>
-
+
<enum name="SystemError">
<element name="SYNC_REBOOTED"/>
<element name="SYNC_OUT_OF_MEMMORY" />
</enum>
-
+
<enum name="StatisticsType">
<element name="iAPP_BUFFER_FULL"/>
</enum>
-
+
<enum name="ConsentSource">
<element name="GUI"/>
<element name="VUI" />
</enum>
-
+
<enum name="DeviceState">
<element name="UNKNOWN"/>
<element name="UNPAIRED"/>
@@ -1481,7 +1545,7 @@
<param name="line2" type="String" mandatory="false"/>
<param name="textBody" type="String" mandatory="false"/>
</struct>
-
+
<struct name="PermissionItem">
<param name="name" type="String" mandatory="true">
<description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
@@ -1492,7 +1556,7 @@
<param name="allowed" type="Boolean" mandatory="false">
<description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
</param>
- </struct>
+ </struct>
<struct name="ServiceInfo">
<param name="url" type="String" mandatory="true">
<description>Get URL based on service type.</description>
@@ -1524,7 +1588,136 @@
<enum name="ModuleType">
<element name="CLIMATE"/>
<element name="RADIO"/>
- </enum>
+ <element name="SEAT"/>
+ <element name="AUDIO"/>
+ <element name="LIGHT"/>
+ <element name="HMI_SETTINGS"/>
+</enum>
+
+ <enum name="MassageZone">
+ <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>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <enum name="MassageMode">
+ <description>List possible modes of a massage zone.</description>
+ <element name="OFF"/>
+ <element name="LOW"/>
+ <element name="HIGH"/>
+ </enum>
+
+ <struct name="MassageModeData">
+ <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">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <struct name="MassageCushionFirmness">
+ <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">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <struct name="SeatMemoryAction">
+ <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">
+ <description>List possible seats that is a remote controllable seat.</description>
+ <element name="DRIVER"/>
+ <element name="FRONT_PASSENGER"/>
+ </enum>
+
+ <struct name="SeatControlData">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <struct name="SeatControlCapabilities">
+ <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="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
<enum name="RadioBand">
<element name="AM"/>
@@ -1566,6 +1759,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>
@@ -1577,10 +1856,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">
@@ -1593,6 +1875,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">
@@ -1654,6 +1939,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">
@@ -1705,6 +2008,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">
@@ -1782,6 +2097,285 @@
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>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</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>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ </description>
+ </param>
+ <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">
@@ -1792,13 +2386,21 @@
</param>
<param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
</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 -->
@@ -1938,11 +2540,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>
@@ -1974,6 +2571,9 @@
<param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
<description>The ID, serial number, transport type the named-app's-device is connected over to HU.</description>
</param>
+ <param name="secondaryDeviceInfo" type="Common.DeviceInfo" mandatory="false">
+ <description>The ID, serial number, transport type that are acquired through Secondary Transport.</description>
+ </param>
<param name="policyAppID" type="String" maxlength="50" minlength="1" mandatory="true">
<description>Policy ID(=the appID the application registers with) of registered application.</description>
</param>
@@ -2025,7 +2625,7 @@
</description>
</param>
<param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
- <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
</struct>
<struct name="MenuParams">
@@ -2223,6 +2823,7 @@
<description>
Describes different audio type configurations for PerformAudioPassThru.
e.g. 8kHz,8-bit,PCM
+ The audio is recorded in monaural.
</description>
<param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
<param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
@@ -2309,65 +2910,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>
@@ -2619,7 +3161,7 @@
<struct name="DateTime">
<param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
+ <description>Milliseconds </description>
</param>
<param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
<description>Seconds part of time</description>
@@ -2757,6 +3299,20 @@
<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>
+ <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>
<struct name="Rectangle">
@@ -2925,13 +3481,6 @@
<description>ID of the application.</description>
</param>
</function>
- <function name="AllowDeviceToConnect" messagetype="request">
- <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="AllowDeviceToConnect" messagetype="response">
- <param name="allow" type="Boolean" mandatory="true"/>
- </function>
<function name="OnDeviceChosen" messagetype="notification">
<description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
<param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
@@ -3673,6 +4222,9 @@
<description>The update method of the media clock.</description>
<description>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="Common.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="appID" type="Integer" mandatory="true">
<description>ID of application that requested this RPC.</description>
</param>
@@ -3819,7 +4371,7 @@
<description>ID of application related to this RPC.</description>
</param>
<param name="dayColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
- <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
+ <param name="nightColorScheme" type="Common.TemplateColorScheme" mandatory="false"></param>
</function>
<function name="SetDisplayLayout" messagetype="response">
<param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
@@ -4014,7 +4566,7 @@
</function>
</interface>
-<interface name="Navigation" version="1.5.0" date="2017-08-15">
+<interface name="Navigation" version="1.5.0" date="2017-08-15">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
@@ -4393,6 +4945,9 @@
<param name="engineOilLife" type="Boolean" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4478,6 +5033,9 @@
<param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4569,6 +5127,9 @@
<param name="engineOilLife" type="Boolean" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4654,6 +5215,9 @@
<param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
@@ -4743,6 +5307,9 @@
<param name="engineOilLife" type="Boolean" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -4829,6 +5396,9 @@
<param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
<description>The estimated percentage of remaining oil life of the engine.</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
@@ -4866,7 +5436,7 @@
<description>The instantaneous fuel consumption in microlitres</description>
</param>
<param name="fuelRange" type="Common.FuelRange" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ <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>
@@ -4889,6 +5459,9 @@
<param name="beltStatus" type="Common.BeltStatus" mandatory="false">
<description>The status of the seat belts</description>
</param>
+ <param name="electronicParkBrakeStatus" type="Common.ElectronicParkBrakeStatus" mandatory="false">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
<param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
<description>The body information including power modes</description>
</param>
@@ -5146,9 +5719,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">
@@ -5193,5 +5763,19 @@
<description>The remote control access mode specified by the driver via HMI.</description>
</param>
</function>
+
+<function name="OnRCStatus" messagetype="notification">
+ <description>Issued by SDL to notify HMI about remote control status change on SDL</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ <param name="allocatedModules" type="Common.ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="Common.ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+</function>
+
</interface>
</interfaces>
diff --git a/src/components/interfaces/Json_HMI_message_specification.txt b/src/components/interfaces/Json_HMI_message_specification.txt
index 9f5b20a3c4..f464f42351 100644
--- a/src/components/interfaces/Json_HMI_message_specification.txt
+++ b/src/components/interfaces/Json_HMI_message_specification.txt
@@ -267,6 +267,13 @@ Notifications:
{
"longPressAvailable" : true,
+ "name" : "PLAY_PAUSE",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
"name" : "SEEKLEFT",
"shortPressAvailable" : true,
"upDownAvailable" : true
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 4e4b096c1d..c36c4a4533 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" 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,8 +302,23 @@
<description>Clears the media clock timer (previously done through Show->mediaClock)</description>
</element>
</enum>
+
+ <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">
+ <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>
@@ -315,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>
@@ -328,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>
@@ -347,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" />
@@ -355,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>
@@ -381,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>
@@ -400,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" />
@@ -421,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" />
@@ -464,36 +479,51 @@
<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"/>
- <element name="16KHZ" internal_name="SamplingRate_16KHZ"/>
- <element name="22KHZ" internal_name="SamplingRate_22KHZ"/>
- <element name="44KHZ" internal_name="SamplingRate_44KHZ"/>
+ <element name="8KHZ" internal_name="SamplingRate_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="SamplingRate_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="SamplingRate_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="SamplingRate_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </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"/>
- <element name="16_BIT" internal_name="BitsPerSample_16_BIT"/>
+ <element name="8_BIT" internal_name="BitsPerSample_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="BitsPerSample_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
</enum>
- <enum name="AudioType">
+ <enum name="AudioType" since="2.0">
<description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM" />
+ <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}
+ The audio is recorded in monaural.
</description>
<param name="samplingRate" type="SamplingRate" mandatory="true"/>
<param name="bitsPerSample" type="BitsPerSample" mandatory="true"/>
<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>
@@ -504,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" />
@@ -524,13 +554,24 @@
<element name="VEHICLEDATA_ENGINETORQUE" />
<element name="VEHICLEDATA_ACCPEDAL" />
<element name="VEHICLEDATA_STEERINGWHEEL" />
- <element name="VEHICLEDATA_FUELRANGE" />
- <element name="VEHICLEDATA_ENGINEOILLIFE" />
+ <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="PLAY_PAUSE" since="5.0">
+ <description>
+ The button name for the physical Play/Pause
+ toggle that can be used by media apps.
+ </description>
+ <warning>
+ Please use the physical OK button in order to
+ use a Play/Pause toggle for versions &lt; 4.5.0.
+ </warning>
+ </element>
<element name="SEEKLEFT" />
<element name="SEEKRIGHT" />
<element name="TUNEUP" />
@@ -548,28 +589,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;
@@ -582,7 +623,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
@@ -619,7 +660,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
@@ -630,22 +671,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>
@@ -678,51 +722,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>
@@ -742,25 +786,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>
@@ -797,7 +841,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>
@@ -809,13 +853,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>
@@ -831,14 +875,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" />
@@ -852,26 +896,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>
@@ -890,7 +934,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>
@@ -909,19 +953,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>
@@ -945,24 +989,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>
@@ -974,7 +1022,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">
@@ -983,37 +1031,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>
@@ -1033,7 +1081,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>
@@ -1046,7 +1094,7 @@
</element>
</enum>
- <enum name="PRNDL">
+ <enum name="PRNDL" since="2.0">
<description>The selected gear.</description>
<element name="PARK">
<description>Parking</description>
@@ -1087,7 +1135,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>
@@ -1103,7 +1151,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>
@@ -1130,7 +1178,35 @@
</element>
</enum>
- <enum name="FuelType">
+ <enum name="ElectronicParkBrakeStatus" since="5.0">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+ </enum>
+
+ <enum name="FuelType" since="5.0">
<element name="GASOLINE" />
<element name="DIESEL" />
<element name="CNG">
@@ -1151,7 +1227,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>
@@ -1160,19 +1236,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>
@@ -1184,7 +1260,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>
@@ -1196,7 +1272,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>
@@ -1206,7 +1282,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>
@@ -1222,7 +1298,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>
@@ -1236,7 +1312,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>
@@ -1252,10 +1328,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">
@@ -1268,9 +1346,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" />
@@ -1289,7 +1375,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>
@@ -1299,7 +1385,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>
@@ -1311,7 +1397,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>
@@ -1325,7 +1411,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" />
@@ -1337,44 +1423,48 @@
<element name="INVALID" />
</enum>
- <enum name="ModuleType">
+ <enum name="ModuleType" since="4.5">
<element name="CLIMATE"/>
<element name="RADIO"/>
+ <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>
@@ -1422,7 +1512,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>
@@ -1446,7 +1536,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>
@@ -1482,7 +1572,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>
@@ -1494,7 +1584,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">
@@ -1517,7 +1607,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" />
@@ -1529,7 +1619,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>
@@ -1539,7 +1629,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>
@@ -1557,7 +1647,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>
@@ -1575,7 +1665,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>
@@ -1587,7 +1677,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>
@@ -1609,7 +1699,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>
@@ -1621,7 +1711,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>
@@ -1633,7 +1723,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>
@@ -1660,7 +1750,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>
@@ -1683,7 +1773,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>
@@ -1698,7 +1788,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>
@@ -1708,7 +1798,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>
@@ -1739,7 +1829,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">
@@ -1766,7 +1856,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>
@@ -1782,66 +1872,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>
@@ -1851,7 +1989,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>
@@ -1864,7 +2002,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.
@@ -1875,7 +2013,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>
@@ -1890,7 +2028,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>
@@ -1899,7 +2037,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>
@@ -1911,7 +2049,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>
@@ -1920,14 +2058,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.
@@ -1947,7 +2085,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">
@@ -1956,7 +2094,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>
@@ -1965,7 +2103,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"/>
@@ -1973,7 +2111,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>
@@ -1982,7 +2120,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>
@@ -1991,7 +2129,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>
@@ -1999,12 +2137,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">
@@ -2016,22 +2157,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>
@@ -2056,7 +2198,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>
@@ -2081,27 +2224,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.
@@ -2120,8 +2266,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>
@@ -2129,11 +2276,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>
@@ -2141,7 +2290,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>
@@ -2154,14 +2304,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" />
@@ -2169,7 +2321,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>
@@ -2181,7 +2334,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>
@@ -2204,7 +2358,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>
@@ -2225,7 +2380,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" />
@@ -2247,9 +2403,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" />
@@ -2261,10 +2418,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>
@@ -2387,103 +2545,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="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.
@@ -2493,43 +2653,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>
@@ -2538,7 +2722,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>
@@ -2568,7 +2752,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>
@@ -2592,7 +2776,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"/>
@@ -2600,7 +2784,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>
@@ -2610,14 +2794,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>
@@ -2627,7 +2811,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>
@@ -2642,10 +2826,156 @@
<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 -->
-
- <struct name="Temperature">
+
+ <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>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <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" 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" since="5.0">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <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" since="5.0">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <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" 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" since="5.0">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <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.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="Temperature" since="4.5">
<param name="unit" type="TemperatureUnit" mandatory="true">
<description>Temperature Unit</description>
</param>
@@ -2654,7 +2984,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>
@@ -2680,8 +3010,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>
@@ -2692,11 +3049,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>
@@ -2704,13 +3070,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">
@@ -2731,19 +3100,21 @@
</param>
<param name="ventilationMode" type="VentilationMode" mandatory="false">
</param>
- </struct>
-
- <struct name="ModuleData">
- <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 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="radioControlData" type="RadioControlData" mandatory="false">
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
</param>
- <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ <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">
@@ -2806,9 +3177,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">
@@ -2879,9 +3268,299 @@
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>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</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>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus" since="5.0">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities" since="5.0">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ </description>
+ </param>
+ <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="RemoteControlCapabilities">
+ <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>
+ <param name="radioControlData" type="RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ </param>
+ <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" 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>
@@ -2891,10 +3570,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" 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>
@@ -2913,7 +3606,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>
@@ -2951,8 +3644,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>
@@ -2967,7 +3660,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>
@@ -2981,8 +3674,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>
@@ -2991,40 +3684,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.
@@ -3036,7 +3709,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.
@@ -3047,7 +3720,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)
@@ -3055,7 +3728,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)
@@ -3063,20 +3736,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
@@ -3084,14 +3757,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.
@@ -3099,26 +3772,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="appInfo" type="AppInfo" mandatory="false">
+ <param name="fullAppID" type="String" maxlength="100" mandatory="false" since="5.0">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ <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">
@@ -3154,7 +3830,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>
@@ -3166,65 +3842,67 @@
<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="true">
- <description>Existence of apps icon at system. If true, apps icon
- was resumed at system. If false, apps icon is not resumed at system</description>
+ <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
+ </description>
</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.
@@ -3232,7 +3910,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>
@@ -3254,10 +3932,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.
@@ -3265,7 +3943,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.
@@ -3273,7 +3951,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.
@@ -3281,7 +3959,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.
@@ -3289,20 +3967,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>
@@ -3328,7 +4006,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">
@@ -3336,7 +4014,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>
@@ -3359,7 +4037,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.
@@ -3380,7 +4058,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.
@@ -3389,7 +4067,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>
@@ -3417,7 +4095,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">
@@ -3426,7 +4104,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>
@@ -3450,7 +4128,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">
@@ -3471,12 +4149,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>
@@ -3499,7 +4177,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">
@@ -3508,7 +4186,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>
@@ -3533,7 +4211,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">
@@ -3543,7 +4221,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>
@@ -3567,7 +4245,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">
@@ -3616,21 +4294,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>
@@ -3663,7 +4340,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
@@ -3679,7 +4356,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>
@@ -3688,7 +4365,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>
@@ -3711,7 +4388,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">
@@ -3722,7 +4399,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>
@@ -3748,13 +4425,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.
@@ -3763,7 +4440,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>
@@ -3789,7 +4466,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.
@@ -3799,10 +4476,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.
@@ -3810,7 +4487,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.
@@ -3818,7 +4495,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.
@@ -3826,7 +4503,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.
@@ -3834,25 +4511,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.
@@ -3860,43 +4537,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>
@@ -3922,7 +4598,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">
@@ -3934,7 +4610,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>
@@ -3960,7 +4636,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">
@@ -3972,7 +4648,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)
@@ -3988,9 +4664,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" 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>
@@ -4012,7 +4691,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>
@@ -4048,7 +4727,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>
@@ -4073,11 +4752,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>
@@ -4099,7 +4778,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.
@@ -4111,7 +4790,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>
@@ -4134,7 +4813,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">
@@ -4142,7 +4821,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>
@@ -4165,7 +4844,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.
@@ -4191,13 +4870,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">
@@ -4236,9 +4915,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -4261,7 +4944,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>
@@ -4303,13 +4986,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">
@@ -4348,9 +5031,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="VehicleDataResult" mandatory="false">
@@ -4372,7 +5059,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">
@@ -4393,13 +5080,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">
@@ -4438,9 +5125,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -4462,7 +5153,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>
@@ -4503,13 +5194,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">
@@ -4548,9 +5239,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="VehicleDataResult" mandatory="false">
@@ -4572,7 +5267,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">
@@ -4593,13 +5288,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">
@@ -4641,9 +5336,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="Boolean" mandatory="false">
@@ -4665,7 +5364,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>
@@ -4707,13 +5406,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">
@@ -4755,9 +5454,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Data Items -->
<param name="eCallInfo" type="ECallInfo" mandatory="false">
@@ -4779,7 +5482,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">
@@ -4790,7 +5493,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>
@@ -4820,7 +5523,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">
@@ -4833,7 +5536,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>
@@ -4870,7 +5573,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">
@@ -4888,7 +5591,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>
@@ -4920,7 +5623,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>
@@ -4936,7 +5639,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>
@@ -4962,7 +5665,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>
@@ -4990,7 +5693,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>
@@ -5023,40 +5726,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.
@@ -5064,7 +5767,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>
@@ -5086,7 +5789,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>
@@ -5095,7 +5798,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>
@@ -5120,7 +5823,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">
@@ -5128,7 +5831,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>
@@ -5150,32 +5853,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
@@ -5201,7 +5901,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.
@@ -5220,7 +5920,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.
@@ -5262,12 +5962,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">
@@ -5299,7 +5999,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.
@@ -5311,7 +6011,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.
@@ -5341,14 +6041,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.
@@ -5385,7 +6085,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.
@@ -5397,7 +6097,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.
@@ -5425,7 +6125,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
@@ -5438,12 +6138,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>
@@ -5470,11 +6170,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">
@@ -5483,7 +6183,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>
@@ -5491,7 +6191,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>
@@ -5505,7 +6205,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>
@@ -5531,7 +6231,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">
@@ -5562,21 +6262,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>
@@ -5599,7 +6299,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">
@@ -5610,7 +6310,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>
@@ -5632,7 +6332,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>
@@ -5644,7 +6344,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"/>
@@ -5665,22 +6365,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">
@@ -5711,13 +6414,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>
@@ -5744,11 +6447,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>
@@ -5767,14 +6470,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>
@@ -5798,11 +6501,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>
@@ -5824,14 +6527,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">
@@ -5861,14 +6564,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>
@@ -5884,7 +6587,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>
@@ -5896,40 +6599,40 @@
<param name="systemContext" type="SystemContext" mandatory="true">
<description>See SystemContext</description>
</param>
- <param name="videoStreamingState" type="VideoStreamingState" mandatory="true">
+ <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>
@@ -5949,13 +6652,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">
@@ -5997,9 +6700,13 @@
<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" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+
<!-- Ford Specific Vehicle Data -->
<param name="eCallInfo" type="ECallInfo" mandatory="false">
@@ -6021,7 +6728,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>
@@ -6031,32 +6738,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>
@@ -6065,7 +6772,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>
@@ -6083,7 +6790,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>
@@ -6093,7 +6800,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)
@@ -6101,7 +6808,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>
@@ -6130,7 +6837,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.
@@ -6140,23 +6847,38 @@
</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" 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>
+ If "true" - RC is allowed; if "false" - RC is disallowed.
+ </description>
+ </param>
+ <param name="allocatedModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+ </function>
<!-- ~~~~~~~~~~~~~~~~~~ -->
<!-- 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.
@@ -6169,7 +6891,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>
@@ -6220,7 +6942,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/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml
deleted file mode 100644
index 0c86d4eea3..0000000000
--- a/src/components/interfaces/QT_HMI_API.xml
+++ /dev/null
@@ -1,5517 +0,0 @@
-<!--
- * Copyright (c) 2013, 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. -->
-
-<!--
- * DEPRECATED, use HMI_API instead. This API is used with the DBus adapter,
- * which will be removed or refactored to use HMI_API in the next major release
--->
-<interfaces name="SmartDeviceLink HMI API">
- <interface name="Common" version="1.1" date="2013-10-02">
- <enum name="Result">
- <element name="SUCCESS" value="0"/>
- <element name="UNSUPPORTED_REQUEST" value="1"/>
- <element name="UNSUPPORTED_RESOURCE" value="2"/>
- <element name="DISALLOWED" value="3"/>
- <element name="REJECTED" value="4"/>
- <element name="ABORTED" value="5"/>
- <element name="IGNORED" value="6"/>
- <element name="RETRY" value="7"/>
- <element name="IN_USE" value="8"/>
- <element name="DATA_NOT_AVAILABLE" value="9"/>
- <element name="TIMED_OUT" value="10"/>
- <element name="INVALID_DATA" value="11"/>
- <element name="CHAR_LIMIT_EXCEEDED" value="12"/>
- <element name="INVALID_ID" value="13"/>
- <element name="DUPLICATE_NAME" value="14"/>
- <element name="APPLICATION_NOT_REGISTERED" value="15"/>
- <element name="WRONG_LANGUAGE" value="16"/>
- <element name="OUT_OF_MEMORY" value="17"/>
- <element name="TOO_MANY_PENDING_REQUESTS" value="18"/>
- <element name="NO_APPS_REGISTERED" value="19"/>
- <element name="NO_DEVICES_CONNECTED" value="20"/>
- <element name="WARNINGS" value="21"/>
- <element name="GENERIC_ERROR" value="22"/>
- <element name="USER_DISALLOWED" value="23"/>
- <element name="TRUNCATED_DATA" value="24"/>
- <element name="SAVED" value="25"/>
- <element name="READ_ONLY" value="26"/>
- </enum>
- <enum name="TransportType">
- <description>
- Lists of the transport types used for device connection to HU.
- </description>
- <element name="BLUETOOTH"/>
- <element name="USB_IOS"/>
- <element name="USB_AOA"/>
- <element name="WIFI"/>
- </enum>
- <enum name="ButtonName">
- <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
- <element name="OK"/>
- <element name="SEEKLEFT"/>
- <element name="SEEKRIGHT"/>
- <element name="TUNEUP"/>
- <element name="TUNEDOWN"/>
- <element name="PRESET_0"/>
- <element name="PRESET_1"/>
- <element name="PRESET_2"/>
- <element name="PRESET_3"/>
- <element name="PRESET_4"/>
- <element name="PRESET_5"/>
- <element name="PRESET_6"/>
- <element name="PRESET_7"/>
- <element name="PRESET_8"/>
- <element name="PRESET_9"/>
- <element name="CUSTOM_BUTTON"/>
- <element name="SEARCH"/>
- </enum>
- <enum name="ButtonEventMode">
- <element name="BUTTONUP">
- <description>A button has been released up</description>
- </element>
- <element name="BUTTONDOWN">
- <description>A button has been pressed down</description>
- </element>
- </enum>
- <enum name="ButtonPressMode">
- <element name="LONG">
- <description>A button was released, after it was pressed for a long time. Actual timing is defined by head unit and may vary</description>
- </element>
- <element name="SHORT">
- <description>A button was released, after it was pressed for a short time. Actual timing is defined by head unit and may vary</description>
- </element>
- </enum>
- <enum name="Language">
- <element name="EN-US" internal_name="EN_US">
- <description>English - US</description>
- </element>
- <element name="ES-MX" internal_name="ES_MX">
- <description>Spanish - Mexico</description>
- </element>
- <element name="FR-CA" internal_name="FR_CA">
- <description>French - Canada</description>
- </element>
- <element name="DE-DE" internal_name="DE_DE">
- <description>German - Germany</description>
- </element>
- <element name="ES-ES" internal_name="ES_ES">
- <description>Spanish - Spain</description>
- </element>
- <element name="EN-GB" internal_name="EN_GB">
- <description>English - GB</description>
- </element>
- <element name="RU-RU" internal_name="RU_RU">
- <description>Russian - Russia</description>
- </element>
- <element name="TR-TR" internal_name="TR_TR">
- <description>Turkish - Turkey</description>
- </element>
- <element name="PL-PL" internal_name="PL_PL">
- <description>Polish - Poland</description>
- </element>
- <element name="FR-FR" internal_name="FR_FR">
- <description>French - France</description>
- </element>
- <element name="IT-IT" internal_name="IT_IT">
- <description>Italian - Italy</description>
- </element>
- <element name="SV-SE" internal_name="SV_SE">
- <description>Swedish - Sweden</description>
- </element>
- <element name="PT-PT" internal_name="PT_PT">
- <description>Portuguese - Portugal</description>
- </element>
- <element name="NL-NL" internal_name="NL_NL">
- <description>Dutch (Standard) - Netherlands</description>
- </element>
- <element name="EN-AU" internal_name="EN_AU">
- <description>English - Australia</description>
- </element>
- <element name="ZH-CN" internal_name="ZH_CN">
- <description>Mandarin - China</description>
- </element>
- <element name="ZH-TW" internal_name="ZH_TW">
- <description>Mandarin - Taiwan</description>
- </element>
- <element name="JA-JP" internal_name="JA_JP">
- <description>Japanese - Japan</description>
- </element>
- <element name="AR-SA" internal_name="AR_SA">
- <description>Arabic - Saudi Arabia</description>
- </element>
- <element name="KO-KR" internal_name="KO_KR">
- <description>Korean - South Korea</description>
- </element>
- <element name="PT-BR" internal_name="PT_BR">
- <description>Portuguese - Brazil</description>
- </element>
- <element name="CS-CZ" internal_name="CS_CZ">
- <description>Czech - Czech Republic</description>
- </element>
- <element name="DA-DK" internal_name="DA_DK">
- <description>Danish - Denmark</description>
- </element>
- <element name="NO-NO" internal_name="NO_NO">
- <description>Norwegian - Norway</description>
- </element>
- <element name="NL-BE" internal_name="NL_BE">
- <description>Dutch (Flemish) - Belgium</description>
- </element>
- <element name="EL-GR" internal_name="EL_GR">
- <description>Greek - Greece</description>
- </element>
- <element name="HU-HU" internal_name="HU_HU">
- <description>Hungarian - Hungary</description>
- </element>
- <element name="FI-FI" internal_name="FI_FI">
- <description>Finnish - Finland</description>
- </element>
- <element name="SK-SK" internal_name="SK_SK">
- <description>Slovak - Slovakia</description>
- </element>
- <element name="EN-IN" internal_name="EN_IN">
- <description>English - India</description>
- </element>
- <element name="TH-TH" internal_name="TH_TH">
- <description>Thai - Thailand</description>
- </element>
- <element name="EN-SA" internal_name="EN_SA">
- <description>English - Middle East</description>
- </element>
- <element name="HE-IL" internal_name="HE_IL">
- <description>Hebrew - Israel</description>
- </element>
- <element name="RO-RO" internal_name="RO_RO">
- <description>Romanian - Romania</description>
- </element>
- <element name="UK-UA" internal_name="UK_UA">
- <description>Ukrainian - Ukraine</description>
- </element>
- <element name="ID-ID" internal_name="ID_ID">
- <description>Indonesian - Indonesia</description>
- </element>
- <element name="VI-VN" internal_name="VI_VN">
- <description>Vietnamese - Vietnam</description>
- </element>
- <element name="MS-MY" internal_name="MS_MY">
- <description>Malay - Malaysia</description>
- </element>
- <element name="HI-IN" internal_name="HI_IN">
- <description>Hindi - India</description>
- </element>
- </enum>
- <enum name="SoftButtonType">
- <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="SystemAction">
- <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>
- </element>
- <element name="STEAL_FOCUS">
- <description>The calling app's dialog or related event should clear and the app should be brought into HMI_FULL.</description>
- </element>
- <element name="KEEP_CONTEXT">
- <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
- </element>
- </enum>
- <enum name="AppHMIType">
- <description>Enumeration listing possible app types.</description>
- <element name="DEFAULT"/>
- <element name="COMMUNICATION"/>
- <element name="MEDIA"/>
- <element name="MESSAGING"/>
- <element name="NAVIGATION"/>
- <element name="INFORMATION"/>
- <element name="SOCIAL"/>
- <element name="BACKGROUND_PROCESS"/>
- <element name="TESTING"/>
- <element name="SYSTEM"/>
- </enum>
- <enum name="WayPointType">
- <description>Describes what kind of waypoint is requested/provided.</description>
- <element name="ALL" />
- <element name="DESTINATION" />
- </enum>
-
- <struct name="Coordinate">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
- <description>Latitude of the location.</description>
- </param>
- <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
- <description>Longitude of the location.</description>
- </param>
- </struct>
- <enum name="LayoutMode">
- <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>
- <element name="ICON_WITH_SEARCH"/>
- <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
- <element name="LIST_ONLY"/>
- <description>This mode causes the interaction to display the previous set of choices as a list.</description>
- <element name="LIST_WITH_SEARCH"/>
- <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
- <element name="KEYBOARD"/>
- <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
- </enum>
- <enum name="DeactivateReason">
- <description>Specifies the functionality the User has switched to.</description>
- <element name="AUDIO">
- <description>Navigated to audio(radio, etc)</description>
- </element>
- <element name="PHONECALL">
- <description>Navigated to make a call.</description>
- </element>
- <element name="NAVIGATIONMAP">
- <description>Navigated to navigation screen.</description>
- </element>
- <element name="PHONEMENU">
- <description>Navigated to phone menu.</description>
- </element>
- <element name="SYNCSETTINGS">
- <description>Navigated to settings menu.</description>
- </element>
- <element name="GENERAL">
- <description>Other screens navigation apart from other mobile app.</description>
- </element>
- </enum>
- <enum name="ClockUpdateMode">
- <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>
- <element name="COUNTDOWN"/>
- <description>Starts the media clock timer counting downwards, as in time remaining.</description>
- <element name="PAUSE"/>
- <description>Pauses the media clock timer</description>
- <element name="RESUME"/>
- <description>Resume the media clock timer</description>
- <element name="CLEAR"/>
- <description>Clears the media clock timer (previously done through Show-&gt;mediaClock)</description>
- </enum>
- <enum name="SystemContext">
- <description>Enumeration that describes possible contexts the application might be in on HU.</description>
- <description>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>
- <description> There is currently no user interaction (user-initiated or app-initiated) with the head-unit</description>
- </element>
- <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
- <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
- </element>
- <element name="MENU" internal_name="SYSCTXT_MENU">
- <description>The system is currently displaying a system or in-App menu onscreen.</description>
- </element>
- <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
- <description>The app's display HMI is currently obscuring with either a system or other app's overlay (except of Alert element).</description>
- </element>
- <element name="ALERT" internal_name="SYSCTXT_ALERT">
- <description>Broadcast only to whichever app has an alert currently being displayed.</description>
- </element>
- </enum>
- <enum name="HmiZoneCapabilities">
- <description>Contains information about the HMI zone capabilities.</description>
- <description>For future use.</description>
- <element name="FRONT"/>
- <element name="BACK"/>
- </enum>
- <enum name="SpeechCapabilities">
- <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"/>
- </enum>
- <enum name="VrCapabilities">
- <description>Contains information about the VR capabilities.</description>
- <element name="TEXT" internal_name="VR_TEXT"/>
- </enum>
- <enum name="PrerecordedSpeech">
- <description>Contains a list of prerecorded speech items present on the platform.</description>
- <element name="HELP_JINGLE"/>
- <element name="INITIAL_JINGLE"/>
- <element name="LISTEN_JINGLE"/>
- <element name="POSITIVE_JINGLE"/>
- <element name="NEGATIVE_JINGLE"/>
- </enum>
- <enum name="TBTState">
- <description>Enumeration that describes possible states of turn-by-turn client or SmartDeviceLink app.</description>
- <element name="ROUTE_UPDATE_REQUEST"/>
- <element name="ROUTE_ACCEPTED"/>
- <element name="ROUTE_REFUSED"/>
- <element name="ROUTE_CANCELLED"/>
- <element name="ETA_REQUEST"/>
- <element name="NEXT_TURN_REQUEST"/>
- <element name="ROUTE_STATUS_REQUEST"/>
- <element name="ROUTE_SUMMARY_REQUEST"/>
- <element name="TRIP_STATUS_REQUEST"/>
- <element name="ROUTE_UPDATE_REQUEST_TIMEOUT"/>
- </enum>
- <enum name="ApplicationsCloseReason">
- <description>Describes the reasons for exiting all of applications.</description>
- <element name="IGNITION_OFF"/>
- <element name="MASTER_RESET"/>
- <element name="FACTORY_DEFAULTS"/>
- <element name="SUSPEND"/>
- </enum>
- <enum name="DisplayType">
- <description>The possible types of HU display.</description>
- <element name="CID">
- <description> A 2-line x 20 character "dot matrix" display </description>
- </element>
- <element name="TYPE2">
- <description> 1 line older radio head unit.</description>
- </element>
- <element name="TYPE5">
- <description> Old radio head unit.</description>
- </element>
- <element name="NGN">
- <description> Next Generation Navigation display.</description>
- </element>
- <element name="GEN2_8_DMA">
- <description> GEN-2, 8 inch display.</description>
- </element>
- <element name="GEN2_6_DMA">
- <description> GEN-2, 6 inch display.</description>
- </element>
- <element name="MFD3">
- <description> 3 inch GEN1.1 display </description>
- </element>
- <element name="MFD4">
- <description> 4 inch GEN1.1 display </description>
- </element>
- <element name="MFD5">
- <description> 5 inch GEN1.1 display </description>
- </element>
- <element name="GEN3_8_INCH"/>
- </enum>
- <enum name="ImageType">
- <description>Contains information about the type of image.</description>
- <element name="STATIC"/>
- <element name="DYNAMIC"/>
- </enum>
- <enum name="ApplicationExitReason">
- <element name="DRIVER_DISTRACTION_VIOLATION">
- <description>By getting this value, SDL puts the named app to NONE HMILevel</description>
- </element>
- <element name="USER_EXIT">
- <description>By getting this value, SDL puts the named app to NONE HMILevel</description>
- </element>
- <element name="UNAUTHORIZED_TRANSPORT_REGISTRATION">
- <description>By getting this value, SDL unregisters the named application</description>
- </element>
- <element name="UNSUPPORTED_HMI_RESOURCE">
- <description>By getting this value, SDL unregisters the named application</description>
- </element>
- </enum>
- <enum name="TextFieldName">
- <element name="mainField1">
- <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="mainField2">
- <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="mainField3">
- <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
- </element>
- <element name="mainField4">
- <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
- </element>
- <element name="statusBar">
- <description>The status bar on NGN; applies to "Show"</description>
- </element>
- <element name="mediaClock">
- <description>Text value for MediaClock field; applies to "Show"</description>
- </element>
- <element name="mediaTrack">
- <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
- </element>
- <element name="alertText1">
- <description>The first line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="alertText2">
- <description>The second line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="alertText3">
- <description>The third line of the alert text field; applies to "Alert"</description>
- </element>
- <element name="scrollableMessageBody">
- <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
- </element>
- <element name="initialInteractionText">
- <description> First line suggestion for a user response (in the case of VR enabled interaction</description>
- </element>
- <element name="navigationText1">
- <description> First line of navigation text</description>
- </element>
- <element name="navigationText2">
- <description> Second line of navigation text</description>
- </element>
- <element name="ETA">
- <description> Estimated Time of Arrival time for navigation</description>
- </element>
- <element name="totalDistance">
- <description> Total distance to destination for navigation</description>
- </element>
- <element name="audioPassThruDisplayText1">
- <description> First line of text for audio pass thru</description>
- </element>
- <element name="audioPassThruDisplayText2">
- <description> Second line of text for audio pass thru</description>
- </element>
- <element name="sliderHeader">
- <description> Header text for slider</description>
- </element>
- <element name="sliderFooter">
- <description> Footer text for slider</description>
- </element>
- <element name="menuName">
- <description> Primary text for Choice</description>
- </element>
- <element name="secondaryText">
- <description> Secondary text for Choice</description>
- </element>
- <element name="tertiaryText">
- <description> Tertiary text for Choice</description>
- </element>
- <element name="menuTitle">
- <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </element>
- <element name="timeToDestination"/>
- <element name="navigationText">
- <description>Navigation text for UpdateTurnList.</description>
- </element>
- <element name="notificationText">
- <description>Text of notification to be displayed on screen.</description>
- </element>
- <element name="locationName">
- <description> Optional name / title of intended location for SendLocation.</description>
- </element>
- <element name="locationDescription">
- <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
- <element name="addressLines">
- <description> Optional location address (if applicable) for SendLocation.</description>
- </element>
- <element name="phoneNumber">
- <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
- <!-- TO DO to be removed -->
- <element name="turnText"/>
- </enum>
- <enum name="MetadataType">
- <element name="mediaTitle">
- <description>The data in this field contains the title of the currently playing audio track.</description>
- </element>
- <element name="mediaArtist">
- <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
- </element>
- <element name="mediaAlbum">
- <description>The data in this field contains the album title of the currently playing audio track.</description>
- </element>
- <element name="mediaYear">
- <description>The data in this field contains the creation year of the currently playing audio track.</description>
- </element>
- <element name="mediaGenre">
- <description>The data in this field contains the genre of the currently playing audio track.</description>
- </element>
- <element name="mediaStation">
- <description>The data in this field contains the name of the current source for the media.</description>
- </element>
- <element name="rating">
- <description>The data in this field is a rating.</description>
- </element>
- <element name="currentTemperature">
- <description>The data in this field is the current temperature.</description>
- </element>
- <element name="maximumTemperature">
- <description>The data in this field is the maximum temperature for the day.</description>
- </element>
- <element name="minimumTemperature">
- <description>The data in this field is the minimum temperature for the day.</description>
- </element>
- <element name="weatherTerm">
- <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
- </element>
- <element name="humidity">
- <description>The data in this field describes the current humidity value.</description>
- </element>
- </enum>
- <enum name="ImageFieldName">
- <element name="softButtonImage">
- <description>The image field for SoftButton</description>
- </element>
- <element name="choiceImage">
- <description>The first image field for Choice</description>
- </element>
- <element name="choiceSecondaryImage">
- <description>The secondary image field for Choice</description>
- </element>
- <element name="vrHelpItem">
- <description>The image field for vrHelpItem</description>
- </element>
- <element name="turnIcon">
- <description>The image field for Turn</description>
- </element>
- <element name="menuIcon">
- <description>The image field for the menu icon in SetGlobalProperties</description>
- </element>
- <element name="cmdIcon">
- <description>The image field for AddCommand</description>
- </element>
- <element name="appIcon">
- <description>The image field for the app icon (set by setAppIcon)</description>
- </element>
- <element name="graphic">
- <description>The image field for Show</description>
- </element>
- <element name="showConstantTBTIcon">
- <description>The primary image field for ShowConstantTBT</description>
- </element>
- <element name="showConstantTBTNextTurnIcon">
- <description>The secondary image field for ShowConstantTBT</description>
- </element>
- <element name="locationImage">
- <description>The optional image of a destination / location</description>
- </element>
- </enum>
- <enum name="TextAlignment">
- <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="DriverDistractionState">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON"/>
- <element name="DD_OFF"/>
- </enum>
- <enum name="MediaClockFormat">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- Is used for Type II, NGN and CID head units.
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- Is used for Type V head units.
- </description>
- </element>
- <element name="CLOCK3">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- Is used for GEN1.1 (i.e. MFD3/4/5) head units.
- </description>
- </element>
- <element name="CLOCKTEXT1">
- <description>
- 5 characters possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for Type II head unit
- </description>
- </element>
- <element name="CLOCKTEXT2">
- <description>
- 5 chars possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for CID and NGN head unit
- </description>
- </element>
- <element name="CLOCKTEXT3">
- <description>
- 6 chars possible
- Format: 1|sp c c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters
- :|sp : colon or space
- Is used for Type V head unit
- </description>
- </element>
- <element name="CLOCKTEXT4">
- <description>
- 6 chars possible
- Format: c :|sp c c : c c
- :|sp : colon or space
- c : character out of following character set: sp|0-9|[letters].
- Is used for GEN1.1 (i.e. MFD3/4/5) head units
- </description>
- </element>
- </enum>
- <enum name="VRCommandType">
- <element name="Choice">
- <description>Type that expound that current AddCommand should be pocessed as choise for initiated PerformInteraction request for current active on HMI.</description>
- </element>
- <element name="Command">
- <description>Type that expound that current AddCommand should be pocessed as common command for current application on HMI.</description>
- </element>
- </enum>
- <!--IVI part-->
- <enum name="ComponentVolumeStatus">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- <description> The data is unknown.</description>
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- <description> The volume is normal.</description>
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- <description> The volume is low.</description>
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- <description> The module/sensor is currently faulted. </description>
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- <description> The component`s volume is in critical level.</description>
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- <description> The data is not supported.</description>
- </element>
- </enum>
- <enum name="PRNDL">
- <description>The selected gear.</description>
- <element name="PARK">
- <description>Parking</description>
- </element>
- <element name="REVERSE">
- <description>Reverse gear</description>
- </element>
- <element name="NEUTRAL">
- <description>No gear</description>
- </element>
- <element name="DRIVE">
- </element>
- <element name="SPORT">
- <description>Drive Sport mode</description>
- </element>
- <element name="LOWGEAR">
- <description>1st gear hold</description>
- </element>
- <element name="FIRST">
- </element>
- <element name="SECOND">
- </element>
- <element name="THIRD">
- </element>
- <element name="FOURTH">
- </element>
- <element name="FIFTH">
- </element>
- <element name="SIXTH">
- </element>
- <element name="SEVENTH">
- </element>
- <element name="EIGHTH">
- </element>
- <element name="FAULT">
- </element>
- </enum>
- <enum name="VehicleDataEventStatus">
- <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">
- <description> The system does not have the adequate information to send valid YES or NO states.</description>
- </element>
- <element name="NO" internal_name="VDES_NO">
- <description> The requested event is in NO state.</description>
- </element>
- <element name="YES" internal_name="VDES_YES">
- <description> The requested event is in YES state.</description>
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- <description> The requested data is not supported </description>
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- <description> The module/sensor is currently faulted.</description>
- </element>
- </enum>
- <enum name="VehicleDataStatus">
- <description>Reflects the status of a binary vehicle data item.</description>
- <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
- </element>
- <element name="OFF" internal_name="VDS_OFF">
- </element>
- <element name="ON" internal_name="VDS_ON">
- </element>
- </enum>
- <enum name="IgnitionStableStatus">
- <description>Reflects the ignition switch stability.</description>
- <element name="IGNITION_SWITCH_NOT_STABLE">
- </element>
- <element name="IGNITION_SWITCH_STABLE">
- </element>
- <element name="MISSING_FROM_TRANSMITTER">
- <description> Either the data is not accessible or the sensor is broken.</description>
- </element>
- </enum>
- <enum name="IgnitionStatus">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- <description> The information is not acceptable. </description>
- </element>
- <element name="OFF" internal_name="IS_OFF">
- <description> The ignition is off.</description>
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- <description> The accessories are active (power windows, audio, display, etc.).</description>
- </element>
- <element name="RUN" internal_name="IS_RUN">
- <description> Ignition is active.</description>
- </element>
- <element name="START" internal_name="IS_START">
- <description> Starter is switched.</description>
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- <description> The data is provided, but there is some sort of fault or problem.</description>
- </element>
- </enum>
- <enum name="DeviceLevelStatus">
- <description>Reflects the reported component status of the connected device, if reported.</description>
- <element name="ZERO_LEVEL_BARS">
- </element>
- <element name="ONE_LEVEL_BARS">
- </element>
- <element name="TWO_LEVEL_BARS">
- </element>
- <element name="THREE_LEVEL_BARS">
- </element>
- <element name="FOUR_LEVEL_BARS">
- </element>
- <element name="NOT_PROVIDED">
- </element>
- </enum>
- <enum name="PrimaryAudioSource">
- <description>Reflects the current primary audio source (if selected).</description>
- <element name="NO_SOURCE_SELECTED">
- </element>
- <element name="USB">
- </element>
- <element name="USB2">
- </element>
- <element name="BLUETOOTH_STEREO_BTST">
- </element>
- <element name="LINE_IN">
- </element>
- <element name="IPOD">
- </element>
- <element name="MOBILE_APP">
- </element>
- </enum>
- <enum name="CompassDirection">
- <description>The list of potential compass directions</description>
- <element name="NORTH">
- </element>
- <element name="NORTHWEST">
- </element>
- <element name="WEST">
- </element>
- <element name="SOUTHWEST">
- </element>
- <element name="SOUTH">
- </element>
- <element name="SOUTHEAST">
- </element>
- <element name="EAST">
- </element>
- <element name="NORTHEAST">
- </element>
- </enum>
- <enum name="Dimension">
- <description>The supported dimensions of the GPS</description>
- <element name="NO_FIX" internal_name="Dimension_NO_FIX">
- <description>No GPS at all</description>
- </element>
- <element name="2D" internal_name="Dimension_2D">
- <description>Longitude and lattitude</description>
- </element>
- <element name="3D" internal_name="Dimension_3D">
- <description>Longitude and lattitude and altitude</description>
- </element>
- </enum>
- <enum name="TouchType">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- </enum>
- <enum name="WarningLightStatus">
- <description>Reflects the status of a cluster instrument warning light.</description>
- <element name="OFF" internal_name="WLS_OFF">
- </element>
- <element name="ON" internal_name="WLS_ON">
- </element>
- <element name="FLASH" internal_name="WLS_FLASH">
- </element>
- <element name="NOT_USED" internal_name="WLS_NOT_USED">
- </element>
- </enum>
- <enum name="VehicleDataResultCode">
- <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
- <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
- <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
- <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
- <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
- <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
- <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
- <element name="IGNORED" internal_name="VDRC_IGNORED"/>
- </enum>
- <enum name="VehicleDataType">
- <description>Defines the data types that can be published and subscribed to.</description>
- <element name="VEHICLEDATA_GPS">
- <description>Notifies GPSData may be subscribed</description>
- </element>
- <element name="VEHICLEDATA_SPEED"/>
- <element name="VEHICLEDATA_RPM"/>
- <element name="VEHICLEDATA_FUELLEVEL"/>
- <element name="VEHICLEDATA_FUELLEVEL_STATE"/>
- <element name="VEHICLEDATA_FUELCONSUMPTION"/>
- <element name="VEHICLEDATA_EXTERNTEMP"/>
- <element name="VEHICLEDATA_VIN"/>
- <element name="VEHICLEDATA_PRNDL"/>
- <element name="VEHICLEDATA_TIREPRESSURE"/>
- <element name="VEHICLEDATA_ODOMETER"/>
- <element name="VEHICLEDATA_BELTSTATUS"/>
- <element name="VEHICLEDATA_BODYINFO"/>
- <element name="VEHICLEDATA_DEVICESTATUS"/>
- <element name="VEHICLEDATA_ECALLINFO"/>
- <element name="VEHICLEDATA_AIRBAGSTATUS"/>
- <element name="VEHICLEDATA_EMERGENCYEVENT"/>
- <element name="VEHICLEDATA_CLUSTERMODESTATUS"/>
- <element name="VEHICLEDATA_MYKEY"/>
- <element name="VEHICLEDATA_BRAKING"/>
- <element name="VEHICLEDATA_WIPERSTATUS"/>
- <element name="VEHICLEDATA_HEADLAMPSTATUS"/>
- <element name="VEHICLEDATA_BATTVOLTAGE"/>
- <element name="VEHICLEDATA_ENGINETORQUE"/>
- <element name="VEHICLEDATA_ACCPEDAL"/>
- <element name="VEHICLEDATA_STEERINGWHEEL"/>
- </enum>
- <enum name="WiperStatus">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF">
- <description> The wipers are off.</description>
- </element>
- <element name="AUTO_OFF">
- <description> The wipers are automatically off </description>
- </element>
- <element name="OFF_MOVING">
- <description> Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).</description>
- </element>
- <element name="MAN_INT_OFF">
- <description> The wipers are manually off after having been working.</description>
- </element>
- <element name="MAN_INT_ON">
- <description> The wipers are manually on.</description>
- </element>
- <element name="MAN_LOW">
- <description> The wipers are manually set to low speed.</description>
- </element>
- <element name="MAN_HIGH">
- <description> The wipers are manually set to high speed.</description>
- </element>
- <element name="MAN_FLICK">
- <description> The wipers are manually set for doing a flick.</description>
- </element>
- <element name="WASH">
- <description> The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.</description>
- </element>
- <element name="AUTO_LOW">
- <description> The wipers are automatically set to low speed.</description>
- </element>
- <element name="AUTO_HIGH">
- <description> The wipers are automatically set to high speed.</description>
- </element>
- <element name="COURTESYWIPE">
- <description> This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid.</description>
- </element>
- <element name="AUTO_ADJUST">
- <description> This is set as the user moves between possible automatic wiper speeds.</description>
- </element>
- <element name="STALLED">
- <description> The wiper is stalled to its place. </description>
- </element>
- <element name="NO_DATA_EXISTS">
- <description> The sensor / module cannot provide any information for wiper.</description>
- </element>
- </enum>
- <enum name="SamplingRate">
- <description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="RATE_8KHZ"/>
- <element name="16KHZ" internal_name="RATE_16KHZ"/>
- <element name="22KHZ" internal_name="RATE_22KHZ"/>
- <element name="44KHZ" internal_name="RATE_44KHZ"/>
- </enum>
- <enum name="BitsPerSample">
- <description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="RATE_8_BIT"/>
- <element name="16_BIT" internal_name="RATE_16_BIT"/>
- </enum>
- <enum name="AudioType">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM"/>
- </enum>
- <enum name="KeyboardLayout">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY"/>
- <element name="QWERTZ"/>
- <element name="AZERTY"/>
- </enum>
- <enum name="KeyboardEvent">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS"/>
- <element name="ENTRY_SUBMITTED"/>
- <element name="ENTRY_VOICE"/>
- <element name="ENTRY_CANCELLED"/>
- <element name="ENTRY_ABORTED"/>
- </enum>
- <enum name="KeypressMode">
- <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>
- </element>
- <element name="QUEUE_KEYPRESSES">
- <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
- </element>
- <element name="RESEND_CURRENT_ENTRY">
- <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>
- <enum name="AmbientLightStatus">
- <description>Reflects the status of the ambient light sensor.</description>
- <element name="NIGHT"/>
- <element name="TWILIGHT_1"/>
- <element name="TWILIGHT_2"/>
- <element name="TWILIGHT_3"/>
- <element name="TWILIGHT_4"/>
- <element name="DAY"/>
- <element name="UNKNOWN"/>
- <element name="INVALID"/>
- </enum>
- <enum name="FileType">
- <description>Enumeration listing possible file types.</description>
- <element name="GRAPHIC_BMP"/>
- <element name="GRAPHIC_JPEG"/>
- <element name="GRAPHIC_PNG"/>
- <element name="AUDIO_WAVE"/>
- <element name="AUDIO_MP3"/>
- <element name="AUDIO_AAC"/>
- <element name="BINARY"/>
- <element name="JSON"/>
- </enum>
- <enum name="RequestType">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP"/>
- <element name="FILE_RESUME"/>
- <element name="AUTH_REQUEST"/>
- <element name="AUTH_CHALLENGE"/>
- <element name="AUTH_ACK"/>
- <element name="PROPRIETARY"/>
- <element name="QUERY_APPS"/>
- <element name="LAUNCH_APP"/>
- <element name="LOCK_SCREEN_ICON_URL"/>
- <element name="TRAFFIC_MESSAGE_CHANNEL"/>
- <element name="DRIVER_PROFILE"/>
- <element name="VOICE_SEARCH"/>
- <element name="NAVIGATION"/>
- <element name="PHONE"/>
- <element name="CLIMATE"/>
- <element name="SETTINGS"/>
- <element name="VEHICLE_DIAGNOSTICS"/>
- <element name="EMERGENCY"/>
- <element name="MEDIA"/>
- <element name="FOTA"/>
- </enum>
- <enum name="ECallConfirmationStatus">
- <description>Reflects the status of the eCall Notification.</description>
- <element name="NORMAL" internal_name="ECCS_NORMAL">
- </element>
- <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
- </element>
- <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
- </element>
- <element name="CALL_COMPLETED">
- </element>
- <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
- </element>
- <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
- </element>
- <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
- </element>
- </enum>
- <enum name="VehicleDataNotificationStatus">
- <description>Reflects the status of a vehicle data notification.</description>
- <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
- </element>
- <element name="NORMAL" internal_name="VDNS_NORMAL">
- </element>
- <element name="ACTIVE" internal_name="VDNS_ACTIVE">
- </element>
- <element name="NOT_USED" internal_name="VDNS_NOT_USED">
- </element>
- </enum>
- <enum name="EmergencyEventType">
- <description>Reflects the emergency event status of the vehicle.</description>
- <element name="NO_EVENT" internal_name="EET_NO_EVENT">
- </element>
- <element name="FRONTAL" internal_name="EET_FRONTAL">
- </element>
- <element name="SIDE" internal_name="EET_SIDE">
- </element>
- <element name="REAR" internal_name="EET_REAR">
- </element>
- <element name="ROLLOVER" internal_name="EET_ROLLOVER">
- </element>
- <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="EET_FAULT">
- </element>
- </enum>
- <enum name="FuelCutoffStatus">
- <description>Reflects the status of the RCM fuel cutoff.</description>
- <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
- </element>
- <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
- </element>
- <element name="FAULT" internal_name="FCS_FAULT">
- </element>
- </enum>
- <enum name="PowerModeQualificationStatus">
- <description>Reflects the status of the current power mode qualification.</description>
- <element name="POWER_MODE_UNDEFINED">
- </element>
- <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
- </element>
- <element name="NOT_DEFINED">
- </element>
- <element name="POWER_MODE_OK">
- </element>
- </enum>
- <enum name="CarModeStatus">
- <description>Reflects the status of the current car mode.</description>
- <element name="NORMAL" internal_name="CMS_NORMAL">
- </element>
- <element name="FACTORY" internal_name="CMS_FACTORY">
- </element>
- <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
- </element>
- <element name="CRASH" internal_name="CMS_CRASH">
- </element>
- </enum>
- <enum name="PowerModeStatus">
- <description>Reflects the status of the current power mode.</description>
- <element name="KEY_OUT">
- </element>
- <element name="KEY_RECENTLY_OUT">
- </element>
- <element name="KEY_APPROVED_0">
- </element>
- <element name="POST_ACCESORY_0">
- </element>
- <element name="ACCESORY_1">
- </element>
- <element name="POST_IGNITION_1">
- </element>
- <element name="IGNITION_ON_2">
- </element>
- <element name="RUNNING_2">
- </element>
- <element name="CRANK_3">
- </element>
- </enum>
- <enum name="CharacterSet">
- <description>The list of potential character sets</description>
- <element name="TYPE2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="TYPE5SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID1SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- </enum>
- <!-- End of IVI part-->
- <enum name="AppPriority">
- <element name="EMERGENCY"/>
- <element name="NAVIGATION"/>
- <element name="VOICE_COMMUNICATION"/>
- <element name="COMMUNICATION"/>
- <element name="NORMAL"/>
- <element name="NONE"/>
- </enum>
-<enum name="MethodName">
- <description>Defines the type of the request which causes text-to-speech prompt</description>
- <element name="ALERT"/>
- <element name="SPEAK"/>
- <element name="AUDIO_PASS_THRU"/>
- <element name="ALERT_MANEUVER"/>
-</enum>
-
-<enum name="AlertType">
-<description>Defines the type of the request which causes text-to-speech prompt</description>
-<element name="UI"/>
-<element name="BOTH"/>
-</enum>
-
-<enum name="HMILevel">
- <element name="FULL"/>
- <element name="LIMITED"/>
- <element name="BACKGROUND"/>
- <element name="NONE"/>
-</enum>
-
-<enum name="EventTypes">
- <description>Reflects the current active event</description>
- <element name="AUDIO_SOURCE">
- <description>Navigated to audio(radio, etc)</description>
- </element>
- <element name="EMBEDDED_NAVI">
- <description>Navigated to navigation screen</description>
- </element>
- <element name="PHONE_CALL">
- <description>Phone call is active</description>
- </element>
- <element name="EMERGENCY_EVENT">
- <description>Active emergency event, active parking event</description>
- </element>
- <element name="DEACTIVATE_HMI">
- <description> GAL/DIO is active </description>
- </element>
-</enum>
-
-<enum name="VideoStreamingProtocol">
- <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>
- </element>
- <element name="RTP">
- <description>
- RTP facilitates the transfer of real-time data. Information provided by this protocol include
- timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
- and the payload format which indicates the encoded format of the data.
- </description>
- </element>
- <element name="RTSP">
- <description>
- The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
- Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP)
- for media stream delivery. However, some vendors implement proprietary transport protocols.
- </description>
- </element>
- <element name="RTMP">
- <description>
- Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
- Macromedia for streaming audio, video and data over the Internet, between a Flash player
- and a server. Macromedia is now owned by Adobe, which has released an incomplete version
- of the specification of the protocol for public use.
- </description>
- </element>
- <element name="WEBM">
- <description>
- The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
- Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
- </description>
- </element>
-</enum>
-
-<enum name="VideoStreamingCodec">
- <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>
- </element>
- <element name="H265">
- <description>
- High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
- compression standard, one of several potential successors to the widely used AVC (H.264 or
- MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio
- at the same level of video quality, or substantially improved video quality at the same
- bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
- </description>
- </element>
- <element name="Theora">
- <description>
- Theora is derived from the formerly proprietary VP3 codec, released into the public domain
- by On2 Technologies. It is broadly comparable in design and bitrate efficiency to
- MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of
- the features present in some of these other codecs. It is comparable in open standards
- philosophy to the BBC's Dirac codec.
- </description>
- </element>
- <element name="VP8">
- <description>
- VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
- Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
- successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for
- Open Media (AOMedia) are based on VP8.
- </description>
- </element>
- <element name="VP9">
- <description>
- Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD)
- and also enables lossless compression.
- </description>
- </element>
-</enum>
-
- <!-- Policies -->
- <enum name="UpdateResult">
- <element name="UP_TO_DATE"/>
- <element name="UPDATING"/>
- <element name="UPDATE_NEEDED"/>
- </enum>
- <enum name="SystemError">
- <element name="SYNC_REBOOTED"/>
- <element name="SYNC_OUT_OF_MEMMORY"/>
- </enum>
- <enum name="StatisticsType">
- <element name="iAPP_BUFFER_FULL"/>
- </enum>
- <enum name="ConsentSource">
- <element name="GUI"/>
- <element name="VUI"/>
- </enum>
- <enum name="DeviceState">
- <element name="UNKNOWN"/>
- <element name="UNPAIRED"/>
- </enum>
- <struct name="DeviceInfo">
- <param name="name" type="String" mandatory="true">
- <description>The name of the device connected.</description>
- </param>
- <param name="id" type="String" mandatory="true">
- <description>The ID of the device connected</description>
- </param>
- <param name="transportType" type="Common.TransportType" mandatory="false">
- <description>The transport type the named-app's-device is connected over HU(BlueTooth, USB or WiFi). It must be provided in OnAppRegistered and in UpdateDeviceList</description>
- </param>
- <param name="isSDLAllowed" type="Boolean" mandatory="false">
- <description>Sent by SDL in UpdateDeviceList. &#8217;true&#8217; &#8211; if device is allowed for PolicyTable Exchange; &#8216;false&#8217; &#8211; if device is NOT allowed for PolicyTable Exchange </description>
- </param>
- </struct>
- <struct name="UserFriendlyMessage" scope="internal">
- <param name="messageCode" type="String" mandatory="true"/>
- <param name="ttsString" type="String" mandatory="false"/>
- <param name="label" type="String" mandatory="false"/>
- <param name="line1" type="String" mandatory="false"/>
- <param name="line2" type="String" mandatory="false"/>
- <param name="textBody" type="String" mandatory="false"/>
- </struct>
- <struct name="PermissionItem">
- <param name="name" type="String" mandatory="true">
- <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
- </param>
- <param name="id" type="Integer" mandatory="true">
- <description>Id of corresponding functional group, needed by SDL.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="false">
- <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
- </param>
- </struct>
- <struct name="ServiceInfo">
- <param name="url" type="String" mandatory="true">
- <description>Get URL based on service type.</description>
- </param>
- <param name="policyAppId" type="String" mandatory="false">
- <description>Used if URL needed are specific for application.</description>
- </param>
- </struct>
- <!-- End of Policies -->
- <struct name="TextField">
- <param name="name" type="Common.TextFieldName" mandatory="true">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="Common.CharacterSet" mandatory="true">
- <description>The character set that is supported in this field. See CharacterSet.</description>
- </param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
- <description>The number of characters in one row of this field.</description>
- </param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
- <description>The number of rows of this field.</description>
- </param>
- </struct>
- <struct name="ButtonCapabilities">
- <description>Contains the information about capabilities of a button.</description>
- <param name="name" type="Common.ButtonName" mandatory="true">
- <description>The name of the Button from the ButtonName enum</description>
- </param>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a short press. Whenever the button is pressed short, onButtonPressed(SHORT) should be invoked.</description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a LONG press. Whenever the button is pressed long, onButtonPressed(LONG) should be invoked.</description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent(DOWN) should be invoked. Whenever the button is released, onButtonEvent(UP) should be invoked.</description>
- </param>
- </struct>
- <struct name="VehicleDataResult">
- <description>Individual published data request result</description>
- <param name="dataType" type="Common.VehicleDataType" mandatory="true">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
- <description>Published data result code.</description>
- </param>
- </struct>
- <struct name="TouchCoord">
- <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The x coordinate of the touch.</description>
- </param>
- <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The y coordinate of the touch.</description>
- </param>
- </struct>
- <struct name="TouchEvent">
- <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.
- If a touch event has type begin, the id should be added to the set of touches.
- If a touch event has type end, the id should be removed from the set of touches.
- </description>
- </param>
- <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
- <description>
- The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
- The timestamp is used to determined the rate of change of position of a touch.
- The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
- If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
- </description>
- </param>
- <param name="c" type="Common.TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
- <struct name="PresetBankCapabilities">
- <description>Contains information about on-screen preset capabilities (whether the HW preset buttons could be duplicated with onscreen buttons).</description>
- <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
- <description>Must be true if onscreen custom presets are available.</description>
- </param>
- </struct>
- <struct name="Image">
- <param name="value" maxlength="65535" type="String" mandatory="true">
- <description>The path to the dynamic image stored on HU or the static binary image itself.</description>
- </param>
- <param name="imageType" type="Common.ImageType" mandatory="true">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- </struct>
- <struct name="SoftButton">
- <param name="type" type="Common.SoftButtonType" mandatory="true">
- <description>Describes, whether text, icon or both text and image should be displayed on the soft button. See softButtonType</description>
- </param>
- <param name="text" maxlength="500" type="String" mandatory="false">
- <description>Optional text to be displayed (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" mandatory="false">
- <description>If true, must be highlighted</description>
- <description>If false, must be not</description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Value which must be returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="Common.SystemAction" mandatory="true">
- <description>Parameter indicates whether clicking a SoftButton must call a specific system action. See SystemAction</description>
- </param>
- </struct>
- <struct name="TTSChunk">
- <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
- <param name="text" type="String" mandatory="true" maxlength="500">
- <description>The text or phonemes to be spoken.</description>
- </param>
- <param name="type" type="Common.SpeechCapabilities" mandatory="true">
- <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
- </param>
- </struct>
- <struct name="HMIApplication">
- <description>Data type containing information about application needed by HMI.</description>
- <param name="appName" type="String" maxlength="100" mandatory="true">
- <description>The mobile application name, e.g. "Ford Drive Green".</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Provides an abbreviated version of the app name (if needed), that may be displayed on the NGN media screen.</description>
- <description>If not provided, the appName should be used instead (and may be truncated if too long)</description>
- </param>
- <param name="icon" type="String" mandatory="false">
- <description>Path to application icon stored on HU.</description>
- </param>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
- <description>The ID, serial number, transport type the named-app's-device is connected over to HU.</description>
- </param>
- <param name="policyAppID" type="String" maxlength="50" minlength="1" mandatory="true">
- <description>Policy ID(=the appID the application registers with) of registered application.</description>
- </param>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <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.
- May not be empty.
- May not start with a new line character.
- Not unique value
- </description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Unique (during ignition cycle) id of the application. To be used in all RPCs sent by both HU system and SDL</description>
- </param>
- <param name="hmiDisplayLanguageDesired" type="Common.Language" mandatory="true">
- <description>The language the application intends to use on HU </description>
- </param>
- <param name="isMediaApplication" type="Boolean" mandatory="true">
- <description>Indicates whether it is a media or a non-media application.</description>
- </param>
- <param name="appType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>List of all applicable app types stating which classifications to be given to the app.</description>
- <description>e.g. for platforms like GEN2, this determines which "corner(s)" the app can populate.</description>
- </param>
- <param name="greyOut" type="Boolean" mandatory="false">
- <description>Indicates whether application should be dimmed on the screen.</description>
- <description>Applicable only for apps received through QueryApps and still not registered.</description>
- </param>
- <param name="requestType" type="Common.RequestType" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The list of SystemRequest's RequestTypes allowed by policies for the named application</description>
- <description>(the app's SystemRequest sent with RequestType out of this list will get 'disallowed' response from SDL).</description>
- <description>If SDL sends an empty array - any RequestType is allowed for this app.</description>
- <description>If SDL omits this parameter - none RequestType is allowed for this app</description>
- <description>(either this is a pre-registered app or such is dictated by policies).</description>
- </param>
- </struct>
- <struct name="MenuParams">
- <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>unique ID of the sub menu, the command must be added to.</description>
- <description>If not provided, the command must be added to the top level of the in application menu.</description>
- </param>
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>Position within the items that are at the top level of the in application menu.</description>
- <description>0 should insert at the front.</description>
- <description>1 should insert at the second position.</description>
- <description>if position is greater than or equal to the number of items on the top level, the the sub menu/command should be appended to the end.</description>
- <description>If this param is omitted the entry should be added at the end.</description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="true">
- <description>The name of the sub menu/command.</description>
- </param>
- </struct>
- <struct name="Choice">
- <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">
- <description> The unique within the concerned application identifier for this choice </description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="false">
- <description> The name of the choice </description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description> The image for representing the choice </description>
- </param>
- <param name="secondaryText" maxlength="500" type="String" mandatory="false">
- <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">
- <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">
- <description>Optional secondary image struct for choice</description>
- </param>
- </struct>
- <struct name="VrHelpItem">
- <param name="text" maxlength="500" type="String" mandatory="true">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Common.Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
- <struct name="TimeFormat">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
- <description>The hour of the media clock.</description>
- <description>Some units only support a max of 19 hours. If out of range, it should be rejected.</description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- </struct>
- <struct name="TouchEventCapabilities">
- <param name="pressAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="multiTouchAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="doublePressAvailable" type="Boolean" mandatory="true">
- </param>
- </struct>
- <struct name="ImageResolution">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution height.</description>
- </param>
- </struct>
- <struct name="ScreenParams">
- <param name="resolution" type="Common.ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="Common.TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
- <struct name="ImageField">
- <param name="name" type="Common.ImageFieldName" mandatory="true">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="Common.FileType" maxsize="100" array="true" mandatory="false" minsize="1">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="Common.ImageResolution" mandatory="false">
- <description>The image resolution of this field.</description>
- </param>
- </struct>
- <struct name="VideoStreamingFormat">
- <description>Video streaming formats and their specifications.</description>
- <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="true">
- <description>Protocol type, see VideoStreamingProtocol</description>
- </param>
- <param name="codec" type="Common.VideoStreamingCodec" mandatory="true">
- <description>Codec type, see VideoStreamingCodec</description>
- </param>
- </struct>
-
- <struct name="VideoConfig">
- <description>Configuration of a video stream.</description>
- <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="false">
- <description>The video protocol configuration</description>
- </param>
- <param name="codec" type="Common.VideoStreamingCodec" mandatory="false">
- <description>The video codec configuration</description>
- </param>
- <param name="width" type="Integer" mandatory="false">
- <description>Width of the video stream, in pixels.</description>
- </param>
- <param name="height" type="Integer" mandatory="false">
- <description>Height of the video stream, in pixels.</description>
- </param>
- </struct>
- <struct name="DisplayCapabilities">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="Common.DisplayType" mandatory="true">
- <description>The type of the display. See DisplayType</description>
- </param>
- <param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
- <description>If there are no textfields supported, the empty array must be returned</description>
- </param>
- <param name="imageFields" type="Common.ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="Common.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="imageCapabilities" type="Common.ImageType" array="true" minsize="0" maxsize="2" mandatory="false">
- </param>
- <param name="graphicSupported" type="Boolean" mandatory="true">
- <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="true">
- <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
- </param>
- <param name="screenParams" type="Common.ScreenParams" mandatory="false">
- <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">
- <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
- </param>
- </struct>
- <struct name="SoftButtonCapabilities">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a short press.</description>
- <description>Whenever the button is pressed short, onButtonPressed( SHORT) must be invoked.</description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>The button supports a LONG press.</description>
- <description>Whenever the button is pressed long, onButtonPressed( LONG) must be invoked.</description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>The button supports "button down" and "button up".</description>
- <description>Whenever the button is pressed, onButtonEvent( DOWN) must be invoked.</description>
- <description>Whenever the button is released, onButtonEvent( UP) must be invoked.</description>
- </param>
- <param name="imageSupported" type="Boolean" mandatory="true">
- <description>Must be true if the button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
- <struct name="HMICapabilities">
- <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>
- </struct>
- <struct name="AudioPassThruCapabilities">
- <description>
- Describes different audio type configurations for PerformAudioPassThru.
- e.g. 8kHz,8-bit,PCM
- </description>
- <param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
- <param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
- <param name="audioType" type="Common.AudioType" mandatory="true"/>
- </struct>
- <struct name="TextFieldStruct">
- <param name="fieldName" type="Common.TextFieldName" mandatory="true">
- <description>The name of the field for displaying the text.</description>
- </param>
- <param name="fieldText" type="String" maxlength="500" mandatory="true">
- <description>The text itself.</description>
- </param>
- </struct>
- <struct name="KeyboardProperties">
- <description>Configuration of on-screen keyboard (if available).</description>
- <param name="language" type="Common.Language" mandatory="false">
- <description>The keyboard language.</description>
- </param>
- <param name="keyboardLayout" type="Common.KeyboardLayout" mandatory="false">
- <description>Desired keyboard layout.</description>
- </param>
- <param name="keypressMode" type="Common.KeypressMode" mandatory="false">
- <description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- </description>
- </param>
- <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Array of keyboard characters to enable.</description>
- <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
- <description>If omitted, the entire keyboard will be enabled.</description>
- </param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
- </struct>
- <struct name="Turn">
- <param name="navigationText" type="Common.TextFieldStruct" mandatory="false">
- <description>Uses navigationText from TextFieldStruct.</description>
- </param>
- <param name="turnIcon" type="Common.Image" mandatory="false">
- </param>
- </struct>
- <struct name="VehicleType">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle</description>
- <description>e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle</description>
- <description>e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle</description>
- <description>e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle</description>
- <description>e.g. SE</description>
- </param>
- </struct>
- <!--IVI part-->
- <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>
- </param>
- </struct>
- <struct name="DIDResult">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data (the address from ReadDID request)</description>
- </param>
- <param name="data" type="String" maxlength="5000" mandatory="false">
- <description>Raw DID-based data returned for requested element.</description>
- </param>
- </struct>
- <struct name="HeadLampStatus">
- <param name="lowBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the low beam lamps.</description>
- </param>
- <param name="highBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the high beam lamps.</description>
- </param>
- <param name="ambientLightSensorStatus" type="Common.AmbientLightStatus" mandatory="true">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
- <struct name="TireStatus">
- <description>The status and pressure of the tires.</description>
- <param name="pressureTelltale" type="Common.WarningLightStatus" mandatory="false">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="Common.SingleTireStatus" mandatory="false">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
- <struct name="BeltStatus">
- <param name="driverBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="BodyInformation">
- <param name="parkBrakeActive" type="Boolean" mandatory="true">
- <description>Must be true if the park brake is active</description>
- </param>
- <param name="ignitionStableStatus" type="Common.IgnitionStableStatus" mandatory="true">
- <description>Information about the ignition switch. See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="Common.IgnitionStatus" mandatory="true">
- <description>The status of the ignition. See IgnitionStatus.</description>
- </param>
- <param name="driverDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatDrv_B_Actl".</description>
- </param>
- <param name="passengerDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatPsngr_B_Actl".</description>
- </param>
- <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRl_B_Actl".</description>
- </param>
- <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRr_B_Actl".</description>
- </param>
- </struct>
- <struct name="DeviceStatus">
- <param name="voiceRecOn" type="Boolean" mandatory="false">
- <description>Must be true if the voice recording is on.</description>
- </param>
- <param name="btIconOn" type="Boolean" mandatory="false">
- <description>Must be true if Bluetooth icon is displayed.</description>
- </param>
- <param name="callActive" type="Boolean" mandatory="false">
- <description>Must be true if there is an active call..</description>
- </param>
- <param name="phoneRoaming" type="Boolean" mandatory="false">
- <description>Must be true if ther is a phone roaming.</description>
- </param>
- <param name="textMsgAvailable" type="Boolean" mandatory="false">
- <description>Must be true if the text message is available.</description>
- </param>
- <param name="battLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
- <description>Device battery level status. See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean" mandatory="false">
- <description>Must be true if stereo audio output is muted.</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean" mandatory="false">
- <description>Must be true if mono audio output is muted.</description>
- </param>
- <param name="signalLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
- <description>Device signal level status. See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="Common.PrimaryAudioSource" mandatory="false">
- <description>See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean" mandatory="false">
- <description>Must be true if emergency call event is active.</description>
- </param>
- </struct>
- <struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus" mandatory="true">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
- <struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="EmergencyEvent">
- <param name="emergencyEventType" type="Common.EmergencyEventType" mandatory="true">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus" mandatory="true">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="multipleEvents" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
- <struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean" mandatory="true">
- <description>References signal "PowerMode_UB".</description>
- </param>
- <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus" mandatory="true">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="Common.CarModeStatus" mandatory="true">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="Common.PowerModeStatus" mandatory="true">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
- <struct name="MyKey">
- <param name="e911Override" type="Common.VehicleDataStatus" mandatory="true">
- <description>Indicates whether e911 override is on. See VehicleDataStatus.</description>
- </param>
- </struct>
- <!--end of IVI part-->
- <!-- Remote Control -->
- <enum name="ModuleType">
- <element name="CLIMATE"/>
- <element name="RADIO"/>
- </enum>
-
- <enum name="RadioBand">
- <element name="AM"/>
- <element name="FM"/>
- <element name="XM"/>
- </enum>
-
- <struct name="RdsData">
- <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
- <description>Program Service Name</description>
- </param>
- <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
- <description>Radio Text</description>
- </param>
- <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
- <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
- </param>
- <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
- <description>Program Identification - the call sign for the radio station</description>
- </param>
- <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>The program type - The region should be used to differentiate between EU and North America program types</description>
- </param>
- <param name="TP" type="Boolean" mandatory="false">
- <description>Traffic Program Identification - Identifies a station that offers traffic</description>
- </param>
- <param name="TA" type="Boolean" mandatory="false">
- <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
- </param>
- <param name="REG" type="String" mandatory="false">
- <description>Region</description>
- </param>
- </struct>
-
- <enum name="RadioState">
- <element name="ACQUIRING"/>
- <element name="ACQUIRED"/>
- <element name="MULTICAST"/>
- <element name="NOT_FOUND"/>
- </enum>
-
- <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>
- </param>
- <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
- <description>The fractional part of the frequency for 101.7 is 7</description>
- </param>
- <param name="band" type="Common.RadioBand" mandatory="false">
- </param>
- <param name="rdsData" type="Common.RdsData" mandatory="false">
- </param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
- <description>number of HD sub-channels if available</description>
- </param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
- <description>Current HD sub-channel if available</description>
- </param>
- <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- </param>
- <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <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>
- </param>
- <param name="state" type="Common.RadioState" mandatory="false">
- </param>
- </struct>
-
- <struct name="RadioControlCapabilities">
- <description>Contains information about a radio control module's capabilities.</description>
- <param name="moduleName" type="String" maxlength="100" mandatory="true" >
- <description>The short name or a short description of the radio control module.</description>
- </param>
- <param name="radioEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable radio.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="radioBandAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the control of radio band.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the control of radio frequency.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the control of HD radio channel.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting Radio Data System (RDS) data.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the number of available HD channels.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="stateAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the Radio state.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the signal strength.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
- <description>
- Availability of the getting the signal Change Threshold.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- </struct>
-
- <enum name="DefrostZone">
- <element name="FRONT"/>
- <element name="REAR"/>
- <element name="ALL"/>
- <element name="NONE"/>
- </enum>
-
- <enum name="VentilationMode">
- <element name="UPPER"/>
- <element name="LOWER"/>
- <element name="BOTH"/>
- <element name="NONE"/>
- </enum>
-
- <enum name="TemperatureUnit">
- <element name="FAHRENHEIT"/>
- <element name="CELSIUS"/>
- </enum>
-
- <struct name="Temperature">
- <param name="unit" type="TemperatureUnit" mandatory="true" >
- <description>Temperature Unit</description>
- </param>
- <param name="value" type="Float" mandatory="true" >
- <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
- </param>
- </struct>
-
- <struct name="ClimateControlData">
- <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- </param>
- <param name="currentTemperature" type="Common.Temperature" mandatory="false">
- </param>
- <param name="desiredTemperature" type="Common.Temperature" mandatory="false">
- </param>
- <param name="acEnable" type="Boolean" mandatory="false">
- </param>
- <param name="circulateAirEnable" type="Boolean" mandatory="false">
- </param>
- <param name="autoModeEnable" type="Boolean" mandatory="false">
- </param>
- <param name="defrostZone" type="DefrostZone" mandatory="false">
- </param>
- <param name="dualModeEnable" type="Boolean" mandatory="false">
- </param>
- <param name="acMaxEnable" type="Boolean" mandatory="false">
- </param>
- <param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
- </param>
- </struct>
-
- <struct name="ClimateControlCapabilities">
- <description>Contains information about a climate control module's capabilities.</description>
- <param name="moduleName" type="String" maxlength="100" mandatory="true" >
- <description>The short name or a short description of the climate control module.</description>
- </param>
- <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the reading of current temperature.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of fan speed.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of desired temperature.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="acEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of turn on/off AC.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable air conditioning is ON on the maximum level.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable circulate Air mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable auto mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable dual mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of defrost zones.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="defrostZone" type="Common.DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- A set of all defrost zones that are controllable.
- </description>
- </param>
- <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of air ventilation mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="ventilationMode" type="Common.VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- A set of all ventilation modes that are controllable.
- </description>
- </param>
- </struct>
-
- <struct name="ModuleData">
- <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="Common.ModuleType" mandatory="true" >
- </param>
- <param name="radioControlData" type="Common.RadioControlData" mandatory="false">
- </param>
- <param name="climateControlData" type="Common.ClimateControlData" 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"/>
- </enum>
-<struct name="DateTime">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
- </param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
- <description>Seconds part of time</description>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>Minutes part of time</description>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
- </param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>Day of the month</description>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>Month of the year</description>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false">
- <description>The year in YYYY format</description>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
- <description>Time zone offset in Hours wrt UTC.</description>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
- <description>Time zone offset in Min wrt UTC.</description>
- </param>
-</struct>
-
-<struct name="OASISAddress">
- <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Name of the country (localized)</description>
- </param>
- <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
- <description>Name of country (ISO 3166-2)</description>
- </param>
- <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
- <description>(PLZ, ZIP, PIN, CAP etc.)</description>
- </param>
- <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of country (e.g. state)</description>
- </param>
- <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of e.g. state (e.g. county)</description>
- </param>
- <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. city/village</description>
- </param>
- <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. district</description>
- </param>
- <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for street, road etc.</description>
- </param>
- <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of thoroughfare e.g. house number</description>
- </param>
-</struct>
-
- <struct name="LocationDetails">
- <param name="coordinate" type="Coordinate" mandatory="false">
- <description>Latitude/Longitude of the location.</description>
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>Name of location.</description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>Location address for display purposes only</description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>Description intended location / establishment (if applicable)</description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>Phone number of location / establishment.</description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>Image / icon of intended location.</description>
- </param>
- <param name="searchAddress" type="OASISAddress" mandatory="false">
- <description>Address to be used by navigation engines for search</description>
- </param>
- </struct>
-
- <struct name="NavigationCapability">
- <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>
- </param>
- <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
- <description>If the module has the ability to return way points from onboard nav</description>
- </param>
- </struct>
-
- <struct name="PhoneCapability">
- <description>Extended capabilities of the module's phone feature</description>
- <param name="dialNumberEnabled" type="Boolean" mandatory="false">
- <description>If the module has the abiulity to perform dial number</description>
- </param>
- </struct>
-
- <struct name="VideoStreamingCapability">
- <description>Contains information about this system's video streaming capabilities.</description>
- <param name="preferredResolution" type="Common.ImageResolution" mandatory="false">
- <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
- </param>
- <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
- <description>The maximum bitrate of video stream that is supported, in kbps.</description>
- </param>
- <param name="supportedFormats" type="Common.VideoStreamingFormat" array="true" mandatory="false">
- <description>
- Detailed information on each format supported by this system, in its preferred order
- (i.e. the first element in the array is most preferable to the system).
- Each object will contain a VideoStreamingFormat that describes what can be expected.
- </description>
- </param>
- <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
- <description>True if the system can utilize the haptic spatial data from the source being streamed. </description>
- </param>
- </struct>
-
- <struct name="SystemCapabilities">
- <param name="navigationCapability" type="NavigationCapability" mandatory="false">
- </param>
- <param name="phoneCapability" type="PhoneCapability" mandatory="false">
- </param>
- <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
- </param>
- </struct>
-
- <struct name="RemoteControlCapabilities">
- <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>
- <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
- </param>
- <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>
- </struct>
-
- <struct name="Rectangle">
- <param name="x" type="Float" mandatory="true">
- <description>The X-coordinate of the user control</description>
- </param>
- <param name="y" type="Float" mandatory="true">
- <description>The Y-coordinate of the user control</description>
- </param>
- <param name="width" type="Float" mandatory="true">
- <description>The width of the user control's bounding rectangle</description>
- </param>
- <param name="height" type="Float" mandatory="true">
- <description>The height of the user control's bounding rectangle</description>
- </param>
- </struct>
-
- <struct name="HapticRect">
- <description>Defines haptic rectangle 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>
- </param>
- <param name="rect" type="Common.Rectangle" mandatory="true">
- <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>
- </interface>
- <interface name="Buttons" version="1.0" date="2013-04-12">
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="capabilities" type="Common.ButtonCapabilities" array="true" minsize="1" maxsize="100" mandatory="true">
- <description>Response must provide the names of available buttons and their capabilities.See ButtonCapabilities</description>
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>Must be returned if the platform supports custom on-screen Presets</description>
- </param>
- </function>
- <function name="OnButtonEvent" messagetype="notification" provider="hmi">
- <description>HU system must notify about every UP/DOWN event for buttons</description>
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="mode" type="Common.ButtonEventMode" mandatory="true">
- <description>Indicates whether this is an UP or DOWN event.</description>
- </param>
- <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
- <description>Must be provided if ButtonName is CUSTOM_BUTTON, this references the integer ID passed by a custom button. (e.g. softButtonName)</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>
- In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
- Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
- </description>
- </param>
- </function>
- <function name="OnButtonPress" messagetype="notification" provider="hmi">
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="mode" type="Common.ButtonPressMode" mandatory="true">
- <description>Indicates whether this is a LONG or SHORT button press event.</description>
- </param>
- <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
- <description>Must be returned if ButtonName is CUSTOM_BUTTON, this references the string passed by a custom button. (e.g. softButtonName)</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>
- In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
- Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
- </description>
- </param>
- </function>
- <function name="OnButtonSubscription" messagetype="notification">
- <description>
- Sender: SDL-&gt;HMI. Purpose: to notify about button subscription state is changed for the named application
- </description>
- <param name="name" type="Common.ButtonName" mandatory="true"/>
- <param name="isSubscribed" type="Boolean" mandatory="true">
- <description>
- Defines whether the named button has status of 'subscribed' or 'unsubscribed':
- If "true" - the named button is subscribed.
- If "false" - the named button is unsubscribed.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>
- The ID of application that relates to this button-subscription status change.
- </description>
- </param>
- </function>
- </interface>
- <interface name="BasicCommunication" version="1.0" date="2013-04-12">
- <function name="OnReady" messagetype="notification" provider="hmi">
- <description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
- </function>
- <function name="OnStartDeviceDiscovery" messagetype="notification" provider="hmi">
- <description>Initiated by HMI user for getting the list of connected devices.</description>
- </function>
- <function name="OnUpdateDeviceList" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
- </function>
- <function name="OnPhoneCall" messagetype="notification">
- <description>Sender: HMI-&gt;SDL. When: upon phone-call event started or ended</description>
- <param name="isActive" type="Boolean" mandatory="true">
- <description>Must be 'true' - when the phone call is started on HMI. Must be 'false' when the phone call is ended on HMI</description>
- </param>
- </function>
- <function name="OnEmergencyEvent" messagetype="notification">
- <description>
- "Sender: HMI-&gt;SDL. Conditions: when HMI enters the mode of "911 Assist", or other rear view camera,
- or something else in the future. Purpose: for SDL to change the audioStreamingState of the related apps to
- NOT_AUDIBLE when "enabled:true" and back to AUDIBLE when "enabled:false""
- </description>
- <param name="enabled" type="Boolean" mandatory="true">
- </param>
- </function>
- <function name="OnResumeAudioSource" messagetype="notification" provider="sdl">
- <description>This method must be invoked by SDL to update audio state.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>The ID of app to be resumed audio source.</description>
- </param>
- </function>
- <function name="OnSDLPersistenceComplete" messagetype="notification" provider="sdl">
- </function>
- <function name="UpdateAppList" messagetype="request" provider="hmi">
- <description>Issued by SDL to notify HMI about new applications registered.</description>
- <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="0" maxsize="100"/>
- </function>
- <function name="UpdateAppList" messagetype="response">
- </function>
- <function name="UpdateDeviceList" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change device list.</description>
- <param name="deviceList" type="Common.DeviceInfo" mandatory="true" array="true" minsize="0" maxsize="100">
- <description>The array of names/IDs of connected devices</description>
- </param>
- </function>
- <function name="UpdateDeviceList" messagetype="response">
- </function>
- <function name="OnFileRemoved" messagetype="notification" provider="sdl">
- <description>Notifies HMI in case some application file has been removed</description>
- <param name="fileName" type="String" minlength="1" maxlength="30" mandatory="true">
- <description>The name of the removed file</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>The file type. See FileType.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- </function>
- <function name="AllowDeviceToConnect" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="AllowDeviceToConnect" messagetype="response">
- <param name="allow" type="Boolean" mandatory="true"/>
- </function>
- <function name="OnDeviceChosen" messagetype="notification" provider="hmi">
- <description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
- <description>The name and ID of the device chosen</description>
- </param>
- </function>
- <function name="OnFindApplications" messagetype="notification" provider="hmi">
- <description>This method must be invoked by HMI to get list of registered apps.</description>
- <param name="deviceInfo" type="Common.DeviceInfo" mandatory="false">
- <description>The name and ID of the device the list of registered applications is required for.</description>
- </param>
- </function>
- <function name="ActivateApp" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to bring specified application to front on UI e.g make it HMI status 'FULL'.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of deactivated application.</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- <param name="level" type="Common.HMILevel" mandatory="false">
- <description>If level for application is to be changed to something else then FULL then this parameter should be used.</description>
- </param>
- </function>
- <function name="ActivateApp" messagetype="response">
- </function>
- <function name="OnAppActivated" messagetype="notification" provider="hmi">
- <description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of selected application.</description>
- </param>
- </function>
- <function name="OnAppDeactivated" messagetype="notification" provider="hmi">
- <description>Must be sent by HU system when the user switches to any functionality which is not other mobile application.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of deactivated application.</description>
- </param>
- <param name="reason" type="Common.DeactivateReason" mandatory="true">
- <description>Specifies the functionality the user has switched to.</description>
- </param>
- </function>
- <function name="OnAppRegistered" messagetype="notification" provider="sdl">
- <description>Issued by SDL to notify HMI about new application registered.</description>
- <param name="application" type="Common.HMIApplication" mandatory="true">
- <description>The information about application registered. See HMIApplication. </description>
- </param>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <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.
- May not be empty.
- May not start with a new line character.
- Not unique value
- </description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="resumeVrGrammars" type="Boolean" mandatory="false">
- <description>The flag if VR grammars resume is required</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- </function>
- <function name="OnAppUnregistered" messagetype="notification" provider="sdl">
- <description>
- Issued by SDL to notify HMI about application unregistered.
- Application then to be removed from application list; all data connected with application has to be cleared up.
- </description>
- <param name="unexpectedDisconnect" type="Boolean" mandatory="true">
- <description>
- SDL sends 'true' in case the connection is unexpectedly lost.
- SDL sends 'false' in case the mobile app is unregistered gracefully (via appropriate RPC)
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application unregistered</description>
- </param>
- </function>
- <function name="OnExitApplication" messagetype="notification" provider="hmi">
- <description>Must be sent by HMI when the User chooses to exit the application..</description>
- <param name="reason" type="Common.ApplicationExitReason" mandatory="true">
- <description>Specifies reason of moving the app to NONE</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application to be exited.</description>
- </param>
- </function>
- <function name="OnExitAllApplications" messagetype="notification" provider="hmi">
- <description>Sent by HMI to SDL to close all registered applications.</description>
- <param name="reason" type="Common.ApplicationsCloseReason" mandatory="true">
- <description>Specifies reason for exiting all apllications.</description>
- </param>
- </function>
- <function name="OnAwakeSDL" messagetype="notification">
- <description>
- Sender: HMI-&gt;SDL. Must be sent to return SDL to normal operation after 'Suspend' or 'LowVoltage' events
- </description>
- </function>
- <function name="MixingAudioSupported" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to find out if the last one supports mixing audio (i.e. recording TTS command and playing audio).</description>
- </function>
- <function name="MixingAudioSupported" messagetype="response">
- <description>If no response received SDL supposes that mixing audio is not supported</description>
- <param name="attenuatedSupported" type="Boolean" mandatory="true">
- <description>Must be true if supported</description>
- </param>
- </function>
- <function name="PlayTone" messagetype="notification" provider="sdl">
- <description>Sent by SDL to HMI to notify that the tone should be played.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application that invoked this notification</description>
- </param>
- <param name="methodName" type="Common.MethodName" mandatory="true">
- <description>Defines the name of app's request that initiates playing a tone</description>
- </param>
- </function>
- <function name="DialNumber" messagetype="request">
- <description>Request from SDL to call a specific number.</description>
- <param name="number" type="String" maxlength="40" mandatory="true">
- <description>The number to dial. Only the character + and numbers are allowed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DialNumber" messagetype="response">
- </function>
- <!-- Policies -->
- <!-- SyncP RPC-->
- <function name="OnSystemRequest" messagetype="notification" provider="hmi">
- <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)
- </description>
- <param name="requestType" type="Common.RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
- <description>Optional array of URL(s) for HTTP requests.</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="false">
- <description>Optional file type (meant for HTTP file requests).</description>
- </param>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- </param>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SystemRequest" messagetype="request" provider="hmi">
- <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
- <param name="requestType" type="Common.RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>The path to file.</description>
- </param>
- <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SystemRequest" messagetype="response">
- </function>
- <function name="PolicyUpdate" messagetype="request" provider="hmi">
- <description>
- From: SDL
- To: SYNCP Manager
- Asks SYNCP Manager to send given Policy Table snapshot to the backend
- </description>
- <param name="file" type="String" minlength="1" maxlength="255" mandatory="true">
- <description>
- Location of policy table snapshot
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>
- Send attempt timeout in seconds
- </description>
- </param>
- <param name="retry" type="Integer" minvalue="0" maxvalue="65535" array="true" minsize="1" maxsize="5" mandatory="true">
- <description>
- Array of delays to wait after failed atempts
- </description>
- </param>
- </function>
- <function name="PolicyUpdate" messagetype="response">
- </function>
- <!-- End of SyncP RPC-->
- <function name="OnSDLClose" messagetype="notification" provider="sdl">
- <description>SDL must notify HMI about finish working application</description>
- </function>
- <function name="OnPutFile" messagetype="notification" provider="sdl">
- <description>
- Notification, that comes to HMI when mobile sents file with systemFile flag
- </description>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Full Size of file. sends in first OnPutFile notification if file is splited
- into many PutFiles
- </description>
- </param>
- <param name="FileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
- <param name="fileType" type="Common.FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
- </function>
- <!-- Policies -->
- <function name="GetSystemInfo" messagetype="request" provider="hmi">
- <description>Request from SDL to HMI to obtain information about head unit system.</description>
- </function>
- <function name="GetSystemInfo" messagetype="response">
- <param name="ccpu_version" type="String" maxlength="500" mandatory="true">
- <description>Software version of the module</description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>ISO 639-1 combined with ISO 3166 alpha-2 country code (i.e. en-us)</description>
- </param>
- <param name="wersCountryCode" type="String" maxlength="500" mandatory="true">
- <description>Country code from the Ford system WERS (i.e.WAEGB).</description>
- </param>
- </function>
- <function name="OnSystemInfoChanged" messagetype="notification" provider="hmi">
- <description>Issued by system to SDL to notify that some system param has changed. Currently applied for Sync Language.</description>
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="OnIgnitionCycleOver" messagetype="notification" provider="hmi">
- <description>Notification from system to SDL to let it know that ignition cycle is over.</description>
- </function>
- <function name="DecryptCertificate" messagetype="request">
- <description>Sender: SDL-&gt;HMI. Purpose: to decrypt the certificate received via the Updated Policy Table. </description>
- <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
- <description>The path to the file with the encrypted certificate from the PolicyTable.</description>
- </param>
- </function>
- <function name="DecryptCertificate" messagetype="response">
- <description>SUCCESS - in case the certificate is decrypted and placed to the same file from request.</description>
- </function>
- <function name="OnEventChanged" messagetype="notification">
- <description>Sender: HMI->SDL. When event is become active</description>
- <param name="eventName" type="Common.EventTypes" mandatory="true">
- <description>Specifies the types of active events.</description>
- </param>
- <param name="isActive" type="Boolean" mandatory="true">
- <description>Must be 'true' - when the event is started on HMI. Must be 'false' when the event is ended on HMI</description>
- </param>
- </function>
- <!-- End of Policies -->
- </interface>
- <interface name="VR" version="1.0" date="2013-04-17">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response provides information about presence of VR module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if VR is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="Started" messagetype="notification" provider="hmi">
- <description>Must be initiated by VR module to let SDL know that VR session has started.</description>
- </function>
- <function name="Stopped" messagetype="notification" provider="hmi">
- <description>Must be initiated by VR module to let SDL know that VR session has stopped.</description>
- </function>
- <function name="AddCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to add a command(string with associated id) to VR.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of a command (further to be used in OnCommand notification).</description>
- </param>
- <param name="vrCommands" type="String" mandatory="true" maxlength="99" minsize="1" maxsize="100" array="true">
- <description>List of strings to be used as VR commands.</description>
- </param>
- <param name="type" type="Common.VRCommandType" mandatory="true">
- <description>Type of added command. See VRCommandType.</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>
- ID of the specific grammar, whether top-level or choice set.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="AddCommand" messagetype="response">
- </function>
- <function name="DeleteCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a command from VR.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Id of a command (list of strings), previously sent by AddCommand.</description>
- </param>
- <param name="type" type="Common.VRCommandType" mandatory="true">
- <description>Type of added command. See VRCommandType.</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the specific grammar.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="DeleteCommand" messagetype="response">
- </function>
- <function name="PerformInteraction" messagetype="request" provider="hmi">
- <description>
- Sets some properties for the application initiated request.
- </description>
- <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The help prompt. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="initialPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- This is the intial prompt spoken to the user at the start of an interaction. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text for a wait timeout. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
- </description>
- </param>
- <param name="timeout" type="Integer" mandatory="true">
- <description>Timeout initiate timeoutPrompt</description>
- </param>
- <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- IDs of the specific compiled grammars for this voice interaction.
- </description>
- </param>
- </function>
- <function name="PerformInteraction" messagetype="response">
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- </description>
- </param>
- </function>
- <function name="OnCommand" messagetype="notification" provider="hmi">
- <description>Notifies SDL about command trigerred via VR</description>
- <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
- <description>ID of of the command (list of strings)</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language of VR.</description>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Request new VR synonyms registration
- Defines an additional voice recognition command.
- Must not interfere with any name of previously registered applications(SDL makes check).
- </description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language VR has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. Response must provide the information about VR supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in VR.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active VR language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup by SDL to request information about VR capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="vrCapabilities" type="Common.VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Types of input recognized by VR module.</description>
- </param>
- </function>
- </interface>
- <interface name="TTS" version="1.0" date="2013-04-18">
- <description>RPCs for communication between TTS and SDL.</description>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
- <description>See SpeechCapabilities</description>
- </param>
- <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
- <description>See PrerecordedSpeech</description>
- </param>
- </function>
- <function name="Started" messagetype="notification" provider="hmi">
- <description>Must be initiated by TTS module to let SDL know that TTS session has started.</description>
- </function>
- <function name="Stopped" messagetype="notification" provider="hmi">
- <description>Must be initiated by TTS module to let SDL know that TTS session has stopped.</description>
- </function>
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up. Response must provide the information about presence of TTS module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if TTS is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="Speak" messagetype="request" provider="hmi">
- <description>RPC from SDL to TTS for speaking the text.</description>
- <param name="ttsChunks" type="Common.TTSChunk" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of strings to be spoken.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- <param name="speakType" type="Common.MethodName" mandatory="false">
- <description>Defines the type of the request which causes text-to-speech</description>
- </param>
- </function>
- <function name="Speak" messagetype="response">
- <description>Provides information about success of operation.</description>
- </function>
- <function name="StopSpeaking" messagetype="request" provider="hmi">
- <description>Initiated by SDL to stop speaking the text.</description>
- </function>
- <function name="StopSpeaking" messagetype="response">
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language of TTS.</description>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Request new ttsName registration
- 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.
- May not be empty.
- May not start with a new line character.
- Not unique value (SDL makes all the checks)
- </description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language TTS has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method is invoked at system start-up by SDL. Response must provide the information about TTS supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in TTS.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active TTS language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="SetGlobalProperties" messagetype="request" provider="hmi">
- <description>Sets some properties for the application initiated request.</description>
- <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The help prompt.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
- <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text for a wait timeout.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetGlobalProperties" messagetype="response">
- </function>
- <function name="OnResetTimeout" messagetype="notification">
- <description>
- Sender: HMI-&gt;SDL. HMI must send this notification every 10 sec. in case the 'methodName'
- results long processing on HMI
- </description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that concerns the 'methodName'.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>The name of the method, the renew of timeout is required for</description>
- </param>
- </function>
- </interface>
- <interface name="UI" version="1.0" date="2013-04-16">
- <function name="Alert" messagetype="request" provider="hmi">
- <description>Request from SDL to show an alert message on the display.</description>
- <param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
- <description>Array of lines of alert text fields. See TextFieldStruct. Uses alertText1, alertText2, alertText3.</description>
- </param>
- <param name="duration" type="Integer" mandatory="true" minvalue="3000" maxvalue="10000">
- <description>Timeout in milliseconds.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" mandatory="false" minsize="0" maxsize="4" array="true">
- <description>App defined SoftButtons</description>
- </param>
- <param name="progressIndicator" type="Boolean" mandatory="false">
- <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="alertType" type="Common.AlertType" mandatory="true">
- <description>Defines if only UI or BOTH portions of the Alert request are being sent to HMI Side</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="Alert" messagetype="response">
- <param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
- <description>Amount of time (in milliseconds) that SDL must wait before resending an alert. Must be provided if another system event or overlay currently has a higher priority than this alert.</description>
- </param>
- </function>
- <function name="Show" messagetype="request" provider="hmi">
- <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="7">
- <description>Array of lines of show text fields. See TextFieldStruct. Uses mainField1, mainField2, mainField3, mainField4. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
- mainField1: The text that should be displayed in a single or upper display line.
- mainField2: The text that should be displayed on the second display line.
- mainField3: The text that should be displayed on the second "page" first display line.
- mainField4: The text that should be displayed on the second "page" second display line.
- statusBar: statusBar.
- mediaClock: Text value for MediaClock field.
- mediaTrack: The text that should be displayed in the track field. This field is only valid for media applications on NGN type ACMs.
- </description>
- </param>
- <param name="alignment" type="Common.TextAlignment" mandatory="false">
- <description>Specifies how mainField1 and mainField2 texts should be aligned on the display.</description>
- <description>If omitted, texts must be centered</description>
- </param>
- <param name="graphic" type="Common.Image" mandatory="false">
- <description>Path to optional dynamic image or the static binary image itself. See Image. If omitted, the displayed graphic should not change.</description>
- </param>
- <param name="secondaryGraphic" type="Common.Image" mandatory="false">
- <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="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>App defined SoftButtons.</description>
- <description>If omitted, the currently displayed SoftButton values should not change.</description>
- </param>
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
- <description>App labeled on-screen presets (i.e. GEN3 media presets or dynamic search suggestions).</description>
- <description>If omitted on supported displays, the presets will be shown as not defined.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application related to this RPC.</description>
- </param>
- </function>
- <function name="Show" messagetype="response">
- </function>
- <function name="AddCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to add a command to the application menu.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the command to be added.</description>
- </param>
- <param name="menuParams" type="Common.MenuParams" mandatory="false">
- <description>Optional sub value containing parameters of the command (position, name, etc.). See MenuParams. If omitted the command should be added to the end of the list of commands.</description>
- </param>
- <param name="cmdIcon" type="Common.Image" mandatory="false">
- <description>Image to be displayed for representing the command. See Image.</description>
- <description>If omitted, no (or the default if applicable) icon should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="AddCommand" messagetype="response">
- </function>
- <function name="DeleteCommand" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a command from the in-application menu with the specified command id.</description>
- <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
- <description>cmdId previously sent via AddCommand request - id of the command to be deleted.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DeleteCommand" messagetype="response">
- </function>
- <function name="AddSubMenu" messagetype="request" provider="hmi">
- <description>Request from SDL to add a sub menu to the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>ID of the sub menu to be added. Unique for the application.</description>
- </param>
- <param name="menuParams" type="Common.MenuParams" mandatory="true">
- <description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="AddSubMenu" messagetype="response">
- </function>
- <function name="DeleteSubMenu" messagetype="request" provider="hmi">
- <description>Request from SDL to delete a submenu from the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>The "menuID" of the sub-menu to be deleted. (See addSubMenu.menuID)</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="DeleteSubMenu" messagetype="response">
- </function>
- <function name="PerformInteraction" messagetype="request" provider="hmi">
- <description>Request from SDL for triggering an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
- <param name="initialText" type="Common.TextFieldStruct" mandatory="false">
- <description>Uses initialInteractionText. See TextFieldStruct.</description>
- </param>
- <param name="choiceSet" type="Common.Choice" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>The list of choices to be used for the interaction with the user</description>
- </param>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>VR Help Title text.</description>
- <description>If omitted on supported displays, the default HU system help title should be used.</description>
- </param>
- <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="true">
- <description>Timeout in milliseconds.</description>
- </param>
- <param name="interactionLayout" type="Common.LayoutMode" mandatory="false">
- <description>See LayoutMode.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="PerformInteraction" messagetype="response">
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>ID of the choice that was selected in response to PerformInteraction.</description>
- </param>
- <param name="manualTextEntry" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>
- Manually entered text selection, e.g. through keyboard
- Can be returned in lieu of choiceID, depending on trigger source
- </description>
- </param>
- </function>
- <function name="SetMediaClockTimer" messagetype="request" provider="hmi">
- <description>Sets the initial media clock value and automatic update method.</description>
- <param name="startTime" type="Common.TimeFormat" mandatory="false">
- <description>startTime should be ignored for "PAUSE", "RESUME", and "CLEAR"</description>
- </param>
- <param name="endTime" type="Common.TimeFormat" mandatory="false">
- <description>
- See TimeFormat.
- endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
- </description>
- </param>
- <param name="updateMode" type="Common.ClockUpdateMode" mandatory="true">
- <description>The update method of the media clock.</description>
- <description>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="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="SetMediaClockTimer" messagetype="response">
- </function>
- <function name="SetGlobalProperties" messagetype="request" provider="hmi">
- <description>Request from SDL to set some properties for VR help.</description>
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
- <description>VR Help Title text.</description>
- <description>If omitted on supported displays, the default HU system help title should be used.</description>
- </param>
- <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
- </param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false">
- <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </param>
- <param name="menuIcon" type="Common.Image" mandatory="false">
- <description>&gt;Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
- </param>
- <param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
- <description>On-screen keybaord configuration (if available).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="SetGlobalProperties" messagetype="response">
- </function>
- <function name="OnCommand" messagetype="notification" provider="hmi">
- <description>Notification must be initiated by HMI on user choosing menu item.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Command ID, which is related to a specific menu entry (previously sent with AddCommand).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that is related to this RPC.</description>
- </param>
- </function>
- <function name="OnSystemContext" messagetype="notification" provider="hmi">
- <description>
- Notification must be initiated by HMI when the user changes the context of application: goes to menu (in-application menu or system menu);
- switches to VR; pop-up appears on screen etc.
- </description>
- <param name="systemContext" type="Common.SystemContext" mandatory="true">
- <description>The context the application is brought into.</description>
- </param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that is related to this RPC.</description>
- </param>
- </function>
- <function name="GetCapabilities" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup by SDL to request information about UI capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="true">
- <description>Information about the capabilities of the display: its type, text field supported, etc. See DisplayCapabilities. </description>
- </param>
- <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true"/>
- <param name="hmiZoneCapabilities" type="Common.HmiZoneCapabilities" mandatory="true"/>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Must be returned if the platform supports on-screen SoftButtons.</description>
- </param>
- <param name="hmiCapabilities" type="Common.HMICapabilities" mandatory="false">
- <description>Specifies the HMI&#8217;s capabilities. See HMICapabilities.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to change language for app.</description>
- <param name="appName" type="String" maxlength="100" mandatory="false">
- <description>
- Request new app name registration
- Needs to be unique over all applications.
- May not be empty. May not start with a new line character.
- May not interfere with any name or synonym of any registered applications.
- Applications with the same name will be rejected. (SDL makes all the checks)
- </description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
- <description>Request new app short name registration</description>
- </param>
- <param name="language" type="Common.Language" mandatory="true">
- <description>The language application wants to switch to.</description>
- </param>
- <param name="appHMIType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Sent when app's requested-during-registration AppHMIType is changed to different one due to Policies update. Contains the updated list of all allowed app's AppHMITypes.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="ChangeRegistration" messagetype="response">
- </function>
- <function name="OnLanguageChange" messagetype="notification" provider="hmi">
- <description>Notification from HMI to SmartDeviceLink about change of language.</description>
- <param name="language" type="Common.Language" mandatory="true">
- <description>Language UI has switched to.</description>
- </param>
- </function>
- <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
- <description>Method should be invoked at system startup. Response provides information about UI supported languages.</description>
- </function>
- <function name="GetSupportedLanguages" messagetype="response">
- <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
- <description>List of languages supported in UI.</description>
- </param>
- </function>
- <function name="GetLanguage" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLink to HMI to get currently active UI language</description>
- </function>
- <function name="GetLanguage" messagetype="response">
- <param name="language" type="Common.Language" mandatory="true"/>
- </function>
- <function name="OnDriverDistraction" messagetype="notification" provider="hmi">
- <description>Notification must be sent from HMI to SDL when driver distraction state is changed. Driver distraction rules are defined by the platform.</description>
- <param name="state" type="Common.DriverDistractionState" mandatory="true">
- <description>See DriverDistractionState. </description>
- </param>
- </function>
- <function name="SetAppIcon" messagetype="request" provider="hmi">
- <description>Used to set existing local file on SYNC as the app's icon.</description>
- <param name="syncFileName" type="Common.Image" mandatory="true">
- <description>Either the path to the dynamic image stored on HY or the static binary image itself. See Image</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetAppIcon" messagetype="response">
- </function>
- <function name="SetDisplayLayout" messagetype="request" provider="hmi">
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetDisplayLayout" messagetype="response">
- <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
- <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description>
- </param>
- <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
- </param>
- <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
- </param>
- </function>
- <function name="ShowCustomForm" messagetype="request" provider="hmi">
- <description>Used to show a custom form; it can be a parent or child screen. If no parent screen is designated, it is set as a parent screen.</description>
- <param name="customFormID" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined forms are defined.
- Predefined layouts include:
- "DEFAULT" - Default media / non-media screen
- "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
- "KEYBOARD_SEARCH" - Custom template containing app-configured on-screen keyboard with active search updating; user also can trigger voice search.
- "NAV_FULLSCREEN_MAP" - Custom root template screen containing full screen map with navigation controls.
- "NAV_POI_MENU" - Custom template containing app-defined POI options.
- "NAV_SEARCH_RESULTS" - Custom template containing a list of app-defined search results
- "NAV_POI_INFO" - Custom template containing app-defined POI information (and potentially map data).
- </description>
- </param>
- <param name="parentFormID" type="String" maxlength="500" defvalue="DEFAULT" mandatory="false">
- <description>
- Parent screen of predefined form to display.
- Currently only predefined forms are defined.
- If not provided, then set to "DEFAULT".
- Predefined layouts include:
- "DEFAULT" - Default media / non-media screen
- "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
- "NAV_FULLSCREEN_MAP" - Custom template containing full screen map with navigation controls.
- </description>
- </param>
- </function>
- <function name="ShowCustomForm" messagetype="response">
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
- <function name="OnKeyboardInput" messagetype="notification" provider="hmi">
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
- <param name="event" type="Common.KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
- <param name="data" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>On-screen keyboard input data.</description>
- <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
- <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
- <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
- </param>
- </function>
- <function name="OnTouchEvent" messagetype="notification" provider="hmi">
- <description>Notifies about touch events on the screen's prescribed area</description>
- <param name="type" type="Common.TouchType" mandatory="true">
- <description>The type of touch event.</description>
- </param>
- <param name="event" type="Common.TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
- <function name="Slider" messagetype="request" provider="hmi">
- <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>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
- <description>Initial position of slider control (cannot exceed numTicks)</description>
- </param>
- <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
- <description>Text header to be displayed.</description>
- </param>
- <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
- <description>Text footer to be displayed (meant to display min/max threshold descriptors).</description>
- <description>For a static text footer, only one footer string shall be provided in the array.</description>
- <description>For a dynamic text footer, the number of footer text string in the array must match the numTicks value.</description>
- <description>For a dynamic text footer, text array string should correlate with potential slider position index.</description>
- <description>If omitted on supported displays, no footer text shall be displayed.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" mandatory="true">
- <description>Timeout. The slider should be displayed until the defined amount of time has elapsed. </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that concerns this RPC.</description>
- </param>
- </function>
- <function name="Slider" messagetype="response">
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>Current slider position. Must be returned when the user has clicked the &#8216;Save&#8217; or &#8216;Canceled&#8217; button or by the timeout </description>
- </param>
- </function>
- <function name="ScrollableMessage" messagetype="request" provider="hmi">
- <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="messageText" type="Common.TextFieldStruct" mandatory="true">
- <description>Body of text that can include newlines and tabs. Uses scrollableMessageBody.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Timeout in milliseconds. The message should be displayed until the time defined is up.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>App defined SoftButtons.</description>
- <description>If omitted on supported displays, only the system defined "Close" SoftButton should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ScrollableMessage" messagetype="response">
- </function>
- <function name="PerformAudioPassThru" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <param name="audioPassThruDisplayTexts" type="Common.TextFieldStruct" mandatory="true" minsize="0" maxsize="2" array="true">
- <description>Uses
- audioPassThruDisplayText1: First line of text displayed during audio capture.
- audioPassThruDisplayText2: Second line of text displayed during audio capture.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. If not provided, the recording should be performed until EndAudioPassThru arrives.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="true">
- <description>
- Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
- If omitted, the value is set to true.
- </description>
- </param>
- </function>
- <function name="PerformAudioPassThru" messagetype="response">
- </function>
- <function name="EndAudioPassThru" messagetype="request" provider="hmi">
- <description>Request is sent by SDL to stop the audio capturing.</description>
- </function>
- <function name="EndAudioPassThru" messagetype="response">
- </function>
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response provides information about presence of UI module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if UI is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="ClosePopUp" messagetype="request" provider="hmi">
- <description>Initiated by SDL to close currently active pop-up on HMI.</description>
- <param name="methodName" type="String" mandatory="false">
- <description>Method to be closed</description>
- </param>
- </function>
- <function name="ClosePopUp" messagetype="response">
- <description>Provides the result of operation.</description>
- </function>
- <function name="OnResetTimeout" messagetype="notification" provider="hmi">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Id of application that invoked notifcation.</description>
- </param>
- <param name="methodName" type="String" mandatory="true">
- <description>Currently used method name on which was triggered action</description>
- </param>
- </function>
- <function name="OnRecordStart" messagetype="notification" provider="sdl">
- <description>Issued by SDL to notify HMI about capturing mic data should be started</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SendHapticData" messagetype="request">
- <description>Send the UI spatial data from MOBILE. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal ID of the application that requested this RPC.</description>
- </param>
- <param name="hapticRectData" type="Common.HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
- <description>
- Array of rectangle 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 rectangle data previously sent through RPC.
- Avoidance of doubt, when an empty hapticRectData, it will be clear all rectangle data previously sent through RPC.
- </description>
- </param>
- </function>
- <function name="SendHapticData" messagetype="response">
- </function>
- </interface>
- <interface name="Navigation" version="1.0" date="2013-05-22">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if Navigation is present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="SendLocation" messagetype="request">
- <description>That allows the app to send a destination to the embedded nav system.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- <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="locationName" type="String" maxlength="500" mandatory="false">
- <description> Name / title of intended location </description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description> Description intended location / establishment (if applicable) </description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description> Location address (if applicable) </description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description> Phone number of intended location / establishment (if applicable) </description>
- </param>
- <param name="locationImage" type="Common.Image" mandatory="false">
- <description> Image / icon of intended location (if applicable and supported) </description>
- </param>
- </function>
- <function name="SendLocation" messagetype="response">
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="request">
- <description>Dials a phone number and switches to phone application.</description>
- <param name="number" type="String" maxlength="40" mandatory="true">
- <description>Phone number is a string, which can be up to 40 chars.</description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="response">
- </function>
-
- <function name="ShowConstantTBT" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to show info about navigation.</description>
- <param name="navigationTexts" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="5">
- <description>See TextFieldStruct. Uses:
- navigationText1
- navigationText2
- ETA
- totalDistance
- timeToDestination.
- </description>
- </param>
- <param name="turnIcon" type="Common.Image" mandatory="false">
- </param>
- <param name="nextTurnIcon" type="Common.Image" mandatory="false">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
- <description>Fraction of distance till next maneuver (from previous maneuver).</description>
- <description>May be used to calculate progress bar.</description>
- </param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
- <description>Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).</description>
- <description>May be used to calculate progress bar.</description>
- </param>
- <param name="maneuverComplete" type="Boolean" mandatory="false">
- <description>If and when a maneuver has completed while an AlertManeuver is active, SDL will send this value set to TRUE in order to clear the AlertManeuver overlay.</description>
- <description>If omitted the value should be assumed as FALSE.</description>
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>Three dynamic SoftButtons available</description>
- <description>If omitted on supported displays, the currently displayed SoftButton values will not change.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ShowConstantTBT" messagetype="response">
- </function>
- <function name="AlertManeuver" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to announce navigation maneuver</description>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted, only the system defined "Close" SoftButton should be displayed.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application requested this RPC.</description>
- </param>
- </function>
- <function name="AlertManeuver" messagetype="response">
- </function>
- <function name="UpdateTurnList" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to update turn list.</description>
- <param name="turnList" type="Common.Turn" minsize="1" maxsize="100" array="true" mandatory="false">
- </param>
- <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
- <description>If omitted, app-defined SoftButton should be left blank.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="UpdateTurnList" messagetype="response">
- </function>
- <function name="OnTBTClientState" messagetype="notification" provider="hmi">
- <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
- <param name="state" type="Common.TBTState" mandatory="true">
- <description>Current State of TBT client</description>
- </param>
- </function>
- <function name="SetVideoConfig" messagetype="request">
- <description>Request from SDL to HMI to ask whether HMI accepts a video stream with given configuration.</description>
- <param name="config" type="Common.VideoConfig" mandatory="true">
- <description>Configuration of a video stream.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="SetVideoConfig" messagetype="response">
- <description>
- Response from HMI to SDL whether the configuration is accepted.
- In a negative response, a list of rejected parameters are supplied.
- </description>
- <param name="rejectedParams" type="String" array="true" minsize="1" maxsize="1000" mandatory="false">
- <description>
- List of params of VideoConfig struct which are not accepted by HMI, e.g. "protocol" and "codec".
- This param exists only when the response is negative.
- </description>
- </param>
- </function>
- <function name="StartStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
- <description>URL that HMI start playing.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StartStream" messagetype="response">
- </function>
- <function name="StopStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to stop playing video streaming.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StopStream" messagetype="response">
- </function>
- <function name="StartAudioStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
- <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
- <description>URL that HMI start playing.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StartAudioStream" messagetype="response">
- </function>
- <function name="StopAudioStream" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to stop playing audio streaming.</description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="StopAudioStream" messagetype="response">
- </function>
- <function name="OnAudioDataStreaming" messagetype="notification">
- <description>Sender: SDL-&gt;HMI. Purpose: notify about raw audio data presence over the URL provided via StartAudioStream SDL's request.</description>
- <param name="available" type="Boolean" mandatory="true">
- <description>If "true" - audio data started. If "false" - audio data stopped.</description>
- </param>
- </function>
- <function name="OnVideoDataStreaming" messagetype="notification">
- <description>Sender: SDL-&gt;HMI. Purpose: notify about raw video data presence over the URL provided via StartStream SDL's request.</description>
- <param name="available" type="Boolean" mandatory="true">
- <description>If "true" - video data started. If "false" - video data stopped.</description>
- </param>
- </function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
- <description>Request for getting waypoint/destination data.</description>
- <param name="wayPointType" type="Common.WayPointType" mandatory="true">
- <description>To request for either the destination only or for all waypoints including destination</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- </function>
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
- <param name="wayPoints" type="Common.LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
- <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
- <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
- <param name="wayPoints" type="Common.LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
- <description>To subscribe in getting changes for Waypoints/destinations</description>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
- <description>Request to unsubscribe from WayPoints and Destination</description>
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response">
- </function>
- </interface>
-
- <interface name="VehicleInfo" version="1.0" date="2013-04-21">
- <function name="IsReady" messagetype="request" provider="hmi">
- <description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if vehicle data modules are present and ready to communicate with SDL.</description>
- </param>
- </function>
- <function name="GetVehicleType" messagetype="request" provider="hmi">
- <description>Request from SmartDeviceLinkCore to HMI to get info about the vehicle (type, model, etc.).</description>
- </function>
- <function name="GetVehicleType" messagetype="response">
- <param name="vehicleType" type="Common.VehicleType" mandatory="true"/>
- </function>
- <function name="ReadDID" messagetype="request" provider="hmi">
- <description>Request from SDL for vehicle data reading.</description>
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
- <description>Get raw data from vehicle data DID location(s).</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application related to this RPC.</description>
- </param>
- </function>
- <function name="ReadDID" messagetype="response">
- <param name="didResult" type="Common.DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>Array of requested DID results (with data if available).</description>
- </param>
- </function>
- <function name="GetDTCs" messagetype="request" provider="hmi">
- <description>Vehicle module diagnostic trouble code request.</description>
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
- <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="GetDTCs" messagetype="response">
- <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
- </param>
- <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
- <description>
- Array of all reported DTCs on module. Each DTC is represented with 4 bytes:
- 3 bytes for data
- 1 byte for status
- </description>
- </param>
- </function>
- <function name="DiagnosticMessage" messagetype="request" provider="hmi">
- <description>Non periodic vehicle diagnostic request</description>
- <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of target ECU.</description>
- </param>
- <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Length of message (in bytes).</description>
- </param>
- <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message.
- </description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- </function>
- <function name="DiagnosticMessage" messagetype="response">
- <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message result.
- </description>
- </param>
- </function>
- <function name="SubscribeVehicleData" messagetype="request">
- <description>
- Subscribes for specific published data items.
- The data will be only sent if it has changed.
- The application will be notified by the onVehicleData notification whenever new data is available.
- To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
- </description>
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="SubscribeVehicleData" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Common.VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="UnsubscribeVehicleData" messagetype="request">
- <description>
- This function is used to unsubscribe the notifications from the subscribeVehicleData function.
- </description>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application that requested this RPC.</description>
- </param>
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="UnsubscribeVehicleData" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Common.VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
- </function>
- <function name="GetVehicleData" messagetype="request">
- <description>Non periodic vehicle data read request.</description>
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="Boolean" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including ignition status and internal temp</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="GetVehicleData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="Common.PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="OnVehicleData" messagetype="notification">
- <description>Callback for the periodic and non periodic vehicle data read function.</description>
- <param name="gps" type="Common.GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number.</description>
- </param>
- <param name="prndl" type="Common.PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Common.TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Common.MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--Qt HMI version of GetVehicleData-->
- <function name="GetGpsData" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetGpsData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="response">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="response">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="response">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="GetVin" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="response">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="response">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="response">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="GetECallInfo" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="request" provider="hmi">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="response">
- <param name="myKey" type="Common.MyKey" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of GetVehicleData-->
- <!--Qt HMI version of OnVehicleData-->
- <function name="OnGpsData" messagetype="notification" provider="hmi">
- <param name="gps" type="Common.GPSData" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="OnSpeed" messagetype="notification" provider="hmi">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="OnRpm" messagetype="notification" provider="hmi">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="OnFuelLevel" messagetype="notification" provider="hmi">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="OnFuelLevelState" messagetype="notification" provider="hmi">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="OnInstantFuelConsumption" messagetype="notification" provider="hmi">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="OnExternalTemperature" messagetype="notification" provider="hmi">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="OnVin" messagetype="notification" provider="hmi">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number.</description>
- </param>
- </function>
- <function name="OnPrndl" messagetype="notification" provider="hmi">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="OnTirePressure" messagetype="notification" provider="hmi">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="OnOdometer" messagetype="notification" provider="hmi">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="OnBeltStatus" messagetype="notification" provider="hmi">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="OnBodyInformation" messagetype="notification" provider="hmi">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="OnDeviceStatus" messagetype="notification" provider="hmi">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="OnDriverBraking" messagetype="notification" provider="hmi">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="OnWiperStatus" messagetype="notification" provider="hmi">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="OnHeadLampStatus" messagetype="notification" provider="hmi">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="OnEngineTorque" messagetype="notification" provider="hmi">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="OnAccPedalPosition" messagetype="notification" provider="hmi">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="OnSteeringWheelAngle" messagetype="notification" provider="hmi">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnECallInfo" messagetype="notification" provider="hmi">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnAirbagStatus" messagetype="notification" provider="hmi">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnEmergencyEvent" messagetype="notification" provider="hmi">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnClusterModeStatus" messagetype="notification" provider="hmi">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="OnMyKey" messagetype="notification" provider="hmi">
- <param name="myKey" type="Common.MyKey" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of OnVehicleData-->
- <!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- <function name="SubscribeGps" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="UnsubscribeGps" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
- </param>
- </function>
- <function name="SubscribeSpeed" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- </function>
- <function name="SubscribeRpm" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="UnsubscribeRpm" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- </function>
- <function name="SubscribeFuelLevel" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
- </param>
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- </function>
- <function name="SubscribeExternalTemperature" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
- <function name="SubscribePrndl" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="UnsubscribePrndl" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
- </param>
- </function>
- <function name="SubscribeVin" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="UnsubscribeVin" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
- <function name="SubscribeTirePressure" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
- </param>
- </function>
- <function name="SubscribeOdometer" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
- </param>
- </function>
- <function name="SubscribeBeltStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
- </param>
- </function>
- <function name="SubscribeBodyInformation" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
- </param>
- </function>
- <function name="SubscribeDeviceStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
- </param>
- </function>
- <function name="SubscribeDriverBraking" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
- </param>
- </function>
- <function name="SubscribeWiperStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
- </param>
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
- </param>
- </function>
- <function name="SubscribeEngineTorque" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- </function>
- <function name="SubscribeECallInfo" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- </function>
- <function name="SubscribeAirbagStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
- </param>
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
- </param>
- </function>
- <function name="SubscribeMyKey" messagetype="request" provider="hmi">
- </function>
- <function name="SubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="request" provider="hmi">
- </function>
- <function name="UnsubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
- </param>
- </function>
- <!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- </interface>
- <!-- Policies -->
- <interface name="SDL" version="1.0" date="2014-03-12">
- <function name="ActivateApp" messagetype="request" provider="sdl">
- <param name="appID" type="Integer" mandatory="true">
- </param>
- </function>
- <function name="ActivateApp" messagetype="response">
- <param name="isSDLAllowed" type="Boolean" mandatory="true" scope="internal"/>
- <param name="device" type="Common.DeviceInfo" mandatory="false" scope="internal">
- <description>If isSDLAllowed is false, consent for sending PT through specified device is required.</description>
- </param>
- <param name="isPermissionsConsentNeeded" type="Boolean" mandatory="true"/>
- <param name="isAppPermissionsRevoked" type="Boolean" mandatory="true"/>
- <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
- </param>
- <param name="isAppRevoked" type="Boolean" mandatory="true"/>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- </function>
- <function name="GetUserFriendlyMessage" messagetype="request" scope="internal" provider="sdl">
- <description>Request from HMI to SDL to get user friendly messages for UI/TTS info boxes/texts (i.e. for help/dialogs etc) from Policy Table.</description>
- <param name="messageCodes" type="String" array="true" minsize="1" maxsize="100" maxlength="500" mandatory="true">
- <description>Id of message to be received according to Policy Table i.e. StatusNeeded, Notifications, DrivingCharacteristics etc.</description>
- </param>
- <param name="language" type="Common.Language" mandatory="false">
- <description>Optional parameter if HMI wants message in some other language then its current one already known to SDL.</description>
- </param>
- </function>
- <function name="GetUserFriendlyMessage" messagetype="response">
- <param name="messages" type="Common.UserFriendlyMessage" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If no message was found in PT for specified message code and for HMI current or specified language, this parameter will be omitted.</description>
- </param>
- </function>
- <function name="OnAllowSDLFunctionality" messagetype="notification" provider="hmi">
- <description>Initiated by HMI. Notifies about user/HMI allowing SDL functionality or disallowing access to all mobile apps. Needed if HMI has additional ways of asking user about this (i.e. Settings etc)</description>
- <param name="device" type="Common.DeviceInfo" mandatory="false">
- <description>If no device is specified permission counts for SDL functionality in general.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="true">
- <description>Must be true if allowed</description>
- </param>
- <param name="source" type="Common.ConsentSource" mandatory="true"/>
- </function>
- <!-- SyncP RPC-->
- <function name="OnReceivedPolicyUpdate" messagetype="notification" provider="hmi">
- <description>
- From: SYNCP Manager
- To: SDL
- Notification sent to SDL when SYNCP Manager receives and decrypts updated policy table
- </description>
- <param name="policyfile" type="String" minlength="1" maxlength="255" mandatory="true">
- <description>Location of decrypted policy table Json file on target</description>
- </param>
- </function>
- <function name="OnPolicyUpdate" messagetype="notification" provider="hmi">
- <description>
- From: SYNCP Manager
- To: SDL
- Notifies SDL to supply a new "PolicyUpdate" request with more recent snapshot data
- </description>
- </function>
- <!-- End of SyncP RPC-->
- <function name="GetListOfPermissions" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to get list of permissions for app. If no app specified - list of permissions for all apps.</description>
- <param name="appID" type="Integer" mandatory="false"/>
- </function>
- <function name="GetListOfPermissions" messagetype="response">
- <param name="allowedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="0" maxsize="100">
- <description>If no permissions were specified for application the array will come empty.</description>
- </param>
- </function>
- <function name="OnAppPermissionConsent" messagetype="notification" provider="hmi">
- <description>Initiated by HMI for specifying the allowance for the application to perform some functionality. Duplicates functionality of the request, needed if HMI has specific ways to allow/disallow functionality (i.e.Setting Menu)</description>
- <param name="appID" type="Integer" mandatory="false">
- <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
- </param>
- <param name="consentedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="1" maxsize="100">
- </param>
- <param name="source" type="Common.ConsentSource" mandatory="true"/>
- </function>
- <function name="OnAppPermissionChanged" messagetype="notification" provider="sdl">
- <description>Notification from SDL to HMI. Occurs when app permissions were reduced. If no permission specified means that app was dissallowed and has to be unregitstered.</description>
- <param name="appID" type="Integer" mandatory="true"/>
- <param name="isAppPermissionsRevoked" type="Boolean" mandatory="false"/>
- <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
- <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
- </param>
- <param name="appRevoked" type="Boolean" mandatory="false">
- <description>If present then specified application was prohibited to used with Sync.</description>
- </param>
- <param name="appPermissionsConsentNeeded" type="Boolean" mandatory="false">
- <description>If present specifies that permissions were added to application that require User Consent, then HMI can send GetListOfPermissions request to obtain list of permissions.</description>
- </param>
- <param name="appUnauthorized" type="Boolean" mandatory="false">
- <description>When present and set to true (should be if present) then this means that application was not authorized (nickname check failed.)</description>
- </param>
- <param name="priority" type="Common.AppPriority" mandatory="false">
- <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
- </param>
- <param name="requestType" type="Common.RequestType" minsize="0" maxsize="100" array="true" mandatory="false">
- <description>The list of SystemRequest's RequestTypes allowed by policies for the named application (the app's SystemRequest sent with RequestType out of this list will get 'disallowed' response from SDL).
- If SDL sends an empty array - any RequestType is allowed for this app.
- If SDL omits this parameter - nothing is changed for RequestType in the policies
- </description>
- </param>
- </function>
- <function name="OnSDLConsentNeeded" messagetype="notification" provider="sdl">
- <description>Send from SDL to HMI to notify that data consent is needed for device either because PT update or Retry strategy.</description>
- <param name="device" type="Common.DeviceInfo" mandatory="true"/>
- </function>
- <function name="UpdateSDL" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to start update of Policy Table.</description>
- </function>
- <function name="UpdateSDL" messagetype="response">
- <description>Specify result: no update needed, update was successful/unsuccessful etc</description>
- <param name="result" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="GetStatusUpdate" messagetype="request" provider="sdl">
- <description>Request from HMI to SDL to find out current status of PT exchange process.</description>
- </function>
- <function name="GetStatusUpdate" messagetype="response">
- <param name="status" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="OnStatusUpdate" messagetype="notification" provider="sdl">
- <description>Notification from SDL to HMI when current status of PT exchange changed (i.e. it Succeded or Failed etc)</description>
- <param name="status" type="Common.UpdateResult" mandatory="true"/>
- </function>
- <function name="OnSystemError" messagetype="notification" provider="hmi">
- <param name="error" type="Common.SystemError" mandatory="true"/>
- </function>
- <function name="AddStatisticsInfo" messagetype="notification" provider="hmi">
- <description>Sent by system to record statiscs and error counts. Increases statistics specified by statisticType by one.</description>
- <param name="statisticType" type="Common.StatisticsType" mandatory="true"/>
- </function>
- <function name="GetURLS" messagetype="request" scope="internal" provider="sdl">
- <description>Sent by system to SDL to get list of URL for specified service type and optionally policy's application id.</description>
- <param name="service" type="Integer" minvalue="0" maxvalue="100" mandatory="true"/>
- </function>
- <function name="GetURLS" messagetype="response" scope="internal">
- <param name="urls" type="Common.ServiceInfo" array="true" mandatory="false" minsize="1" maxsize="100"/>
- </function>
- <function name="OnDeviceStateChanged" messagetype="notification" scope="internal" provider="hmi">
- <param name="deviceState" type="Common.DeviceState" mandatory="true"/>
- <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500"/>
- <param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
- </function>
- </interface>
-<interface name="RC" version="1.1.0" date="2017-07-18">
- <function name="IsReady" messagetype="request">
- <description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description>
- </function>
- <function name="IsReady" messagetype="response">
- <param name="available" type="Boolean" mandatory="true">
- <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description>
- </param>
- </function>
-
- <function name="GetCapabilities" messagetype="request">
- <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description>
- </function>
- <function name="GetCapabilities" messagetype="response">
- <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
- <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description>
- </param>
- </function>
-
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- <description>The module type and data to set</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>Internal SDL-assigned ID of the related application</description>
- </param>
- </function>
-
- <function name="SetInteriorVehicleData" messagetype="response">
- <description>Used to set the values of one zone and one data type within that zone</description>
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- </param>
- </function>
-
-<function name="GetInteriorVehicleData" messagetype="request">
- <param name="moduleType" type="Common.ModuleType" mandatory="true" >
- <description>The module data to retrieve from the vehicle for that type</description>
- </param>
- <param name="subscribe" type="Boolean" mandatory="false" defvalue="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">
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- </param>
- <param name="isSubscribed" type="Boolean" mandatory="false" >
- <description>Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
- if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription.
- if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.</description>
- </param>
-</function>
-
-<function name="GetInteriorVehicleDataConsent" messagetype="request">
- <description>Sender: SDL->HMI. </description>
- <description>HMI is expected to display a permission prompt to the driver showing the RC module and app details (for example, app's name).
- The driver is expected to have an ability to grant or deny the permission.</description>
- <param name="moduleType" type="Common.ModuleType" mandatory="true">
- <description>The module type that the app requests to control.</description>
- </param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application that triggers the permission prompt.</description>
- </param>
- </function>
- <function name="GetInteriorVehicleDataConsent" messagetype="response">
- <param name="allowed" type="Boolean" mandatory="true">
- <description>"true" - if the driver grants the permission for controlling to the named app;
- "false" - in case the driver denies the permission for controlling to the named app.</description>
- </param>
-</function>
-
-<function name="OnInteriorVehicleData" messagetype="notification">
- <param name="moduleData" type="Common.ModuleData" mandatory="true" >
- </param>
-</function>
-
-<function name="OnRemoteControlSettings" messagetype="notification">
- <description>Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI.</description>
- <param name="allowed" type="Boolean" mandatory="false" >
- <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
- </param>
- <param name="accessMode" type="Common.RCAccessMode" mandatory="false" >
- <description>The remote control access mode specified by the driver via HMI.</description>
- </param>
-</function>
-</interface>
-</interfaces> \ No newline at end of file
diff --git a/src/components/media_manager/include/media_manager/media_adapter_impl.h b/src/components/media_manager/include/media_manager/media_adapter_impl.h
index 75c48c98b7..37401f9c2b 100644
--- a/src/components/media_manager/include/media_manager/media_adapter_impl.h
+++ b/src/components/media_manager/include/media_manager/media_adapter_impl.h
@@ -40,7 +40,7 @@
namespace media_manager {
-typedef utils::SharedPtr<MediaAdapterListener> MediaListenerPtr;
+typedef std::shared_ptr<MediaAdapterListener> MediaListenerPtr;
class MediaAdapterImpl : public MediaAdapter {
public:
@@ -57,7 +57,7 @@ class MediaAdapterImpl : public MediaAdapter {
DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
};
-typedef utils::SharedPtr<MediaAdapterImpl> MediaAdapterImplPtr;
+typedef std::shared_ptr<MediaAdapterImpl> MediaAdapterImplPtr;
} // namespace media_manager
diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
index 7fbd4f2f6f..749356e656 100644
--- a/src/components/media_manager/include/media_manager/media_manager_impl.h
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -86,10 +86,10 @@ class MediaManagerImpl : public MediaManager,
void set_mock_mic_listener(MediaListenerPtr media_listener);
void set_mock_mic_recorder(MediaAdapterImpl* media_adapter);
void set_mock_streamer(protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterImpl> mock_stream);
+ std::shared_ptr<MediaAdapterImpl> mock_stream);
void set_mock_streamer_listener(
protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterListener> mock_stream);
+ std::shared_ptr<MediaAdapterListener> mock_stream);
#endif // BUILD_TESTS
protected:
diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h
index 5ac8e05cac..56bf941f8e 100644
--- a/src/components/media_manager/include/media_manager/streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/streamer_adapter.h
@@ -37,8 +37,7 @@
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
-#include "utils/atomic_object.h"
-#include "utils/shared_ptr.h"
+#include <atomic>
#include "protocol/raw_message.h"
namespace media_manager {
@@ -80,7 +79,7 @@ class StreamerAdapter : public MediaAdapterImpl {
virtual bool Send(protocol_handler::RawMessagePtr msg) = 0;
private:
- sync_primitives::atomic_bool stop_flag_;
+ std::atomic_bool stop_flag_;
StreamerAdapter* adapter_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
@@ -96,7 +95,7 @@ class StreamerAdapter : public MediaAdapterImpl {
DISALLOW_COPY_AND_ASSIGN(StreamerAdapter);
};
-typedef utils::SharedPtr<StreamerAdapter> StreamerAdapterPtr;
+typedef std::shared_ptr<StreamerAdapter> StreamerAdapterPtr;
} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
index 5e9d6ab0ba..91e3c5465d 100644
--- a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
+++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
@@ -91,19 +91,19 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
if (application_key != current_application_) {
current_application_ = application_key;
- uint32_t device_id = 0;
+ transport_manager::DeviceHandle device_id = 0;
session_observer_.GetDataOnSessionKey(application_key, 0, NULL, &device_id);
- std::string mac_adddress;
- session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_adddress);
+ std::string mac_address;
+ session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_address);
- // TODO(PK): Convert mac_adddress to the
+ // TODO(PK): Convert mac_address to the
// following format : "bluez_source.XX_XX_XX_XX_XX_XX" if needed
// before passing to the A2DPSourcePlayerThread constructor
A2DPSourcePlayerThread* delegate =
- new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_adddress);
+ new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_address);
threads::Thread* new_activity =
- threads::CreateThread(mac_adddress.c_str(), delegate);
+ threads::CreateThread(mac_address.c_str(), delegate);
sources_[application_key] = Pair(new_activity, delegate);
new_activity->start();
}
diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
index 1aacbe4c28..23181e7431 100644
--- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
+++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
@@ -61,6 +61,15 @@ const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1000;
#endif
const uint32_t kMqueueMessageSize = 4095;
+// Size of RIFF header contained in a .wav file: 12 bytes for 'RIFF' chunk
+// descriptor, 24 bytes for 'fmt ' sub-chunk and 8 bytes for 'data' sub-chunk
+// header.
+// The correct format of audio stream for AudioPassThru feature is to include
+// only audio sample data. Since both pre-recorded file (audio.8bit.wav) and
+// GStreamer-generated file contain RIFF header, we will skip it when reading
+// the files.
+static const uint32_t kRIFFHeaderSize = 44;
+
CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
AudioStreamSenderThread::AudioStreamSenderThread(
@@ -69,7 +78,7 @@ AudioStreamSenderThread::AudioStreamSenderThread(
application_manager::ApplicationManager& app_mngr)
: session_key_(session_key)
, fileName_(fileName)
- , offset_(0)
+ , offset_(kRIFFHeaderSize)
, shouldBeStoped_(false)
, shouldBeStoped_lock_()
, shouldBeStoped_cv_()
@@ -82,7 +91,7 @@ AudioStreamSenderThread::~AudioStreamSenderThread() {}
void AudioStreamSenderThread::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
- offset_ = 0;
+ offset_ = kRIFFHeaderSize;
while (false == getShouldBeStopped()) {
AutoLock auto_lock(shouldBeStoped_lock_);
@@ -125,7 +134,7 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() {
}
#if !defined(EXTENDED_MEDIA_MODE)
// without recording stream restart reading 1-sec file
- offset_ = 0;
+ offset_ = kRIFFHeaderSize;
#endif
}
@@ -145,7 +154,7 @@ void AudioStreamSenderThread::SendAudioPassThroughNotification(
data.binary_data = binary_data;
smart_objects::SmartObjectSPtr on_audio_pass =
- new smart_objects::SmartObject();
+ std::make_shared<smart_objects::SmartObject>();
if (!on_audio_pass) {
LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer");
diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
index 99548e71bd..5c12614662 100644
--- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
+++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
@@ -42,6 +42,9 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
GMainLoop* FromMicToFileRecorderThread::loop = NULL;
+// As per spec, AudioPassThru recording is in monaural
+static const int kNumAudioChannels = 1;
+
FromMicToFileRecorderThread::FromMicToFileRecorderThread(
const std::string& output_file, int32_t duration)
: threads::ThreadDelegate()
@@ -119,7 +122,8 @@ void FromMicToFileRecorderThread::threadMain() {
initArgs();
GstElement* pipeline;
- GstElement* alsasrc, *wavenc, *filesink;
+ GstElement* alsasrc, *audioconvert, *capsfilter, *wavenc, *filesink;
+ GstCaps* audiocaps;
GstBus* bus;
const gchar* device = "hw:0,0";
@@ -196,11 +200,18 @@ void FromMicToFileRecorderThread::threadMain() {
// Create all of the elements to be added to the pipeline
alsasrc = gst_element_factory_make("alsasrc", "alsasrc0");
+ audioconvert = gst_element_factory_make("audioconvert", "audioconvert0");
+ capsfilter = gst_element_factory_make("capsfilter", "filter0");
wavenc = gst_element_factory_make("wavenc", "wavenc0");
filesink = gst_element_factory_make("filesink", "filesink0");
+ // create a capability to downmix the recorded audio to monaural
+ audiocaps = gst_caps_new_simple(
+ "audio/x-raw", "channels", G_TYPE_INT, kNumAudioChannels, NULL);
+
// Assert that all the elements were created
- if (!alsasrc || !wavenc || !filesink) {
+ if (!alsasrc || !audioconvert || !capsfilter || !wavenc || !filesink ||
+ !audiocaps) {
g_error("Failed creating one or more of the pipeline elements.\n");
}
@@ -209,10 +220,21 @@ void FromMicToFileRecorderThread::threadMain() {
g_object_set(G_OBJECT(filesink), "location", outfile, NULL);
// Add the elements to the pipeline
- gst_bin_add_many(GST_BIN(pipeline), alsasrc, wavenc, filesink, NULL);
+ gst_bin_add_many(GST_BIN(pipeline),
+ alsasrc,
+ audioconvert,
+ capsfilter,
+ wavenc,
+ filesink,
+ NULL);
// Link the elements
- gst_element_link_many(alsasrc, wavenc, filesink, NULL);
+ gst_element_link_many(
+ alsasrc, audioconvert, capsfilter, wavenc, filesink, NULL);
+
+ // set the capability
+ g_object_set(G_OBJECT(capsfilter), "caps", audiocaps, NULL);
+ gst_caps_unref(audiocaps);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index 6a9ded9029..ec88e910d3 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -98,13 +98,13 @@ void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) {
void MediaManagerImpl::set_mock_streamer(
protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterImpl> mock_stream) {
+ std::shared_ptr<MediaAdapterImpl> mock_stream) {
streamer_[stype] = mock_stream;
}
void MediaManagerImpl::set_mock_streamer_listener(
protocol_handler::ServiceType stype,
- ::utils::SharedPtr<MediaAdapterListener> mock_stream) {
+ std::shared_ptr<MediaAdapterListener> mock_stream) {
streamer_listener_[stype] = mock_stream;
}
@@ -120,29 +120,36 @@ void MediaManagerImpl::Init() {
#endif
if ("socket" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new SocketVideoStreamerAdapter(
- settings().server_address(), settings().video_streaming_port());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<SocketVideoStreamerAdapter>(
+ settings().server_address(), settings().video_streaming_port());
} else if ("pipe" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new PipeVideoStreamerAdapter(
- settings().named_video_pipe_path(), settings().app_storage_folder());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<PipeVideoStreamerAdapter>(
+ settings().named_video_pipe_path(),
+ settings().app_storage_folder());
} else if ("file" == settings().video_server_type()) {
- streamer_[ServiceType::kMobileNav] = new FileVideoStreamerAdapter(
- settings().video_stream_file(), settings().app_storage_folder());
+ streamer_[ServiceType::kMobileNav] =
+ std::make_shared<FileVideoStreamerAdapter>(
+ settings().video_stream_file(), settings().app_storage_folder());
}
if ("socket" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new SocketAudioStreamerAdapter(
- settings().server_address(), settings().audio_streaming_port());
+ streamer_[ServiceType::kAudio] =
+ std::make_shared<SocketAudioStreamerAdapter>(
+ settings().server_address(), settings().audio_streaming_port());
} else if ("pipe" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new PipeAudioStreamerAdapter(
+ streamer_[ServiceType::kAudio] = std::make_shared<PipeAudioStreamerAdapter>(
settings().named_audio_pipe_path(), settings().app_storage_folder());
} else if ("file" == settings().audio_server_type()) {
- streamer_[ServiceType::kAudio] = new FileAudioStreamerAdapter(
+ streamer_[ServiceType::kAudio] = std::make_shared<FileAudioStreamerAdapter>(
settings().audio_stream_file(), settings().app_storage_folder());
}
- streamer_listener_[ServiceType::kMobileNav] = new StreamerListener(*this);
- streamer_listener_[ServiceType::kAudio] = new StreamerListener(*this);
+ streamer_listener_[ServiceType::kMobileNav] =
+ std::make_shared<StreamerListener>(*this);
+ streamer_listener_[ServiceType::kAudio] =
+ std::make_shared<StreamerListener>(*this);
if (streamer_[ServiceType::kMobileNav]) {
streamer_[ServiceType::kMobileNav]->AddListener(
@@ -187,8 +194,8 @@ void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key,
std::string file_path = settings().app_storage_folder();
file_path += "/";
file_path += output_file;
- from_mic_listener_ =
- new FromMicRecorderListener(file_path, application_manager_);
+ from_mic_listener_ = std::make_shared<FromMicRecorderListener>(
+ file_path, application_manager_);
#ifdef EXTENDED_MEDIA_MODE
if (from_mic_recorder_) {
from_mic_recorder_->AddListener(from_mic_listener_);
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
index 80b2ee3377..96499d9358 100644
--- a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
@@ -44,10 +44,9 @@ using namespace media_manager;
class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl {
public:
- MOCK_METHOD1(AddListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
+ MOCK_METHOD1(AddListener, void(const std::shared_ptr<MediaAdapterListener>&));
MOCK_METHOD1(RemoveListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
+ void(const std::shared_ptr<MediaAdapterListener>&));
MOCK_METHOD2(SendData,
void(int32_t application_key,
const ::protocol_handler::RawMessagePtr message));
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc
index a9dc27d7a3..c77c984a75 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -44,8 +44,7 @@
#include "application_manager/state_controller.h"
#include "protocol_handler/mock_protocol_handler.h"
#include "protocol/common.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
+
#include "utils/file_system.h"
#include "utils/scope_guard.h"
@@ -58,7 +57,7 @@ using namespace ::media_manager;
using ::testing::_;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::utils::SharedPtr;
+
using ::utils::ScopeGuard;
using ::utils::MakeGuard;
using ::testing::NiceMock;
@@ -99,20 +98,18 @@ void dealloc_file(std::ofstream* test_file) {
} // namespace
typedef NiceMock<application_manager_test::MockApplication> MockApp;
-typedef SharedPtr<MockApp> MockAppPtr;
-typedef SharedPtr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
+typedef std::shared_ptr<MockApp> MockAppPtr;
+typedef std::shared_ptr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
class MediaManagerImplTest : public ::testing::Test {
public:
- // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
- MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) {
- media_adapter_listener_mock_ =
- utils::MakeShared<MockMediaAdapterListener>();
+ MediaManagerImplTest() {
+ media_adapter_listener_mock_ = std::make_shared<MockMediaAdapterListener>();
ON_CALL(mock_media_manager_settings_, video_server_type())
.WillByDefault(ReturnRef(kDefaultValue));
ON_CALL(mock_media_manager_settings_, audio_server_type())
.WillByDefault(ReturnRef(kDefaultValue));
- mock_app_ = ::utils::MakeShared<MockApp>();
+ mock_app_ = std::make_shared<MockApp>();
media_manager_impl_.reset(
new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
}
@@ -181,7 +178,7 @@ class MediaManagerImplTest : public ::testing::Test {
.WillOnce(Return(mock_app_));
EXPECT_CALL(*mock_app_, WakeUpStreaming(service_type));
MockMediaAdapterImplPtr mock_media_streamer =
- utils::MakeShared<MockMediaAdapterImpl>();
+ std::make_shared<MockMediaAdapterImpl>();
media_manager_impl_->set_mock_streamer(service_type, mock_media_streamer);
media_manager_impl_->set_mock_streamer_listener(
service_type, media_adapter_listener_mock_);
@@ -204,11 +201,10 @@ class MediaManagerImplTest : public ::testing::Test {
application_manager_test::MockApplicationManager app_mngr_;
MockAppPtr mock_app_;
- SharedPtr<MockMediaAdapterListener> media_adapter_listener_mock_;
- MockMediaAdapter* media_adapter_mock_;
+ std::shared_ptr<MockMediaAdapterListener> media_adapter_listener_mock_;
const ::testing::NiceMock<MockMediaManagerSettings>
mock_media_manager_settings_;
- SharedPtr<MediaManagerImpl> media_manager_impl_;
+ std::shared_ptr<MediaManagerImpl> media_manager_impl_;
};
TEST_F(MediaManagerImplTest,
@@ -277,14 +273,17 @@ TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) {
}
TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) {
- media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
- EXPECT_CALL(*media_adapter_mock_, StartActivity(kApplicationKey));
+ // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
+ MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
+ EXPECT_CALL(*media_adapter_mock, StartActivity(kApplicationKey));
media_manager_impl_->PlayA2DPSource(kApplicationKey);
}
TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) {
- media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
- EXPECT_CALL(*media_adapter_mock_, StopActivity(kApplicationKey));
+ MockMediaAdapter* media_adapter_mock = new MockMediaAdapter();
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock);
+ EXPECT_CALL(*media_adapter_mock, StopActivity(kApplicationKey));
media_manager_impl_->StopA2DPSource(kApplicationKey);
}
@@ -375,11 +374,11 @@ TEST_F(MediaManagerImplTest, StopMicrophoneRecording_SUCCESS) {
TEST_F(MediaManagerImplTest,
StartStopStreaming_AudioAndVideoServiceType_SUCCESS) {
MockMediaAdapterImplPtr mock_audio_media_streamer =
- utils::MakeShared<MockMediaAdapterImpl>();
+ std::make_shared<MockMediaAdapterImpl>();
media_manager_impl_->set_mock_streamer(ServiceType::kAudio,
mock_audio_media_streamer);
MockMediaAdapterImplPtr mock_nav_media_streamer =
- utils::MakeShared<MockMediaAdapterImpl>();
+ std::make_shared<MockMediaAdapterImpl>();
media_manager_impl_->set_mock_streamer(ServiceType::kMobileNav,
mock_nav_media_streamer);
diff --git a/src/components/policy/policy_external/.gitignore b/src/components/policy/policy_external/.gitignore
index d67909069a..d6052d61da 100644
--- a/src/components/policy/policy_external/.gitignore
+++ b/src/components/policy/policy_external/.gitignore
@@ -29,8 +29,6 @@ src/appMain/hmi_link
src/appMain/smartDeviceLinkCore
test/components/application_manager/policies_manager/test_policies_table
test/components/application_manager/test_formatters_commands
-test/components/dbus/test_DBusAdapter
-test/components/dbus/test_DBusSchema
test/components/protocol_handler/test_ProtocolHandler
test/components/request_watchdog/test_RequestWatchdog
test/components/smart_objects/SchemaItem/test_SmartObject_AlwaysFalseSchemaItemTest
diff --git a/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..0144efaf7f 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -1,9 +1,9 @@
-/*! \page components_jsonhandler_formatters Smart Objects Formatters
+/*! \page components_jsonhandler_formatters Smart Objects formatters
In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
-The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+The interface of formatter is quite simple and defined by ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class. Actually it has two methods - ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
-Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+Current implementation has two different implementations of ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class: ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
index 6505ae6f43..2c23555902 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
@@ -1,11 +1,11 @@
/*! \page components_smartobjects_types_repr Type value representation methods for SmartObjects
-As alternative to the type casts NsSmartDeviceLink::NsSmartObjects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
+As alternative to the type casts ns_smart_device_link::ns_smart_objects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
Example:
<pre>
-NsSmartDeviceLink::NsSmartObjects::CSmartObject obj;
+ns_smart_device_link::ns_smart_objects::CSmartObject obj;
obj[0] = 1;
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
index 2e611f74b9..a031e9fd86 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
@@ -1,25 +1,25 @@
/*! \page components_smartobjects_validation_items Schema structure: Schema Items
-In order to create new Schema (new object of class NsSmartDeviceLink::NsSmartObjects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
+In order to create new Schema (new object of class ns_smart_device_link::ns_smart_objects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
-Schema Items are represented as class hierarchy. The base class for all schema items is a NsSmartDeviceLink::NsSmartObjects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
+Schema Items are represented as class hierarchy. The base class for all schema items is a ns_smart_device_link::ns_smart_objects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
-To define special elements with always successful or always failing validation there are two special Schema Items: NsSmartDeviceLink::NsSmartObjects::CAlwaysTrueSchemaItem and NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem.
+To define special elements with always successful or always failing validation there are two special Schema Items: ns_smart_device_link::ns_smart_objects::CAlwaysTrueSchemaItem and ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem.
-NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
+ns_smart_device_link::ns_smart_objects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
-NsSmartDeviceLink::NsSmartObjects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
+ns_smart_device_link::ns_smart_objects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
-NsSmartDeviceLink::NsSmartObjects::TEnumSchemaItem is used to verify any custom client-defined enum.
+ns_smart_device_link::ns_smart_objects::TEnumSchemaItem is used to verify any custom client-defined enum.
-NsSmartDeviceLink::NsSmartObjects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
+ns_smart_device_link::ns_smart_objects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
-NsSmartDeviceLink::NsSmartObjects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
+ns_smart_device_link::ns_smart_objects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
-NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
+ns_smart_device_link::ns_smart_objects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
After creation of all required Schema Items (which is actually bind in the tree) it is possible to create Schema.
-Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem::SMember class). So every root item (NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
+Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by ns_smart_device_link::ns_smart_objects::CObjectSchemaItem::SMember class). So every root item (ns_smart_device_link::ns_smart_objects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
and pass root Schema Item as initial parameter to the new Schema.
@@ -77,21 +77,21 @@ schemaMembersMap["info"] = CObjectSchemaItem::SMember(info_SchemaItem, false);
std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
-paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+paramsMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
-rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap), true);
+rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap), true);
-rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap), true);
+rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap), true);
CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
index a02f0be4bd..c651af5294 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
@@ -1,9 +1,9 @@
/*! \page components_smartobjects_validation_use Using Schema for validation
-The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
+The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using ns_smart_device_link::ns_smart_objects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
-Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
+Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using ns_smart_device_link::ns_smart_objects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
-To "unapply" modifications done by apply feature Schema has NsSmartDeviceLink::NsSmartObjects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
+To "unapply" modifications done by apply feature Schema has ns_smart_device_link::ns_smart_objects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
index 2ba273e9d4..dab3df104d 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_connection_management Connection Management
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
- * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDeviceListener()
* in order to receive notifications.
- * To connect remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::connectDevice(). It will initiate connections to all
+ * To connect remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::connectDevice(). It will initiate connections to all
* applications running on remove device. For TCP device this call has no effect as TCP connections are initiated by remote devices.
- * Client will be notified about each connected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationConnected().
- * To disconnect all applications running on remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::disconnectDevice().
- * Client will be notified about each disconnected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationDisconnected().
+ * Client will be notified about each connected application with ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onApplicationConnected().
+ * To disconnect all applications running on remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::disconnectDevice().
+ * Client will be notified about each disconnected application with ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onApplicationDisconnected().
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
index 98dd7426be..831a0c7818 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_data_transfer Data Transfer
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener
- * interface and add itself as a data listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDataListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener
+ * interface and add itself as a data listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDataListener()
* in order to receive notifications.
- * To send frame to remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::sendFrame() poviding connection handle,
+ * To send frame to remote device client must use ns_smart_device_link::ns_transport_manager::ITransportManager::sendFrame() poviding connection handle,
* frame data, data size and user data. User data is an integer that is assigned to a frame and will be sent back to client when sending of frame
* will be completed. Client may use this data to identify frame when send result will be reported. When sending of frame is completed
- * client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
- * device client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameReceived().
+ * client is notified via ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
+ * device client is notified via ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener::onFrameReceived().
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
index eb5f3e477e..4b5b63bf87 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_client_device_management Device Management
*
- * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
- * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * As all requests to TransportManager are asynchronous, client must implement ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with ns_smart_device_link::ns_transport_manager::ITransportManager::addDeviceListener()
* in order to receive notifications.
- * Client of TransportManager may use NsSmartDeviceLink::NsTransportManager::ITransportManager::scanForNewDevices()
+ * Client of TransportManager may use ns_smart_device_link::ns_transport_manager::ITransportManager::scanForNewDevices()
* to initiate device scan on all device adapters that support this feature. In order to get list of available
- * devices client must override NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onDeviceListUpdated().
+ * devices client must override ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener::onDeviceListUpdated().
* Each device adapter will perform scan independently from other device adapters and device list might be updated
* several times (after each adapter that supports scanning finishes scanning operation). Device list might also be
* updated without device scan request, e.g. if new client connects via TCP this device will be added to device list
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
index 8916dbeb55..d4d0efeb7b 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
@@ -3,12 +3,12 @@
This chapter describes details of correct use of Transport Manager on the client side. In other words this chapter can be called "How to create effective and safe client of Transport Manager".
Transport Manager defines set of asynchronous requests (means that operations are non-blocking in the calling thread) and provides two different interfaces to monitor asynchronous responses and notifications about data update.
-Clients of Transport Manager should use NsSmartDeviceLink::NsTransportManager::ITransportManager interface to initiate any request to the component.
+Clients of Transport Manager should use ns_smart_device_link::ns_transport_manager::ITransportManager interface to initiate any request to the component.
Also Transport Manager provides two different interfaces:
-1) NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
+1) ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
-2) NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
+2) ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
For more information about typical use of Transport Manager please read the following topics:
- \subpage components_transportmanager_client_device_management "Device Management"
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
index 970aeffd83..eb5de23e35 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
@@ -1,18 +1,18 @@
/** @page components_transportmanager_internal_design_transport_adapters_bluetooth_adapter Bluetooth Adapter
*
* Bluetooth adapter handles communication with external devices via bluetooth. It is implemented in
- * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter.
+ * ns_smart_device_link::ns_transport_manager::CBluetoothAdapter.
*
* @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_discovery Device discovery
*
- * When requested by a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::scanForNewDevices() bluetooth adapter
+ * When requested by a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::scanForNewDevices() bluetooth adapter
* searches for bluetooth devices. For each found device it runs SDP query for service with SmartDeviceLink UUID
* (936DA01F-9ABD-4D9D-80C7-02AF85C822A8). Devices that support this service are added to bluetooth adapter device list.
* Bluetooth device scans are performed only when explicitly requested.
*
* @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_connecting_devices Connecting devices
*
- * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
+ * ns_smart_device_link::ns_transport_manager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
* and fills connection list with connections to all RFCOMM channels on remote device where SmartDeviceLink service has been discovered.
*
* @see @ref components_transportmanager_internal_design_transport_adapters_common_connecting_devices
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
index d81b70dfe8..2fbd835ec9 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
@@ -1,11 +1,11 @@
/** @page components_transportmanager_internal_design_transport_adapters_tcp_adapter TCP Adapter
*
* TCP adapter handles communication with remote devices via TCP/IP socket. It is implemented in
- * NsSmartDeviceLink::NsTransportManager::CTCPAdapter.
+ * ns_smart_device_link::ns_transport_manager::CTCPAdapter.
*
* @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_listen Listening for connections
*
- * TCP adapter creates listening TCP socket (TCP port is specified in NsSmartDeviceLink::NsTransportManager::CTCPAdapter::cTCPAdapterPort)
+ * TCP adapter creates listening TCP socket (TCP port is specified in ns_smart_device_link::ns_transport_manager::CTCPAdapter::cTCPAdapterPort)
* and listens for incoming connections. Devices are identified by their IP address.
*
* @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_accept Accepting connection
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
index 3a5d0f0e91..015978b773 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
@@ -4,80 +4,80 @@
*
* @section components_transportmanager_internal_design_transport_adapters_common Common logic
*
- * Logic common to all device adapters is implemented in class NsSmartDeviceLink::NsTransportManager::CTransportAdapter.
+ * Logic common to all device adapters is implemented in class ns_smart_device_link::ns_transport_manager::CTransportAdapter.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_devices_map Devices map
*
- * Devices map is a map of device handle to internal device structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SDevice.
- * Devices map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevices. Any access to this map must be performed
- * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevicesMutex locked.
+ * Devices map is a map of device handle to internal device structure ns_smart_device_link::ns_transport_manager::CTransportAdapter::SDevice.
+ * Devices map is stored in ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDevices. Any access to this map must be performed
+ * with ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDevicesMutex locked.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connections_map Connections map
*
- * Connections map is a map of connection handle to internal connection structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection.
- * Connections map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnections. Any access to this map must be performed
- * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnectionsMutex locked.
+ * Connections map is a map of connection handle to internal connection structure ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection.
+ * Connections map is stored in ns_smart_device_link::ns_transport_manager::CTransportAdapter::mConnections. Any access to this map must be performed
+ * with ns_smart_device_link::ns_transport_manager::CTransportAdapter::mConnectionsMutex locked.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_main_thread Device adapter main thread
*
- * Device adapter main thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::run().
- * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mainThread()
+ * Device adapter main thread is started in ns_smart_device_link::ns_transport_manager::CTransportAdapter::run().
+ * Specific device adapter must implement virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::mainThread()
* and implement its specific main thread logic there.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connection_thread Device adapter connection thread
*
- * Device adapter connection thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection().
- * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectionThread()
+ * Device adapter connection thread is started in ns_smart_device_link::ns_transport_manager::CTransportAdapter::startConnection().
+ * Specific device adapter must implement virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::connectionThread()
* and implement its specific connection thread logic there. When connection is established and socket file descriptor is set
- * in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() to handle all communication through this socket
+ * in ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::handleCommunication() to handle all communication through this socket
* until connection is terminated.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_threads_termination Termination of device adapter threads
*
- * Specific device adapter implementation must call in its destructor NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForThreadsTermination()
+ * Specific device adapter implementation must call in its destructor ns_smart_device_link::ns_transport_manager::CTransportAdapter::waitForThreadsTermination()
* to wait for termination of all threads (main thread and connection threads). Device adapter threads must be terminated before specific
* device adapter class is destructed, so it can't be called in the destructor of base class and must be called explicitly from the inherited
* class's destructor.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_device_scan Requesting scan for new devices
*
- * Device scan is requested by setting flag NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequested
- * and signaling conditional variable NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
+ * Device scan is requested by setting flag ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDeviceScanRequested
+ * and signaling conditional variable ns_smart_device_link::ns_transport_manager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
* by specific device adapter if it supports device scanning. Specific device adaptere may call for this purpose
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
* until it's signaled or specified timeout expires.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_connecting_devices Connecting devices
*
- * Device connection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectDevice().
- * This method calls virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::createConnectionsListForDevice()
+ * Device connection is initiated with a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::connectDevice().
+ * This method calls virtual function ns_smart_device_link::ns_transport_manager::CTransportAdapter::createConnectionsListForDevice()
* which may be implemented by specific device adapter to create a list of connections that must be established for the device.
- * For each connection created by device adapter it calls NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection()
+ * For each connection created by device adapter it calls ns_smart_device_link::ns_transport_manager::CTransportAdapter::startConnection()
* which adds connection to connections map and starts connection thread.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_disconnecting_devices Disconnecting devices
*
- * Device disconnection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::disconnectDevice().
+ * Device disconnection is initiated with a call to ns_smart_device_link::ns_transport_manager::CTransportAdapter::disconnectDevice().
* This method finds all connections in connections map that corresponds to specified device and calls
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::stopConnection() for each of them.
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::stopConnection() for each of them.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_handling_communication Handling communication
*
- * All frames requested to be sent via NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() are stored in
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mFramesToSend. Pipe
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() to notify connection thread that data is available
- * to be sent. NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
- * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() uses poll() to wait for
+ * All frames requested to be sent via ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() are stored in
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mFramesToSend. Pipe
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() to notify connection thread that data is available
+ * to be sent. ns_smart_device_link::ns_transport_manager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
+ * ns_smart_device_link::ns_transport_manager::CTransportAdapter::handleCommunication() uses poll() to wait for
* incoming data using connection socket file descriptor and outgoing data using file descriptor of the read end of this pipe.
* When either of them become available for reading or some error occurs (e.g. socket gets disconnected) connection thread
* wakes up and handles this event. Notification pipe is also used to notify connection thread that connection has to be
- * terminated using NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mTerminateFlag.
+ * terminated using ns_smart_device_link::ns_transport_manager::CTransportAdapter::SConnection::mTerminateFlag.
*
* @subsection components_transportmanager_internal_design_transport_adapters_common_update_client_device_list Updating client device list.
*
- * Specific device adapter may call NsSmartDeviceLink::NsTransportManager::CTransportAdapter::updateClientDeviceList() when its internal
+ * Specific device adapter may call ns_smart_device_link::ns_transport_manager::CTransportAdapter::updateClientDeviceList() when its internal
* knowledge about available devices is updated to notify device adapter client (TransportManager) about this update.
*
* @section components_transportmanager_internal_design_transport_adapters_common_specific Specific device adapters
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
index 6c35f0962f..3d2fcb5094 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
@@ -2,8 +2,8 @@
Internally Transport Manager uses different threads for different operations. This design solution was used to provide efficient asynchronous communication with clients and underlying Device Adapters.
-Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener will be called from that thread.
+Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in ns_smart_device_link::ns_transport_manager::ITransportManagerDeviceListener will be called from that thread.
-For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
+For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of ns_smart_device_link::ns_transport_manager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
index c96fd46a22..164fad9140 100644
--- a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
@@ -2,13 +2,13 @@
Actually Transport Manager component is implemented as classical manager component. It manages connections and abstract devices and provides unified information for the clients.
-Connection-related information encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
+Connection-related information encapsulated in structure ns_smart_device_link::ns_transport_manager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
-Frame processing encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
+Frame processing encapsulated in structure ns_smart_device_link::ns_transport_manager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
Callback information between transport manager threads passed in form of special structures:
-NsSmartDeviceLink::NsTransportManager::CTransportManager::SDeviceListenerCallback.
-NsSmartDeviceLink::NsTransportManager::CTransportManager::SDataListenerCallback.
+ns_smart_device_link::ns_transport_manager::CTransportManager::SDeviceListenerCallback.
+ns_smart_device_link::ns_transport_manager::CTransportManager::SDataListenerCallback.
Client calls to TM guarded by separate mutex. This allows use component from different threads without any risk.
diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h
index 0fa53b0237..cee2a8774f 100644
--- a/src/components/policy/policy_external/include/policy/access_remote_impl.h
+++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h
@@ -35,7 +35,7 @@
#include <map>
#include "policy/policy_table/types.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "policy/access_remote.h"
#include "policy/cache_manager.h"
@@ -46,7 +46,7 @@ namespace policy {
class AccessRemoteImpl : public AccessRemote {
public:
AccessRemoteImpl();
- explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
+ explicit AccessRemoteImpl(std::shared_ptr<CacheManager> cache);
/**
* @brief CheckModuleType check if module type is allowed for application
* @param app_id application id
@@ -144,7 +144,7 @@ class AccessRemoteImpl : public AccessRemote {
/**
* @brief cache_ contains pointer to cache manager instance
*/
- utils::SharedPtr<CacheManager> cache_;
+ std::shared_ptr<CacheManager> cache_;
/**
* @brief hmi_types_ contains list of default HMI types for applications
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
index f41ddb14cd..d30e7cea24 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -35,7 +35,6 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
@@ -232,7 +231,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -720,7 +719,7 @@ class CacheManager : public CacheManagerInterface {
void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE;
#ifdef BUILD_TESTS
- utils::SharedPtr<policy_table::Table> GetPT() const {
+ std::shared_ptr<policy_table::Table> GetPT() const {
return pt_;
}
#endif
@@ -782,15 +781,15 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
- utils::SharedPtr<PTExtRepresentation> ex_backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
+ std::shared_ptr<PTExtRepresentation> ex_backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- mutable sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
index 1d74780f19..bb9ce14c7f 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -38,7 +38,7 @@
#include "policy/policy_table/types.h"
#include "policy/pt_representation.h"
-#include "utils/shared_ptr.h"
+
#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.h"
@@ -237,7 +237,7 @@ class CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() = 0;
/**
* Applies policy table to the current table
@@ -823,16 +823,16 @@ class CacheManagerInterface {
#ifdef BUILD_TESTS
/**
- * @brief GetPT allows to obtain SharedPtr to PT.
+ * @brief GetPT allows to obtain std::shared_ptr to PT.
* Used ONLY in Unit tests
- * @return SharedPTR to PT
+ * @return std::shared_ptr to PT
*
*/
- virtual utils::SharedPtr<policy_table::Table> GetPT() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GetPT() const = 0;
#endif
};
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+typedef std::shared_ptr<CacheManagerInterface> CacheManagerInterfaceSPtr;
} // namespace policy
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 e399b44719..6f916b7cd0 100644
--- a/src/components/policy/policy_external/include/policy/policy_helper.h
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
+
#include "policy/policy_types.h"
namespace policy {
@@ -85,8 +85,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
*/
struct CheckAppPolicy {
CheckAppPolicy(PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot,
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot,
CheckAppPolicyResults& out_results);
bool operator()(const AppPoliciesValueType& app_policy);
@@ -202,8 +202,8 @@ struct CheckAppPolicy {
private:
PolicyManagerImpl* pm_;
- const utils::SharedPtr<policy_table::Table> update_;
- const utils::SharedPtr<policy_table::Table> snapshot_;
+ const std::shared_ptr<policy_table::Table> update_;
+ const std::shared_ptr<policy_table::Table> snapshot_;
CheckAppPolicyResults& out_results_;
};
@@ -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_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
index 67756c053d..3837dda1fa 100644
--- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
#include <list>
-#include "utils/shared_ptr.h"
+
#include "utils/lock.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
@@ -472,7 +472,7 @@ class PolicyManagerImpl : public PolicyManager {
* @brief Setter for access_remote instance
* @param access_remote pointer to new access_remote instance
*/
- void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+ void set_access_remote(std::shared_ptr<AccessRemote> access_remote) OVERRIDE;
/**
* @brief Sends notification about application HMI level changed
@@ -717,7 +717,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param pt_content binary content of PT
* @return pointer to converted PT
*/
- virtual utils::SharedPtr<policy_table::Table> Parse(
+ virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
private:
@@ -736,8 +736,8 @@ class PolicyManagerImpl : public PolicyManager {
* @return Collection per-application results
*/
CheckAppPolicyResults CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
/**
* @brief Processes results from policy table update analysis done by
@@ -860,7 +860,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param type policy table type
* @return true if policy table valid, otherwise false
*/
- bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ bool IsPTValid(std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
/**
@@ -1017,7 +1017,7 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief pointer to AccessRemote instance for working with RC applications
*/
- utils::SharedPtr<AccessRemote> access_remote_;
+ std::shared_ptr<AccessRemote> access_remote_;
/**
* @brief lock guard for protecting applications list access
diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h
index ecbd56c2e4..fe27f1cb57 100644
--- a/src/components/policy/policy_external/include/policy/policy_table.h
+++ b/src/components/policy/policy_external/include/policy/policy_table.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
@@ -42,7 +41,7 @@ namespace policy {
class PolicyTable {
public:
PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ explicit PolicyTable(std::shared_ptr<PTRepresentation> pt_data);
virtual ~PolicyTable();
/**
@@ -50,12 +49,12 @@ class PolicyTable {
* actual class storing policy table.
* @return PTRepresentation* Policy Table Content Handler
*/
- utils::SharedPtr<PTRepresentation> pt_data() const {
+ std::shared_ptr<PTRepresentation> pt_data() const {
return pt_data_;
}
private:
- utils::SharedPtr<PTRepresentation> pt_data_;
+ std::shared_ptr<PTRepresentation> pt_data_;
};
} // namespace policy
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 2804166f17..a31e955d99 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
@@ -78,6 +78,7 @@ enum Parameter {
P_VIN,
P_ACCPEDALPOSITION,
P_BELTSTATUS,
+ P_ELECTRONICPARKBRAKESTATUS,
P_DRIVERBRAKING,
P_PRNDL,
P_RPM,
@@ -169,6 +170,11 @@ bool EnumFromJsonString(const std::string& literal, Input* result);
enum ModuleType {
MT_CLIMATE,
MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS,
+ MT_EMPTY
};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h
index b062fa0966..68e29a97ee 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -303,6 +303,7 @@ struct ModuleConfig : CompositeType {
Optional<String<0, 10> > preloaded_date;
Optional<String<0, 65535> > certificate;
Optional<Boolean> preloaded_pt;
+ Optional<Boolean> full_app_id_supported;
public:
ModuleConfig();
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 401a5dcb9f..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
@@ -38,6 +38,7 @@
<element name="vin" />
<element name="accPedalPosition" />
<element name="beltStatus" />
+ <element name="electronicParkBrakeStatus" />
<element name="driverBraking" />
<element name="prndl" />
<element name="rpm" />
@@ -97,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
@@ -139,6 +139,7 @@
<struct name="ModuleConfig">
<param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
<param name="preloaded_pt" type="Boolean" mandatory="false" />
+ <param name="full_app_id_supported" type="Boolean" mandatory="false" />
<param name="exchange_after_x_ignition_cycles" type="Integer"
maxvalue="255" />
<param name="exchange_after_x_kilometers" type="Integer"
diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h
index 9682b3d58d..84d9376a93 100644
--- a/src/components/policy/policy_external/include/policy/policy_types.h
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -39,7 +39,8 @@
#include <map>
#include <set>
#include <utility>
-#include "utils/shared_ptr.h"
+#include <memory>
+
#include "utils/helpers.h"
#include "transport_manager/common.h"
@@ -79,7 +80,7 @@ enum PolicyTableStatus {
// Code generator uses String class name, so this typedef was renamed to PTSring
typedef std::string PTString;
typedef std::vector<uint8_t> BinaryMessage;
-typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+typedef std::shared_ptr<BinaryMessage> BinaryMessageSptr;
typedef std::string HMILevel;
typedef std::string Parameter;
diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h
index 66a9218771..f25fcc6cab 100644
--- a/src/components/policy/policy_external/include/policy/pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/pt_representation.h
@@ -213,7 +213,7 @@ class PTRepresentation {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const = 0;
virtual bool Save(const policy_table::Table& table) = 0;
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
index d56f6aeba2..13816eb6c5 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
@@ -85,7 +85,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Clear();
bool Drop();
virtual void WriteDb();
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id,
StringArray* nicknames = NULL,
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h
index b663610a5b..b4a373d1cf 100644
--- a/src/components/policy/policy_external/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_external/include/policy/update_status_manager.h
@@ -66,14 +66,14 @@ class UpdateStatusManager {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- void SetNextStatus(utils::SharedPtr<Status> status);
+ void SetNextStatus(std::shared_ptr<Status> status);
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- void SetPostponedStatus(utils::SharedPtr<Status> status);
+ void SetPostponedStatus(std::shared_ptr<Status> status);
/**
* @brief Sets listener pointer
@@ -199,17 +199,17 @@ class UpdateStatusManager {
/**
* @brief Current update status
*/
- utils::SharedPtr<Status> current_status_;
+ std::shared_ptr<Status> current_status_;
/**
* @brief Next status after current to be set
*/
- utils::SharedPtr<Status> next_status_;
+ std::shared_ptr<Status> next_status_;
/**
* @brief Status to be set after 'next' status
*/
- utils::SharedPtr<Status> postponed_status_;
+ std::shared_ptr<Status> postponed_status_;
sync_primitives::Lock status_lock_;
UpdateEvent last_processed_event_;
@@ -227,7 +227,7 @@ class UpdateStatusManager {
volatile uint32_t timeout_;
volatile bool stop_flag_;
- sync_primitives::Lock state_lock_;
+ sync_primitives::RecursiveLock state_lock_;
sync_primitives::ConditionalVariable termination_condition_;
UpdateStatusManager* update_status_manager_;
};
diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
index adaef0eb28..c145bb432b 100644
--- a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
@@ -36,7 +36,7 @@
#include <ctime>
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
+
#include "utils/timer.h"
#include "utils/macro.h"
@@ -46,18 +46,18 @@ using timer::Timer;
class GlobalCounter {
public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounter(std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type);
void operator++() const;
private:
GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppCounter {
public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type);
void operator++() const;
@@ -65,12 +65,12 @@ class AppCounter {
private:
std::string app_id_;
AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppInfo {
public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type);
void Update(const std::string& new_info) const;
@@ -78,14 +78,14 @@ class AppInfo {
private:
std::string app_id_;
AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppStopwatchImpl : public AppStopwatch {
public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
std::uint32_t timeout);
~AppStopwatchImpl();
@@ -97,7 +97,7 @@ class AppStopwatchImpl : public AppStopwatch {
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
timer::Timer timer_;
const std::uint32_t time_out_;
DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc
index d042d8c402..26c8c5e38e 100644
--- a/src/components/policy/policy_external/src/access_remote_impl.cc
+++ b/src/components/policy/policy_external/src/access_remote_impl.cc
@@ -89,7 +89,7 @@ struct ToModuleType {
AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
-AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr<CacheManager> cache)
: cache_(cache) {}
bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index 00bb1e4a1c..e4a4151fa4 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -253,8 +253,7 @@ CacheManager::CacheManager()
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTExtRepresentation())
- , update_required(false)
- , cache_lock_(true) {
+ , update_required(false) {
InitBackupThread();
}
@@ -262,8 +261,7 @@ CacheManager::CacheManager(bool in_memory)
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTExtRepresentation(in_memory))
- , update_required(false)
- , cache_lock_(true) {
+ , update_required(false) {
InitBackupThread();
}
@@ -1119,8 +1117,8 @@ bool CacheManager::SetUserPermissionsForApp(
it_group->second != is_allowed) {
*out_app_permissions_changed = true;
- const TimevalStruct tm = date_time::DateTime::getCurrentTime();
- int64_t current_time_msec = date_time::DateTime::getmSecs(tm);
+ const date_time::TimeDuration tm = date_time::getCurrentTime();
+ int64_t current_time_msec = date_time::getmSecs(tm);
ucr.consent_last_updated = current_time_msec;
LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
}
@@ -1333,7 +1331,7 @@ int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
@@ -1519,6 +1517,9 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.full_app_id_supported) =
+ settings_->use_full_app_id();
+
// SDL must not send certificate in snapshot
snapshot_->policy_table.module_config.certificate =
rpc::Optional<rpc::String<0, 65535> >();
@@ -1627,8 +1628,8 @@ void CacheManager::CheckSnapshotInitialization() {
void CacheManager::PersistData() {
LOG4CXX_AUTO_TRACE(logger_);
- if (backup_.valid()) {
- if (pt_.valid()) {
+ if (backup_.use_count() != 0) {
+ if (pt_.use_count() != 0) {
// Comma expression is used to hold the lock only during the constructor
// call
policy_table::Table copy_pt(
@@ -1670,7 +1671,7 @@ void CacheManager::PersistData() {
}
// In case of extended policy the meta info should be backuped as well.
- if (ex_backup_.valid()) {
+ if (ex_backup_.use_count() != 0) {
ex_backup_->SetMetaInfo(
*(*copy_pt.policy_table.module_meta).ccpu_version,
*(*copy_pt.policy_table.module_meta).wers_country_code,
@@ -1750,9 +1751,9 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
return false;
}
-utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+std::shared_ptr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- snapshot_ = new policy_table::Table();
+ snapshot_ = std::make_shared<policy_table::Table>();
sync_primitives::AutoLock auto_lock(cache_lock_);
snapshot_->policy_table = pt_->policy_table;
@@ -2237,8 +2238,7 @@ bool CacheManager::Init(const std::string& file_name,
LOG4CXX_AUTO_TRACE(logger_);
settings_ = settings;
InitResult init_result = backup_->Init(settings);
- ex_backup_ = utils::SharedPtr<PTRepresentation>::dynamic_pointer_cast<
- PTExtRepresentation>(backup_);
+ ex_backup_ = std::dynamic_pointer_cast<PTExtRepresentation>(backup_);
bool result = true;
switch (init_result) {
@@ -2261,7 +2261,7 @@ bool CacheManager::Init(const std::string& file_name,
case InitResult::SUCCESS: {
LOG4CXX_INFO(logger_, "Policy Table was inited successfully");
result = LoadFromFile(file_name, *pt_);
- utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = GenerateSnapshot();
result &= snapshot->is_valid();
LOG4CXX_DEBUG(logger_,
@@ -2651,8 +2651,8 @@ void CacheManager::SetExternalConsentForApp(
(*(*pt_->policy_table.device_data)[permissions.device_id]
.user_consent_records)[permissions.policy_app_id];
- const TimevalStruct tm = date_time::DateTime::getCurrentTime();
- int64_t current_time_msec = date_time::DateTime::getmSecs(tm);
+ const date_time::TimeDuration tm = date_time::getCurrentTime();
+ int64_t current_time_msec = date_time::getmSecs(tm);
app_consent_records.ext_consent_last_updated = current_time_msec;
LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
index 39b9399c24..2358c54bef 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -122,8 +122,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
CheckAppPolicy::CheckAppPolicy(
PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot,
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot,
CheckAppPolicyResults& out_results)
: pm_(pm)
, update_(update)
@@ -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_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index 4ac66c0d53..c7d814e56e 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -49,7 +49,7 @@
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
-#include "utils/make_shared.h"
+
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
@@ -213,8 +213,8 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
- , access_remote_(new AccessRemoteImpl(
- CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
@@ -224,8 +224,8 @@ PolicyManagerImpl::PolicyManagerImpl(bool in_memory)
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager(in_memory))
- , access_remote_(new AccessRemoteImpl(
- CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
@@ -239,15 +239,15 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) {
update_status_manager_.set_listener(listener);
}
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::make_shared<policy_table::Table>();
}
}
@@ -279,7 +279,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
"PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
// Parse message into table struct
- utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is NULL.");
update_status_manager_.OnWrongUpdateReceived();
@@ -301,7 +301,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
sync_primitives::AutoLock lock(apps_registration_lock_);
// Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(
@@ -363,8 +363,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
+ const std::shared_ptr<policy_table::Table> pt_update,
+ const std::shared_ptr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
// Replace predefined policies with its actual setting, e.g. "123":"default"
@@ -468,7 +468,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
void PolicyManagerImpl::RequestPTUpdate() {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
@@ -1276,7 +1276,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
}
bool PolicyManagerImpl::IsPTValid(
- utils::SharedPtr<policy_table::Table> policy_table,
+ std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const {
policy_table->SetPolicyTableType(type);
if (!policy_table->is_valid()) {
@@ -1367,7 +1367,7 @@ void PolicyManagerImpl::SendPermissionsToApp(
Permissions notification_data;
// Need to get rid of this call
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
PrepareNotificationData(
@@ -1496,7 +1496,7 @@ void PolicyManagerImpl::CalculateGroupsConsentFromExternalConsent(
bool PolicyManagerImpl::ExceededDays() {
LOG4CXX_AUTO_TRACE(logger_);
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
const int days = current_time.tv_sec / kSecondsInDay;
@@ -1775,11 +1775,11 @@ StatusNotifier PolicyManagerImpl::AddApplication(
sync_primitives::AutoLock lock(apps_registration_lock_);
if (IsNewApplication(application_id)) {
AddNewApplication(application_id, device_consent);
- return utils::MakeShared<CallStatusChange>(update_status_manager_,
- device_consent);
+ return std::make_shared<CallStatusChange>(update_status_manager_,
+ device_consent);
} else {
PromoteExistedApplication(application_id, device_consent);
- return utils::MakeShared<utils::CallNothing>();
+ return std::make_shared<utils::CallNothing>();
}
}
@@ -1909,7 +1909,7 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
- cache_ = cache_manager;
+ cache_ = std::shared_ptr<CacheManagerInterface>(cache_manager);
}
std::ostream& operator<<(std::ostream& output,
@@ -2024,7 +2024,7 @@ bool PolicyManagerImpl::GetModuleTypes(
}
void PolicyManagerImpl::set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) {
+ std::shared_ptr<AccessRemote> access_remote) {
access_remote_ = access_remote;
}
diff --git a/src/components/policy/policy_external/src/policy_table.cc b/src/components/policy/policy_external/src/policy_table.cc
index 7a63fac50d..8ca6b698d1 100644
--- a/src/components/policy/policy_external/src/policy_table.cc
+++ b/src/components/policy/policy_external/src/policy_table.cc
@@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
PolicyTable::PolicyTable() : pt_data_(new SQLPTExtRepresentation()) {}
-PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
: pt_data_(pt_data) {}
PolicyTable::~PolicyTable() {
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 cb724e93b1..31a6fc86e6 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -142,6 +142,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_BELTSTATUS:
return true;
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return true;
case P_DRIVERBRAKING:
return true;
case P_PRNDL:
@@ -235,6 +237,8 @@ const char* EnumToJsonString(Parameter val) {
return "accPedalPosition";
case P_BELTSTATUS:
return "beltStatus";
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return "electronicParkBrakeStatus";
case P_DRIVERBRAKING:
return "driverBraking";
case P_PRNDL:
@@ -343,6 +347,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("beltStatus" == literal) {
*result = P_BELTSTATUS;
return true;
+ } else if ("electronicParkBrakeStatus" == literal) {
+ *result = P_ELECTRONICPARKBRAKESTATUS;
+ return true;
} else if ("driverBraking" == literal) {
*result = P_DRIVERBRAKING;
return true;
@@ -764,6 +771,16 @@ 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;
+ case MT_EMPTY:
+ return true;
default:
return false;
}
@@ -774,6 +791,16 @@ 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";
+ case MT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -786,6 +813,21 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("RADIO" == literal) {
*result = MT_RADIO;
return true;
+ } 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 if ("EMPTY" == literal) {
+ *result = MT_EMPTY;
+ return true;
} else {
return false;
}
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc
index 8c4f454dfa..5922a020e6 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -569,7 +569,9 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
, vehicle_year(impl::ValueMember(value__, "vehicle_year"))
, preloaded_date(impl::ValueMember(value__, "preloaded_date"))
, certificate(impl::ValueMember(value__, "certificate"))
- , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) {}
+ , preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
+ , full_app_id_supported(
+ impl::ValueMember(value__, "full_app_id_supported")) {}
void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
exchange_after_x_days = from.exchange_after_x_days;
@@ -592,6 +594,8 @@ Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("certificate", certificate, &result__);
impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField(
+ "full_app_id_supported", full_app_id_supported, &result__);
impl::WriteJsonField("exchange_after_x_ignition_cycles",
exchange_after_x_ignition_cycles,
&result__);
@@ -622,6 +626,9 @@ bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
}
+ if (!full_app_id_supported.is_valid()) {
+ return false;
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
return false;
}
@@ -672,6 +679,9 @@ bool ModuleConfig::struct_empty() const {
if (preloaded_pt.is_initialized()) {
return false;
}
+ if (full_app_id_supported.is_initialized()) {
+ return false;
+ }
if (exchange_after_x_ignition_cycles.is_initialized()) {
return false;
@@ -720,6 +730,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (!preloaded_pt.is_valid()) {
preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
}
+ if (!full_app_id_supported.is_valid()) {
+ full_app_id_supported.ReportErrors(
+ &report__->ReportSubobject("full_app_id_supported"));
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
exchange_after_x_ignition_cycles.ReportErrors(
&report__->ReportSubobject("exchange_after_x_ignition_cycles"));
@@ -797,6 +811,7 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
preloaded_pt.SetPolicyTableType(pt_type);
+ full_app_id_supported.SetPolicyTableType(pt_type);
exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
exchange_after_x_kilometers.SetPolicyTableType(pt_type);
exchange_after_x_days.SetPolicyTableType(pt_type);
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
index 5bb602244e..f26264ddf9 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
@@ -761,6 +761,13 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
+
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -870,6 +877,17 @@ bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
+
+ bool denied = false;
+ if (!GatherRemoteControlDenied(app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
+
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index 3cd7388672..34c5b90903 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -235,10 +235,10 @@ int SQLPTRepresentation::TimeoutResponse() {
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND;
return defaultTimeout;
}
- return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND;
}
bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
@@ -513,10 +513,10 @@ bool SQLPTRepresentation::RefreshDB() {
return true;
}
-utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
+std::shared_ptr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
const {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ auto table = std::make_shared<policy_table::Table>();
GatherModuleMeta(&*table->policy_table.module_meta);
GatherModuleConfig(&table->policy_table.module_config);
GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
@@ -1740,6 +1740,10 @@ bool SQLPTRepresentation::GatherModuleType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::ModuleType::MT_EMPTY == type) {
+ app_types->mark_initialized();
+ continue;
+ }
app_types->push_back(type);
}
return true;
@@ -1772,18 +1776,30 @@ bool SQLPTRepresentation::SaveModuleType(
}
policy_table::ModuleTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
query.Bind(0, app_id);
- std::string module(policy_table::EnumToJsonString(*it));
- query.Bind(1, module);
- LOG4CXX_DEBUG(logger_,
- "Module(app: " << app_id << ", type: " << module << ")");
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::ModuleType::MT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ LOG4CXX_WARN(logger_, "Incorrect insert into module types.");
return false;
}
+ } else {
+ LOG4CXX_WARN(logger_, "Module Type omitted.");
}
-
return true;
}
diff --git a/src/components/policy/policy_external/src/status.cc b/src/components/policy/policy_external/src/status.cc
index 31fc7f110b..c2ee4e4bbc 100644
--- a/src/components/policy/policy_external/src/status.cc
+++ b/src/components/policy/policy_external/src/status.cc
@@ -32,7 +32,6 @@
#include "policy/status.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
policy::UpToDateStatus::UpToDateStatus()
: Status(kUpToDate, policy::PolicyTableStatus::StatusUpToDate) {}
@@ -45,7 +44,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManager* manager,
case kScheduleUpdate:
case kScheduleManualUpdate:
case kOnResetRetrySequence:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -59,14 +58,14 @@ void policy::UpdateNeededStatus::ProcessEvent(
policy::UpdateStatusManager* manager, policy::UpdateEvent event) {
switch (event) {
case kOnUpdateSentOut:
- manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ manager->SetNextStatus(std::make_shared<UpdatingStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
default:
break;
@@ -85,23 +84,23 @@ void policy::UpdatingStatus::ProcessEvent(policy::UpdateStatusManager* manager,
switch (event) {
case kOnValidUpdateReceived:
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kScheduleUpdate:
case kScheduleManualUpdate:
case kOnResetRetrySequence:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc
index 087db1149b..e738554799 100644
--- a/src/components/policy/policy_external/src/update_status_manager.cc
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,7 +40,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
, last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
, app_registered_from_non_consented_device_(true) {
@@ -67,11 +66,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
@@ -210,7 +209,6 @@ UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate(
UpdateStatusManager* update_status_manager)
: timeout_(0)
, stop_flag_(false)
- , state_lock_(true)
, update_status_manager_(update_status_manager) {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Create UpdateThreadDelegate");
diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc
index 661ea29704..d46f6a315a 100644
--- a/src/components/policy/policy_external/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc
@@ -36,13 +36,13 @@
#include <cassert>
#include "policy/usage_statistics/counter.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace usage_statistics {
GlobalCounter::GlobalCounter(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
GlobalCounterId counter_type)
: counter_type_(counter_type), statistics_manager_(statistics_manager) {}
@@ -53,7 +53,7 @@ void GlobalCounter::operator++() const {
}
AppCounter::AppCounter(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type)
: app_id_(app_id)
@@ -67,7 +67,7 @@ void AppCounter::operator++() const {
}
AppInfo::AppInfo(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type)
: app_id_(app_id)
@@ -81,7 +81,7 @@ void AppInfo::Update(const std::string& new_info) const {
}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager,
const std::string& app_id)
: app_id_(app_id)
, stopwatch_type_(SECONDS_HMI_NONE)
@@ -92,7 +92,7 @@ AppStopwatchImpl::AppStopwatchImpl(
, time_out_(60) {}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
uint32_t timeout)
: app_id_(app_id)
@@ -107,8 +107,7 @@ AppStopwatchImpl::~AppStopwatchImpl() {}
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
- timer::kPeriodic);
+ timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc
index 90f247de31..22b19c878e 100644
--- a/src/components/policy/policy_external/test/counter_test.cc
+++ b/src/components/policy/policy_external/test/counter_test.cc
@@ -28,6 +28,7 @@
* 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 "policy/usage_statistics/mock_statistics_manager.h"
#include "policy/usage_statistics/counter.h"
@@ -45,7 +46,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -59,7 +60,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -74,7 +75,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -88,7 +89,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -102,7 +103,7 @@ TEST(
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -115,7 +116,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -130,7 +131,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
@@ -145,7 +146,7 @@ TEST(StatisticsManagerAddMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
@@ -161,7 +162,7 @@ TEST(
StatisticsManagerAddMethod,
AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
index 995c63ed20..3870e4ece1 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
@@ -78,7 +78,7 @@ class MockPTRepresentation : virtual public ::policy::PTRepresentation {
MOCK_METHOD0(Close, bool());
MOCK_METHOD0(Clear, bool());
MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
MOCK_METHOD1(SaveUpdateRequired, void(bool value));
diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
index e753751308..23701e86de 100644
--- a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
+++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
@@ -54,7 +54,7 @@ using ::policy::PolicyManagerImpl;
typedef std::multimap<std::string, policy_table::Rpcs&>
UserConsentPromptToRpcsConnections;
-typedef utils::SharedPtr<policy_table::Table> PolicyTableSPtr;
+typedef std::shared_ptr<policy_table::Table> PolicyTableSPtr;
namespace {
const std::string kSdlPreloadedPtJson = "json/sdl_preloaded_pt.json";
@@ -203,7 +203,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
void EmulatePTAppRevoked(const std::string& ptu_name);
- utils::SharedPtr<policy_table::Table> PreconditionForBasicValidateSnapshot();
+ std::shared_ptr<policy_table::Table> PreconditionForBasicValidateSnapshot();
template <typename ParentType, typename Value>
bool IsKeyExisted(const ParentType& parent, const Value& value) const {
@@ -236,7 +236,7 @@ class PolicyManagerImplTest_RequestTypes : public ::testing::Test {
const std::string app_storage_folder_;
const std::string preloaded_pt_filename_;
- utils::SharedPtr<PolicyManagerImpl> policy_manager_impl_sptr_;
+ std::shared_ptr<PolicyManagerImpl> policy_manager_impl_sptr_;
NiceMock<MockPolicyListener> listener_;
NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json
index 5209030eec..4cd71d6004 100644
--- a/src/components/policy/policy_external/test/json/PTU.json
+++ b/src/components/policy/policy_external/test/json/PTU.json
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json
index 30746123d4..9c9436144e 100644
--- a/src/components/policy/policy_external/test/json/PTU2.json
+++ b/src/components/policy/policy_external/test/json/PTU2.json
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json
index f3bd615c73..279051e7bf 100644
--- a/src/components/policy/policy_external/test/json/PTU3.json
+++ b/src/components/policy/policy_external/test/json/PTU3.json
@@ -403,6 +403,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -419,6 +420,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -435,6 +437,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -451,6 +454,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
index 6db3836e4a..08027f2786 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
@@ -1438,6 +1438,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1450,6 +1451,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1462,6 +1464,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1474,6 +1477,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
index 22f7bd2930..a88bcfbd08 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
@@ -1441,6 +1441,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1453,6 +1454,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1465,6 +1467,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1477,6 +1480,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
index 83a2b308bb..250bfb21f2 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
@@ -1438,6 +1438,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1450,6 +1451,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1462,6 +1464,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1474,6 +1477,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
index 8509935752..85910c098c 100644
--- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
+++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
@@ -1437,6 +1437,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1449,6 +1450,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1461,6 +1463,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1473,6 +1476,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
index 4d99dfbc35..1c1b04ca2b 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
index aeed9655e1..51690d7b8e 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
index 2e99c6c8ee..cfa6c4010c 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json
index 9a6ad3720d..d7177f2251 100644
--- a/src/components/policy/policy_external/test/json/ptu2_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json
@@ -415,6 +415,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -431,6 +432,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -447,6 +449,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -463,6 +466,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json
index 87fcf17aee..6a531dd2ad 100644
--- a/src/components/policy/policy_external/test/json/ptu_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu_requestType.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
index 7f5436b5b6..59e3f947c3 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
@@ -297,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -309,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -321,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -333,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
index 37e0476683..a4491fd449 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
@@ -2051,6 +2051,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2065,6 +2066,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2079,6 +2081,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -2093,6 +2096,7 @@
[
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
index 2a503ab4a1..83c4ccf15c 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
@@ -415,6 +415,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -431,6 +432,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -447,6 +449,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -463,6 +466,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
index d28f70379c..7b882c6ceb 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
index 7bf287671e..7d90275328 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json
index 6b130c8f60..807b0eb312 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
index be177335fe..3d0a004dbe 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
index 58e3f2fad3..6a36f1f9c5 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
index 4b10f8c80b..3303d56844 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
index 7728b69a0b..e7a33ba2c0 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
index aaa7664d06..08739f9d6a 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
index 079892677d..21396b8cac 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
index 82048d21e6..5aa467a23c 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
@@ -414,6 +414,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -430,6 +431,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -446,6 +448,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -462,6 +465,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
index 81521a2e0b..5827ab287a 100644
--- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
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 947bb5d3ad..8d2802c831 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);
@@ -924,7 +924,7 @@ TEST_F(
}
uint32_t GetCurrentDaysCount() {
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const uint32_t kSecondsInDay = 60 * 60 * 24;
return current_time.tv_sec / kSecondsInDay;
}
@@ -1092,7 +1092,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT(preloaded_pt_filename_);
GetPTU(kValidSdlPtUpdateJson);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
::policy::VehicleInfo vehicle_info = policy_manager_->GetVehicleInfo();
@@ -1202,7 +1202,7 @@ TEST_F(
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
CreateLocalPT(preloaded_pt_filename_);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
::policy_table::PolicyTableType type1 =
::policy_table::PolicyTableType::PT_PRELOADED;
@@ -1302,7 +1302,7 @@ TEST_F(PolicyManagerImplTest2,
actual_groups_permissions[index].group_name);
EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
uint32_t ucr_size = 0;
::policy_table::DeviceData& device_data = *pt->policy_table.device_data;
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
index e666ac82de..c1ff31f748 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -84,7 +84,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
EXPECT_TRUE(cache->IsPTPreloaded());
// Arrange
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Get FunctionalGroupings
policy_table::FunctionalGroupings& fc =
table->policy_table.functional_groupings;
@@ -119,7 +119,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT(preloaded_pt_filename_);
policy_manager_->SetSystemLanguage("it-it");
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ("it-it", static_cast<std::string>(*(ModuleMeta.language)));
@@ -130,7 +130,7 @@ TEST_F(PolicyManagerImplTest2, SetVINValue_ExpectVINSetSuccessfully) {
CreateLocalPT(preloaded_pt_filename_);
std::string vin_code("1FAPP6242VH100001");
policy_manager_->SetVINValue(vin_code);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ(vin_code, static_cast<std::string>(*(ModuleMeta.vin)));
@@ -141,7 +141,7 @@ TEST_F(PolicyManagerImplTest2, SetSystemInfo_ExpectSystemInfoSetSuccessfully) {
CreateLocalPT(preloaded_pt_filename_);
policy_manager_->SetSystemInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru");
policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
- utils::SharedPtr<policy_table::Table> pt = cache->GetPT();
+ std::shared_ptr<policy_table::Table> pt = cache->GetPT();
::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
EXPECT_EQ("ru-ru", static_cast<std::string>(*(ModuleMeta.language)));
EXPECT_EQ("4.1.3.B_EB355B",
@@ -189,7 +189,7 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
policy_manager_->AddDevice("AAA123456789RRR", "Bluetooth");
policy_manager_->SetDeviceInfo("AAA123456789RRR", dev_info3);
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
// Try to find first device in PT
policy_table::DeviceData::const_iterator iter =
@@ -316,7 +316,7 @@ TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) {
const bool result =
(policy_manager_->GetCache())->AddDevice(device_id_1_, connection_type);
// Get Policy table
- const utils::SharedPtr<policy_table::Table> policy_table =
+ const std::shared_ptr<policy_table::Table> policy_table =
policy_manager_->GetCache()->GetPT();
// Get preloaded_pt flag from Policy table
const bool is_preloaded_pt =
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
index f4e922e647..6521db7c36 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -37,8 +37,6 @@
#include <utility>
#include "policy/policy_manager_impl_test_base.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
using ::testing::_;
using ::testing::Return;
@@ -148,8 +146,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
std::string json = table.toStyledString();
::policy::BinaryMessage msg(json.begin(), json.end());
- utils::SharedPtr<policy_table::Table> snapshot =
- new policy_table::Table(update.policy_table);
+ std::shared_ptr<policy_table::Table> snapshot =
+ std::make_shared<policy_table::Table>(update.policy_table);
// Assert
EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(snapshot));
EXPECT_CALL(*cache_manager_, ApplyUpdate(_)).WillOnce(Return(true));
@@ -236,9 +234,9 @@ TEST_F(PolicyManagerImplTest2, TimeOutExchange) {
TEST_F(PolicyManagerImplTest,
RequestPTUpdate_SetPT_GeneratedSnapshotAndPTUpdate) {
Json::Value table = createPTforLoad();
- utils::SharedPtr<policy_table::Table> p_table =
- utils::MakeShared<policy_table::Table>(&table);
- ASSERT_TRUE(p_table);
+ std::shared_ptr<policy_table::Table> p_table =
+ std::make_shared<policy_table::Table>(&table);
+ ASSERT_TRUE(p_table.get());
p_table->SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
EXPECT_TRUE(IsValid(*p_table));
@@ -249,9 +247,9 @@ TEST_F(PolicyManagerImplTest,
}
TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) {
- utils::SharedPtr<policy_table::Table> p_table =
- utils::MakeShared<policy_table::Table>();
- ASSERT_TRUE(p_table);
+ std::shared_ptr<policy_table::Table> p_table =
+ std::make_shared<policy_table::Table>();
+ ASSERT_TRUE(p_table.get());
EXPECT_FALSE(IsValid(*p_table));
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
@@ -261,7 +259,7 @@ TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) {
}
TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidSnapshot_PTUpdateFail) {
- utils::SharedPtr<policy_table::Table> p_table;
+ std::shared_ptr<policy_table::Table> p_table;
EXPECT_FALSE(p_table);
EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
@@ -355,7 +353,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Checking groups consents before setting ExternalConsent status
@@ -420,7 +418,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Checking ExternalConsent consents before setting new ExternalConsent status
@@ -484,7 +482,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppPolicy();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -552,7 +550,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppPolicy();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -634,7 +632,7 @@ TEST_F(
HmiTypes(policy_table::AHT_DEFAULT));
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -724,7 +722,7 @@ TEST_F(
HmiTypes(policy_table::AHT_DEFAULT));
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
ExternalConsentStatus status;
@@ -818,7 +816,7 @@ TEST_F(PolicyManagerImplTest_ExternalConsent,
policy_manager_->AddApplication(app_id_1_,
HmiTypes(policy_table::AHT_DEFAULT));
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Check ExternalConsent consents for application
@@ -943,7 +941,7 @@ TEST_F(PolicyManagerImplTest_ExternalConsent,
policy_manager_->AddApplication(app_id_1_,
HmiTypes(policy_table::AHT_DEFAULT));
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Check ExternalConsent consents for application
@@ -1046,7 +1044,7 @@ TEST_F(
PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
// Act
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
policy_manager_->GetCache()->GetPT();
// Checking ExternalConsent consents before setting new ExternalConsent status
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index 48e86d24b7..86b7cdc9ef 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -38,7 +38,7 @@
#include "policy/policy_manager_impl_test_base.h"
#include "utils/file_system.h"
-#include "utils/make_shared.h"
+
#include "utils/gen_hash.h"
#include "json/reader.h"
@@ -414,7 +414,7 @@ void PolicyManagerImplTest2::GetFunctionalGroupingsFromManager(
// Get cache
::policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
// Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Set functional groupings from policy table
input_functional_groupings = table->policy_table.functional_groupings;
}
@@ -639,7 +639,7 @@ void PolicyManagerImplTest_RequestTypes::SetUp() {
file_system::CreateDirectory(app_storage_folder_);
const bool in_memory = true;
- policy_manager_impl_sptr_ = utils::MakeShared<PolicyManagerImpl>(in_memory);
+ policy_manager_impl_sptr_ = std::make_shared<PolicyManagerImpl>(in_memory);
policy_manager_impl_sptr_->set_listener(&listener_);
}
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
index 2f2162494f..4df4012ad3 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -69,7 +69,7 @@ TEST_F(
// To set UP_TO_DATE before registration
GetPTU(kValidSdlPtUpdateJson);
- const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
const int days_after_epoch = current_time.tv_sec / kSecondsInDay;
@@ -395,7 +395,7 @@ TEST_F(PolicyManagerImplTest2,
uint32_t size = result.size();
EXPECT_GT(size, 0u);
std::vector< ::policy::UserFriendlyMessage>::iterator result_iter;
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
policy_table::ConsumerFriendlyMessages& consumer_friendly_messages =
@@ -456,7 +456,7 @@ TEST_F(PolicyManagerImplTest2,
TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
// Arrange
::policy::DeviceInfo dev_info;
- utils::SharedPtr<policy_table::Table> pt =
+ std::shared_ptr<policy_table::Table> pt =
(policy_manager_->GetCache())->GetPT();
dev_info.hardware = "hardware IPX";
dev_info.firmware_rev = "v.8.0.1";
diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
index 92525c646d..b87598b986 100644
--- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
@@ -44,8 +44,6 @@
#include "rpc_base/rpc_base.h"
#include "policy/policy_table/types.h"
#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using namespace ::policy;
namespace policy_table = rpc::policy_table_interface_base;
@@ -393,7 +391,7 @@ TEST_F(SQLPTExtRepresentationTest,
ASSERT_TRUE(reps_->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps_->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps_->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
policy_table["module_meta"] = Json::Value(Json::objectValue);
@@ -1506,7 +1504,7 @@ TEST_F(SQLPTExtRepresentationTest, SaveUserConsentRecords_ExpectedSaved) {
// Act
EXPECT_TRUE(reps_->Save(original_table));
- utils::SharedPtr<Table> loaded_table = reps_->GenerateSnapshot();
+ std::shared_ptr<Table> loaded_table = reps_->GenerateSnapshot();
// GetData/GetKeyData methods do internal existence check - no need to do it
// separately. In case of data is missing expectations will be violated.
@@ -1591,7 +1589,7 @@ TEST_F(SQLPTExtRepresentationTest, SaveFunctionalGroupings_ExpectedSaved) {
// Act
EXPECT_TRUE(reps_->Save(original_table));
- utils::SharedPtr<Table> loaded_table = reps_->GenerateSnapshot();
+ std::shared_ptr<Table> loaded_table = reps_->GenerateSnapshot();
FunctionalGroupings loaded_groupings =
GetData<Table, FunctionalGroupings>(*loaded_table);
diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
index 0b0831eaad..b0f340b0f2 100644
--- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
@@ -49,7 +49,6 @@
#include "policy/policy_table/enums.h"
#include "rpc_base/rpc_base.h"
#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
namespace policy_table = rpc::policy_table_interface_base;
using policy::SQLPTRepresentation;
@@ -81,14 +80,14 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static utils::dbms::SQLQuery* query_wrapper_;
// Gtest can show message that this object doesn't destroyed
- static std::auto_ptr<policy_handler_test::MockPolicySettings>
+ static std::unique_ptr<policy_handler_test::MockPolicySettings>
policy_settings_;
static void SetUpTestCase() {
const std::string kAppStorageFolder = "storage_SQLPTRepresentationTest";
reps = new SQLPTRepresentation(in_memory_);
ASSERT_TRUE(reps != NULL);
- policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
+ policy_settings_ = std::unique_ptr<policy_handler_test::MockPolicySettings>(
new policy_handler_test::MockPolicySettings());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
@@ -348,7 +347,7 @@ SQLPTRepresentation* SQLPTRepresentationTest::reps = 0;
utils::dbms::SQLQuery* SQLPTRepresentationTest::query_wrapper_ = 0;
const std::string SQLPTRepresentationTest::kDatabaseName = ":memory:";
const bool SQLPTRepresentationTest::in_memory_ = true;
-std::auto_ptr<policy_handler_test::MockPolicySettings>
+std::unique_ptr<policy_handler_test::MockPolicySettings>
SQLPTRepresentationTest::policy_settings_;
class SQLPTRepresentationTest2 : public ::testing::Test {
@@ -1585,7 +1584,7 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
// Remove fields which must be absent in snapshot
table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc
index 5546984ff4..278c4fc43a 100644
--- a/src/components/policy/policy_external/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_external/test/update_status_manager_test.cc
@@ -34,7 +34,7 @@
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
+
#include "utils/conditional_variable.h"
namespace test {
@@ -48,7 +48,7 @@ using testing::NiceMock;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
- utils::SharedPtr<UpdateStatusManager> manager_;
+ std::shared_ptr<UpdateStatusManager> manager_;
PolicyTableStatus status_;
const uint32_t k_timeout_;
NiceMock<MockPolicyListener> listener_;
@@ -58,7 +58,7 @@ class UpdateStatusManagerTest : public ::testing::Test {
public:
UpdateStatusManagerTest()
- : manager_(utils::MakeShared<UpdateStatusManager>())
+ : manager_(std::make_shared<UpdateStatusManager>())
, k_timeout_(1000)
, listener_()
, up_to_date_status_("UP_TO_DATE")
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..0144efaf7f 100644
--- a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -1,9 +1,9 @@
-/*! \page components_jsonhandler_formatters Smart Objects Formatters
+/*! \page components_jsonhandler_formatters Smart Objects formatters
In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
-The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+The interface of formatter is quite simple and defined by ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class. Actually it has two methods - ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
-Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+Current implementation has two different implementations of ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase class: ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
*/
diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
index 933690dc49..dbe317667a 100644
--- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h
+++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
@@ -35,7 +35,7 @@
#include <map>
#include "policy/policy_table/types.h"
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+
#include "policy/access_remote.h"
#include "policy/cache_manager.h"
@@ -46,7 +46,7 @@ namespace policy {
class AccessRemoteImpl : public AccessRemote {
public:
AccessRemoteImpl();
- explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
+ explicit AccessRemoteImpl(std::shared_ptr<CacheManager> cache);
/**
* @brief CheckModuleType check if module type is allowed for application
* @param app_id application id
@@ -139,7 +139,7 @@ class AccessRemoteImpl : public AccessRemote {
/**
* @brief cache_ contains pointer to cache manager instance
*/
- utils::SharedPtr<CacheManager> cache_;
+ std::shared_ptr<CacheManager> cache_;
/**
* @brief hmi_types_ contains list of default HMI types for applications
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
index 4a0a09db83..a28f1b3461 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -35,7 +35,6 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
@@ -216,7 +215,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -723,7 +722,7 @@ class CacheManager : public CacheManagerInterface {
const PolicySettings& get_settings() const;
- utils::SharedPtr<policy_table::Table> pt() const {
+ std::shared_ptr<policy_table::Table> pt() const {
return pt_;
}
@@ -775,14 +774,14 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- mutable sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
index 3dd2953865..10a6ea7f89 100644
--- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -36,7 +36,6 @@
#include <string>
#include <vector>
-#include "utils/shared_ptr.h"
#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.h"
@@ -222,7 +221,7 @@ class CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() = 0;
/**
* Applies policy table to the current table
@@ -670,12 +669,12 @@ class CacheManagerInterface {
virtual std::string GetCertificate() const = 0;
/**
- * @brief pt allows to obtain SharedPtr to PT.
+ * @brief pt allows to obtain std::shared_ptr to PT.
* Used ONLY in Unit tests
- * @return SharedPTR to PT
+ * @return std::shared_ptr to PT
*
*/
- virtual utils::SharedPtr<policy_table::Table> pt() const = 0;
+ virtual std::shared_ptr<policy_table::Table> pt() const = 0;
/**
* @brief OnDeviceSwitching Processes existing policy permissions for devices
@@ -687,7 +686,7 @@ class CacheManagerInterface {
const std::string& device_id_to) = 0;
};
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+typedef std::shared_ptr<CacheManagerInterface> CacheManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h
index 7f27ab2676..3ca0f93ebd 100644
--- a/src/components/policy/policy_regular/include/policy/policy_helper.h
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
+
#include "policy/policy_types.h"
namespace policy {
@@ -82,8 +82,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
*/
struct CheckAppPolicy {
CheckAppPolicy(PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
bool operator()(const AppPoliciesValueType& app_policy);
private:
@@ -131,8 +131,8 @@ struct CheckAppPolicy {
private:
PolicyManagerImpl* pm_;
- const utils::SharedPtr<policy_table::Table> update_;
- const utils::SharedPtr<policy_table::Table> snapshot_;
+ const std::shared_ptr<policy_table::Table> update_;
+ const std::shared_ptr<policy_table::Table> snapshot_;
};
/*
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
index c162d73011..51d4ee88aa 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -37,7 +37,6 @@
#include <list>
#include <cstdint>
-#include "utils/shared_ptr.h"
#include "utils/lock.h"
#include "policy/policy_manager.h"
#include "policy/policy_table.h"
@@ -467,7 +466,7 @@ class PolicyManagerImpl : public PolicyManager {
* @brief Setter for access_remote instance
* @param access_remote pointer to new access_remote instance
*/
- void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+ void set_access_remote(std::shared_ptr<AccessRemote> access_remote) OVERRIDE;
/**
* @brief Sends notification about application HMI level changed
@@ -671,7 +670,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param pt_content binary content of PT
* @return pointer to converted PT
*/
- virtual utils::SharedPtr<policy_table::Table> Parse(
+ virtual std::shared_ptr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
#else
/**
@@ -679,7 +678,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param pt_content binary content of PT
* @return pointer to converted PT
*/
- virtual utils::SharedPtr<policy_table::Table> ParseArray(
+ virtual std::shared_ptr<policy_table::Table> ParseArray(
const BinaryMessage& pt_content);
#endif
@@ -705,8 +704,8 @@ class PolicyManagerImpl : public PolicyManager {
* @return Collection per-application results
*/
void CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot);
/**
* @brief Fill structure to be sent with OnPermissionsChanged notification
@@ -803,7 +802,7 @@ class PolicyManagerImpl : public PolicyManager {
* @param type policy table type
* @return true if policy table valid, otherwise false
*/
- bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ bool IsPTValid(std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
/**
@@ -867,7 +866,7 @@ class PolicyManagerImpl : public PolicyManager {
/**
* @brief pointer to AccessRemote instance for working with RC applications
*/
- utils::SharedPtr<AccessRemote> access_remote_;
+ std::shared_ptr<AccessRemote> access_remote_;
/**
* @brief lock guard for protecting applications list access
diff --git a/src/components/policy/policy_regular/include/policy/policy_table.h b/src/components/policy/policy_regular/include/policy/policy_table.h
index afee8a34e4..353cdda871 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
@@ -42,7 +41,7 @@ namespace policy {
class PolicyTable {
public:
PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ explicit PolicyTable(std::shared_ptr<PTRepresentation> pt_data);
virtual ~PolicyTable();
/**
@@ -50,12 +49,12 @@ class PolicyTable {
* actual class storing policy table.
* @return PTRepresentation* Policy Table Content Handler
*/
- utils::SharedPtr<PTRepresentation> pt_data() const {
+ std::shared_ptr<PTRepresentation> pt_data() const {
return pt_data_;
}
private:
- utils::SharedPtr<PTRepresentation> pt_data_;
+ std::shared_ptr<PTRepresentation> pt_data_;
};
} // namespace policy
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 050ab63973..b2acf77ec1 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
@@ -78,6 +78,7 @@ enum Parameter {
P_VIN,
P_ACCPEDALPOSITION,
P_BELTSTATUS,
+ P_ELECTRONICPARKBRAKESTATUS,
P_DRIVERBRAKING,
P_PRNDL,
P_RPM,
@@ -155,6 +156,11 @@ bool EnumFromJsonString(const std::string& literal, Input* result);
enum ModuleType {
MT_CLIMATE,
MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS,
+ MT_EMPTY
};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
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 ebfbb7f29f..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;
@@ -230,6 +230,7 @@ struct ModuleConfig : CompositeType {
public:
Optional<Map<String<0, 100>, 0, 255> > device_certificates;
Optional<Boolean> preloaded_pt;
+ Optional<Boolean> full_app_id_supported;
Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles;
Integer<int64_t, 0, 4294967296ll> exchange_after_x_kilometers;
Integer<uint8_t, 0, 255> exchange_after_x_days;
diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h
index e0fc808e2f..276a0a5dca 100644
--- a/src/components/policy/policy_regular/include/policy/policy_types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -39,7 +39,8 @@
#include <map>
#include <set>
#include <utility>
-#include "utils/shared_ptr.h"
+#include <memory>
+
#include "utils/helpers.h"
#include "transport_manager/common.h"
@@ -79,7 +80,7 @@ enum PolicyTableStatus {
// Code generator uses String class name, so this typedef was renamed to PTSring
typedef std::string PTString;
typedef std::vector<uint8_t> BinaryMessage;
-typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+typedef std::shared_ptr<BinaryMessage> BinaryMessageSptr;
typedef std::string HMILevel;
typedef std::string Parameter;
diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h
index 08bd6d4923..378a294532 100644
--- a/src/components/policy/policy_regular/include/policy/pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/pt_representation.h
@@ -35,9 +35,11 @@
#include <vector>
#include <string>
+#include <memory>
#include "policy/policy_types.h"
#include "policy/policy_table/types.h"
#include "policy/policy_settings.h"
+#include "utils/macro.h"
namespace policy {
namespace policy_table = rpc::policy_table_interface_base;
@@ -208,7 +210,7 @@ class PTRepresentation {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const = 0;
virtual bool Save(const policy_table::Table& table) = 0;
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
index b26b2c9ede..0e9302dfac 100644
--- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
@@ -84,7 +84,7 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool Clear();
bool Drop();
virtual void WriteDb();
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const;
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot() const;
virtual bool Save(const policy_table::Table& table);
bool GetInitialAppData(const std::string& app_id,
StringArray* nicknames = NULL,
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h
index a68d986d10..52d5b92b8a 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h
@@ -66,14 +66,14 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- void SetNextStatus(utils::SharedPtr<Status> status);
+ void SetNextStatus(std::shared_ptr<Status> status);
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- void SetPostponedStatus(utils::SharedPtr<Status> status);
+ void SetPostponedStatus(std::shared_ptr<Status> status);
/**
* @brief Sets listener pointer
@@ -198,17 +198,17 @@ class UpdateStatusManager : public UpdateStatusManagerInterface {
/**
* @brief Current update status
*/
- utils::SharedPtr<Status> current_status_;
+ std::shared_ptr<Status> current_status_;
/**
* @brief Next status after current to be set
*/
- utils::SharedPtr<Status> next_status_;
+ std::shared_ptr<Status> next_status_;
/**
* @brief Status to be set after 'next' status
*/
- utils::SharedPtr<Status> postponed_status_;
+ std::shared_ptr<Status> postponed_status_;
sync_primitives::Lock status_lock_;
UpdateEvent last_processed_event_;
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
index e118f9974f..b9da90f929 100644
--- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
-#include "utils/shared_ptr.h"
#include "policy/policy_types.h"
#include "policy/status.h"
@@ -55,14 +54,14 @@ class UpdateStatusManagerInterface {
* @brief Set next status during event processing
* @param status Status shared pointer
*/
- virtual void SetNextStatus(utils::SharedPtr<Status> status) = 0;
+ virtual void SetNextStatus(std::shared_ptr<Status> status) = 0;
/**
* @brief Set postponed status (will be set after next status) during event
* processing
* @param status Status shared pointer
*/
- virtual void SetPostponedStatus(utils::SharedPtr<Status> status) = 0;
+ virtual void SetPostponedStatus(std::shared_ptr<Status> status) = 0;
/**
* @brief Sets listener pointer
* @param listener Pointer to policy listener implementation
@@ -112,7 +111,7 @@ class UpdateStatusManagerInterface {
virtual void OnPolicyInit(bool is_update_required) = 0;
};
-typedef utils::SharedPtr<UpdateStatusManagerInterface>
+typedef std::shared_ptr<UpdateStatusManagerInterface>
UpdateStatusManagerInterfaceSPtr;
} // namespace policy
diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
index 1e263ec9df..72ae5fd9e0 100644
--- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
+++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
@@ -36,7 +36,7 @@
#include <ctime>
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
+
#include "utils/timer.h"
#include "utils/macro.h"
@@ -46,18 +46,18 @@ using timer::Timer;
class GlobalCounter {
public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounter(std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type);
void operator++() const;
private:
GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppCounter {
public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type);
void operator++() const;
@@ -65,12 +65,12 @@ class AppCounter {
private:
std::string app_id_;
AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppInfo {
public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type);
void Update(const std::string& new_info) const;
@@ -78,14 +78,14 @@ class AppInfo {
private:
std::string app_id_;
AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
};
class AppStopwatchImpl : public AppStopwatch {
public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ AppStopwatchImpl(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
std::uint32_t timeout);
void Start(AppStopwatchId stopwatch_type) OVERRIDE;
@@ -96,7 +96,7 @@ class AppStopwatchImpl : public AppStopwatch {
// Fields
std::string app_id_;
AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
+ std::shared_ptr<StatisticsManager> statistics_manager_;
timer::Timer timer_;
const std::uint32_t time_out_;
DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
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 742ed547a8..7a751c0ea9 100644
--- a/src/components/policy/policy_regular/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_regular/policy_table_interface_ext.xml
@@ -39,6 +39,7 @@
<element name="vin" />
<element name="accPedalPosition" />
<element name="beltStatus" />
+ <element name="electronicParkBrakeStatus" />
<element name="driverBraking" />
<element name="prndl" />
<element name="rpm" />
@@ -93,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
@@ -135,6 +135,7 @@
<struct name="ModuleConfig">
<param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
<param name="preloaded_pt" type="Boolean" mandatory="false" />
+ <param name="full_app_id_supported" type="Boolean" mandatory="false" />
<param name="exchange_after_x_ignition_cycles" type="Integer"
maxvalue="255" />
<param name="exchange_after_x_kilometers" type="Integer"
diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc
index f99b226f2e..f743a4d56e 100644
--- a/src/components/policy/policy_regular/src/access_remote_impl.cc
+++ b/src/components/policy/policy_regular/src/access_remote_impl.cc
@@ -89,7 +89,7 @@ struct ToModuleType {
AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
-AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr<CacheManager> cache)
: cache_(cache) {}
bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 1d51b81af4..9accabf59b 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -103,8 +103,7 @@ CacheManager::CacheManager()
: CacheManagerInterface()
, pt_(new policy_table::Table)
, backup_(new SQLPTRepresentation())
- , update_required(false)
- , cache_lock_(true) {
+ , update_required(false) {
LOG4CXX_AUTO_TRACE(logger_);
backuper_ = new BackgroundBackuper(this);
backup_thread_ = threads::CreateThread("Backup thread", backuper_);
@@ -646,7 +645,7 @@ int CacheManager::TimeoutResponse() {
CACHE_MANAGER_CHECK(0);
sync_primitives::AutoLock auto_lock(cache_lock_);
return pt_->policy_table.module_config.timeout_after_x_seconds *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
}
bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
@@ -826,6 +825,9 @@ void CacheManager::CheckSnapshotInitialization() {
*(snapshot_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.full_app_id_supported) =
+ settings_->use_full_app_id();
+
// SDL must not send certificate in snapshot
snapshot_->policy_table.module_config.certificate =
rpc::Optional<rpc::String<0, 65535> >();
@@ -934,8 +936,8 @@ void CacheManager::CheckSnapshotInitialization() {
void CacheManager::PersistData() {
LOG4CXX_AUTO_TRACE(logger_);
- if (backup_.valid()) {
- if (pt_.valid()) {
+ if (backup_.use_count() != 0) {
+ if (pt_.use_count() != 0) {
// Comma expression is used to hold the lock only during the constructor
// call
policy_table::Table copy_pt(
@@ -1029,10 +1031,10 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id,
return false;
}
-utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+std::shared_ptr<policy_table::Table> CacheManager::GenerateSnapshot() {
CACHE_MANAGER_CHECK(snapshot_);
- snapshot_ = new policy_table::Table();
+ snapshot_ = std::make_shared<policy_table::Table>();
// Copy all members of policy table except messages in consumer friendly
// messages
@@ -1426,7 +1428,7 @@ bool CacheManager::Init(const std::string& file_name,
result = LoadFromFile(file_name, *pt_);
- utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = GenerateSnapshot();
result &= snapshot->is_valid();
LOG4CXX_DEBUG(logger_,
"Check if snapshot is valid: " << std::boolalpha << result);
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index 796dd25ec4..bae9fceb49 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -121,8 +121,8 @@ bool operator!=(const policy_table::ApplicationParams& first,
CheckAppPolicy::CheckAppPolicy(
PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot)
+ const std::shared_ptr<policy_table::Table> update,
+ const std::shared_ptr<policy_table::Table> snapshot)
: pm_(pm), update_(update), snapshot_(snapshot) {}
bool policy::CheckAppPolicy::HasRevokedGroups(
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
index d01631a2a2..f4b6f0ae03 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -44,12 +44,12 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "policy/cache_manager.h"
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
#include "utils/timer_task_impl.h"
-#include "utils/make_shared.h"
+
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
@@ -62,7 +62,7 @@ void DeleteManager(policy::PolicyManager* pm) {
namespace {
const uint32_t kDefaultRetryTimeoutInMSec =
- 60u * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ 60u * date_time::MILLISECONDS_IN_SECOND;
} // namespace
namespace policy {
@@ -73,8 +73,8 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
- , access_remote_(new AccessRemoteImpl(
- CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
+ , access_remote_(
+ new AccessRemoteImpl(std::static_pointer_cast<CacheManager>(cache_)))
, retry_sequence_timeout_(kDefaultRetryTimeoutInMSec)
, retry_sequence_index_(0)
, timer_retry_sequence_("Retry sequence timer",
@@ -93,21 +93,21 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) {
#ifdef USE_HMI_PTU_DECRYPTION
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::Parse(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
Json::Reader reader;
if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::make_shared<policy_table::Table>();
}
}
#else
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
+std::shared_ptr<policy_table::Table> PolicyManagerImpl::ParseArray(
const BinaryMessage& pt_content) {
std::string json(pt_content.begin(), pt_content.end());
Json::Value value;
@@ -116,12 +116,12 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray(
// For PT Update received from SDL Server.
if (value["data"].size() != 0) {
Json::Value data = value["data"];
- return new policy_table::Table(&data[0]);
+ return std::make_shared<policy_table::Table>(&data[0]);
} else {
- return new policy_table::Table(&value);
+ return std::make_shared<policy_table::Table>(&value);
}
} else {
- return utils::SharedPtr<policy_table::Table>();
+ return std::shared_ptr<policy_table::Table>();
}
}
@@ -154,11 +154,11 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
// Assuemes Policy Table was parsed, formatted, and/or decrypted by
// the HMI after system request before calling OnReceivedPolicyUpdate
// Parse message into table struct
- utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = Parse(pt_content);
#else
// Message Received from server unecnrypted with PTU in first element
// of 'data' array. No Parsing was done by HMI.
- utils::SharedPtr<policy_table::Table> pt_update = ParseArray(pt_content);
+ std::shared_ptr<policy_table::Table> pt_update = ParseArray(pt_content);
#endif
if (!pt_update) {
LOG4CXX_WARN(logger_, "Parsed table pointer is 0.");
@@ -187,7 +187,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
sync_primitives::AutoLock lock(apps_registration_lock_);
// Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(
@@ -238,8 +238,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
}
void PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
+ const std::shared_ptr<policy_table::Table> pt_update,
+ const std::shared_ptr<policy_table::Table> snapshot) {
LOG4CXX_INFO(logger_, "Checking incoming permissions.");
// Replace predefined policies with its actual setting, e.g. "123":"default"
@@ -274,7 +274,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
bool PolicyManagerImpl::RequestPTUpdate() {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ std::shared_ptr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
@@ -806,7 +806,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() {
}
bool PolicyManagerImpl::IsPTValid(
- utils::SharedPtr<policy_table::Table> policy_table,
+ std::shared_ptr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const {
policy_table->SetPolicyTableType(type);
if (!policy_table->is_valid()) {
@@ -827,9 +827,9 @@ const PolicySettings& PolicyManagerImpl::get_settings() const {
bool PolicyManagerImpl::ExceededDays() {
LOG4CXX_AUTO_TRACE(logger_);
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
+ const int days = date_time::getSecs(current_time) / kSecondsInDay;
return 0 == cache_->DaysBeforeExchange(days);
}
@@ -879,8 +879,7 @@ uint32_t PolicyManagerImpl::NextRetryTimeout() {
}
for (uint32_t i = 0u; i < retry_sequence_index_; ++i) {
- next += retry_sequence_seconds_[i] *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next += retry_sequence_seconds_[i] * date_time::MILLISECONDS_IN_SECOND;
next += retry_sequence_timeout_;
}
++retry_sequence_index_;
@@ -1066,11 +1065,11 @@ StatusNotifier PolicyManagerImpl::AddApplication(
sync_primitives::AutoLock lock(apps_registration_lock_);
if (IsNewApplication(application_id)) {
AddNewApplication(application_id, device_consent);
- return utils::MakeShared<CallStatusChange>(update_status_manager_,
- device_consent);
+ return std::make_shared<CallStatusChange>(update_status_manager_,
+ device_consent);
} else {
PromoteExistedApplication(application_id, device_consent);
- return utils::MakeShared<utils::CallNothing>();
+ return std::make_shared<utils::CallNothing>();
}
}
@@ -1165,7 +1164,7 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) {
void PolicyManagerImpl::set_cache_manager(
CacheManagerInterface* cache_manager) {
- cache_ = cache_manager;
+ cache_ = std::shared_ptr<CacheManagerInterface>(cache_manager);
}
void PolicyManagerImpl::RetrySequence() {
@@ -1287,7 +1286,7 @@ bool PolicyManagerImpl::GetModuleTypes(
}
void PolicyManagerImpl::set_access_remote(
- utils::SharedPtr<AccessRemote> access_remote) {
+ std::shared_ptr<AccessRemote> access_remote) {
access_remote_ = access_remote;
}
diff --git a/src/components/policy/policy_regular/src/policy_table.cc b/src/components/policy/policy_regular/src/policy_table.cc
index c5c6e3e132..b0fa5739da 100644
--- a/src/components/policy/policy_regular/src/policy_table.cc
+++ b/src/components/policy/policy_regular/src/policy_table.cc
@@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
PolicyTable::PolicyTable() : pt_data_(new SQLPTRepresentation()) {}
-PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+PolicyTable::PolicyTable(std::shared_ptr<PTRepresentation> pt_data)
: pt_data_(pt_data) {}
PolicyTable::~PolicyTable() {
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 e05ed8f064..138d866174 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -143,6 +143,8 @@ bool IsValidEnum(Parameter val) {
return true;
case P_BELTSTATUS:
return true;
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return true;
case P_DRIVERBRAKING:
return true;
case P_PRNDL:
@@ -207,6 +209,8 @@ const char* EnumToJsonString(Parameter val) {
return "accPedalPosition";
case P_BELTSTATUS:
return "beltStatus";
+ case P_ELECTRONICPARKBRAKESTATUS:
+ return "electronicParkBrakeStatus";
case P_DRIVERBRAKING:
return "driverBraking";
case P_PRNDL:
@@ -287,6 +291,9 @@ bool EnumFromJsonString(const std::string& literal, Parameter* result) {
} else if ("beltStatus" == literal) {
*result = P_BELTSTATUS;
return true;
+ } else if ("electronicParkBrakeStatus" == literal) {
+ *result = P_ELECTRONICPARKBRAKESTATUS;
+ return true;
} else if ("driverBraking" == literal) {
*result = P_DRIVERBRAKING;
return true;
@@ -634,6 +641,16 @@ bool IsValidEnum(ModuleType val) {
return true;
case MT_RADIO:
return true;
+ case MT_SEAT:
+ return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
+ case MT_EMPTY:
+ return true;
default:
return false;
}
@@ -644,6 +661,16 @@ const char* EnumToJsonString(ModuleType val) {
return "CLIMATE";
case MT_RADIO:
return "RADIO";
+ case MT_SEAT:
+ return "SEAT";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
+ case MT_EMPTY:
+ return "EMPTY";
default:
return "";
}
@@ -656,9 +683,23 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("RADIO" == literal) {
*result = MT_RADIO;
return true;
- } else {
- return false;
+ } 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 if ("EMPTY" == literal) {
+ *result = MT_EMPTY;
+ return true;
}
+ return false;
}
const std::string kDefaultApp = "default";
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
index c983e4f12b..851ed1bd18 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -455,6 +455,7 @@ ModuleConfig::ModuleConfig(const Json::Value* value__)
: CompositeType(InitHelper(value__, &Json::Value::isObject))
, device_certificates(impl::ValueMember(value__, "device_certificates"))
, preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
+ , full_app_id_supported(impl::ValueMember(value__, "full_app_id_supported"))
, exchange_after_x_ignition_cycles(
impl::ValueMember(value__, "exchange_after_x_ignition_cycles"))
, exchange_after_x_kilometers(
@@ -494,6 +495,8 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
Json::Value ModuleConfig::ToJsonValue() const {
Json::Value result__(Json::objectValue);
impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField(
+ "full_app_id_supported", full_app_id_supported, &result__);
impl::WriteJsonField("exchange_after_x_ignition_cycles",
exchange_after_x_ignition_cycles,
&result__);
@@ -521,6 +524,9 @@ bool ModuleConfig::is_valid() const {
if (!preloaded_pt.is_valid()) {
return false;
}
+ if (!full_app_id_supported.is_valid()) {
+ return false;
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
return false;
}
@@ -568,6 +574,9 @@ bool ModuleConfig::struct_empty() const {
if (preloaded_pt.is_initialized()) {
return false;
}
+ if (full_app_id_supported.is_initialized()) {
+ return false;
+ }
if (exchange_after_x_ignition_cycles.is_initialized()) {
return false;
@@ -617,6 +626,10 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
if (!preloaded_pt.is_valid()) {
preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
}
+ if (!full_app_id_supported.is_valid()) {
+ full_app_id_supported.ReportErrors(
+ &report__->ReportSubobject("full_app_id_supported"));
+ }
if (!exchange_after_x_ignition_cycles.is_valid()) {
exchange_after_x_ignition_cycles.ReportErrors(
&report__->ReportSubobject("exchange_after_x_ignition_cycles"));
@@ -675,6 +688,7 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
CompositeType::SetPolicyTableType(pt_type);
preloaded_pt.SetPolicyTableType(pt_type);
+ full_app_id_supported.SetPolicyTableType(pt_type);
exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
exchange_after_x_kilometers.SetPolicyTableType(pt_type);
exchange_after_x_days.SetPolicyTableType(pt_type);
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index b1e574578e..d32ee7133d 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -187,10 +187,10 @@ int SQLPTRepresentation::TimeoutResponse() {
utils::dbms::SQLQuery query(db());
if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const int defaultTimeout = 30 * date_time::MILLISECONDS_IN_SECOND;
return defaultTimeout;
}
- return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return query.GetInteger(0) * date_time::MILLISECONDS_IN_SECOND;
}
bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
@@ -483,10 +483,10 @@ bool SQLPTRepresentation::RefreshDB() {
return true;
}
-utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
+std::shared_ptr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot()
const {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ auto table = std::make_shared<policy_table::Table>();
GatherModuleMeta(&*table->policy_table.module_meta);
GatherModuleConfig(&table->policy_table.module_config);
GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
@@ -1696,6 +1696,10 @@ bool SQLPTRepresentation::GatherModuleType(
if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
return false;
}
+ if (policy_table::ModuleType::MT_EMPTY == type) {
+ app_types->mark_initialized();
+ continue;
+ }
app_types->push_back(type);
}
return true;
@@ -1728,18 +1732,30 @@ bool SQLPTRepresentation::SaveModuleType(
}
policy_table::ModuleTypes::const_iterator it;
- for (it = types.begin(); it != types.end(); ++it) {
+ if (!types.empty()) {
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+ } else if (types.is_initialized()) {
query.Bind(0, app_id);
- std::string module(policy_table::EnumToJsonString(*it));
- query.Bind(1, module);
- LOG4CXX_DEBUG(logger_,
- "Module(app: " << app_id << ", type: " << module << ")");
+ query.Bind(1,
+ std::string(policy_table::EnumToJsonString(
+ policy_table::ModuleType::MT_EMPTY)));
if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ LOG4CXX_WARN(logger_, "Incorrect insert into module types.");
return false;
}
+ } else {
+ LOG4CXX_WARN(logger_, "Module Type omitted.");
}
-
return true;
}
diff --git a/src/components/policy/policy_regular/src/status.cc b/src/components/policy/policy_regular/src/status.cc
index 8d65c606d0..00a6a95af3 100644
--- a/src/components/policy/policy_regular/src/status.cc
+++ b/src/components/policy/policy_regular/src/status.cc
@@ -32,7 +32,6 @@
#include "policy/status.h"
#include "policy/update_status_manager_interface.h"
-#include "utils/make_shared.h"
policy::UpToDateStatus::UpToDateStatus()
: Status("UP_TO_DATE", policy::PolicyTableStatus::StatusUpToDate) {}
@@ -44,7 +43,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManagerInterface* manager,
case kOnResetPolicyTableRequireUpdate:
case kScheduleUpdate:
case kOnResetRetrySequence:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -59,17 +58,17 @@ void policy::UpdateNeededStatus::ProcessEvent(
policy::UpdateStatusManagerInterface* manager, policy::UpdateEvent event) {
switch (event) {
case kOnUpdateSentOut:
- manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ manager->SetNextStatus(std::make_shared<UpdatingStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
@@ -88,22 +87,22 @@ void policy::UpdatingStatus::ProcessEvent(
switch (event) {
case kOnValidUpdateReceived:
case kOnResetPolicyTableNoUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
break;
case kOnNewAppRegistered:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnWrongUpdateReceived:
case kOnUpdateTimeout:
- manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpdateNeededStatus>());
break;
case kOnResetPolicyTableRequireUpdate:
- manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetNextStatus(std::make_shared<UpToDateStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
case kScheduleUpdate:
case kOnResetRetrySequence:
- manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ manager->SetPostponedStatus(std::make_shared<UpdateNeededStatus>());
break;
default:
break;
diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc
index 941113c753..66d21dea54 100644
--- a/src/components/policy/policy_regular/src/update_status_manager.cc
+++ b/src/components/policy/policy_regular/src/update_status_manager.cc
@@ -33,7 +33,6 @@
#include "policy/update_status_manager.h"
#include "policy/policy_listener.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace policy {
@@ -41,7 +40,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
UpdateStatusManager::UpdateStatusManager()
: listener_(NULL)
- , current_status_(utils::MakeShared<UpToDateStatus>())
+ , current_status_(std::make_shared<UpToDateStatus>())
, last_processed_event_(kNoEvent)
, apps_search_in_progress_(false)
, app_registered_from_non_consented_device_(true) {}
@@ -55,11 +54,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
DoTransition();
}
-void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetNextStatus(std::shared_ptr<Status> status) {
next_status_ = status;
}
-void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+void UpdateStatusManager::SetPostponedStatus(std::shared_ptr<Status> status) {
postponed_status_ = status;
}
diff --git a/src/components/policy/policy_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
index 60e34a929d..ed16fa3e8d 100644
--- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
@@ -36,13 +36,13 @@
#include <cassert>
#include "policy/usage_statistics/counter.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
namespace usage_statistics {
GlobalCounter::GlobalCounter(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
GlobalCounterId counter_type)
: counter_type_(counter_type), statistics_manager_(statistics_manager) {}
@@ -52,7 +52,7 @@ void GlobalCounter::operator++() const {
}
}
-AppCounter::AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+AppCounter::AppCounter(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppCounterId counter_type)
: app_id_(app_id)
@@ -65,7 +65,7 @@ void AppCounter::operator++() const {
}
}
-AppInfo::AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+AppInfo::AppInfo(std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
AppInfoId info_type)
: app_id_(app_id)
@@ -79,7 +79,7 @@ void AppInfo::Update(const std::string& new_info) const {
}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id)
: app_id_(app_id)
, stopwatch_type_(SECONDS_HMI_NONE)
@@ -90,7 +90,7 @@ AppStopwatchImpl::AppStopwatchImpl(
, time_out_(60) {}
AppStopwatchImpl::AppStopwatchImpl(
- utils::SharedPtr<StatisticsManager> statistics_manager,
+ std::shared_ptr<StatisticsManager> statistics_manager,
const std::string& app_id,
uint32_t timeout)
: app_id_(app_id)
@@ -103,8 +103,7 @@ AppStopwatchImpl::AppStopwatchImpl(
void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
stopwatch_type_ = stopwatch_type;
- timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
- timer::kPeriodic);
+ timer_.Start(time_out_ * date_time::MILLISECONDS_IN_SECOND, timer::kPeriodic);
}
void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
index f53ceb735b..2f4735dd66 100644
--- a/src/components/policy/policy_regular/test/PTU.json
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 6f24ee97f6..806ab8bcc0 100644
--- a/src/components/policy/policy_regular/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
index e1aaa953c5..28396be29a 100644
--- a/src/components/policy/policy_regular/test/PTU3.json
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index dad00de53e..4592e228df 100644
--- a/src/components/policy/policy_regular/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
@@ -296,6 +296,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -308,6 +309,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -320,6 +322,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -332,6 +335,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
index d086144d86..f79bb683f8 100644
--- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -37,7 +37,7 @@ namespace policy {
TEST(AccessRemoteImplTest, CheckModuleType) {
AccessRemoteImpl access_remote;
- access_remote.cache_->pt_ = new policy_table::Table();
+ access_remote.cache_->pt_ = std::make_shared<policy_table::Table>();
// No application
EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
@@ -81,7 +81,7 @@ TEST(AccessRemoteImplTest, GetGroups) {
ApplicationOnDevice who = {"dev1", "1234"};
access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL);
- access_remote.cache_->pt_ = new policy_table::Table();
+ access_remote.cache_->pt_ = std::make_shared<policy_table::Table>();
policy_table::ApplicationPolicies& apps =
access_remote.cache_->pt_->policy_table.app_policies_section.apps;
apps["1234"].groups.push_back("group_default");
diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc
index 2c0ab73c0b..d11bcec2ac 100644
--- a/src/components/policy/policy_regular/test/counter_test.cc
+++ b/src/components/policy/policy_regular/test/counter_test.cc
@@ -53,7 +53,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -67,7 +67,7 @@ TEST(
StatisticsManagerIncrementMethod1Arg,
GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
// Assert
@@ -82,7 +82,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -96,7 +96,7 @@ TEST(
StatisticsManagerIncrementMethod2Args,
AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
// Assert
@@ -110,7 +110,7 @@ TEST(
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -123,7 +123,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerSetMethod,
AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
// Assert
@@ -138,7 +138,7 @@ TEST(StatisticsManagerSetMethod,
TEST(StatisticsManagerAddMethod,
AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
@@ -155,7 +155,7 @@ TEST(StatisticsManagerAddMethod,
TEST(StatisticsManagerAddMethod,
DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
@@ -171,7 +171,7 @@ TEST(
StatisticsManagerAddMethod,
DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
// Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ auto msm = std::make_shared<StrictMock<MockStatisticsManager> >();
const std::uint32_t time_out = 1;
AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
index 8a47e7ca97..72f183175c 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
+++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
@@ -76,7 +76,7 @@ class MockPTRepresentation : virtual public PTRepresentation {
MOCK_METHOD0(Close, bool());
MOCK_METHOD0(Clear, bool());
MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr<policy_table::Table>());
MOCK_METHOD1(Save, bool(const policy_table::Table& table));
MOCK_CONST_METHOD0(UpdateRequired, bool());
MOCK_METHOD1(SaveUpdateRequired, void(bool value));
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index e4e361c52c..9f73f60d28 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -51,7 +51,7 @@
#include "utils/macro.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
-#include "utils/make_shared.h"
+
#include "utils/gen_hash.h"
#include "policy/mock_access_remote.h"
@@ -145,14 +145,14 @@ class PolicyManagerImplTest : public ::testing::Test {
MockCacheManagerInterface* cache_manager;
NiceMock<MockPolicyListener> listener;
const std::string device_id;
- utils::SharedPtr<access_remote_test::MockAccessRemote> access_remote;
+ std::shared_ptr<access_remote_test::MockAccessRemote> access_remote;
void SetUp() OVERRIDE {
manager = new PolicyManagerImpl();
manager->set_listener(&listener);
cache_manager = new MockCacheManagerInterface();
manager->set_cache_manager(cache_manager);
- access_remote = new access_remote_test::MockAccessRemote();
+ access_remote = std::shared_ptr<access_remote_test::MockAccessRemote>();
manager->set_access_remote(access_remote);
}
@@ -202,6 +202,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
manager = new PolicyManagerImpl();
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, use_full_app_id()).WillByDefault(Return(true));
manager->set_listener(&listener);
const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"};
hmi_level.assign(levels, levels + sizeof(levels) / sizeof(levels[0]));
@@ -238,6 +239,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
file_system::remove_directory_content(kAppStorageFolder);
ON_CALL(policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, use_full_app_id()).WillByDefault(Return(true));
ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_));
}
@@ -352,7 +354,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
// Get cache
::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
// Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Set functional groupings from policy table
input_functional_groupings = table->policy_table.functional_groupings;
}
@@ -466,6 +468,7 @@ TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
// Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
Json::Value table = CreatePTforLoad();
manager->ForcePTExchange();
manager->SetSendOnUpdateSentOut(false);
@@ -504,6 +507,7 @@ TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
}
TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
+ CreateLocalPT("sdl_preloaded_pt.json");
// Arrange
std::ifstream ifile("sdl_preloaded_pt.json");
Json::Reader reader;
@@ -720,8 +724,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
const std::string json = table.toStyledString();
::policy::BinaryMessage msg(json.begin(), json.end());
- utils::SharedPtr<policy_table::Table> snapshot =
- utils::MakeShared<policy_table::Table>(update.policy_table);
+ std::shared_ptr<policy_table::Table> snapshot =
+ std::make_shared<policy_table::Table>(update.policy_table);
// Assert
EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot));
EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true));
@@ -834,9 +838,9 @@ TEST_F(PolicyManagerImplTest2,
PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- int days = current_time.tv_sec / kSecondsInDay;
+ int days = date_time::getSecs(current_time) / kSecondsInDay;
EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
GetPTU("valid_sdl_pt_update.json");
@@ -894,24 +898,24 @@ TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
uint32_t timeout_after_x_seconds =
root["policy_table"]["module_config"]["timeout_after_x_seconds"]
.asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ date_time::MILLISECONDS_IN_SECOND;
const uint32_t first_retry = timeout_after_x_seconds;
EXPECT_EQ(first_retry, manager->NextRetryTimeout());
- uint32_t next_retry = first_retry +
- seconds_between_retries[0].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ uint32_t next_retry =
+ first_retry +
+ seconds_between_retries[0].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[1].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[1].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[2].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[2].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
- next_retry = first_retry + next_retry +
- seconds_between_retries[3].asInt() *
- date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next_retry =
+ first_retry + next_retry +
+ seconds_between_retries[3].asInt() * date_time::MILLISECONDS_IN_SECOND;
EXPECT_EQ(next_retry, manager->NextRetryTimeout());
}
}
@@ -961,7 +965,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
// Arrange
::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> table = cache->GenerateSnapshot();
// Get FunctionalGroupings
policy_table::FunctionalGroupings& fc =
table->policy_table.functional_groupings;
@@ -1253,7 +1257,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
GetPTU("valid_sdl_pt_update.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
+ std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo();
@@ -1334,7 +1338,7 @@ TEST_F(
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
+ std::shared_ptr<policy_table::Table> pt = (manager->GetCache())->pt();
::policy_table::PolicyTableType type1 =
::policy_table::PolicyTableType::PT_PRELOADED;
pt->SetPolicyTableType(type1);
diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 1f23adda1c..2a05a94f8b 100644
--- a/src/components/policy/policy_regular/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
@@ -416,6 +416,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -432,6 +433,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -448,6 +450,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -464,6 +467,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index 998ab7f5d4..b0d9117568 100644
--- a/src/components/policy/policy_regular/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
@@ -416,6 +416,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -432,6 +433,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -448,6 +450,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -464,6 +467,7 @@
"parameters": [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
index 7f5436b5b6..59e3f947c3 100644
--- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -297,6 +297,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -309,6 +310,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -321,6 +323,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -333,6 +336,7 @@
"LIMITED"],
"parameters": ["accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
index d28f70379c..7b882c6ceb 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
index 7bf287671e..7d90275328 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index cb9f9bddf6..909e4d5238 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
@@ -1433,6 +1433,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1445,6 +1446,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1457,6 +1459,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1469,6 +1472,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
index a5f3741331..7d192515dc 100644
--- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
+++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
@@ -47,8 +47,7 @@
#include "json/writer.h"
#include "json/reader.h"
#include "rpc_base/rpc_base.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/file_system.h"
#include "utils/sqlite_wrapper/sql_database.h"
@@ -78,12 +77,12 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
static const std::string kDatabaseName;
static const std::string kAppStorageFolder;
// Gtest can show message that this object doesn't destroyed
- std::auto_ptr<NiceMock<MockPolicySettings> > policy_settings_;
+ std::unique_ptr<NiceMock<MockPolicySettings> > policy_settings_;
void SetUp() OVERRIDE {
file_system::CreateDirectory(kAppStorageFolder);
reps = new SQLPTRepresentation;
- policy_settings_ = std::auto_ptr<NiceMock<MockPolicySettings> >(
+ policy_settings_ = std::unique_ptr<NiceMock<MockPolicySettings> >(
new NiceMock<MockPolicySettings>());
ON_CALL(*policy_settings_, app_storage_folder())
.WillByDefault(ReturnRef(kAppStorageFolder));
@@ -1517,7 +1516,7 @@ TEST_F(SQLPTRepresentationTest,
ASSERT_TRUE(reps->Save(update));
// Act
- utils::SharedPtr<policy_table::Table> snapshot = reps->GenerateSnapshot();
+ std::shared_ptr<policy_table::Table> snapshot = reps->GenerateSnapshot();
snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT);
// Remove fields which must be absent in snapshot
table["policy_table"]["consumer_friendly_messages"].removeMember("messages");
diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc
index 9d0326d0be..6f301c6720 100644
--- a/src/components/policy/policy_regular/test/update_status_manager_test.cc
+++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc
@@ -34,7 +34,6 @@
#include "policy/mock_policy_listener.h"
#include "policy/policy_manager_impl.h"
#include "policy/update_status_manager.h"
-#include "utils/make_shared.h"
namespace test {
namespace components {
@@ -46,13 +45,13 @@ using ::testing::Return;
class UpdateStatusManagerTest : public ::testing::Test {
protected:
- utils::SharedPtr<UpdateStatusManager> manager_;
- utils::SharedPtr<MockPolicyListener> listener_;
+ std::shared_ptr<UpdateStatusManager> manager_;
+ std::shared_ptr<MockPolicyListener> listener_;
public:
UpdateStatusManagerTest()
- : manager_(utils::MakeShared<UpdateStatusManager>())
- , listener_(utils::MakeShared<MockPolicyListener>()) {}
+ : manager_(std::make_shared<UpdateStatusManager>())
+ , listener_(std::make_shared<MockPolicyListener>()) {}
void SetUp() OVERRIDE {
manager_->set_listener(listener_.get());
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
index 81521a2e0b..5827ab287a 100644
--- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -1431,6 +1431,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1443,6 +1444,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1455,6 +1457,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
@@ -1467,6 +1470,7 @@
"parameters" : [
"accPedalPosition",
"beltStatus",
+ "electronicParkBrakeStatus",
"driverBraking",
"myKey",
"prndl",
diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc
index fb225b1461..11160d7082 100644
--- a/src/components/protocol/src/bson_object_keys.cc
+++ b/src/components/protocol/src/bson_object_keys.cc
@@ -12,6 +12,12 @@ const char* height = "height";
const char* width = "width";
const char* video_protocol = "videoProtocol";
const char* video_codec = "videoCodec";
+const char* secondary_transports = "secondaryTransports";
+const char* audio_service_transports = "audioServiceTransports";
+const char* video_service_transports = "videoServiceTransports";
+const char* tcp_ip_address = "tcpIpAddress";
+const char* tcp_port = "tcpPort";
+const char* reason = "reason";
} // namespace strings
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index d57211040a..ff8678b826 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -65,7 +65,6 @@ endforeach()
add_library(ProtocolHandler ${SOURCES})
-#add_dependencies(ProtocolHandler libbson)
target_link_libraries(ProtocolHandler ${LIBRARIES})
if(BUILD_TESTS)
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 8b7f28d50e..cb52c9d375 100644
--- a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
+++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
@@ -40,6 +40,8 @@
#include "protocol_handler/session_observer.h"
#include "security_manager/security_manager_listener.h"
+#include "utils/semantic_version.h"
+
namespace protocol_handler {
class ProtocolHandlerImpl;
@@ -50,22 +52,9 @@ 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,
- ProtocolPacket::ProtocolVersion& full_version,
- std::shared_ptr<BsonObject> payload);
-
HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
SessionObserver& session_observer,
- ProtocolPacket::ProtocolVersion& full_version,
+ utils::SemanticVersion& full_version,
const SessionContext& context,
const uint8_t protocol_version,
std::shared_ptr<BsonObject> payload);
@@ -124,7 +113,7 @@ class HandshakeHandler : public security_manager::SecurityManagerListener {
ProtocolHandlerImpl& protocol_handler_;
SessionObserver& session_observer_;
SessionContext context_;
- ProtocolPacket::ProtocolVersion full_version_;
+ utils::SemanticVersion full_version_;
const uint8_t protocol_version_;
std::shared_ptr<BsonObject> payload_;
};
diff --git a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
index bac37b508c..84ec3c9e30 100644
--- a/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
+++ b/src/components/protocol_handler/include/protocol_handler/multiframe_builder.h
@@ -60,7 +60,7 @@ typedef uint32_t MessageID;
struct ProtocolFrameData {
ProtocolFramePtr frame;
- TimevalStruct append_time;
+ date_time::TimeDuration append_time;
};
/**
*\brief Map of frames with last frame data for messages received in multiple
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 99f03b1c04..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
@@ -42,8 +42,10 @@
#include "utils/prioritized_queue.h"
#include "utils/message_queue.h"
#include "utils/threads/message_loop_thread.h"
-#include "utils/shared_ptr.h"
+
#include "utils/messagemeter.h"
+#include "utils/custom_string.h"
+#include "utils/semantic_version.h"
#include "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_packet.h"
@@ -55,6 +57,7 @@
#include "transport_manager/common.h"
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener_empty.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
#include "connection_handler/connection_handler.h"
#include "application_manager/policies/policy_handler_observer.h"
@@ -131,6 +134,30 @@ typedef threads::MessageLoopThread<
utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
typedef threads::MessageLoopThread<
utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
+
+// Type to allow easy mapping between a device type and transport
+// characteristics
+typedef enum {
+ TT_NONE = -1,
+ TT_USB = 0,
+ TT_BLUETOOTH = 1,
+ TT_WIFI = 2
+} TransportType;
+
+struct TransportDescription {
+ TransportDescription(const TransportType transport_type,
+ const bool ios_transport,
+ const bool android_transport)
+ : transport_type_(transport_type)
+ , ios_transport_(ios_transport)
+ , android_transport_(android_transport) {}
+
+ TransportType transport_type_;
+ bool ios_transport_;
+ bool android_transport_;
+};
+
+typedef std::map<std::string, TransportDescription> TransportTypes;
} // namespace impl
/**
@@ -231,7 +258,15 @@ class ProtocolHandlerImpl
*/
void SendEndSession(int32_t connection_id, uint8_t session_id);
- void SendEndService(int32_t connection_id,
+ /**
+ * \brief Sends ending session to mobile application
+ * \param primary_connection_id Identifier of connection within which
+ * service exists
+ * \param connection_id Identifier of the actual transport for the service
+ * \param session_id ID of session to be ended
+ */
+ void SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type);
@@ -279,7 +314,7 @@ class ProtocolHandlerImpl
uint32_t hash_code,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version);
+ utils::SemanticVersion& full_version);
/**
* \brief Sends acknowledgement of starting session to mobile application
@@ -303,7 +338,7 @@ class ProtocolHandlerImpl
uint32_t hash_code,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version,
+ utils::SemanticVersion& full_version,
BsonObject& params);
const ProtocolHandlerSettings& get_settings() const OVERRIDE {
@@ -383,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
@@ -422,10 +436,19 @@ class ProtocolHandlerImpl
const impl::ToMobileQueue& get_to_mobile_queue() const {
return raw_ford_messages_to_mobile_;
}
+
+ void set_tcp_config(bool tcp_enabled,
+ std::string tcp_address,
+ std::string tcp_port) {
+ tcp_enabled_ = tcp_enabled;
+ tcp_ip_address_ = tcp_address;
+ tcp_port_ = tcp_port;
+ }
#endif
private:
- void SendEndServicePrivate(int32_t connection_id,
+ void SendEndServicePrivate(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type);
@@ -436,6 +459,28 @@ class ProtocolHandlerImpl
uint8_t session_id,
uint32_t message_id);
+ /*
+ * Prepare and send TransportUpdateEvent message
+ */
+ void SendTransportUpdateEvent(ConnectionID connection_id, uint8_t session_id);
+
+ /*
+ * Prepare and send RegisterSecondaryTransportAck message
+ */
+ RESULT_CODE SendRegisterSecondaryTransportAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id);
+
+ /*
+ * Prepare and send RegisterSecondaryTransportNAck message
+ */
+ RESULT_CODE SendRegisterSecondaryTransportNAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id,
+ BsonObject* reason = NULL);
+
/**
* @brief Notifies about receiving message from TM.
*
@@ -474,6 +519,19 @@ class ProtocolHandlerImpl
void OnConnectionClosed(
const transport_manager::ConnectionUID connection_id) OVERRIDE;
+ void OnUnexpectedDisconnect(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError& error) OVERRIDE;
+
+ /**
+ * @brief Notifies that configuration of a transport has been updated.
+ *
+ * @param configs pairs of key and value that represent configuration.
+ */
+ void OnTransportConfigUpdated(
+ const transport_manager::transport_adapter::TransportConfig& configs)
+ OVERRIDE;
+
/**
* @brief Notifies subscribers about message
* received from mobile device.
@@ -570,11 +628,11 @@ class ProtocolHandlerImpl
RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet);
- DEPRECATED RESULT_CODE
- HandleControlMessageStartSession(const ProtocolPacket& packet);
-
RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet);
+ RESULT_CODE HandleControlMessageRegisterSecondaryTransport(
+ const ProtocolFramePtr packet);
+
RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet);
void PopValideAndExpirateMultiframes();
@@ -603,6 +661,32 @@ class ProtocolHandlerImpl
*/
uint8_t SupportedSDLProtocolVersion() const;
+ const impl::TransportDescription GetTransportTypeFromConnectionType(
+ const std::string& device_type) const;
+
+ const bool ParseSecondaryTransportConfiguration(
+ const ConnectionID connection_id,
+ std::vector<std::string>& secondaryTransports,
+ std::vector<int32_t>& audioServiceTransports,
+ std::vector<int32_t>& videoServiceTransports) const;
+
+ void GenerateSecondaryTransportsForStartSessionAck(
+ const std::vector<std::string>& secondary_transport_types,
+ bool device_is_ios,
+ bool device_is_android,
+ std::vector<std::string>& secondaryTransports) const;
+
+ void GenerateServiceTransportsForStartSessionAck(
+ bool secondary_enabled,
+ const std::vector<std::string>& service_transports,
+ const std::string& primary_connection_type,
+ const impl::TransportType primary_transport_type,
+ const std::vector<std::string>& secondary_transport_types,
+ std::vector<int32_t>& serviceTransports) const;
+
+ const std::string TransportTypeFromTransport(
+ const utils::custom_string::CustomString& transport) const;
+
const ProtocolHandlerSettings& settings_;
/**
@@ -689,6 +773,10 @@ class ProtocolHandlerImpl
sync_primitives::Lock start_session_frame_map_lock_;
StartSessionFrameMap start_session_frame_map_;
+ bool tcp_enabled_;
+ std::string tcp_port_;
+ std::string tcp_ip_address_;
+
#ifdef TELEMETRY_MONITOR
PHTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
index b6c05d4c46..de4af84915 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -64,58 +64,6 @@ class ProtocolPacket {
};
/**
- * \class ProtocolVersion
- * \brief Used for storing the full protocol version of a service
- * (major.minor.patch).
- */
- class ProtocolVersion {
- public:
- ProtocolVersion();
- ProtocolVersion(uint8_t majorVersion,
- uint8_t minorVersion,
- uint8_t patchVersion);
- ProtocolVersion(ProtocolVersion& other);
- ProtocolVersion(std::string versionString);
- uint8_t majorVersion;
- uint8_t minorVersion;
- uint8_t patchVersion;
- static inline int16_t cmp(const ProtocolVersion& version1,
- const ProtocolVersion& version2) {
- int16_t diff =
- static_cast<int16_t>(version1.majorVersion - version2.majorVersion);
- if (diff == 0) {
- diff =
- static_cast<int16_t>(version1.minorVersion - version2.minorVersion);
- if (diff == 0) {
- diff = static_cast<int16_t>(version1.patchVersion -
- version2.patchVersion);
- }
- }
- return diff;
- }
- inline bool operator==(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) == 0;
- }
- inline bool operator<(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) < 0;
- }
- bool operator>(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) > 0;
- }
- inline bool operator<=(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) <= 0;
- }
- bool operator>=(const ProtocolVersion& other) {
- return ProtocolVersion::cmp(*this, other) >= 0;
- }
- static inline ProtocolVersion* min(ProtocolVersion& version1,
- ProtocolVersion& version2) {
- return (version1 < version2) ? &version1 : &version2;
- }
- std::string to_string();
- };
-
- /**
* \class ProtocolHeader
* \brief Used for storing protocol header of a message.
*/
@@ -332,6 +280,11 @@ class ProtocolPacket {
ConnectionID connection_id() const;
/**
+ * \brief Setter of Connection Identifier
+ */
+ void set_connection_id(ConnectionID connection_id);
+
+ /**
* \brief Getter for data payload size
*/
uint32_t payload_size() const;
@@ -370,7 +323,7 @@ class ProtocolPacket {
* @brief Type definition for variable that hold shared pointer to protocolol
* packet
*/
-typedef utils::SharedPtr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
+typedef std::shared_ptr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
typedef std::list<ProtocolFramePtr> ProtocolFramePtrList;
template <typename _CharT>
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
index 8db551cfd6..775d77db66 100644
--- a/src/components/protocol_handler/src/handshake_handler.cc
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -43,33 +43,12 @@ 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,
- ProtocolPacket::ProtocolVersion& 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,
- ProtocolPacket::ProtocolVersion& full_version,
- const SessionContext& context,
- const uint8_t protocol_version,
- std::shared_ptr<BsonObject> payload)
+HandshakeHandler::HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ utils::SemanticVersion& full_version,
+ const SessionContext& context,
+ const uint8_t protocol_version,
+ std::shared_ptr<BsonObject> payload)
: protocol_handler_(protocol_handler)
, session_observer_(session_observer)
, context_(context)
diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc
index cf8a23ddc1..c34e2ec640 100644
--- a/src/components/protocol_handler/src/multiframe_builder.cc
+++ b/src/components/protocol_handler/src/multiframe_builder.cc
@@ -35,7 +35,7 @@
#include <limits>
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/lock.h"
#include "utils/date_time.h"
@@ -124,7 +124,7 @@ ProtocolFramePtrList MultiFrameBuilder::PopMultiframes() {
if (consecutive_frame_wait_msecs_ != 0) {
LOG4CXX_TRACE(logger_, "Expiration verification");
const int64_t time_left =
- date_time::DateTime::calculateTimeSpan(frame_data.append_time);
+ date_time::calculateTimeSpan(frame_data.append_time);
LOG4CXX_DEBUG(logger_, "mSecs left: " << time_left);
if (time_left >= consecutive_frame_wait_msecs_) {
LOG4CXX_WARN(logger_, "Expired frame: " << frame);
@@ -200,7 +200,7 @@ RESULT_CODE MultiFrameBuilder::HandleFirstFrame(const ProtocolFramePtr packet) {
<< connection_id
<< ", session_id: " << static_cast<int>(session_id)
<< ", message_id: " << message_id);
- messageId_map[message_id] = {packet, date_time::DateTime::getCurrentTime()};
+ messageId_map[message_id] = {packet, date_time::getCurrentTime()};
return RESULT_OK;
}
@@ -279,7 +279,7 @@ RESULT_CODE MultiFrameBuilder::HandleConsecutiveFrame(
LOG4CXX_INFO(logger_,
"Assembled frame with payload size: "
<< assembling_frame->payload_size());
- frame_data.append_time = date_time::DateTime::getCurrentTime();
+ frame_data.append_time = date_time::getCurrentTime();
return RESULT_OK;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 636932f449..093d89490b 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -31,6 +31,7 @@
*/
#include "protocol_handler/protocol_handler_impl.h"
+#include <arpa/inet.h> // for INET6_ADDRSTRLEN
#include <memory.h>
#include <algorithm> // std::find
#include <bson_object.h>
@@ -60,7 +61,8 @@ std::string ConvertPacketDataToString(const uint8_t* data,
const size_t kStackSize = 65536;
-ProtocolPacket::ProtocolVersion defaultProtocolVersion(5, 0, 0);
+utils::SemanticVersion defaultProtocolVersion(5, 1, 0);
+utils::SemanticVersion minMultipleTransportsVersion(5, 1, 0);
ProtocolHandlerImpl::ProtocolHandlerImpl(
const ProtocolHandlerSettings& settings,
@@ -84,6 +86,7 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
"PH ToMobile", this, threads::ThreadOptions(kStackSize))
, start_session_frame_map_lock_()
, start_session_frame_map_()
+ , tcp_enabled_(false)
#ifdef TELEMETRY_MONITOR
, metric_observer_(NULL)
#endif // TELEMETRY_MONITOR
@@ -196,7 +199,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
uint8_t service_type,
bool protection) {
LOG4CXX_AUTO_TRACE(logger_);
- ProtocolPacket::ProtocolVersion fullVersion;
+ utils::SemanticVersion fullVersion;
SendStartSessionAck(connection_id,
session_id,
input_protocol_version,
@@ -213,7 +216,7 @@ void ProtocolHandlerImpl::SendStartSessionAck(
uint32_t hash_id,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version) {
+ utils::SemanticVersion& full_version) {
LOG4CXX_AUTO_TRACE(logger_);
BsonObject empty_param;
@@ -238,16 +241,18 @@ void ProtocolHandlerImpl::SendStartSessionAck(
uint32_t hash_id,
uint8_t service_type,
bool protection,
- ProtocolPacket::ProtocolVersion& full_version,
+ utils::SemanticVersion& full_version,
BsonObject& params) {
LOG4CXX_AUTO_TRACE(logger_);
+ bool send_transport_update_event = false;
+
uint8_t ack_protocol_version = SupportedSDLProtocolVersion();
const bool proxy_supports_v5_protocol =
input_protocol_version >= PROTOCOL_VERSION_5 ||
(ServiceTypeFromByte(service_type) == kRpc &&
- full_version.majorVersion >= PROTOCOL_VERSION_5);
+ full_version.major_version_ >= PROTOCOL_VERSION_5);
if (kRpc != service_type) {
// In case if input protocol version os bigger then supported, SDL should
@@ -285,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: "
@@ -295,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: "
@@ -302,21 +309,107 @@ void ProtocolHandlerImpl::SendStartSessionAck(
&params, strings::hash_id)));
// Minimum protocol version supported by both
- ProtocolPacket::ProtocolVersion* minVersion =
- (full_version.majorVersion < PROTOCOL_VERSION_5)
+ utils::SemanticVersion* minVersion =
+ (full_version.major_version_ < PROTOCOL_VERSION_5)
? &defaultProtocolVersion
- : ProtocolPacket::ProtocolVersion::min(full_version,
- defaultProtocolVersion);
+ : utils::SemanticVersion::min(full_version,
+ defaultProtocolVersion);
char protocolVersionString[256];
- strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255);
+ strncpy(protocolVersionString, (*minVersion).toString().c_str(), 255);
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: "
<< protocol_ver_written << "; Value: "
<< bson_object_get_string(&params, strings::protocol_version));
+
+ LOG4CXX_INFO(logger_,
+ "Protocol Version String " << protocolVersionString);
+
+ std::vector<std::string> secondaryTransports;
+ std::vector<int32_t> audioServiceTransports;
+ std::vector<int32_t> videoServiceTransports;
+ if (*minVersion >= minMultipleTransportsVersion) {
+ if (ParseSecondaryTransportConfiguration(connection_id,
+ secondaryTransports,
+ audioServiceTransports,
+ videoServiceTransports)) {
+ LOG4CXX_DEBUG(logger_, "Multiple transports are enabled.");
+ BsonArray secondaryTransportsArr;
+ bson_array_initialize(&secondaryTransportsArr,
+ secondaryTransports.size());
+ for (unsigned int i = 0; i < secondaryTransports.size(); i++) {
+ char secondaryTransport[255];
+ strncpy(secondaryTransport,
+ secondaryTransports[i].c_str(),
+ sizeof(secondaryTransport));
+ secondaryTransport[sizeof(secondaryTransport) - 1] = '\0';
+ LOG4CXX_DEBUG(
+ logger_,
+ "Adding "
+ << secondaryTransport
+ << " to secondaryTransports parameter of StartSessionAck");
+ bson_array_add_string(&secondaryTransportsArr, secondaryTransport);
+ }
+ bson_object_put_array(
+ &params, strings::secondary_transports, &secondaryTransportsArr);
+
+ BsonArray audioServiceTransportsArr;
+ bson_array_initialize(&audioServiceTransportsArr,
+ audioServiceTransports.size());
+ for (unsigned int i = 0; i < audioServiceTransports.size(); i++) {
+ LOG4CXX_DEBUG(logger_,
+ "Adding " << audioServiceTransports[i]
+ << " to audioServiceTransports parameter "
+ "of StartSessionAck");
+ bson_array_add_int32(&audioServiceTransportsArr,
+ audioServiceTransports[i]);
+ }
+ bson_object_put_array(&params,
+ strings::audio_service_transports,
+ &audioServiceTransportsArr);
+
+ BsonArray videoServiceTransportsArr;
+ bson_array_initialize(&videoServiceTransportsArr,
+ videoServiceTransports.size());
+ for (unsigned int i = 0; i < videoServiceTransports.size(); i++) {
+ LOG4CXX_DEBUG(logger_,
+ "Adding " << videoServiceTransports[i]
+ << " to videoServiceTransports parameter "
+ "of StartSessionAck");
+ bson_array_add_int32(&videoServiceTransportsArr,
+ videoServiceTransports[i]);
+ }
+ bson_object_put_array(&params,
+ strings::video_service_transports,
+ &videoServiceTransportsArr);
+
+ if (settings_.multiple_transports_enabled()) {
+ send_transport_update_event = true;
+ } else {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Multiple transports feature is disabled by configuration");
+ // In this case, we must remember that this session will never have
+ // a secondary transport.
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ } else {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to set up secondary transport and service type params");
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Older protocol version. No multiple transports");
+ connection_handler_.SetSecondaryTransportID(session_id,
+ kDisabledSecondary);
+ }
}
uint8_t* payloadBytes = bson_object_to_bytes(&params);
ptr->set_data(payloadBytes, bson_object_size(&params));
@@ -334,6 +427,16 @@ void ProtocolHandlerImpl::SendStartSessionAck(
<< static_cast<int32_t>(service_type) << " session_id "
<< static_cast<int32_t>(session_id) << " protection "
<< (protection ? "ON" : "OFF"));
+
+ if (send_transport_update_event) {
+ // Wait until the StartService ACK has been processed for sending.
+ // The TransportUpdateEvent has a higher priority, being that it's
+ // a SERVICE_TYPE_CONTROL message. (The ACK is SERVICE_TYPE_RPC.)
+ LOG4CXX_DEBUG(logger_, "Waiting for the MessageToMobile queue to be empty");
+ raw_ford_messages_to_mobile_.WaitDumpQueue();
+ LOG4CXX_DEBUG(logger_, "Sending the TransportUpdate event");
+ SendTransportUpdateEvent(connection_id, session_id);
+ }
}
void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
@@ -491,14 +594,18 @@ void ProtocolHandlerImpl::SendEndSessionAck(ConnectionID connection_id,
<< static_cast<int32_t>(session_id));
}
-void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
+void ProtocolHandlerImpl::SendEndServicePrivate(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) {
LOG4CXX_AUTO_TRACE(logger_);
uint8_t protocol_version;
if (session_observer_.ProtocolVersionUsed(
- connection_id, session_id, protocol_version)) {
+ primary_connection_id, session_id, protocol_version)) {
+ LOG4CXX_TRACE(logger_,
+ "SendEndServicePrivate using protocol version "
+ << static_cast<int32_t>(protocol_version));
ProtocolFramePtr ptr(
new protocol_handler::ProtocolPacket(connection_id,
protocol_version,
@@ -513,25 +620,31 @@ void ProtocolHandlerImpl::SendEndServicePrivate(int32_t connection_id,
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
LOG4CXX_DEBUG(logger_,
- "SendEndSession() for connection "
- << connection_id << " for service_type " << service_type
+ "SendEndServicePrivate() for connection "
+ << primary_connection_id << " for service_type "
+ << static_cast<int>(service_type)
+ << " service connection " << connection_id
<< " session_id " << static_cast<int32_t>(session_id));
} else {
LOG4CXX_WARN(
logger_,
- "SendEndSession is failed connection or session does not exist");
+ "SendEndServicePrivate is failed connection or session does not exist");
}
}
void ProtocolHandlerImpl::SendEndSession(int32_t connection_id,
uint8_t session_id) {
- SendEndServicePrivate(connection_id, session_id, SERVICE_TYPE_RPC);
+ // A session is always associated with a primary connection ID
+ SendEndServicePrivate(
+ connection_id, connection_id, session_id, SERVICE_TYPE_RPC);
}
-void ProtocolHandlerImpl::SendEndService(int32_t connection_id,
+void ProtocolHandlerImpl::SendEndService(int32_t primary_connection_id,
+ int32_t connection_id,
uint8_t session_id,
uint8_t service_type) {
- SendEndServicePrivate(connection_id, session_id, service_type);
+ SendEndServicePrivate(
+ primary_connection_id, connection_id, session_id, service_type);
}
RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
@@ -563,6 +676,139 @@ RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
return RESULT_FAIL;
}
+void ProtocolHandlerImpl::SendTransportUpdateEvent(ConnectionID connection_id,
+ uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t protocol_version;
+ if (session_observer_.ProtocolVersionUsed(
+ connection_id, session_id, protocol_version)) {
+ ProtocolFramePtr ptr(
+ new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ session_id,
+ 0,
+ message_counters_[session_id]++));
+
+ BsonObject payload_obj;
+ bson_object_initialize_default(&payload_obj);
+
+ int32_t tcp_port = atoi(tcp_port_.c_str());
+ char tcp_ip_address[INET6_ADDRSTRLEN + 1];
+ if (tcp_enabled_ && (tcp_port != 0)) {
+ strncpy(tcp_ip_address, tcp_ip_address_.c_str(), INET6_ADDRSTRLEN);
+ tcp_ip_address[INET6_ADDRSTRLEN] = '\0';
+ bson_object_put_string(
+ &payload_obj, strings::tcp_ip_address, tcp_ip_address);
+ bson_object_put_int32(&payload_obj, strings::tcp_port, tcp_port);
+ } else {
+ tcp_ip_address[0] = '\0';
+ bson_object_put_string(
+ &payload_obj, strings::tcp_ip_address, tcp_ip_address);
+ // omit TCP port number
+ }
+ LOG4CXX_INFO(logger_,
+ "SendTransportUpdateEvent IP address: "
+ << tcp_ip_address << " Port: " << tcp_port);
+
+ uint8_t* payloadBytes = bson_object_to_bytes(&payload_obj);
+ ptr->set_data(payloadBytes, bson_object_size(&payload_obj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payload_obj);
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_DEBUG(logger_,
+ "SendTransportUpdateEvent() for connection "
+ << connection_id << " for session "
+ << static_cast<int32_t>(session_id));
+ } else {
+ LOG4CXX_WARN(logger_,
+ "SendTransportUpdateEvent is failed connection or session "
+ "does not exist");
+ }
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendRegisterSecondaryTransportAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // acquire the protocol version from primary transport
+ uint8_t protocol_version;
+ if (session_observer_.ProtocolVersionUsed(
+ primary_transport_connection_id, session_id, protocol_version)) {
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK,
+ session_id,
+ 0u,
+ 2));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+ }
+ LOG4CXX_WARN(logger_,
+ "RegisterSecondaryTransportAck is failed connection or session "
+ "does not exist");
+ return RESULT_FAIL;
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendRegisterSecondaryTransportNAck(
+ ConnectionID connection_id,
+ ConnectionID primary_transport_connection_id,
+ uint8_t session_id,
+ BsonObject* reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // If mobile sends an invalid session ID and we cannot find out the Connection
+ // ID of primary transport, then we use version 5. (The multiple-transports
+ // feature is added in 5.1.0.)
+ uint8_t protocol_version = PROTOCOL_VERSION_5;
+ if (primary_transport_connection_id > 0) {
+ // acquire the protocol version from primary transport
+ if (!session_observer_.ProtocolVersionUsed(
+ primary_transport_connection_id, session_id, protocol_version)) {
+ LOG4CXX_WARN(logger_,
+ "Failed to acquire protocol version for "
+ "RegisterSecondaryTransportNAck");
+ return RESULT_FAIL;
+ }
+ }
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(
+ connection_id,
+ protocol_version,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK,
+ session_id,
+ 0u,
+ 2));
+
+ if (reason) {
+ uint8_t* payloadBytes = bson_object_to_bytes(reason);
+ ptr->set_data(payloadBytes, bson_object_size(reason));
+ free(payloadBytes);
+ }
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+ return RESULT_OK;
+}
+
void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
uint8_t session_id) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -592,7 +838,7 @@ void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
bool final_message) {
#ifdef TELEMETRY_MONITOR
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
LOG4CXX_AUTO_TRACE(logger_);
if (!message) {
@@ -682,8 +928,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
}
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->message_id = message_id;
metric->connection_key = message->connection_key();
metric->raw_msg = message;
@@ -738,7 +983,7 @@ void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
it != protocol_frames.end();
++it) {
#ifdef TELEMETRY_MONITOR
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
#endif // TELEMETRY_MONITOR
ProtocolFramePtr frame = *it;
#ifdef ENABLE_SECURITY
@@ -857,6 +1102,12 @@ void ProtocolHandlerImpl::OnConnectionClosed(
multiframe_builder_.RemoveConnection(connection_id);
}
+void ProtocolHandlerImpl::OnUnexpectedDisconnect(
+ const transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError& error) {
+ OnConnectionClosed(connection_id);
+}
+
void ProtocolHandlerImpl::NotifyOnFailedHandshake() {
LOG4CXX_AUTO_TRACE(logger_);
#ifdef ENABLE_SECURITY
@@ -864,6 +1115,72 @@ void ProtocolHandlerImpl::NotifyOnFailedHandshake() {
#endif // ENABLE_SECURITY
}
+void ProtocolHandlerImpl::OnTransportConfigUpdated(
+ const transport_manager::transport_adapter::TransportConfig& configs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_manager::transport_adapter::TransportConfig::const_iterator it =
+ configs.find(transport_manager::transport_adapter::tc_enabled);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No enabled field in OnTransportConfigUpdated");
+ return;
+ }
+
+ bool tcp_enabled = (0 == strcmp("true", it->second.c_str()));
+ std::string tcp_port;
+
+ if (tcp_enabled) {
+ it = configs.find(transport_manager::transport_adapter::tc_tcp_port);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No port field in OnTransportConfigUpdated");
+ return;
+ }
+ tcp_port = it->second;
+
+ it = configs.find(transport_manager::transport_adapter::tc_tcp_ip_address);
+ if (configs.end() == it) {
+ LOG4CXX_WARN(logger_, "No IP address field in OnTransportConfigUpdated");
+ return;
+ }
+ tcp_enabled_ = true;
+ tcp_port_ = tcp_port;
+ tcp_ip_address_ = it->second;
+ } else {
+ tcp_enabled_ = false;
+ tcp_port_.clear();
+ tcp_ip_address_.clear();
+ }
+
+ LOG4CXX_INFO(logger_,
+ "OnTransportConfigUpdated: new config enabled is "
+ << tcp_enabled_ << ". Port is " << tcp_port_
+ << ". IP Address is " << tcp_ip_address_);
+
+ // Walk the SessionConnection map and find all sessions that need a
+ // TransportUpdate Event. Sessions flagged with kDisabledSecondary in their
+ // secondary transport are ineligible for secondary transport, and
+ // therefore don't get this event.
+ DataAccessor<connection_handler::SessionConnectionMap>
+ session_connection_map_accessor =
+ connection_handler_.session_connection_map();
+ const connection_handler::SessionConnectionMap& session_connection_map =
+ session_connection_map_accessor.GetData();
+ connection_handler::SessionConnectionMap::const_iterator itr =
+ session_connection_map.begin();
+ while (itr != session_connection_map.end()) {
+ const connection_handler::SessionTransports st = itr->second;
+ LOG4CXX_INFO(logger_,
+ "OnTransportConfigUpdated found session "
+ << itr->first << " with primary connection "
+ << st.primary_transport << " and secondary connection "
+ << st.secondary_transport);
+ if (st.secondary_transport != kDisabledSecondary) {
+ SendTransportUpdateEvent(st.primary_transport, itr->first);
+ }
+ itr++;
+ }
+}
+
RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
if (!packet) {
@@ -1048,6 +1365,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
<< packet->data_size() << "; message "
<< ConvertPacketDataToString(packet->data(), packet->data_size()));
+ // Replace a potential secondary transport ID in the packet with the primary
+ // transport ID
+ const connection_handler::SessionTransports st =
+ connection_handler_.GetSessionTransports(packet->session_id());
+ if (st.primary_transport != 0) {
+ packet->set_connection_id(st.primary_transport);
+ }
const uint32_t connection_key = session_observer_.KeyFromPair(
packet->connection_id(), packet->session_id());
@@ -1062,8 +1386,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
}
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->message_id = packet->message_id();
metric->connection_key = connection_key;
metric->raw_msg = rawMessage;
@@ -1080,6 +1403,14 @@ RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
+ // Replace a potential secondary transport ID in the packet with the primary
+ // transport ID
+ const connection_handler::SessionTransports st =
+ connection_handler_.GetSessionTransports(packet->session_id());
+ if (st.primary_transport != 0) {
+ packet->set_connection_id(st.primary_transport);
+ }
+
if (multiframe_builder_.AddFrame(packet) != RESULT_OK) {
LOG4CXX_WARN(logger_, "Frame assembling issue");
}
@@ -1117,6 +1448,10 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
<< packet->connection_id());
return RESULT_OK;
}
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT: {
+ LOG4CXX_TRACE(logger_, "FrameData: RegisterSecondaryTransport");
+ return HandleControlMessageRegisterSecondaryTransport(packet);
+ }
default:
LOG4CXX_WARN(logger_,
"Control message of type "
@@ -1214,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;
- }
- ProtocolPacket::ProtocolVersion* 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 ProtocolPacket::ProtocolVersion(
- std::string(bson_object_get_string(&obj, "protocolVersion")));
- bson_object_deinitialize(&obj);
- // Constructed payloads added in Protocol v5
- if (fullVersion->majorVersion < PROTOCOL_VERSION_5) {
- rejectedParams.push_back(std::string("protocolVersion"));
- }
- } else {
- fullVersion = new ProtocolPacket::ProtocolVersion();
- }
- 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());
- ProtocolPacket::ProtocolVersion fullVersion(
- bson_object_get_string(&obj, "protocolVersion"));
- bson_object_deinitialize(&obj);
-
- if (fullVersion.majorVersion >= 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_);
@@ -1401,6 +1576,11 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
const ConnectionID connection_id = packet->connection_id();
const uint8_t session_id = packet->session_id();
+ LOG4CXX_INFO(logger_,
+ "StartSession ID " << static_cast<int>(session_id)
+ << " and Connection ID "
+ << static_cast<int>(connection_id));
+
{
sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
start_session_frame_map_[std::make_pair(connection_id, session_id)] =
@@ -1414,21 +1594,48 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
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) {
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageRegisterSecondaryTransport(
+ const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
- protocol_handler::SessionContext context(connection_id,
- session_id,
- generated_session_id,
- ServiceType::kInvalidServiceType,
- hash_id,
- protection);
- NotifySessionStarted(context, rejected_params);
+ const uint8_t session_id = packet->session_id();
+ const ConnectionID connection_id = packet->connection_id();
+ ConnectionID primary_connection_id = 0;
+
+ LOG4CXX_INFO(logger_,
+ "RegisterSecondaryTransport ID "
+ << static_cast<int>(session_id) << " and Connection ID "
+ << static_cast<int>(connection_id));
+
+ if (connection_handler_.OnSecondaryTransportStarted(
+ primary_connection_id, connection_id, session_id)) {
+ SendRegisterSecondaryTransportAck(
+ connection_id, primary_connection_id, session_id);
+ } else {
+ char reason[256];
+ BsonObject registerSecondaryTransportNackObj;
+ bson_object_initialize_default(&registerSecondaryTransportNackObj);
+ if (0 == session_id) {
+ strncpy(reason,
+ "RegisterSecondaryTransport MUST include a non-zero session ID",
+ 255);
+ } else if (primary_connection_id == 0) {
+ strncpy(reason, "RegisterSecondaryTransport session ID not found", 255);
+ } else {
+ strncpy(
+ reason,
+ "RegisterSecondaryTransport session ID has already been registered",
+ 255);
+ }
+ bson_object_put_string(
+ &registerSecondaryTransportNackObj, strings::reason, reason);
+ SendRegisterSecondaryTransportNAck(connection_id,
+ primary_connection_id,
+ session_id,
+ &registerSecondaryTransportNackObj);
+ bson_object_deinitialize(&registerSecondaryTransportNackObj);
+ }
+
+ return RESULT_OK;
}
void ProtocolHandlerImpl::NotifySessionStarted(
@@ -1498,7 +1705,7 @@ void ProtocolHandlerImpl::NotifySessionStarted(
bson_object_deinitialize(&req_param);
}
- std::shared_ptr<ProtocolPacket::ProtocolVersion> fullVersion;
+ std::shared_ptr<utils::SemanticVersion> fullVersion;
// 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
@@ -1508,15 +1715,14 @@ void ProtocolHandlerImpl::NotifySessionStarted(
char* version_param =
bson_object_get_string(&request_params, strings::protocol_version);
std::string version_string(version_param == NULL ? "" : version_param);
- fullVersion =
- std::make_shared<ProtocolPacket::ProtocolVersion>(version_string);
+ fullVersion = std::make_shared<utils::SemanticVersion>(version_string);
// Constructed payloads added in Protocol v5
- if (fullVersion->majorVersion < PROTOCOL_VERSION_5) {
+ if (fullVersion->major_version_ < PROTOCOL_VERSION_5) {
rejected_params.push_back(std::string(strings::protocol_version));
}
bson_object_deinitialize(&request_params);
} else {
- fullVersion = std::make_shared<ProtocolPacket::ProtocolVersion>();
+ fullVersion = std::make_shared<utils::SemanticVersion>();
}
#ifdef ENABLE_SECURITY
@@ -1670,8 +1876,7 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
- PHTelemetryObserver::MessageMetric* metric =
- new PHTelemetryObserver::MessageMetric();
+ auto metric = std::make_shared<PHTelemetryObserver::MessageMetric>();
metric->raw_msg = rawMessage;
metric_observer_->EndMessageProcess(metric);
}
@@ -1989,4 +2194,241 @@ uint8_t ProtocolHandlerImpl::SupportedSDLProtocolVersion() const {
LOG4CXX_AUTO_TRACE(logger_);
return get_settings().max_supported_protocol_version();
}
+
+const impl::TransportTypes transportTypes = {
+ std::make_pair(
+ std::string("AOA_USB"),
+ impl::TransportDescription(impl::TransportType::TT_USB, false, true)),
+ std::make_pair(std::string("SPP_BLUETOOTH"),
+ impl::TransportDescription(
+ impl::TransportType::TT_BLUETOOTH, false, true)),
+ std::make_pair(std::string("IAP_BLUETOOTH"),
+ impl::TransportDescription(
+ impl::TransportType::TT_BLUETOOTH, true, false)),
+ std::make_pair(
+ std::string("IAP_USB"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("TCP_WIFI"),
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, true)),
+ std::make_pair(
+ std::string("IAP_USB_HOST_MODE"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("IAP_USB_DEVICE_MODE"),
+ impl::TransportDescription(impl::TransportType::TT_USB, true, false)),
+ std::make_pair(
+ std::string("IAP_CARPLAY"),
+ impl::TransportDescription(impl::TransportType::TT_WIFI, true, false))};
+
+const impl::TransportDescription
+ProtocolHandlerImpl::GetTransportTypeFromConnectionType(
+ const std::string& connection_type) const {
+ impl::TransportDescription result =
+ impl::TransportDescription(impl::TransportType::TT_NONE, false, false);
+ impl::TransportTypes::const_iterator it =
+ transportTypes.find(connection_type);
+ if (it != transportTypes.end()) {
+ result = it->second;
+ } else {
+ LOG4CXX_ERROR(logger_, "Unknown connection type " << connection_type);
+ }
+
+ return result;
+}
+
+const bool ProtocolHandlerImpl::ParseSecondaryTransportConfiguration(
+ const ConnectionID connection_id,
+ std::vector<std::string>& secondaryTransports,
+ std::vector<int32_t>& audioServiceTransports,
+ std::vector<int32_t>& videoServiceTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> secondary_transport_types;
+
+ // First discover what the connection type of the primary transport is
+ // and look up the allowed secondary transports for that primary transport
+ const std::string connection_type =
+ session_observer_.TransportTypeProfileStringFromConnHandle(connection_id);
+ const impl::TransportDescription td =
+ GetTransportTypeFromConnectionType(connection_type);
+ if (settings_.multiple_transports_enabled()) {
+ if (td.transport_type_ == impl::TransportType::TT_USB) {
+ secondary_transport_types = settings_.secondary_transports_for_usb();
+ } else if (td.transport_type_ == impl::TransportType::TT_BLUETOOTH) {
+ secondary_transport_types =
+ settings_.secondary_transports_for_bluetooth();
+ } else if (td.transport_type_ == impl::TransportType::TT_WIFI) {
+ secondary_transport_types = settings_.secondary_transports_for_wifi();
+ } else {
+ LOG4CXX_ERROR(
+ logger_,
+ "Bad or unknown device type in ParseSecondaryTransportConfiguration");
+ return false;
+ }
+ }
+ // note: even if settings_.multiple_transports_enabled() is false, we still
+ // send out an empty "secondaryTransports" parameter, along with
+ // "videoServiceTransports" and "audioServiceTransports" params which are
+ // useful without secondary transport.
+
+ // Then, generate the "secondaryTransports" array for the StartSession ACK
+ GenerateSecondaryTransportsForStartSessionAck(secondary_transport_types,
+ td.ios_transport_,
+ td.android_transport_,
+ secondaryTransports);
+
+ // Next, figure out which connections audio or video services are allowed on
+ GenerateServiceTransportsForStartSessionAck(
+ settings_.multiple_transports_enabled(),
+ settings_.audio_service_transports(),
+ connection_type,
+ td.transport_type_,
+ secondary_transport_types,
+ audioServiceTransports);
+
+ GenerateServiceTransportsForStartSessionAck(
+ settings_.multiple_transports_enabled(),
+ settings_.video_service_transports(),
+ connection_type,
+ td.transport_type_,
+ secondary_transport_types,
+ videoServiceTransports);
+
+ return true;
+}
+
+void ProtocolHandlerImpl::GenerateSecondaryTransportsForStartSessionAck(
+ const std::vector<std::string>& secondary_transport_types,
+ bool device_is_ios,
+ bool device_is_android,
+ std::vector<std::string>& secondaryTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Parse the "secondary_transport_types" vector (which comes from
+ // smartDeviceLink.ini). For each entry in the vector, add an
+ // appropriate string to the secondaryTransports
+ std::vector<std::string>::const_iterator it =
+ secondary_transport_types.begin();
+ while (it != secondary_transport_types.end()) {
+ const utils::custom_string::CustomString transport_type(*it);
+ if (transport_type.CompareIgnoreCase("USB")) {
+ if (device_is_ios) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding IAP_USB to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("IAP_USB");
+ }
+ if (device_is_android) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding AOA_USB to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("AOA_USB");
+ }
+ } else if (transport_type.CompareIgnoreCase("Bluetooth")) {
+ if (device_is_ios) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding IAP_BLUETOOTH to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("IAP_BLUETOOTH");
+ }
+ if (device_is_android) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding SPP_BLUETOOTH to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("SPP_BLUETOOTH");
+ }
+ }
+ if (transport_type.CompareIgnoreCase("WiFi")) {
+ LOG4CXX_TRACE(
+ logger_,
+ "Adding TCP_WIFI to secondaryTransports for StartSessionAck");
+ secondaryTransports.push_back("TCP_WIFI");
+ }
+
+ it++;
+ }
+}
+
+void ProtocolHandlerImpl::GenerateServiceTransportsForStartSessionAck(
+ bool secondary_enabled,
+ const std::vector<std::string>& service_transports,
+ const std::string& primary_connection_type,
+ const impl::TransportType primary_transport_type,
+ const std::vector<std::string>& secondary_transport_types,
+ std::vector<int32_t>& serviceTransports) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (service_transports.size() == 0) {
+ if (secondary_enabled && !secondary_transport_types.empty()) {
+ LOG4CXX_TRACE(logger_,
+ "Empty Service Transports. Allowing service to run on both "
+ "connections");
+ serviceTransports.push_back(1);
+ serviceTransports.push_back(2);
+ } else {
+ serviceTransports.push_back(1);
+ }
+ } else {
+ bool fPrimaryAdded = false;
+ bool fSecondaryAdded = false;
+ std::vector<std::string>::const_iterator it = service_transports.begin();
+ for (; it != service_transports.end(); it++) {
+ const utils::custom_string::CustomString transport(*it);
+ LOG4CXX_TRACE(logger_,
+ "Service Allowed to run on " << transport.c_str()
+ << " transport");
+
+ if (!fPrimaryAdded &&
+ (transport.CompareIgnoreCase(primary_connection_type.c_str()) ||
+ (transport.CompareIgnoreCase("IAP_USB") &&
+ primary_transport_type == impl::TransportType::TT_USB))) {
+ LOG4CXX_TRACE(logger_, "Service allowed on primary transport");
+ serviceTransports.push_back(1);
+ fPrimaryAdded = true;
+ }
+
+ if (!fSecondaryAdded) {
+ const utils::custom_string::CustomString transport_type(
+ TransportTypeFromTransport(transport));
+ std::vector<std::string>::const_iterator found =
+ std::find_if(secondary_transport_types.begin(),
+ secondary_transport_types.end(),
+ [&](const std::string& secondary_transport_type) {
+ return transport_type.CompareIgnoreCase(
+ secondary_transport_type.c_str());
+ });
+ if (found != secondary_transport_types.end()) {
+ LOG4CXX_TRACE(logger_, "Service allowed on secondary transport");
+ serviceTransports.push_back(2);
+ fSecondaryAdded = true;
+ }
+ }
+
+ if (fPrimaryAdded && fSecondaryAdded) {
+ break;
+ }
+ }
+ }
+}
+
+const std::string ProtocolHandlerImpl::TransportTypeFromTransport(
+ const utils::custom_string::CustomString& transport) const {
+ std::string transport_type;
+
+ if (transport.CompareIgnoreCase("IAP_BLUETOOTH") ||
+ transport.CompareIgnoreCase("SPP_BLUETOOTH")) {
+ transport_type = "Bluetooth";
+ } else if (transport.CompareIgnoreCase("IAP_USB") ||
+ transport.CompareIgnoreCase("AOA_USB") ||
+ transport.CompareIgnoreCase("IAP_USB_HOST_MODE") ||
+ transport.CompareIgnoreCase("IAP_USB_DEVICE_MODE")) {
+ transport_type = "USB";
+ } else if (transport.CompareIgnoreCase("TCP_WIFI") ||
+ transport.CompareIgnoreCase("IAP_CARPLAY")) {
+ transport_type = "WiFi";
+ }
+
+ return transport_type;
+}
+
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index a490916c99..d5422e11bc 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -41,6 +41,7 @@
#include "protocol_handler/protocol_packet.h"
#include "utils/macro.h"
#include "utils/byte_order.h"
+#include "utils/semantic_version.h"
namespace protocol_handler {
@@ -52,48 +53,6 @@ ProtocolPacket::ProtocolData::~ProtocolData() {
delete[] data;
}
-ProtocolPacket::ProtocolVersion::ProtocolVersion()
- : majorVersion(0), minorVersion(0), patchVersion(0) {}
-
-ProtocolPacket::ProtocolVersion::ProtocolVersion(uint8_t majorVersion,
- uint8_t minorVersion,
- uint8_t patchVersion)
- : majorVersion(majorVersion)
- , minorVersion(minorVersion)
- , patchVersion(patchVersion) {}
-
-ProtocolPacket::ProtocolVersion::ProtocolVersion(ProtocolVersion& other) {
- this->majorVersion = other.majorVersion;
- this->minorVersion = other.minorVersion;
- this->patchVersion = other.patchVersion;
-}
-
-ProtocolPacket::ProtocolVersion::ProtocolVersion(std::string versionString)
- : majorVersion(0), minorVersion(0), patchVersion(0) {
- unsigned int majorInt, minorInt, patchInt;
- int readElements = sscanf(
- versionString.c_str(), "%u.%u.%u", &majorInt, &minorInt, &patchInt);
- if (readElements != 3) {
- LOG4CXX_WARN(logger_,
- "Error while parsing version string: " << versionString);
- } else {
- majorVersion = static_cast<uint8_t>(majorInt);
- minorVersion = static_cast<uint8_t>(minorInt);
- patchVersion = static_cast<uint8_t>(patchInt);
- }
-}
-
-std::string ProtocolPacket::ProtocolVersion::to_string() {
- char versionString[256];
- snprintf(versionString,
- 255,
- "%u.%u.%u",
- static_cast<unsigned int>(majorVersion),
- static_cast<unsigned int>(minorVersion),
- static_cast<unsigned int>(patchVersion));
- return std::string(versionString);
-}
-
ProtocolPacket::ProtocolHeader::ProtocolHeader()
: version(0x00)
, protection_flag(PROTECTION_OFF)
@@ -304,8 +263,8 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
// Check frame info for each frame type
// Frame type shall be 0x00 (Control), 0x01 (Single), 0x02 (First), 0x03
// (Consecutive)
- // For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
- // Ack), 0xFF(HB Ack)
+ // For Control frames Frame info value shall be from 0x00 to 0x09 or
+ // 0xFD(Transport Event Update), 0xFE(Data Ack), 0xFF(HB Ack)
// For Single and First frames Frame info value shall be equal 0x00
switch (header.frameType) {
case FRAME_TYPE_CONTROL: {
@@ -317,6 +276,10 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
case FRAME_DATA_END_SERVICE:
case FRAME_DATA_END_SERVICE_ACK:
case FRAME_DATA_END_SERVICE_NACK:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK:
+ case FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK:
+ case FRAME_DATA_TRANSPORT_EVENT_UPDATE:
case FRAME_DATA_SERVICE_DATA_ACK:
case FRAME_DATA_HEART_BEAT_ACK:
break;
@@ -642,6 +605,10 @@ ConnectionID ProtocolPacket::connection_id() const {
return connection_id_;
}
+void ProtocolPacket::set_connection_id(ConnectionID connection_id) {
+ connection_id_ = connection_id;
+}
+
uint32_t ProtocolPacket::payload_size() const {
return payload_size_;
}
diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
index a1c1f188d1..9a91a5d1f7 100644
--- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
@@ -43,8 +43,9 @@ namespace protocol_handler_test {
class MockPHTelemetryObserver : public ::protocol_handler::PHTelemetryObserver {
public:
- MOCK_METHOD2(StartMessageProcess, void(uint32_t, const TimevalStruct&));
- MOCK_METHOD2(EndMessageProcess, void(utils::SharedPtr<MessageMetric>));
+ MOCK_METHOD2(StartMessageProcess,
+ void(uint32_t, const date_time::TimeDuration&));
+ MOCK_METHOD2(EndMessageProcess, void(std::shared_ptr<MessageMetric>));
};
} // namespace protocol_handler_test
diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc
index d0a311583c..9abf5d69af 100644
--- a/src/components/protocol_handler/test/incoming_data_handler_test.cc
+++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc
@@ -74,7 +74,7 @@ class IncomingDataHandlerTest : public ::testing::Test {
void AppendPacketToTMData(const ProtocolPacket& packet) {
const RawMessagePtr msg = packet.serializePacket();
- EXPECT_TRUE(msg.valid());
+ EXPECT_TRUE(msg.use_count() != 0);
EXPECT_GT(msg->data_size(), 0u);
tm_data.insert(tm_data.end(), msg->data(), msg->data() + msg->data_size());
}
@@ -192,49 +192,51 @@ TEST_F(IncomingDataHandlerTest, Heartbeat_pack) {
TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
// single packet Nav
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_SINGLE,
- kMobileNav,
- FRAME_DATA_SINGLE,
- ++some_session_id,
- some_data_size,
- ++some_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_SINGLE,
+ kMobileNav,
+ FRAME_DATA_SINGLE,
+ ++some_session_id,
+ some_data_size,
+ ++some_message_id,
+ some_data));
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
for (FrameList::iterator it = mobile_packets.begin();
it != mobile_packets.end();
++it) {
@@ -268,16 +270,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) {
malformed_versions.push_back(version);
}
for (size_t i = 0; i < malformed_versions.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- malformed_versions[i],
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kControl,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ malformed_versions[i],
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kControl,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -316,16 +319,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ServiceType) {
malformed_serv_types.push_back(0x0D);
malformed_serv_types.push_back(0x0E);
for (size_t i = 0; i < malformed_serv_types.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- malformed_serv_types[i],
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ malformed_serv_types[i],
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -360,16 +364,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) {
malformed_frame_types.push_back(frame_type);
}
for (size_t i = 0; i < malformed_frame_types.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- malformed_frame_types[i],
- kControl,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ malformed_frame_types[i],
+ kControl,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -393,27 +398,28 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) {
}
}
-// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
-// Ack), 0xFF(HB Ack)
+// For Control frames Frame info value shall be from 0x00 to 0x09 or 0xFD
+// (Transport Update Event), 0xFE(Data Ack), 0xFF(HB Ack)
TEST_F(IncomingDataHandlerTest, MalformedPacket_ControlFrame) {
FrameList malformed_packets;
std::vector<uint8_t> malformed_frame_data;
- for (uint8_t frame_type = FRAME_DATA_END_SERVICE_NACK + 1;
- frame_type < FRAME_DATA_SERVICE_DATA_ACK;
+ for (uint8_t frame_type = FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK + 1;
+ frame_type < FRAME_DATA_TRANSPORT_EVENT_UPDATE;
++frame_type) {
malformed_frame_data.push_back(frame_type);
}
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -448,16 +454,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_SingleFrame) {
}
malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -492,16 +499,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) {
}
malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE);
for (size_t i = 0; i < malformed_frame_data.size(); ++i) {
- malformed_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kControl,
- malformed_frame_data[i],
- some_session_id,
- 0u,
- some_message_id,
- NULL));
+ malformed_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kControl,
+ malformed_frame_data[i],
+ some_session_id,
+ 0u,
+ some_message_id,
+ nullptr));
}
// We count malformed only first time when it occurs after correct message
@@ -529,106 +537,110 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) {
TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed byte
tm_data.insert(tm_data.end(), 1, 0x1);
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 2, 0x2);
// single packet Nav
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_SINGLE,
- kMobileNav,
- FRAME_DATA_SINGLE,
- ++some_session_id,
- some_data_size,
- ++some_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_SINGLE,
+ kMobileNav,
+ FRAME_DATA_SINGLE,
+ ++some_session_id,
+ some_data_size,
+ ++some_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 3, 0x3);
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 4, 0x4);
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kRpc,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kRpc,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 5, 0x5);
// single packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kAudio,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kAudio,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// Add malformed bytes
tm_data.insert(tm_data.end(), 6, 0x6);
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
ProcessData(uid1, &tm_data[0], tm_data.size());
@@ -651,29 +663,30 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) {
TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
FrameList mobile_packets;
// single packet RPC
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_1,
- PROTECTION_OFF,
- FRAME_TYPE_SINGLE,
- kRpc,
- FRAME_DATA_SINGLE,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_1,
+ PROTECTION_OFF,
+ FRAME_TYPE_SINGLE,
+ kRpc,
+ FRAME_DATA_SINGLE,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
// consecutive packet Audio
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_2,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kAudio,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_2,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kAudio,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Malformed packet 1
@@ -691,16 +704,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
AppendPacketToTMData(malformed_packet1);
// consecutive packet Bulk
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_ON,
- FRAME_TYPE_CONSECUTIVE,
- kBulk,
- FRAME_DATA_LAST_CONSECUTIVE,
- ++some_session_id,
- some_data2_size,
- ++some_message_id,
- some_data2));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_ON,
+ FRAME_TYPE_CONSECUTIVE,
+ kBulk,
+ FRAME_DATA_LAST_CONSECUTIVE,
+ ++some_session_id,
+ some_data2_size,
+ ++some_message_id,
+ some_data2));
AppendPacketToTMData(*mobile_packets.back());
// Malformed packet 2
@@ -718,16 +732,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) {
AppendPacketToTMData(malformed_packet2);
// Audio packet
- mobile_packets.push_back(new ProtocolPacket(uid1,
- PROTOCOL_VERSION_3,
- PROTECTION_OFF,
- FRAME_TYPE_CONTROL,
- kAudio,
- FRAME_DATA_HEART_BEAT,
- some_session_id,
- some_data_size,
- protov1_message_id,
- some_data));
+ mobile_packets.push_back(
+ std::make_shared<ProtocolPacket>(uid1,
+ PROTOCOL_VERSION_3,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ kAudio,
+ FRAME_DATA_HEART_BEAT,
+ some_session_id,
+ some_data_size,
+ protov1_message_id,
+ some_data));
AppendPacketToTMData(*mobile_packets.back());
ProcessData(uid1, &tm_data[0], tm_data.size());
diff --git a/src/components/protocol_handler/test/multiframe_builder_test.cc b/src/components/protocol_handler/test/multiframe_builder_test.cc
index ad8a39f79a..f919ec92af 100644
--- a/src/components/protocol_handler/test/multiframe_builder_test.cc
+++ b/src/components/protocol_handler/test/multiframe_builder_test.cc
@@ -35,7 +35,7 @@
#include <algorithm>
#include <utility>
#include <limits>
-#include "utils/make_shared.h"
+
#include "protocol_handler/multiframe_builder.h"
namespace test {
@@ -149,7 +149,7 @@ class MultiFrameBuilderTest : public ::testing::Test {
const ProtocolFramePtrList::const_iterator it_last = --(multiframes.end());
while (it != it_last) {
const ProtocolFramePtr frame = *it;
- ASSERT_TRUE(frame);
+ ASSERT_TRUE((bool)frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame))
<< "Non final CONSECUTIVE frame: " << frame;
EXPECT_EQ(ProtocolFramePtrList(), multiframe_builder_.PopMultiframes())
@@ -331,7 +331,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_NoConnections) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_FAIL, multiframe_builder_.AddFrame(first_frame))
<< "Non-existed connection " << connection_id
<< "- to be skipped first frame: " << first_frame;
@@ -365,7 +365,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_only) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame))
<< "First frame: " << first_frame;
@@ -440,7 +440,7 @@ TEST_F(MultiFrameBuilderTest, Add_ConsecutiveFrames_per1) {
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr frame = multiframes.front();
- ASSERT_TRUE(frame);
+ ASSERT_TRUE((bool)frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame))
<< "Frame: " << frame;
@@ -501,7 +501,7 @@ TEST_F(MultiFrameBuilderTest, FrameExpired_OneMSec) {
const ProtocolFramePtrList& multiframes = multiframe_data.multiframes;
ASSERT_FALSE(multiframes.empty());
const ProtocolFramePtr first_frame = multiframes.front();
- ASSERT_TRUE(first_frame);
+ ASSERT_TRUE((bool)first_frame);
EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame))
<< "First frame: " << first_frame;
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 0cb8e155d0..615900c7fa 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -41,16 +41,27 @@
#include "protocol_handler/mock_protocol_handler_settings.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
+#include "connection_handler/connection_handler_impl.h"
#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
#endif // ENABLE_SECURITY
#include "transport_manager/mock_transport_manager.h"
#include "utils/mock_system_time_handler.h"
-#include "utils/make_shared.h"
+#include "utils/semantic_version.h"
+
#include "utils/test_async_waiter.h"
#include <bson_object.h>
+namespace transport_manager {
+namespace transport_adapter {
+// taken from transport_adapter_impl.cc
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+const char* tc_tcp_ip_address = "tcp_ip_address";
+}
+}
+
namespace test {
namespace components {
namespace protocol_handler_test {
@@ -88,6 +99,10 @@ using protocol_handler::FRAME_DATA_SERVICE_DATA_ACK;
using protocol_handler::FRAME_DATA_SINGLE;
using protocol_handler::FRAME_DATA_FIRST;
using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK;
+using protocol_handler::FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK;
+using protocol_handler::FRAME_DATA_TRANSPORT_EVENT_UPDATE;
using protocol_handler::kRpc;
using protocol_handler::kControl;
using protocol_handler::kAudio;
@@ -108,10 +123,12 @@ using ContextCreationStrategy =
using connection_handler::DeviceHandle;
// Google Testing Framework Entities
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::ReturnRefOfCopy;
using ::testing::ReturnNull;
using ::testing::An;
using ::testing::AnyOf;
+using ::testing::AtLeast;
using ::testing::ByRef;
using ::testing::DoAll;
using ::testing::SaveArg;
@@ -190,6 +207,9 @@ class ProtocolHandlerImplTest : public ::testing::Test {
.
// Return false to avoid call KeepConnectionAlive
WillRepeatedly(Return(false));
+
+ session_connection_map_lock_ptr_ =
+ std::make_shared<sync_primitives::Lock>();
}
void TearDown() OVERRIDE {
@@ -216,6 +236,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
const uint32_t hash_id,
const bool protection_flag) {
return protocol_handler::SessionContext(connection_id,
+ connection_id,
initial_session_id,
new_session_id,
service_type,
@@ -223,7 +244,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
protection_flag);
}
- void AddSession(const ::utils::SharedPtr<TestAsyncWaiter>& waiter,
+ void AddSession(const std::shared_ptr<TestAsyncWaiter>& waiter,
uint32_t& times) {
using namespace protocol_handler;
ASSERT_TRUE(NULL != waiter.get());
@@ -320,10 +341,11 @@ class ProtocolHandlerImplTest : public ::testing::Test {
uint8_t service_type,
uint8_t sessionId,
uint32_t frame_data,
+ uint8_t protocol_version = PROTOCOL_VERSION_3,
uint32_t dataSize = 0u,
const uint8_t* data = NULL) {
SendTMMessage(connection_id,
- PROTOCOL_VERSION_3,
+ protocol_version,
protection,
FRAME_TYPE_CONTROL,
service_type,
@@ -334,8 +356,20 @@ class ProtocolHandlerImplTest : public ::testing::Test {
data);
}
+ void VerifySecondaryTransportParamsInStartSessionAck(
+ bool config_multiple_transports_enabled,
+ const std::vector<std::string>& config_secondary_transports_for_usb,
+ const std::vector<std::string>& config_secondary_transports_for_bluetooth,
+ const std::vector<std::string>& config_secondary_transports_for_wifi,
+ const std::vector<std::string>& config_audio_service_transports,
+ const std::vector<std::string>& config_video_service_transports,
+ const std::string& connection_type_string,
+ const std::vector<std::string>& expected_transport_strings,
+ const std::vector<int32_t>& expected_audio_service_transports,
+ const std::vector<int32_t>& expected_video_service_transports);
+
testing::NiceMock<MockProtocolHandlerSettings> protocol_handler_settings_mock;
- ::utils::SharedPtr<ProtocolHandlerImpl> protocol_handler_impl;
+ std::shared_ptr<ProtocolHandlerImpl> protocol_handler_impl;
TransportManagerListener* tm_listener;
// Uniq connection
::transport_manager::ConnectionUID connection_id;
@@ -360,6 +394,10 @@ class ProtocolHandlerImplTest : public ::testing::Test {
std::vector<int> force_unprotected_services;
#endif // ENABLE_SECURITY
std::vector<std::string> empty_rejected_param_;
+ // Used by OnTransportConfigUpdated() tests. The lifetime of these objects
+ // should be longer than that of a test case.
+ connection_handler::SessionConnectionMap session_connection_map_;
+ std::shared_ptr<sync_primitives::Lock> session_connection_map_lock_ptr_;
};
#ifdef ENABLE_SECURITY
@@ -584,8 +622,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
SetProtocolVersion2();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -799,8 +836,7 @@ TEST_F(ProtocolHandlerImplTest,
* ProtocolHandler shall send NAck on session_observer rejection
*/
TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -833,8 +869,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) {
* ProtocolHandler shall send NAck on wrong hash code
*/
TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -867,8 +902,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
#ifdef ENABLE_SECURITY
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
using namespace protocol_handler;
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1485,14 +1519,1138 @@ TEST_F(ProtocolHandlerImplTest,
}
#endif // ENABLE_SECURITY
+void ProtocolHandlerImplTest::VerifySecondaryTransportParamsInStartSessionAck(
+ bool config_multiple_transports_enabled,
+ const std::vector<std::string>& config_secondary_transports_for_usb,
+ const std::vector<std::string>& config_secondary_transports_for_bluetooth,
+ const std::vector<std::string>& config_secondary_transports_for_wifi,
+ const std::vector<std::string>& config_audio_service_transports,
+ const std::vector<std::string>& config_video_service_transports,
+ const std::string& connection_type_string,
+ const std::vector<std::string>& expected_transport_strings,
+ const std::vector<int32_t>& expected_audio_service_transports,
+ const std::vector<int32_t>& expected_video_service_transports) {
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+ char full_version_string[] = "5.1.0";
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(config_multiple_transports_enabled));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ // Prepare expected BSON parameters. When we add another param in Start
+ // Service ACK frame in future, it should be also added here.
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+ // secondaryTransports
+ BsonArray secondary_transports;
+ bson_array_initialize(&secondary_transports,
+ expected_transport_strings.size());
+ for (std::vector<std::string>::const_iterator it =
+ expected_transport_strings.begin();
+ it != expected_transport_strings.end();
+ ++it) {
+ // note: if there is no transport allowed, we can either make the array
+ // empty, or completely omit the array. (The spec allows both cases.) In
+ // this test case we make the array empty.
+ bson_array_add_string(&secondary_transports,
+ const_cast<char*>(it->c_str()));
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::secondary_transports,
+ &secondary_transports);
+ // audioServiceTransports
+ BsonArray audio_service_transports;
+ if (expected_audio_service_transports.size() > 0) {
+ bson_array_initialize(&audio_service_transports,
+ expected_audio_service_transports.size());
+ for (std::vector<int32_t>::const_iterator it =
+ expected_audio_service_transports.begin();
+ it != expected_audio_service_transports.end();
+ ++it) {
+ bson_array_add_int32(&audio_service_transports, *it);
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::audio_service_transports,
+ &audio_service_transports);
+ }
+ // videoServiceTransports
+ BsonArray video_service_transports;
+ if (expected_video_service_transports.size() > 0) {
+ bson_array_initialize(&video_service_transports,
+ expected_video_service_transports.size());
+ for (std::vector<int32_t>::const_iterator it =
+ expected_video_service_transports.begin();
+ it != expected_video_service_transports.end();
+ ++it) {
+ bson_array_add_int32(&video_service_transports, *it);
+ }
+ bson_object_put_array(&expected_obj,
+ protocol_handler::strings::video_service_transports,
+ &video_service_transports);
+ }
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_Enabled) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is Android and is connected through Bluetooth SPP
+ std::string connection_type_string("SPP_BLUETOOTH");
+
+ // Core should specify WiFi for secondary transport, and should allow video
+ // and audio services only on secondary transport
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_NoSecondaryTransport) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over USB
+ std::string connection_type_string("IAP_USB");
+
+ // Core should not offer any secondary transport. It will allow both video
+ // and audio services on primary transport.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_MultipleSecondaryTransports) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi and USB
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("WiFi");
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should offer both Wi-Fi and USB for secondary transport. Since the
+ // device is iOS, Core should specify "IAP_USB".
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ expected_transport_strings.push_back("IAP_USB");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(
+ ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_ServiceAllowedOnBothTransports) {
+ std::vector<std::string> secondary_transports_for_usb;
+ secondary_transports_for_usb.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video service to run on Wi-Fi transports only, and audio
+ // service to run on all transports
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_BLUETOOTH");
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("SPP_BLUETOOTH");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is Android and is connected through AOA
+ std::string connection_type_string("AOA_USB");
+
+ // Core should offer Wi-Fi for secondary transport. It should allow audio
+ // service to run on both primary and secondary, while video service to run
+ // on secondary only. Since the list specifies AOA_USB then TCP_WIFI, the
+ // priority is primary > secondary.
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1); // primary preferred
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_SecondaryDisabled) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_BLUETOOTH");
+ audio_service_transports.push_back("IAP_USB");
+ audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("SPP_BLUETOOTH");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_BLUETOOTH");
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_USB_HOST_MODE");
+ video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("SPP_BLUETOOTH");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should not offer any secondary transport. It should still send
+ // the video/audio service transport lists.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ false, /* disabled */
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_ServicesMapEmpty) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth;
+ secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> secondary_transports_for_wifi;
+ secondary_transports_for_wifi.push_back("USB");
+ // config does not specify video and audio services
+ std::vector<std::string> audio_service_transports; // empty
+ std::vector<std::string> video_service_transports; // empty
+
+ // assume the device is connected through Wi-Fi (so not sure if it's iOS or
+ // Android)
+ std::string connection_type_string("TCP_WIFI");
+
+ // Core should offer USB transport for secondary transport. (Since the OS type
+ // is unknown, it will offer both IAP_USB and AOA_USB.) Also, it should allow
+ // video/audio services on all transports.
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("IAP_USB");
+ expected_transport_strings.push_back("AOA_USB");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+ expected_video_service_transports.push_back(2);
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(
+ ProtocolHandlerImplTest,
+ StartSessionAck_SecondaryTransportParams_SecondaryDisabled_ServicesMapEmpty) {
+ std::vector<std::string> secondary_transports_for_usb; // empty
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config does not specify video and audio services
+ std::vector<std::string> audio_service_transports; // empty
+ std::vector<std::string> video_service_transports; // empty
+
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // Core should not offer any secondary transport. It should still send
+ // the video/audio service transport lists.
+ std::vector<std::string> expected_transport_strings; // empty
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(1);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ false, /* disabled */
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+// Secondary transport param should not be included for apps with v5.0.0
+TEST_F(ProtocolHandlerImplTest,
+ StartSessionAck_Unprotected_NoSecondaryTransportParamsForV5) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 0, 0);
+ char full_version_string[] = "5.0.0";
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // configuration
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("USB");
+ std::vector<std::string> config_secondary_transports_for_wifi;
+ config_secondary_transports_for_wifi.push_back("USB");
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ // configuration setup
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ // BSON params should not include any of "secondaryTransports",
+ // "audioServiceTransports" and "videoServiceTransports" since v5.0.0 app
+ // does not understand them
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // mtu
+ bson_object_put_int64(&expected_obj,
+ protocol_handler::strings::mtu,
+ static_cast<int64_t>(maximum_rpc_payload_size));
+ // hashId
+ bson_object_put_int32(&expected_obj,
+ protocol_handler::strings::hash_id,
+ static_cast<int32_t>(hash_id));
+ // protocolVersion
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::protocol_version,
+ full_version_string);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ connection_handler::SessionTransports dummy_st = {0, 0};
+ EXPECT_CALL(connection_handler_mock,
+ SetSecondaryTransportID(_, kDisabledSecondary))
+ .WillOnce(Return(dummy_st));
+
+ // Since the protocol version is less than 5.1.0, Core should not issue
+ // TransportEventUpdate frame. Enable ProtocolVersionUsed() call and verify
+ // that transport_manager_mock will NOT receive another SendMessageToDevice()
+ // call.
+ ON_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillByDefault(Return(true));
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, StartSessionAck_PrimaryTransportUSBHostMode) {
+ // config allows secondary transport only when connected through Bluetooth,
+ // and the secondary is Wi-Fi
+ std::vector<std::string> secondary_transports_for_usb;
+ secondary_transports_for_usb.push_back("WiFi");
+ std::vector<std::string> secondary_transports_for_bluetooth; // empty
+ std::vector<std::string> secondary_transports_for_wifi; // empty
+ // config allows video and audio services to run on all transports except
+ // Bluetooth
+ std::vector<std::string> audio_service_transports;
+ audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ audio_service_transports.push_back("IAP_CARPLAY");
+ audio_service_transports.push_back("AOA_USB");
+ audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> video_service_transports;
+ video_service_transports.push_back("IAP_USB");
+ video_service_transports.push_back("IAP_CARPLAY");
+ video_service_transports.push_back("AOA_USB");
+ video_service_transports.push_back("TCP_WIFI");
+
+ // assume the device is IOS and is connected through USB Host Mode
+ std::string connection_type_string("IAP_USB_HOST_MODE");
+
+ // Core should specify WiFi for secondary transport, and should allow video
+ // services on both transports, and audio only on secondary transport
+ std::vector<std::string> expected_transport_strings;
+ expected_transport_strings.push_back("TCP_WIFI");
+ std::vector<int32_t> expected_audio_service_transports;
+ expected_audio_service_transports.push_back(2);
+ std::vector<int32_t> expected_video_service_transports;
+ expected_video_service_transports.push_back(1);
+ expected_video_service_transports.push_back(2);
+
+ // A TransportUpdateEvent is also issued after Start Service ACK. We don't
+ // check it in this test case.
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(Return(false));
+
+ VerifySecondaryTransportParamsInStartSessionAck(
+ true,
+ secondary_transports_for_usb,
+ secondary_transports_for_bluetooth,
+ secondary_transports_for_wifi,
+ audio_service_transports,
+ video_service_transports,
+ connection_type_string,
+ expected_transport_strings,
+ expected_audio_service_transports,
+ expected_video_service_transports);
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ TransportEventUpdate_afterVersionNegotiation_TCPEnabled) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // TCP configuration setup
+ bool tcp_enabled = true;
+ char tcp_address[] = "192.168.1.1";
+ int32_t tcp_port = 12345;
+ std::string tcp_port_str = "12345";
+ protocol_handler_impl->set_tcp_config(
+ tcp_enabled, std::string(tcp_address), tcp_port_str);
+
+ // configuration setup
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> config_secondary_transports_for_wifi; // empty
+ std::vector<std::string> config_audio_service_transports;
+ config_audio_service_transports.push_back("IAP_USB");
+ config_audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_audio_service_transports.push_back("IAP_CARPLAY");
+ config_audio_service_transports.push_back("AOA_USB");
+ config_audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> config_video_service_transports;
+ config_video_service_transports.push_back("IAP_USB");
+ config_video_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_video_service_transports.push_back("IAP_CARPLAY");
+ config_video_service_transports.push_back("AOA_USB");
+ config_video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::tcp_ip_address, tcp_address);
+ // TCP port number
+ bson_object_put_int32(
+ &expected_obj, protocol_handler::strings::tcp_port, tcp_port);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ TransportEventUpdate_afterVersionNegotiation_TCPDisabled) {
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ const uint8_t input_protocol_version = 5;
+ const uint32_t hash_id = 123456;
+ utils::SemanticVersion full_version(5, 1, 0);
+
+ const size_t maximum_rpc_payload_size = 1500;
+ EXPECT_CALL(protocol_handler_settings_mock, maximum_rpc_payload_size())
+ .WillRepeatedly(Return(maximum_rpc_payload_size));
+ InitProtocolHandlerImpl(0u, 0u);
+
+ // TCP configuration setup
+ bool tcp_enabled = false;
+ char tcp_address[] = "192.168.2.3";
+ std::string tcp_port_str = "12345";
+ protocol_handler_impl->set_tcp_config(
+ tcp_enabled, std::string(tcp_address), tcp_port_str);
+
+ std::vector<std::string> config_secondary_transports_for_usb; // empty
+ std::vector<std::string> config_secondary_transports_for_bluetooth;
+ config_secondary_transports_for_bluetooth.push_back("WiFi");
+ std::vector<std::string> config_secondary_transports_for_wifi; // empty
+ std::vector<std::string> config_audio_service_transports;
+ config_audio_service_transports.push_back("IAP_USB");
+ config_audio_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_audio_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_audio_service_transports.push_back("IAP_CARPLAY");
+ config_audio_service_transports.push_back("AOA_USB");
+ config_audio_service_transports.push_back("TCP_WIFI");
+ std::vector<std::string> config_video_service_transports;
+ config_video_service_transports.push_back("IAP_USB");
+ config_video_service_transports.push_back("IAP_USB_HOST_MODE");
+ config_video_service_transports.push_back("IAP_USB_DEVICE_MODE");
+ config_video_service_transports.push_back("IAP_CARPLAY");
+ config_video_service_transports.push_back("AOA_USB");
+ config_video_service_transports.push_back("TCP_WIFI");
+
+ EXPECT_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillRepeatedly(Return(PROTOCOL_VERSION_5));
+ EXPECT_CALL(protocol_handler_settings_mock, multiple_transports_enabled())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_usb())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_usb));
+ EXPECT_CALL(protocol_handler_settings_mock,
+ secondary_transports_for_bluetooth())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_bluetooth));
+ EXPECT_CALL(protocol_handler_settings_mock, secondary_transports_for_wifi())
+ .Times(AtLeast(0))
+ .WillRepeatedly(ReturnRef(config_secondary_transports_for_wifi));
+ EXPECT_CALL(protocol_handler_settings_mock, audio_service_transports())
+ .WillOnce(ReturnRef(config_audio_service_transports));
+ EXPECT_CALL(protocol_handler_settings_mock, video_service_transports())
+ .WillOnce(ReturnRef(config_video_service_transports));
+
+ // assume the device is iOS and is connected through iAP over Bluetooth
+ std::string connection_type_string("IAP_BLUETOOTH");
+
+ EXPECT_CALL(session_observer_mock,
+ TransportTypeProfileStringFromConnHandle(connection_id))
+ .WillRepeatedly(Return(connection_type_string));
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(
+ FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF, connection_id, _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ char empty_ip_address[] = "";
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::tcp_ip_address,
+ empty_ip_address);
+ // TCP port number should be omitted
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+#ifdef ENABLE_SECURITY
+ AddSecurityManager();
+
+ EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
+ .WillOnce(Return(connection_key));
+
+ EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
+ .WillOnce(ReturnNull());
+#endif // ENABLE_SECURITY
+
+ protocol_handler_impl->SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ protocol_handler::SERVICE_TYPE_RPC,
+ false /* protection */,
+ full_version);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ OnTransportConfigUpdated_TransportEventUpdate_TCPEnabled) {
+ using connection_handler::SessionConnectionMap;
+ using connection_handler::SessionTransports;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ char tcp_address[] = "172.16.2.3";
+ int32_t tcp_port = 23456;
+ std::string tcp_port_str = "23456";
+
+ transport_manager::transport_adapter::TransportConfig configs;
+ configs[transport_manager::transport_adapter::tc_enabled] =
+ std::string("true");
+ configs[transport_manager::transport_adapter::tc_tcp_port] = tcp_port_str;
+ configs[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string(tcp_address);
+
+ transport_manager::ConnectionUID device1_primary_connection_id = 100;
+ transport_manager::ConnectionUID device2_primary_connection_id = 101;
+ transport_manager::ConnectionUID device2_secondary_connection_id = 150;
+
+ SessionTransports st1 = {device1_primary_connection_id, kDisabledSecondary};
+ SessionTransports st2 = {device2_primary_connection_id,
+ device2_secondary_connection_id};
+ session_connection_map_[0x11] = st1;
+ session_connection_map_[0x22] = st2;
+
+ EXPECT_CALL(connection_handler_mock, session_connection_map())
+ .WillOnce(Return(DataAccessor<SessionConnectionMap>(
+ session_connection_map_, session_connection_map_lock_ptr_)));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ bson_object_put_string(
+ &expected_obj, protocol_handler::strings::tcp_ip_address, tcp_address);
+ // TCP port number
+ bson_object_put_int32(
+ &expected_obj, protocol_handler::strings::tcp_port, tcp_port);
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ // since device 1 doesn't support secondary transport feature,
+ // TransportEvetUpdate should be delivered only to device 2
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device2_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ tm_listener->OnTransportConfigUpdated(configs);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest,
+ OnTransportConfigUpdated_TransportEventUpdate_TCPDisabled) {
+ using connection_handler::SessionConnectionMap;
+ using connection_handler::SessionTransports;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ char tcp_address[] = "172.16.2.3";
+ std::string tcp_port_str = "23456";
+
+ transport_manager::transport_adapter::TransportConfig configs;
+ configs[transport_manager::transport_adapter::tc_enabled] =
+ std::string("false");
+ configs[transport_manager::transport_adapter::tc_tcp_port] = tcp_port_str;
+ configs[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string(tcp_address);
+
+ transport_manager::ConnectionUID device1_primary_connection_id = 100;
+ transport_manager::ConnectionUID device1_secondary_connection_id = 150;
+ transport_manager::ConnectionUID device2_primary_connection_id = 101;
+ transport_manager::ConnectionUID device3_primary_connection_id = 102;
+ transport_manager::ConnectionUID device3_secondary_connection_id = 151;
+
+ SessionTransports st1 = {device1_primary_connection_id,
+ device1_secondary_connection_id};
+ SessionTransports st2 = {device2_primary_connection_id, kDisabledSecondary};
+ SessionTransports st3 = {device3_primary_connection_id,
+ device3_secondary_connection_id};
+ session_connection_map_[0x11] = st1;
+ session_connection_map_[0x22] = st2;
+ session_connection_map_[0x33] = st3;
+
+ EXPECT_CALL(connection_handler_mock, session_connection_map())
+ .WillOnce(Return(DataAccessor<SessionConnectionMap>(
+ session_connection_map_, session_connection_map_lock_ptr_)));
+
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ BsonObject expected_obj;
+ bson_object_initialize_default(&expected_obj);
+ // IP address
+ char empty_ip_address[] = "";
+ bson_object_put_string(&expected_obj,
+ protocol_handler::strings::tcp_ip_address,
+ empty_ip_address);
+ // TCP port number should be omitted
+
+ std::vector<uint8_t> expected_param =
+ CreateVectorFromBsonObject(&expected_obj);
+
+ bson_object_deinitialize(&expected_obj);
+
+ // both device 1 and device 3 should receive TransportEventUpdate frames
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device1_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+ EXPECT_CALL(
+ transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_TRANSPORT_EVENT_UPDATE,
+ PROTECTION_OFF,
+ device3_primary_connection_id,
+ Eq(expected_param))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ tm_listener->OnTransportConfigUpdated(configs);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, RegisterSecondaryTransport_SUCCESS) {
+ AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ transport_manager::ConnectionUID primary_connection_id = 123;
+
+ EXPECT_CALL(session_observer_mock,
+ ProtocolVersionUsed(primary_connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ EXPECT_CALL(connection_handler_mock,
+ OnSecondaryTransportStarted(_, connection_id, session_id))
+ .WillOnce(DoAll(SetArgReferee<0>(primary_connection_id), Return(true)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(
+ ControlMessage(FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_ACK,
+ PROTECTION_OFF,
+ connection_id,
+ _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(PROTECTION_OFF,
+ kControl,
+ session_id,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT,
+ PROTOCOL_VERSION_5);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, RegisterSecondaryTransport_FAILURE) {
+ AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ transport_manager::ConnectionUID primary_connection_id = 123;
+
+ EXPECT_CALL(session_observer_mock,
+ ProtocolVersionUsed(primary_connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ // check the behavior when OnSecondaryTransportStarted() returns false
+ EXPECT_CALL(connection_handler_mock,
+ OnSecondaryTransportStarted(_, connection_id, session_id))
+ .WillOnce(DoAll(SetArgReferee<0>(primary_connection_id), Return(false)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(
+ ControlMessage(FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK,
+ PROTECTION_OFF,
+ connection_id,
+ _)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendControlMessage(PROTECTION_OFF,
+ kControl,
+ session_id,
+ FRAME_DATA_REGISTER_SECONDARY_TRANSPORT,
+ PROTOCOL_VERSION_5);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+}
+
TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1529,8 +2687,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_ThresholdValue) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1566,8 +2723,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_VideoFrameSkip) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1595,8 +2751,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_AudioFrameSkip) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1624,8 +2779,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerificationDisable) {
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1653,8 +2807,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1686,8 +2839,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_MalformedLimitVerification) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1734,8 +2886,7 @@ TEST_F(ProtocolHandlerImplTest,
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1806,8 +2957,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1867,8 +3017,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1901,8 +3050,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) {
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1945,8 +3093,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
DISABLED_SendEndServicePrivate_EndSession_MessageSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1970,8 +3117,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendEndServicePrivate_ServiceTypeControl_MessageSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -1990,7 +3136,8 @@ TEST_F(ProtocolHandlerImplTest,
times++;
// Act
- protocol_handler_impl->SendEndService(connection_id, session_id, kControl);
+ protocol_handler_impl->SendEndService(
+ connection_id, connection_id, session_id, kControl);
EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
@@ -2009,8 +3156,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) {
TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2035,8 +3181,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2065,8 +3210,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
TEST_F(ProtocolHandlerImplTest,
DISABLED_SendHeartBeatAck_WrongProtocolVersion_NotSent) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2095,8 +3239,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleControlMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2104,7 +3247,7 @@ TEST_F(ProtocolHandlerImplTest,
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kControl);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -2134,8 +3277,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleNonControlMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2143,7 +3285,7 @@ TEST_F(ProtocolHandlerImplTest,
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kRpc);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -2177,8 +3319,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
// Arrange
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2187,7 +3328,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
const uint32_t total_data_size = MAXIMUM_FRAME_DATA_V2_SIZE * 2;
UCharDataVector data(total_data_size);
const uint8_t first_consecutive_frame = 0x01;
- RawMessagePtr message = utils::MakeShared<RawMessage>(
+ RawMessagePtr message = std::make_shared<RawMessage>(
connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kBulk);
// Expect getting pair from key from session observer
EXPECT_CALL(session_observer_mock,
@@ -2232,8 +3373,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
}
TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
@@ -2259,8 +3399,7 @@ TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) {
}
TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) {
- ::utils::SharedPtr<TestAsyncWaiter> waiter =
- utils::MakeShared<TestAsyncWaiter>();
+ std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>();
uint32_t times = 0;
AddSession(waiter, times);
diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc
index e42ba96251..5554bfd280 100644
--- a/src/components/protocol_handler/test/protocol_header_validator_test.cc
+++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc
@@ -230,12 +230,12 @@ TEST_F(ProtocolHeaderValidatorTest, Malformed_FrameType) {
}
}
-// For Control frames Frame info value shall be from 0x00 to 0x06 or 0xFE(Data
-// Ack), 0xFF(HB Ack)
+// For Control frames Frame info value shall be from 0x00 to 0x09 or 0xFD
+// (Transport Update Event), 0xFE(Data Ack), 0xFF(HB Ack)
TEST_F(ProtocolHeaderValidatorTest, Malformed_ControlFrame) {
std::vector<uint8_t> malformed_frame_data;
- for (uint8_t frame_type = FRAME_DATA_END_SERVICE_NACK + 1;
- frame_type < FRAME_DATA_SERVICE_DATA_ACK;
+ for (uint8_t frame_type = FRAME_DATA_REGISTER_SECONDARY_TRANSPORT_NACK + 1;
+ frame_type < FRAME_DATA_TRANSPORT_EVENT_UPDATE;
++frame_type) {
malformed_frame_data.push_back(frame_type);
}
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h
index 6792f47732..10b494465c 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -42,11 +42,6 @@ namespace Json {
class Value;
} // namespace Json
-namespace dbus {
-class MessageReader;
-class MessageWriter;
-} // namespace dbus
-
namespace rpc {
class ValidationReport;
@@ -173,12 +168,10 @@ class Boolean : public PrimitiveType {
Boolean();
explicit Boolean(bool value);
explicit Boolean(const Json::Value* value);
- explicit Boolean(dbus::MessageReader* reader);
Boolean(const Json::Value* value, bool def_value);
Boolean& operator=(bool new_val);
operator bool() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
// Fields
@@ -197,7 +190,6 @@ class Integer : public PrimitiveType {
explicit Integer(IntType value);
Integer(const Integer& value);
explicit Integer(const Json::Value* value);
- explicit Integer(dbus::MessageReader* reader);
Integer(const Json::Value* value, IntType def_value);
Integer& operator=(IntType new_val);
Integer& operator=(const Integer& new_val);
@@ -205,7 +197,6 @@ class Integer : public PrimitiveType {
Integer& operator+=(int value);
operator IntType() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
IntType value_;
@@ -219,12 +210,10 @@ class Float : public PrimitiveType {
Float();
explicit Float(double value);
explicit Float(const Json::Value* value);
- explicit Float(dbus::MessageReader* reader);
Float(const Json::Value* value, double def_value);
Float& operator=(double new_val);
operator double() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
double value_;
@@ -239,7 +228,6 @@ class String : public PrimitiveType {
explicit String(const std::string& value);
explicit String(const char* value);
explicit String(const Json::Value* value);
- explicit String(dbus::MessageReader* reader);
String(const Json::Value* value, const std::string& def_value);
bool operator<(const String& new_val) const;
String& operator=(const std::string& new_val);
@@ -247,7 +235,6 @@ class String : public PrimitiveType {
bool operator==(const String& rhs) const;
operator const std::string&() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
std::string value_;
@@ -265,12 +252,10 @@ class Enum : public PrimitiveType {
Enum();
explicit Enum(EnumType value);
explicit Enum(const Json::Value* value);
- explicit Enum(dbus::MessageReader* reader);
Enum(const Json::Value* value, EnumType def_value);
Enum& operator=(const EnumType& new_val);
operator EnumType() const;
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
private:
// Fields
@@ -289,7 +274,6 @@ class Array : public std::vector<T>, public CompositeType {
// Need const and non-const versions to beat all-type accepting constructor
explicit Array(Json::Value* value);
explicit Array(const Json::Value* value);
- explicit Array(dbus::MessageReader* reader);
template <typename U>
explicit Array(const U& value);
template <typename U>
@@ -298,7 +282,6 @@ class Array : public std::vector<T>, public CompositeType {
template <typename U>
void push_back(const U& value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
virtual bool is_valid() const;
bool is_initialized() const;
@@ -320,7 +303,6 @@ class Map : public std::map<std::string, T>, public CompositeType {
// Need const and non-const versions to beat all-type accepting constructor
explicit Map(Json::Value* value);
explicit Map(const Json::Value* value);
- explicit Map(dbus::MessageReader* reader);
template <typename U>
explicit Map(const U& value);
template <typename U>
@@ -329,7 +311,6 @@ class Map : public std::map<std::string, T>, public CompositeType {
template <typename U>
void insert(const std::pair<std::string, U>& value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
bool is_valid() const;
bool is_initialized() const;
@@ -343,7 +324,6 @@ class Nullable : public T {
public:
// Methods
Nullable();
- explicit Nullable(dbus::MessageReader* reader);
// Need const and non-const versions to beat all-type accepting constructor
explicit Nullable(Json::Value* value);
explicit Nullable(const Json::Value* value);
@@ -370,7 +350,6 @@ class Stringifyable : public T {
public:
// Methods
Stringifyable();
- explicit Stringifyable(dbus::MessageReader* reader);
// Need const and non-const versions to beat all-type accepting constructor
explicit Stringifyable(Json::Value* value);
explicit Stringifyable(const Json::Value* value);
@@ -398,15 +377,12 @@ class Optional {
public:
// Methods
Optional();
- explicit Optional(dbus::MessageReader* reader);
template <typename U>
explicit Optional(const U& value);
template <typename U>
Optional(const Json::Value* value, const U& def_value);
Json::Value ToJsonValue() const;
- void ToDbusWriter(dbus::MessageWriter* writer) const;
-
// Pointer semantics
T& operator*();
const T& operator*() const;
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
deleted file mode 100644
index aae1a34ac2..0000000000
--- a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Copyright (c) 2014, 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_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
-#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
-
-#include "dbus/dbus_message.h"
-#include "json/value.h"
-#include "rpc_base/rpc_base.h"
-
-namespace rpc {
-
-// static
-inline PrimitiveType::ValueState PrimitiveType::InitHelper(bool is_next) {
- return is_next ? kValid : kInvalid;
-}
-
-// static
-inline CompositeType::InitializationState CompositeType::InitHelper(
- bool is_next) {
- return is_next ? kInitialized : kUninitialized;
-}
-
-namespace impl {
-
-// Helper functions to statically map int types to appropriate
-// MessageReader functions
-
-// Non-specialized versions doesn't have implementation
-
-// Tells if next element of reader is of type T
-template <typename T>
-inline bool NextIs(const dbus::MessageReader& reader);
-// Takes next element of type T from reader
-template <typename T>
-inline T Take(dbus::MessageReader* reader);
-
-template <>
-inline bool NextIs<int8_t>(const dbus::MessageReader& reader) {
- return reader.NextIsByte();
-}
-
-template <>
-inline int8_t Take<int8_t>(dbus::MessageReader* reader) {
- return static_cast<int8_t>(reader->TakeByte());
-}
-
-inline void Put(int8_t val, dbus::MessageWriter* writer) {
- writer->PutByte(static_cast<uint8_t>(val));
-}
-
-template <>
-inline bool NextIs<uint8_t>(const dbus::MessageReader& reader) {
- return reader.NextIsByte();
-}
-
-template <>
-inline uint8_t Take<uint8_t>(dbus::MessageReader* reader) {
- return reader->TakeByte();
-}
-
-inline void Put(uint8_t val, dbus::MessageWriter* writer) {
- writer->PutByte(val);
-}
-
-template <>
-inline bool NextIs<int16_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt16();
-}
-
-template <>
-inline int16_t Take<int16_t>(dbus::MessageReader* reader) {
- return reader->TakeInt16();
-}
-
-inline void Put(int16_t val, dbus::MessageWriter* writer) {
- writer->PutInt16(val);
-}
-
-template <>
-inline bool NextIs<uint16_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint16();
-}
-
-template <>
-inline uint16_t Take<uint16_t>(dbus::MessageReader* reader) {
- return reader->TakeUint16();
-}
-
-inline void Put(uint16_t val, dbus::MessageWriter* writer) {
- writer->PutUint16(val);
-}
-
-template <>
-inline bool NextIs<int32_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt32();
-}
-
-template <>
-inline int32_t Take<int32_t>(dbus::MessageReader* reader) {
- return reader->TakeInt32();
-}
-
-inline void Put(int32_t val, dbus::MessageWriter* writer) {
- writer->PutInt32(val);
-}
-
-template <>
-inline bool NextIs<uint32_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint32();
-}
-
-template <>
-inline uint32_t Take<uint32_t>(dbus::MessageReader* reader) {
- return reader->TakeUint32();
-}
-
-inline void Put(uint32_t val, dbus::MessageWriter* writer) {
- writer->PutUint32(val);
-}
-
-template <>
-inline bool NextIs<int64_t>(const dbus::MessageReader& reader) {
- return reader.NextIsInt64();
-}
-
-template <>
-inline int64_t Take<int64_t>(dbus::MessageReader* reader) {
- return reader->TakeInt64();
-}
-
-inline void Put(int64_t val, dbus::MessageWriter* writer) {
- writer->PutInt64(val);
-}
-
-template <>
-inline bool NextIs<uint64_t>(const dbus::MessageReader& reader) {
- return reader.NextIsUint64();
-}
-
-template <>
-inline uint64_t Take<uint64_t>(dbus::MessageReader* reader) {
- return reader->TakeUint64();
-}
-
-inline void Put(uint64_t val, dbus::MessageWriter* writer) {
- writer->PutUint64(val);
-}
-
-template <>
-inline std::string Take<std::string>(dbus::MessageReader* reader) {
- return reader->TakeString();
-}
-
-inline void Put(const std::string val, dbus::MessageWriter* writer) {
- writer->PutString(val);
-}
-
-// Type to DBus type id mappers
-template <typename T>
-char DbusTypeCode();
-template <>
-inline char DbusTypeCode<bool>() {
- return DBUS_TYPE_BOOLEAN;
-}
-// There is no dbus type for signed byte, map to unsigned
-template <>
-inline char DbusTypeCode<int8_t>() {
- return DBUS_TYPE_BYTE;
-}
-template <>
-inline char DbusTypeCode<uint8_t>() {
- return DBUS_TYPE_BYTE;
-}
-template <>
-inline char DbusTypeCode<int16_t>() {
- return DBUS_TYPE_INT16;
-}
-template <>
-inline char DbusTypeCode<uint16_t>() {
- return DBUS_TYPE_UINT16;
-}
-template <>
-inline char DbusTypeCode<int32_t>() {
- return DBUS_TYPE_INT32;
-}
-template <>
-inline char DbusTypeCode<uint32_t>() {
- return DBUS_TYPE_UINT32;
-}
-template <>
-inline char DbusTypeCode<int64_t>() {
- return DBUS_TYPE_INT64;
-}
-template <>
-inline char DbusTypeCode<uint64_t>() {
- return DBUS_TYPE_UINT64;
-}
-template <>
-inline char DbusTypeCode<double>() {
- return DBUS_TYPE_DOUBLE;
-}
-template <>
-inline char DbusTypeCode<std::string>() {
- return DBUS_TYPE_STRING;
-}
-template <>
-inline char DbusTypeCode<const std::string>() {
- return DBUS_TYPE_STRING;
-}
-
-// Non-specialized template supposes there is static
-// void GetDbusSignature(std::string*) method in T
-template <typename T>
-struct DbusSignatureHelper {
- static void DbusSignature(std::string* signature) {
- T::GetDbusSignature(signature);
- }
-};
-
-template <>
-struct DbusSignatureHelper<Boolean> {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- }
-};
-
-template <typename T, T minval, T maxval>
-struct DbusSignatureHelper<Integer<T, minval, maxval> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<T>();
- }
-};
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-struct DbusSignatureHelper<Float<minnum, maxnum, minden, maxden> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<double>();
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Enum<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<int32_t>();
- }
-};
-
-template <size_t minlen, size_t maxlen>
-struct DbusSignatureHelper<String<minlen, maxlen> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += rpc::impl::DbusTypeCode<std::string>();
- }
-};
-
-template <typename K, typename V>
-struct DbusSignatureHelper<std::pair<K, V> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_DICT_ENTRY_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<K>();
- rpc::impl::DbusSignatureHelper<V>::DbusSignature(signature);
- (*signature) += DBUS_DICT_ENTRY_END_CHAR;
- }
-};
-
-template <typename T, size_t minsize, size_t maxsize>
-struct DbusSignatureHelper<Array<T, minsize, maxsize> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_TYPE_ARRAY;
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- }
-};
-
-template <typename T, size_t minsize, size_t maxsize>
-struct DbusSignatureHelper<Map<T, minsize, maxsize> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_TYPE_ARRAY;
- rpc::impl::DbusSignatureHelper<typename Map<T, minsize, maxsize>::
- value_type>::DbusSignature(signature);
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Optional<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_STRUCT_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- (*signature) += DBUS_STRUCT_END_CHAR;
- }
-};
-
-template <typename T>
-struct DbusSignatureHelper<Nullable<T> > {
- static void DbusSignature(std::string* signature) {
- (*signature) += DBUS_STRUCT_BEGIN_CHAR;
- (*signature) += rpc::impl::DbusTypeCode<bool>();
- rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
- (*signature) += DBUS_STRUCT_END_CHAR;
- }
-};
-
-// Helper Optional type initialization functipon
-template <typename T>
-T TakeOptional(dbus::MessageReader* reader) {
- dbus::MessageReader struct_reader = reader->TakeStructReader();
- bool available = struct_reader.TakeBool();
- T value(&struct_reader);
- return available ? value : T();
-}
-
-// Helper Nullable type initialization functipon
-template <typename T>
-bool TakeNullable(dbus::MessageReader* reader) {
- dbus::MessageReader struct_reader = reader->TakeStructReader();
- bool is_null = struct_reader.TakeBool();
- return is_null;
-}
-
-} // namespace impl
-
-// Helper function that outputs dbus signature for type T
-template <typename T>
-void DbusSignature(std::string* signature) {
- impl::DbusSignatureHelper<T>::DbusSignature(signature);
-}
-
-// Type constructors
-inline Boolean::Boolean(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsBool()))
- , value_(reader->TakeBool()) {}
-
-template <typename T, T minval, T maxval>
-inline Integer<T, minval, maxval>::Integer(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(impl::NextIs<IntType>(*reader)))
- , value_(impl::Take<IntType>(reader)) {
- if (is_valid()) {
- value_state_ = range_.Includes(value_) ? kValid : kInvalid;
- }
-}
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-inline Float<minnum, maxnum, minden, maxden>::Float(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsDouble()))
- , value_(reader->TakeDouble()) {
- if (is_valid()) {
- value_state_ = range_.Includes(value_) ? kValid : kInvalid;
- }
-}
-
-template <size_t minlen, size_t maxlen>
-inline String<minlen, maxlen>::String(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsString()))
- , value_(reader->TakeString()) {
- if (is_valid()) {
- value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
- }
-}
-
-template <typename T>
-inline Enum<T>::Enum(dbus::MessageReader* reader)
- : PrimitiveType(InitHelper(reader->NextIsInt32()))
- , value_(EnumType(reader->TakeInt32())) {
- if (is_valid()) {
- value_state_ = IsValidEnum(value_) ? kValid : kInvalid;
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline Array<T, minsize, maxsize>::Array(dbus::MessageReader* reader)
- : CompositeType(InitHelper(reader->NextIsArray())) {
- dbus::MessageReader array_reader = reader->TakeArrayReader();
- if (array_reader.has_failed()) {
- push_back(T());
- } else {
- while (array_reader.HasNext()) {
- push_back(T(&array_reader));
- }
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline Map<T, minsize, maxsize>::Map(dbus::MessageReader* reader)
- : CompositeType(InitHelper(reader->NextIsStruct())) {
- // Map key-value pairs are serialized into array
- dbus::MessageReader array_reader = reader->TakeArrayReader();
- if (array_reader.has_failed()) {
- this->insert(typename MapType::value_type("", T()));
- } else {
- while (array_reader.HasNext()) {
- dbus::MessageReader dictvalue_reader = array_reader.TakeDictEntryReader();
- typename MapType::key_type key =
- impl::Take<typename MapType::key_type>(&dictvalue_reader);
- this->insert(typename MapType::value_type(key, T(&dictvalue_reader)));
- }
- }
-}
-
-template <typename T>
-inline Nullable<T>::Nullable(dbus::MessageReader* reader)
- : T(reader), marked_null_(impl::TakeNullable<T>(reader)) {}
-
-template <typename T>
-inline Optional<T>::Optional(dbus::MessageReader* reader)
- : value_(impl::TakeOptional<T>(reader)) {}
-
-// MessageWriter serializers
-inline void Boolean::ToDbusWriter(dbus::MessageWriter* writer) const {
- writer->PutBool(value_);
-}
-
-template <typename T, T minval, T maxval>
-inline void Integer<T, minval, maxval>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- impl::Put(value_, writer);
-}
-
-template <int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
-inline void Float<minnum, maxnum, minden, maxden>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- writer->PutDouble(value_);
-}
-
-template <size_t minlen, size_t maxlen>
-inline void String<minlen, maxlen>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- writer->PutString(value_);
-}
-
-template <typename T>
-inline void Enum<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
- writer->PutInt32(static_cast<int32_t>(value_));
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline void Array<T, minsize, maxsize>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- std::string array_signature;
- DbusSignature<typename ArrayType::value_type>(&array_signature);
- dbus::MessageWriter array_writer(
- writer, dbus::kArray, array_signature.c_str());
- for (typename ArrayType::const_iterator i = this->begin(); i != this->end();
- ++i) {
- i->ToDbusWriter(&array_writer);
- }
-}
-
-template <typename T, size_t minsize, size_t maxsize>
-inline void Map<T, minsize, maxsize>::ToDbusWriter(
- dbus::MessageWriter* writer) const {
- std::string array_signature;
- DbusSignature<typename MapType::value_type>(&array_signature);
- dbus::MessageWriter array_writer(
- writer, dbus::kArray, array_signature.c_str());
- for (typename MapType::const_iterator i = this->begin(); i != this->end();
- ++i) {
- dbus::MessageWriter dictentry_writer(&array_writer, dbus::kDictEntry, NULL);
- impl::Put(i->first, &dictentry_writer);
- i->second.ToDbusWriter(&dictentry_writer);
- }
-}
-
-template <typename T>
-inline void Optional<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
- dbus::MessageWriter struct_writer(writer, dbus::kStruct, NULL);
- struct_writer.PutBool(value_.is_initialized());
- value_.ToDbusWriter(&struct_writer);
-}
-
-} // namespace rpc
-
-#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
diff --git a/src/components/rpc_base/test/CMakeLists.txt b/src/components/rpc_base/test/CMakeLists.txt
index ca4f41fe76..ae87bb71b7 100644
--- a/src/components/rpc_base/test/CMakeLists.txt
+++ b/src/components/rpc_base/test/CMakeLists.txt
@@ -31,8 +31,6 @@
include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- ${COMPONENTS_DIR}/dbus/include
- ${COMPONENTS_DIR}/dbus/src
${COMPONENTS_DIR}/rpc_base/include
${GMOCK_INCLUDE_DIRECTORY}
${JSONCPP_INCLUDE_DIRECTORY}
@@ -43,16 +41,5 @@ set(LIBRARIES
jsoncpp
)
-if(${HMI_DBUS_API})
- include_directories(${DBUS_INCLUDE_DIRS})
- list(APPEND LIBRARIES
- DBus
- )
-else()
- set(EXCLUDE_PATHS
- rpc_base_dbus_test.cc
- )
-endif()
-
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
create_test(rpc_base_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/rpc_base/test/rpc_base_dbus_test.cc b/src/components/rpc_base/test/rpc_base_dbus_test.cc
deleted file mode 100644
index 4a22e111a3..0000000000
--- a/src/components/rpc_base/test/rpc_base_dbus_test.cc
+++ /dev/null
@@ -1,682 +0,0 @@
-/* Copyright (c) 2014, 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 "dbus/dbus_message.h"
-#include "rpc_base/rpc_base.h"
-#include "rpc_base/rpc_base_dbus_inl.h"
-
-namespace test {
-namespace components {
-namespace rpc_base_test {
-
-using namespace rpc;
-using namespace dbus;
-
-enum TestEnum { kValue0, kValue1, kInvalidValue };
-
-bool IsValidEnum(TestEnum val) {
- return val == kValue0 || val == kValue1;
-}
-
-bool EnumFromJsonString(const std::string& value, TestEnum* enm) {
- if (value == "kValue0") {
- *enm = kValue0;
- return true;
- } else if (value == "kValue1") {
- *enm = kValue1;
- return true;
- } else {
- return false;
- }
-}
-
-const char* EnumToJsonString(TestEnum enm) {
- switch (enm) {
- case kValue0:
- return "kValue0";
- case kValue1:
- return "kValue1";
- default:
- return "UNKNOWN";
- }
-}
-
-struct DbusDeserialization : public testing::Test {
- dbus::MessageRef msgref;
- DbusDeserialization()
- : msgref(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {}
-};
-
-TEST_F(DbusDeserialization, DeserializeBool) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutBool(true);
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean booln(&reader);
- ASSERT_TRUE(booln);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeByte) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutByte(200);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<uint8_t, 1, 220> byte(&reader);
- ASSERT_TRUE(byte.is_initialized());
- ASSERT_TRUE(byte.is_valid());
- ASSERT_EQ(byte, 200);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeInt64) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutInt64(-1);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int64_t, -5, 220> int64(&reader);
- ASSERT_TRUE(int64.is_initialized());
- ASSERT_TRUE(int64.is_valid());
- ASSERT_EQ(int64, -1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeFloat) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutDouble(3.14);
- }
- {
- dbus::MessageReader reader(msgref);
- Float<3, 4> pi(&reader);
- ASSERT_TRUE(pi.is_initialized());
- ASSERT_TRUE(pi.is_valid());
- ASSERT_DOUBLE_EQ(pi, 3.14);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeString) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello");
- }
- {
- dbus::MessageReader reader(msgref);
- String<3, 10> hello(&reader);
- ASSERT_TRUE(hello.is_initialized());
- ASSERT_TRUE(hello.is_valid());
- ASSERT_EQ(std::string(hello), "Hello");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeEnum) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutInt32(kValue1);
- }
- {
- dbus::MessageReader reader(msgref);
- Enum<TestEnum> enm(&reader);
- ASSERT_TRUE(enm.is_initialized());
- ASSERT_TRUE(enm.is_valid());
- ASSERT_EQ(enm, kValue1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeArray) {
- {
- dbus::MessageWriter writer(msgref);
- std::string array_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50> >(&array_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, array_signature.c_str());
- array_writer.PutInt32(5);
- array_writer.PutInt32(33);
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Integer<int32_t, 1, 50>, 1, 100> array(&reader);
- ASSERT_TRUE(array.is_initialized());
- ASSERT_TRUE(array.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(array.size(), 2u);
- ASSERT_EQ(array[0], 5);
- ASSERT_EQ(array[1], 33);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeArrayOfArrays) {
- {
- dbus::MessageWriter writer(msgref);
- std::string array_signature;
- rpc::DbusSignature<Array<Integer<int32_t, 1, 50>, 1, 5> >(&array_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, array_signature.c_str());
- int val = 5;
- for (int i = 0; i < 2; ++i) {
- std::string subarray_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50> >(&subarray_signature);
- dbus::MessageWriter subarray_wirter(
- &array_writer, dbus::kArray, subarray_signature.c_str());
-
- subarray_wirter.PutInt32(val++);
- subarray_wirter.PutInt32(val++);
- }
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Array<Integer<int32_t, 1, 50>, 1, 5>, 1, 5> array(&reader);
- ASSERT_TRUE(array.is_initialized());
- ASSERT_TRUE(array.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(array.size(), 2u);
- ASSERT_EQ(array[0].size(), 2u);
- ASSERT_EQ(array[1].size(), 2u);
- ASSERT_EQ(array[0][0], 5);
- ASSERT_EQ(array[0][1], 6);
- ASSERT_EQ(array[1][0], 7);
- ASSERT_EQ(array[1][1], 8);
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeMap) {
- {
- dbus::MessageWriter writer(msgref);
- std::string dict_signature;
- rpc::DbusSignature<Map<Enum<TestEnum>, 1, 5>::value_type>(&dict_signature);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, dict_signature.c_str());
- const char* keys[] = {"Hello", "World"};
- int val = 0;
- for (int i = 0; i < 2; ++i) {
- dbus::MessageWriter dictval_wirter(&array_writer, dbus::kDictEntry, NULL);
- dictval_wirter.PutString(keys[val]);
- dictval_wirter.PutInt32(val++);
- }
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Enum<TestEnum>, 1, 5> amap(&reader);
- ASSERT_TRUE(amap.is_initialized());
- ASSERT_TRUE(amap.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(amap.size(), 2u);
- ASSERT_EQ(amap["Hello"], kValue0);
- ASSERT_EQ(amap["World"], kValue1);
- }
-}
-
-TEST_F(DbusDeserialization, InconsistentTypesTest) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello");
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean badbool(&reader);
- ASSERT_TRUE(badbool.is_initialized());
- ASSERT_FALSE(badbool.is_valid());
- ASSERT_TRUE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeOptionalString) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter optwriter(&writer, dbus::kStruct, NULL);
- optwriter.PutBool(true);
- optwriter.PutString("Hello dear");
- }
- {
- dbus::MessageReader reader(msgref);
- Optional<String<1, 100> > readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(std::string(*readback), "Hello dear");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, DeserializeOptionalInt) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter optwriter(&writer, dbus::kStruct, NULL);
- optwriter.PutBool(false);
- optwriter.PutInt32(42);
- }
- {
- dbus::MessageReader reader(msgref);
- Optional<Integer<int32_t, 1, 90> > readback(&reader);
- ASSERT_FALSE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeBool) {
- {
- Boolean true_bool(true);
- dbus::MessageWriter writer(msgref);
- true_bool.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Boolean readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, true);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeInt8t) {
- {
- Integer<int8_t, 1, 100> int8(42);
- dbus::MessageWriter writer(msgref);
- int8.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int8_t, 1, 100> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, 42);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, BadSerializeDeserializeInt8t) {
- {
- Integer<int8_t, 1, 12> int8(42);
- dbus::MessageWriter writer(msgref);
- int8.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int8_t, 1, 12> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_FALSE(readback.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeInt64t) {
- {
- Integer<int64_t, 1, 0xFFFFFFFFFF> int64(0xFFFFFFFFF1);
- dbus::MessageWriter writer(msgref);
- int64.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Integer<int64_t, 1, 0xFFFFFFFFFF> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, 0xFFFFFFFFF1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeDouble) {
- {
- Float<1, 5> flt(3.14);
- dbus::MessageWriter writer(msgref);
- flt.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Float<1, 5> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_DOUBLE_EQ(readback, 3.14);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeString) {
- {
- String<1, 12> hello("Hello");
- dbus::MessageWriter writer(msgref);
- hello.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- String<1, 12> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(std::string(readback), "Hello");
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeEnum) {
- {
- Enum<TestEnum> te(kValue1);
- dbus::MessageWriter writer(msgref);
- te.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Enum<TestEnum> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback, kValue1);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeArray) {
- {
- Array<Integer<int32_t, 1, 100>, 1, 90> ints;
- ints.push_back(42);
- ints.push_back(17);
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Array<Integer<int32_t, 1, 100>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback[0], 42);
- ASSERT_EQ(readback[1], 17);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeMap) {
- {
- Map<Integer<int32_t, 1, 100>, 1, 90> ints;
- ints["first"] = 42;
- ints["second"] = 17;
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Integer<int32_t, 1, 100>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback["first"], 42);
- ASSERT_EQ(readback["second"], 17);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusDeserialization, SerializeDeserializeMapOfArrays) {
- {
- Map<Array<Integer<int32_t, 1, 100>, 1, 5>, 1, 90> ints;
- ints["first"].push_back(1);
- ints["first"].push_back(42);
- ints["second"].push_back(17);
- ints["second"].push_back(3);
- dbus::MessageWriter writer(msgref);
- ints.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msgref);
- Map<Array<Integer<int32_t, 1, 100>, 1, 5>, 1, 90> readback(&reader);
- ASSERT_TRUE(readback.is_initialized());
- ASSERT_TRUE(readback.is_valid());
- ASSERT_EQ(readback.size(), 2u);
- ASSERT_EQ(readback["first"].size(), 2u);
- ASSERT_EQ(readback["second"].size(), 2u);
- ASSERT_EQ(readback["first"][0], 1);
- ASSERT_EQ(readback["first"][1], 42);
- ASSERT_EQ(readback["second"][0], 17);
- ASSERT_EQ(readback["second"][1], 3);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST(ValidatedTypes, TestBooleanDbusSignature) {
- std::string sign;
- DbusSignature<Boolean>(&sign);
- ASSERT_EQ(sign, "b");
-}
-
-TEST(ValidatedTypes, TestIntDbusSignature) {
- std::string sign;
- DbusSignature<Integer<int32_t, 1, 2> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestFloatDbusSignature) {
- std::string sign;
- DbusSignature<Float<1, 2> >(&sign);
- ASSERT_EQ(sign, "d");
-}
-
-TEST(ValidatedTypes, TestStringDbusSignature) {
- std::string sign;
- DbusSignature<String<1, 2> >(&sign);
- ASSERT_EQ(sign, "s");
-}
-
-TEST(ValidatedTypes, TestEnumDbusSignature) {
- std::string sign;
- DbusSignature<Enum<TestEnum> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestIntArrayDbusSignature) {
- std::string sign;
- DbusSignature<Array<Integer<int32_t, 1, 2>, 1, 3> >(&sign);
- ASSERT_EQ(sign, "ai");
-}
-
-TEST(ValidatedTypes, TestIntArrayArrayDbusSignature) {
- std::string sign;
- DbusSignature<Array<Array<Integer<int32_t, 1, 2>, 1, 3>, 4, 5> >(&sign);
- ASSERT_EQ(sign, "aai");
-}
-
-TEST(ValidatedTypes, TestMapDbusSignature) {
- std::string sign;
- DbusSignature<Map<Integer<int32_t, 1, 2>, 3, 4> >(&sign);
- ASSERT_EQ(sign, "a{si}");
-}
-
-TEST(ValidatedTypes, TestMandatoryEnumDbusSignature) {
- std::string sign;
- DbusSignature<Enum<TestEnum> >(&sign);
- ASSERT_EQ(sign, "i");
-}
-
-TEST(ValidatedTypes, TestOptionalEnumDbusSignature) {
- std::string sign;
- DbusSignature<Optional<Enum<TestEnum> > >(&sign);
- ASSERT_EQ(sign, "(bi)");
-}
-
-TEST(ValidatedTypes, TestOptionalFloatArrayDbusSignature) {
- std::string sign;
- DbusSignature<Optional<Array<Float<1, 2>, 3, 4> > >(&sign);
- ASSERT_EQ(sign, "(bad)");
-}
-
-TEST(DbusMessageConstructionTest, DbusMessageConstruction) {
- DBusMessage* rawmsg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
- dbus::MessageRef msgref(rawmsg);
-}
-
-class DbusTest : public testing::Test {
- public:
- dbus::MessageRef msgref;
- DbusTest() : msgref(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {}
-};
-
-TEST_F(DbusTest, DbusWriterConstructionTest) {
- dbus::MessageWriter writer(msgref);
-}
-
-TEST_F(DbusTest, DbusEmptyMessageReaderTest) {
- dbus::MessageReader reader(msgref);
- ASSERT_TRUE(reader.has_failed());
-}
-
-TEST_F(DbusTest, DbusMessageWriterBoolWriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutBool(true);
- dbus::MessageReader reader(msgref);
- bool redback_value = reader.TakeBool();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_TRUE(redback_value);
-}
-
-TEST_F(DbusTest, DbusMessageWriterInt32WriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutInt32(42);
- dbus::MessageReader reader(msgref);
- int32_t readback_value = reader.TakeInt32();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_value, 42);
-}
-
-TEST_F(DbusTest, DbusMessageWriterStringWriteRead) {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello DBus!");
- dbus::MessageReader reader(msgref);
- std::string readback_value = reader.TakeString();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_value, "Hello DBus!");
-}
-
-TEST_F(DbusTest, DbusMultipleParamsReadWrite) {
- {
- dbus::MessageWriter writer(msgref);
- writer.PutString("Hello DBus!");
- writer.PutInt16(42);
- writer.PutDouble(3.14);
- }
- {
- dbus::MessageReader reader(msgref);
- std::string readback_string = reader.TakeString();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_string, "Hello DBus!");
- int16_t readback_int = reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_int, 42);
- double readback_double = reader.TakeDouble();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_DOUBLE_EQ(readback_double, 3.14);
- ASSERT_FALSE(reader.HasNext());
- }
-}
-
-TEST_F(DbusTest, DbusArrayTest) {
- {
- dbus::MessageWriter writer(msgref);
- dbus::MessageWriter array_writer(
- &writer, dbus::kArray, DBUS_TYPE_INT16_AS_STRING);
- array_writer.PutInt16(3);
- array_writer.PutInt16(4);
- array_writer.PutInt16(5);
- }
- {
- dbus::MessageReader reader(msgref);
- dbus::MessageReader array_reader = reader.TakeArrayReader();
- int16_t readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 3);
- readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 4);
- readback_val = array_reader.TakeInt16();
- ASSERT_FALSE(reader.has_failed());
- ASSERT_EQ(readback_val, 5);
- ASSERT_FALSE(array_reader.HasNext());
- }
-}
-
-class DbusFailuresTest : public testing::Test {
- public:
- dbus::MessageRef int_msg;
- DbusFailuresTest()
- : int_msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)) {
- dbus::MessageWriter writer(int_msg);
- writer.PutInt64(42);
- }
-};
-
-TEST_F(DbusFailuresTest, DbusInconsistentTypeReadFailureTest) {
- dbus::MessageReader reader(int_msg);
- std::string str = reader.TakeString();
- ASSERT_EQ(str, std::string(""));
- ASSERT_TRUE(reader.has_failed());
-}
-
-TEST_F(DbusFailuresTest, DbusNonExistentArrayReadTest) {
- dbus::MessageReader reader(int_msg);
- ASSERT_FALSE(reader.has_failed());
- dbus::MessageReader array_reader = reader.TakeArrayReader();
- ASSERT_TRUE(array_reader.has_failed());
- ASSERT_TRUE(reader.has_failed());
- int64_t val = array_reader.TakeInt64();
- ASSERT_TRUE(array_reader.has_failed());
- ASSERT_EQ(val, 0);
-}
-
-} // namespace rpc_base_test
-} // namespace components
-} // namespace test
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
index aa3be0f430..5fd7a95155 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
@@ -46,7 +46,6 @@
#include "utils/macro.h"
#include "utils/lock.h"
-#include "utils/shared_ptr.h"
namespace security_manager {
class CryptoManagerImpl : public CryptoManager {
@@ -138,7 +137,7 @@ class CryptoManagerImpl : public CryptoManager {
public:
explicit CryptoManagerImpl(
- const utils::SharedPtr<const CryptoManagerSettings> set);
+ const std::shared_ptr<const CryptoManagerSettings> set);
~CryptoManagerImpl();
bool Init() OVERRIDE;
@@ -203,7 +202,7 @@ class CryptoManagerImpl : public CryptoManager {
*/
bool SaveModuleKeyToFile(EVP_PKEY* key) const;
- const utils::SharedPtr<const CryptoManagerSettings> settings_;
+ const std::shared_ptr<const CryptoManagerSettings> settings_;
SSL_CTX* context_;
static uint32_t instance_count_;
static sync_primitives::Lock instance_lock_;
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/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index 84c5db7c0e..90ae0177ec 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -87,7 +87,7 @@ void free_ctx(SSL_CTX** ctx) {
}
CryptoManagerImpl::CryptoManagerImpl(
- const utils::SharedPtr<const CryptoManagerSettings> set)
+ const std::shared_ptr<const CryptoManagerSettings> set)
: settings_(set), context_(NULL) {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(instance_lock_);
@@ -354,8 +354,8 @@ bool CryptoManagerImpl::IsCertificateUpdateRequired(
return true;
}
- return seconds <= (get_settings().update_before_hours() *
- date_time::DateTime::SECONDS_IN_HOUR);
+ return seconds <=
+ (get_settings().update_before_hours() * date_time::SECONDS_IN_HOUR);
}
const CryptoManagerSettings& CryptoManagerImpl::get_settings() const {
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 1faaddee1c..70f835fb93 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -69,7 +69,7 @@ void SecurityManagerImpl::OnMessageReceived(
return;
}
- SecurityMessage securityMessagePtr(new SecurityQuery());
+ SecurityMessage securityMessagePtr(std::make_shared<SecurityQuery>());
const bool result =
securityMessagePtr->SerializeQuery(message->data(), message->data_size());
if (!result) {
@@ -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/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc
index 74b071793d..5e096194f3 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -39,7 +39,6 @@
#include <fstream>
#include <sstream>
-#include "utils/make_shared.h"
#include "gtest/gtest.h"
#include "security_manager/crypto_manager_impl.h"
#include "security_manager/mock_security_manager_settings.h"
@@ -90,9 +89,9 @@ class CryptoManagerTest : public testing::Test {
void SetUp() OVERRIDE {
ASSERT_FALSE(certificate_data_base64_.empty());
mock_security_manager_settings_ =
- utils::MakeShared<MockCryptoManagerSettings>();
+ std::make_shared<MockCryptoManagerSettings>();
crypto_manager_ =
- utils::MakeShared<CryptoManagerImpl>(mock_security_manager_settings_);
+ std::make_shared<CryptoManagerImpl>(mock_security_manager_settings_);
forced_protected_services_.reserve(kMaxSizeVector);
forced_unprotected_services_.reserve(kMaxSizeVector);
}
@@ -129,8 +128,8 @@ class CryptoManagerTest : public testing::Test {
.WillByDefault(Return(false));
}
- utils::SharedPtr<CryptoManagerImpl> crypto_manager_;
- utils::SharedPtr<MockCryptoManagerSettings> mock_security_manager_settings_;
+ std::shared_ptr<CryptoManagerImpl> crypto_manager_;
+ std::shared_ptr<MockCryptoManagerSettings> mock_security_manager_settings_;
static std::string certificate_data_base64_;
std::vector<int> forced_protected_services_;
std::vector<int> forced_unprotected_services_;
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index 3523bb7f44..aff7cbca2d 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -45,7 +45,7 @@
#include "security_manager/mock_crypto_manager.h"
#include "security_manager/mock_security_manager_listener.h"
#include "utils/mock_system_time_handler.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
namespace test {
@@ -120,7 +120,7 @@ class SecurityManagerTest : public ::testing::Test {
void call_OnMessageReceived(const uint8_t* const data,
uint32_t dataSize,
const ServiceType serviceType) {
- const RawMessagePtr rawMessagePtr(utils::MakeShared<RawMessage>(
+ const RawMessagePtr rawMessagePtr(std::make_shared<RawMessage>(
kKey, kProtocolVersion, data, dataSize, serviceType));
security_manager_->OnMessageReceived(rawMessagePtr);
}
@@ -305,7 +305,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
TEST_F(SecurityManagerTest, OnMobileMessageSent) {
const uint8_t* data_param = NULL;
const RawMessagePtr rawMessagePtr(
- utils::MakeShared<RawMessage>(kKey, kProtocolVersion, data_param, 0));
+ std::make_shared<RawMessage>(kKey, kProtocolVersion, data_param, 0));
security_manager_->OnMobileMessageSent(rawMessagePtr);
}
/*
diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
index 83ffa33b44..1034bb3c83 100644
--- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc
+++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
@@ -87,14 +87,14 @@ class SSLHandshakeTest : public testing::TestWithParam<Protocol> {
security_manager_test::MockCryptoManagerSettings>();
server_manager_ = new security_manager::CryptoManagerImpl(
- utils::SharedPtr<security_manager::CryptoManagerSettings>(
+ std::shared_ptr<security_manager::CryptoManagerSettings>(
mock_server_manager_settings_));
ASSERT_TRUE(server_manager_);
mock_client_manager_settings_ = new testing::NiceMock<
security_manager_test::MockCryptoManagerSettings>();
client_manager_ = new security_manager::CryptoManagerImpl(
- utils::SharedPtr<security_manager::CryptoManagerSettings>(
+ std::shared_ptr<security_manager::CryptoManagerSettings>(
mock_client_manager_settings_));
ASSERT_TRUE(client_manager_);
server_ctx_ = NULL;
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index 20e509ebc6..05eeb802ad 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -41,8 +41,6 @@
#include "security_manager/ssl_context.h"
#include "utils/custom_string.h"
#include "security_manager/mock_security_manager_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using ::testing::Return;
using ::testing::ReturnRef;
@@ -111,9 +109,9 @@ class SSLTest : public testing::Test {
}
virtual void SetUp() OVERRIDE {
- mock_crypto_manager_settings_ = utils::MakeShared<
+ mock_crypto_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> crypto_set(
+ std::shared_ptr<security_manager::CryptoManagerSettings> crypto_set(
mock_crypto_manager_settings_);
crypto_manager_ = new security_manager::CryptoManagerImpl(crypto_set);
@@ -143,9 +141,9 @@ class SSLTest : public testing::Test {
const bool crypto_manager_initialization = crypto_manager_->Init();
EXPECT_TRUE(crypto_manager_initialization);
- mock_client_manager_settings_ = utils::MakeShared<
+ mock_client_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
@@ -213,9 +211,9 @@ class SSLTest : public testing::Test {
const size_t kMaximumPayloadSize = 1000u;
security_manager::CryptoManager* crypto_manager_;
security_manager::CryptoManager* client_manager_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
security_manager::SSLContext* server_ctx_;
security_manager::SSLContext* client_ctx_;
@@ -244,9 +242,9 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
ASSERT_FALSE(certificate.empty()) << "Certificate data file is empty";
certificate_data_base64_ = certificate;
- mock_crypto_manager_settings_ = utils::MakeShared<
+ mock_crypto_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> server_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> server_crypto(
mock_crypto_manager_settings_);
crypto_manager_ = new security_manager::CryptoManagerImpl(server_crypto);
@@ -256,10 +254,10 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
const bool crypto_manager_initialization = crypto_manager_->Init();
EXPECT_TRUE(crypto_manager_initialization);
- mock_client_manager_settings_ = utils::MakeShared<
+ mock_client_manager_settings_ = std::make_shared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
- utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
+ std::shared_ptr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
@@ -343,9 +341,9 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
.WillByDefault(ReturnRef(kClientPrivateKeyPath));
}
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
+ std::shared_ptr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
security_manager::CryptoManager* crypto_manager_;
security_manager::CryptoManager* client_manager_;
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 cdddcfed55..bfa39af10a 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
@@ -33,11 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Always false schema item.
**/
@@ -47,27 +46,24 @@ class CAlwaysFalseSchemaItem : public ISchemaItem {
* @brief Create a new schema item.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CAlwaysFalseSchemaItem> create();
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return Errors::ERROR
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<CAlwaysFalseSchemaItem> create();
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return Errors::ERROR
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
CAlwaysFalseSchemaItem();
DISALLOW_COPY_AND_ASSIGN(CAlwaysFalseSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
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 e078ae3240..4750c280e5 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
@@ -33,11 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Always true schema item.
**/
@@ -47,27 +46,24 @@ class CAlwaysTrueSchemaItem : public ISchemaItem {
* @brief Create a new schema item.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CAlwaysTrueSchemaItem> create();
- /**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
- **/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<CAlwaysTrueSchemaItem> create();
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
CAlwaysTrueSchemaItem();
DISALLOW_COPY_AND_ASSIGN(CAlwaysTrueSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
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 937979f2fa..a81fdd637e 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
@@ -34,13 +34,14 @@
#include <stddef.h>
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
#include "smart_objects/always_true_schema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include "utils/semantic_version.h"
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Array schema item.
**/
@@ -55,7 +56,7 @@ class CArraySchemaItem : public ISchemaItem {
*
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CArraySchemaItem> create(
+ static std::shared_ptr<CArraySchemaItem> create(
const ISchemaItemPtr ElementSchemaItem = CAlwaysTrueSchemaItem::create(),
const TSchemaItemParameter<size_t>& MinSize =
TSchemaItemParameter<size_t>(),
@@ -63,27 +64,16 @@ 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
- * message if an error occurs
- *
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Apply schema.
@@ -94,7 +84,9 @@ class CArraySchemaItem : public ISchemaItem {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
@@ -138,7 +130,7 @@ class CArraySchemaItem : public ISchemaItem {
const TSchemaItemParameter<size_t> mMaxSize;
DISALLOW_COPY_AND_ASSIGN(CArraySchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/bool_schema_item.h b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
index eca5a0e063..3a9f6c929d 100644
--- a/src/components/smart_objects/include/smart_objects/bool_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
@@ -33,12 +33,10 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
-#include "utils/shared_ptr.h"
-
#include "smart_objects/default_shema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Bool schema item.
**/
@@ -49,7 +47,7 @@ class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
* @param DefaultValue Default value of a parameter.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CBoolSchemaItem> create(
+ static std::shared_ptr<CBoolSchemaItem> create(
const TSchemaItemParameter<bool>& DefaultValue =
TSchemaItemParameter<bool>());
@@ -61,6 +59,6 @@ class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
private:
DISALLOW_COPY_AND_ASSIGN(CBoolSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
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 56952dbac1..5978fcb282 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
@@ -33,14 +33,13 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Default schema item.
@@ -50,20 +49,16 @@ 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
- * @return Errors::ERROR
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Set default value to an object.
@@ -107,23 +102,19 @@ 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__) {
+errors::eType CDefaultSchemaItem<Type>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (getSmartType() != Object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(getSmartType()) +
", got: " +
SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
} else {
- return Errors::OK;
+ return errors::OK;
}
}
@@ -149,6 +140,6 @@ void CDefaultSchemaItem<Type>::BuildObjectBySchema(
}
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
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 524d966188..cbba5bd7cd 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
@@ -39,11 +39,36 @@
#include <set>
#include <string>
-#include "utils/shared_ptr.h"
#include "smart_objects/default_shema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include "utils/semantic_version.h"
+#include <boost/optional.hpp>
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+
+struct ElementSignature {
+ boost::optional<utils::SemanticVersion> mSince;
+ boost::optional<utils::SemanticVersion> mUntil;
+ bool mRemoved;
+
+ ElementSignature(std::string since = "",
+ std::string until = "",
+ bool removed = false) {
+ utils::SemanticVersion since_struct(since);
+ utils::SemanticVersion until_struct(until);
+
+ if (since_struct.isValid()) {
+ mSince = since_struct;
+ }
+
+ if (until_struct.isValid()) {
+ mUntil = until_struct;
+ }
+
+ mRemoved = removed;
+ }
+};
template <typename EnumType>
class EnumConversionHelper;
@@ -60,25 +85,44 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<TEnumSchemaItem> create(
+ static std::shared_ptr<TEnumSchemaItem> create(
const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue =
TSchemaItemParameter<EnumType>());
+
/**
- * @deprecated
- * @brief Validate smart object.
- * @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @brief Create a new schema item.
+ * @param AllowedElements Set of allowed enumeration elements.
+ * @param DefaultValue Default value.
+ * @return Shared pointer to a new schema item.
**/
- Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ static std::shared_ptr<TEnumSchemaItem> createWithSignatures(
+ const std::set<EnumType>& AllowedElements,
+ const std::map<EnumType, std::vector<ElementSignature> >&
+ ElementSignatures,
+ const TSchemaItemParameter<EnumType>& DefaultValue =
+ TSchemaItemParameter<EnumType>());
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
+ /**
+ * @brief Return the correct history signature based on message version.
+ * @param signatures Vector reference of enums history items.
+ * @param MessageVersion RPC Version of mobile app.
+ **/
+ const ElementSignature getSignature(
+ const std::vector<ElementSignature>& signatures,
+ const utils::SemanticVersion& MessageVersion);
+
/**
* @brief Apply schema.
* This implementation checks if enumeration is represented as string
@@ -89,7 +133,9 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
@@ -104,12 +150,18 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
**/
TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue);
+
+ TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue,
+ const std::map<EnumType, std::vector<ElementSignature> >&
+ ElementSignatures);
SmartType getSmartType() const OVERRIDE;
EnumType getDefaultValue() const OVERRIDE;
/**
* @brief Set of allowed enumeration elements.
**/
const std::set<EnumType> mAllowedElements;
+ std::map<EnumType, std::vector<ElementSignature> > mElementSignatures;
/**
* @brief Default value.
**/
@@ -208,21 +260,54 @@ class EnumConversionHelper {
};
template <typename EnumType>
-utils::SharedPtr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
+std::shared_ptr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
const std::set<EnumType>& AllowedElements,
const TSchemaItemParameter<EnumType>& DefaultValue) {
- return new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue);
+ return std::shared_ptr<TEnumSchemaItem<EnumType> >(
+ new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue));
}
template <typename EnumType>
-Errors::eType TEnumSchemaItem<EnumType>::validate(const SmartObject& Object) {
- rpc::ValidationReport report("RPC");
- return validate(Object, &report);
+std::shared_ptr<TEnumSchemaItem<EnumType> >
+TEnumSchemaItem<EnumType>::createWithSignatures(
+ const std::set<EnumType>& AllowedElements,
+ const std::map<EnumType, std::vector<ElementSignature> >& ElementSignatures,
+ const TSchemaItemParameter<EnumType>& DefaultValue) {
+ return std::shared_ptr<TEnumSchemaItem<EnumType> >(
+ new TEnumSchemaItem<EnumType>(
+ AllowedElements, DefaultValue, ElementSignatures));
+}
+
+template <typename EnumType>
+const ElementSignature TEnumSchemaItem<EnumType>::getSignature(
+ const std::vector<ElementSignature>& signatures,
+ const utils::SemanticVersion& MessageVersion) {
+ for (uint i = 0; i < signatures.size(); i++) {
+ ElementSignature signature = signatures[i];
+ // Check if signature matches message version
+ if (signature.mSince != boost::none &&
+ MessageVersion < signature.mSince.get()) {
+ // Msg version predates 'since' field, check next entry
+ continue;
+ }
+ if (signature.mUntil != boost::none &&
+ (MessageVersion >= signature.mUntil.get())) {
+ continue; // Msg version newer than `until` field, check next entry
+ }
+ // Found correct signature
+ return signature;
+ }
+
+ // Could not match msg version to element siganture
+ ElementSignature ret;
+ return ret;
}
template <typename EnumType>
-Errors::eType TEnumSchemaItem<EnumType>::validate(
- const SmartObject& Object, rpc::ValidationReport* report__) {
+errors::eType TEnumSchemaItem<EnumType>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Integer != Object.getType()) {
std::string validation_info;
if (SmartType_String == Object.getType()) {
@@ -234,22 +319,55 @@ Errors::eType TEnumSchemaItem<EnumType>::validate(
SmartObject::typeToString(Object.getType());
}
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
- if (mAllowedElements.find(static_cast<EnumType>(Object.asInt())) ==
- mAllowedElements.end()) {
+
+ auto elements_it =
+ mAllowedElements.find(static_cast<EnumType>(Object.asInt()));
+
+ if (elements_it == mAllowedElements.end()) {
std::stringstream stream;
stream << "Invalid enum value: " << Object.asInt();
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
+ }
+
+ // Element exists in schema. Check if version is also valid.
+ if (MessageVersion.isValid()) {
+ EnumType value = *elements_it;
+ auto signatures_it = mElementSignatures.find(value);
+ if (signatures_it != mElementSignatures.end()) {
+ if (!signatures_it->second.empty()) {
+ ElementSignature signature =
+ getSignature(signatures_it->second, MessageVersion);
+ if (signature.mRemoved) {
+ // Element was removed for this version
+ std::string validation_info = "Enum value : " + Object.asString() +
+ " removed for SyncMsgVersion " +
+ MessageVersion.toString();
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ } else if (signature.mSince == boost::none &&
+ signature.mUntil == boost::none) {
+ // Element does not exist for this version
+ std::string validation_info = "Enum value : " + Object.asString() +
+ " does not exist for SyncMsgVersion " +
+ MessageVersion.toString();
+ report__->set_validation_info(validation_info);
+ return errors::INVALID_VALUE;
+ }
+ }
+ }
}
- return Errors::OK;
+ return errors::OK;
}
template <typename EnumType>
-void TEnumSchemaItem<EnumType>::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void TEnumSchemaItem<EnumType>::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_String == Object.getType()) {
EnumType enum_val = static_cast<EnumType>(-1);
if (ConversionHelper::StringToEnum(Object.asString(), &enum_val)) {
@@ -285,6 +403,15 @@ TEnumSchemaItem<EnumType>::TEnumSchemaItem(
: CDefaultSchemaItem<EnumType>(DefaultValue)
, mAllowedElements(AllowedElements) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+template <typename EnumType>
+TEnumSchemaItem<EnumType>::TEnumSchemaItem(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue,
+ const std::map<EnumType, std::vector<ElementSignature> >& ElementSignatures)
+ : CDefaultSchemaItem<EnumType>(DefaultValue)
+ , mAllowedElements(AllowedElements)
+ , mElementSignatures(ElementSignatures) {}
+
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ENUM_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/errors.h b/src/components/smart_objects/include/smart_objects/errors.h
index 5d22d2386e..8fc73be049 100644
--- a/src/components/smart_objects/include/smart_objects/errors.h
+++ b/src/components/smart_objects/include/smart_objects/errors.h
@@ -31,9 +31,9 @@
#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-namespace Errors {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
+namespace errors {
/**
* @brief Enumeration that provides information about SmartObject validation
*errors
@@ -64,8 +64,8 @@ enum eType {
**/
ERROR
};
-} // namespace Errors
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace errors
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
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 34c5e3a8a6..6481605daf 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
@@ -35,14 +35,14 @@
#include <typeinfo>
#include <limits>
-#include "utils/shared_ptr.h"
+
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
#include "utils/convert_utils.h"
#include "utils/helpers.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Number schema item.
* @tparam NumberType Number type.
@@ -57,7 +57,7 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<TNumberSchemaItem> create(
+ static std::shared_ptr<TNumberSchemaItem> create(
const TSchemaItemParameter<NumberType>& MinValue =
TSchemaItemParameter<NumberType>(),
const TSchemaItemParameter<NumberType>& MaxValue =
@@ -66,20 +66,16 @@ 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
- * @return Errors::ERROR
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
/**
@@ -112,11 +108,12 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
};
template <typename NumberType>
-utils::SharedPtr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
+std::shared_ptr<TNumberSchemaItem<NumberType> > TNumberSchemaItem<
NumberType>::create(const TSchemaItemParameter<NumberType>& MinValue,
const TSchemaItemParameter<NumberType>& MaxValue,
const TSchemaItemParameter<NumberType>& DefaultValue) {
- return new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue);
+ return std::shared_ptr<TNumberSchemaItem<NumberType> >(
+ new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue));
}
template <typename NumberType>
@@ -137,15 +134,10 @@ 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__) {
+errors::eType TNumberSchemaItem<NumberType>::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (!isValidNumberType(Object.getType())) {
SmartType expectedType = (typeid(double) == typeid(Object.getType()))
? SmartType_Double
@@ -154,7 +146,7 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
"Incorrect type, expected: " + SmartObject::typeToString(expectedType) +
", got: " + SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
NumberType value(0);
if (typeid(int32_t) == typeid(value)) {
@@ -178,7 +170,7 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
<< ", minimum allowed: " << rangeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
if (mMaxValue.getValue(rangeLimit) && (value > rangeLimit)) {
@@ -187,9 +179,9 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
<< ", maximum allowed: " << rangeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
- return Errors::OK;
+ return errors::OK;
}
template <typename NumberType>
@@ -227,6 +219,6 @@ SmartType TNumberSchemaItem<int64_t>::getSmartType() const;
template <>
SmartType TNumberSchemaItem<double>::getSmartType() const;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
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 8922caba45..45d161320b 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
@@ -37,13 +37,14 @@
#include <set>
#include "utils/macro.h"
-#include "utils/shared_ptr.h"
+#include "utils/semantic_version.h"
+#include <boost/optional.hpp>
#include "smart_objects/schema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Object schema item.
**/
@@ -63,7 +64,21 @@ class CObjectSchemaItem : public ISchemaItem {
* @param IsMandatory true if member is mandatory, false
* otherwise. Defaults to true.
**/
- SMember(const ISchemaItemPtr SchemaItem, const bool IsMandatory = true);
+
+ SMember(const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory = true,
+ const std::string& Since = "",
+ const std::string& Until = "",
+ const bool IsDeprecated = false,
+ const bool IsRemoved = false,
+ const std::vector<CObjectSchemaItem::SMember>& history_vector = {});
+ /**
+ * @brief Checks the version a parameter was removed (until)
+ * If the mobile's msg version is greater than or
+ **/
+ bool CheckHistoryFieldVersion(
+ const utils::SemanticVersion& MessageVersion) const;
+
/**
* @brief Member schema item.
**/
@@ -72,6 +87,11 @@ class CObjectSchemaItem : public ISchemaItem {
* @brief true if member is mandatory, false otherwise.
**/
bool mIsMandatory;
+ boost::optional<utils::SemanticVersion> mSince;
+ boost::optional<utils::SemanticVersion> mUntil;
+ bool mIsDeprecated;
+ bool mIsRemoved;
+ std::vector<CObjectSchemaItem::SMember> mHistoryVector;
};
typedef std::map<std::string, SMember> Members;
/**
@@ -82,22 +102,19 @@ class CObjectSchemaItem : public ISchemaItem {
*
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<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;
+ static std::shared_ptr<CObjectSchemaItem> create(const Members& Members);
+
/**
* @brief Validate smart object.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Apply schema.
* @param Object Object to apply schema.
@@ -105,7 +122,9 @@ class CObjectSchemaItem : public ISchemaItem {
* from smart object otherwise contains false.
**/
void applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) OVERRIDE;
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
/**
* @brief Unapply schema.
* @param Object Object to unapply schema.
@@ -137,7 +156,16 @@ class CObjectSchemaItem : public ISchemaItem {
* @brief Removes fake parameters from object.
* @param Object Object to remove fake parameters.
**/
- void RemoveFakeParams(SmartObject& Object);
+ void RemoveFakeParams(SmartObject& Object,
+ const utils::SemanticVersion& MessageVersion);
+
+ /**
+ * @brief Returns the correct schema item based on message version.
+ * @param member Schema member
+ * @param MmessageVersion Semantic Version of mobile message.
+ **/
+ const CObjectSchemaItem::SMember& GetCorrectMember(
+ const SMember& member, const utils::SemanticVersion& messageVersion);
/**
* @brief Map of member name to SMember structure describing the object
@@ -146,6 +174,6 @@ class CObjectSchemaItem : public ISchemaItem {
const Members mMembers;
DISALLOW_COPY_AND_ASSIGN(CObjectSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
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 446c7fa65f..24c642c0ba 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -33,13 +33,18 @@
#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
#include <stdlib.h>
-#include "utils/shared_ptr.h"
+
#include "rpc_base/validation_report.h"
#include "smart_objects/errors.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+#include <memory>
+#include <vector>
+#include "utils/macro.h"
+#include "utils/semantic_version.h"
+
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
/**
@@ -48,27 +53,18 @@ 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.
* @param report__ object for reporting errors during validation
* message if an error occurs
- *
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec Histor
+ * @return ns_smart_objects::errors::eType
**/
- virtual Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__);
+ virtual errors::eType validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Set default value to an object.
@@ -96,8 +92,9 @@ class ISchemaItem {
* from smart object otherwise contains false.
**/
virtual void applySchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& Object,
- const bool RemoveFakeParameters);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Unapply schema.
@@ -105,7 +102,7 @@ class ISchemaItem {
* @param Object Object to unapply schema.
**/
virtual void unapplySchema(
- NsSmartDeviceLink::NsSmartObjects::SmartObject& Object);
+ ns_smart_device_link::ns_smart_objects::SmartObject& Object);
/**
* @brief Build smart object by smart schema having copied matched
@@ -126,7 +123,7 @@ class ISchemaItem {
virtual ~ISchemaItem() {}
};
-typedef utils::SharedPtr<ISchemaItem> ISchemaItemPtr;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+typedef std::shared_ptr<ISchemaItem> ISchemaItemPtr;
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
index 49fdb9541b..f747b0ae89 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
@@ -34,8 +34,8 @@
#include "utils/macro.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief SchemaItem parameter.
* Container for schema item parameter such as min/max value, size,
@@ -95,6 +95,6 @@ bool TSchemaItemParameter<ParameterType>::getValue(ParameterType& Value) const {
}
return mIsSpecified;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_PARAMETER_H_
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 cc2bc7e22c..2abc221972 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>
@@ -42,8 +43,8 @@
#include "utils/custom_string.h"
#include "rpc_base/validation_report.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace custom_str = utils::custom_string;
@@ -126,7 +127,7 @@ typedef std::map<std::string, SmartObject> SmartMap;
**/
typedef std::vector<uint8_t> SmartBinary;
-typedef utils::SharedPtr<SmartObject> SmartObjectSPtr;
+typedef std::shared_ptr<SmartObject> SmartObjectSPtr;
/**
* @brief List of SmartObjects
@@ -671,20 +672,15 @@ 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
+ * @param messageVersion of the mobile app to check against RPC Spec Schema
* @return Result of validation.
*/
- Errors::eType validate(rpc::ValidationReport* report__);
+ errors::eType validate(
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief Sets new schema
@@ -704,7 +700,7 @@ class SmartObject FINAL {
/**
* @brief Returns current object type
*
- * @return NsSmartObjects::SmartType
+ * @return ns_smart_objects::SmartType
**/
SmartType getType() const;
@@ -1053,9 +1049,9 @@ static SmartObject invalid_object_value(SmartType_Invalid);
* @brief Value that is used as invalid value for object type
**/
static const SmartBinary invalid_binary_value;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace smart_objects = ns_smart_device_link::ns_smart_objects;
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
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 ada5646043..5e1497fdde 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -35,8 +35,8 @@
#include "utils/macro.h"
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
class SmartObject;
/**
@@ -61,26 +61,17 @@ 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.
* @param report__ object for reporting errors during validation
- *
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) const;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& messageVersion =
+ utils::SemanticVersion()) const;
/**
* @brief Set new root schema item.
@@ -97,7 +88,10 @@ class CSmartSchema FINAL {
* @param RemoveFakeParameters contains true if need to remove fake parameters
* from smart object otherwise contains false.
**/
- void applySchema(SmartObject& Object, const bool RemoveFakeParameters);
+ void applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion = utils::SemanticVersion());
/**
* @brief The reverse SmartObject conversion using schema.
@@ -124,6 +118,6 @@ class CSmartSchema FINAL {
*/
ISchemaItemPtr mSchemaItem;
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
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 6c98dcc3b3..5b37db584d 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
@@ -36,13 +36,11 @@
#include <stddef.h>
#include <string>
-#include "utils/shared_ptr.h"
-
#include "smart_objects/default_shema_item.h"
#include "smart_objects/schema_item_parameter.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief String schema item.
**/
@@ -54,28 +52,25 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
* @param DefaultValue Default value.
* @return Shared pointer to a new schema item.
**/
- static utils::SharedPtr<CStringSchemaItem> create(
+ static std::shared_ptr<CStringSchemaItem> create(
const TSchemaItemParameter<size_t>& MinLength =
TSchemaItemParameter<size_t>(),
const TSchemaItemParameter<size_t>& MaxLength =
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.
* @param Object Object to validate.
* @param report__ object for reporting errors during validation
- * @return NsSmartObjects::Errors::eType
+ * @param MessageVersion to check mobile RPC version against RPC Spec History
+ * @return ns_smart_objects::errors::eType
**/
- Errors::eType validate(const SmartObject& Object,
- rpc::ValidationReport* report__) OVERRIDE;
+ errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion =
+ utils::SemanticVersion()) OVERRIDE;
private:
/**
@@ -95,6 +90,6 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
const TSchemaItemParameter<size_t> mMaxLength;
DISALLOW_COPY_AND_ASSIGN(CStringSchemaItem);
};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_STRING_SCHEMA_ITEM_H_
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 1893ed24d1..ca247eed09 100644
--- a/src/components/smart_objects/src/always_false_schema_item.cc
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -32,24 +32,22 @@
#include "smart_objects/always_false_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CAlwaysFalseSchemaItem::CAlwaysFalseSchemaItem() {}
-utils::SharedPtr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
- return new CAlwaysFalseSchemaItem();
+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__) {
+errors::eType CAlwaysFalseSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
report__->set_validation_info("Generic error");
- return Errors::ERROR;
+ return errors::ERROR;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
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 1e7115316d..983733165c 100644
--- a/src/components/smart_objects/src/always_true_schema_item.cc
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -30,23 +30,21 @@
#include "smart_objects/always_true_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CAlwaysTrueSchemaItem::CAlwaysTrueSchemaItem() {}
-utils::SharedPtr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
- return new CAlwaysTrueSchemaItem();
+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__,
+ const utils::SemanticVersion& MessageVersion) {
+ return errors::OK;
}
-Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object,
- rpc::ValidationReport* report__) {
- return Errors::OK;
-}
-
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index dca0a815e0..7d5f8bcf84 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -31,30 +31,28 @@
#include "smart_objects/array_schema_item.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-utils::SharedPtr<CArraySchemaItem> CArraySchemaItem::create(
+std::shared_ptr<CArraySchemaItem> CArraySchemaItem::create(
const ISchemaItemPtr ElementSchemaItem,
const TSchemaItemParameter<size_t>& MinSize,
const TSchemaItemParameter<size_t>& MaxSize) {
- return new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize);
+ return std::shared_ptr<CArraySchemaItem>(
+ 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__) {
+errors::eType CArraySchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array != Object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(SmartType_Array) +
", got: " +
SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
size_t sizeLimit;
const size_t array_len = Object.length();
@@ -65,7 +63,7 @@ Errors::eType CArraySchemaItem::validate(const SmartObject& Object,
<< ", minimum allowed: " << sizeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
if (mMaxSize.getValue(sizeLimit) && (array_len > sizeLimit)) {
std::stringstream stream;
@@ -73,26 +71,31 @@ Errors::eType CArraySchemaItem::validate(const SmartObject& Object,
<< ", maximum allowed: " << sizeLimit;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
for (size_t i = 0u; i < array_len; ++i) {
std::stringstream strVal;
strVal << i;
- const Errors::eType result = mElementSchemaItem->validate(
- Object.getElement(i), &report__->ReportSubobject(strVal.str()));
- if (Errors::OK != result) {
+ const errors::eType result =
+ mElementSchemaItem->validate(Object.getElement(i),
+ &report__->ReportSubobject(strVal.str()),
+ MessageVersion);
+ if (errors::OK != result) {
return result;
}
}
- return Errors::OK;
+ return errors::OK;
}
-void CArraySchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void CArraySchemaItem::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Array == Object.getType()) {
for (size_t i = 0U; i < Object.length(); ++i) {
- mElementSchemaItem->applySchema(Object[i], RemoveFakeParameters);
+ mElementSchemaItem->applySchema(
+ Object[i], RemoveFakeParameters, MessageVersion);
}
}
}
@@ -128,5 +131,5 @@ CArraySchemaItem::CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
, mMinSize(MinSize)
, mMaxSize(MaxSize) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/bool_schema_item.cc b/src/components/smart_objects/src/bool_schema_item.cc
index c1da95528a..a4875a1b24 100644
--- a/src/components/smart_objects/src/bool_schema_item.cc
+++ b/src/components/smart_objects/src/bool_schema_item.cc
@@ -32,12 +32,12 @@
#include "smart_objects/bool_schema_item.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-utils::SharedPtr<CBoolSchemaItem> CBoolSchemaItem::create(
+std::shared_ptr<CBoolSchemaItem> CBoolSchemaItem::create(
const TSchemaItemParameter<bool>& DefaultValue) {
- return new CBoolSchemaItem(DefaultValue);
+ return std::shared_ptr<CBoolSchemaItem>(new CBoolSchemaItem(DefaultValue));
}
CBoolSchemaItem::CBoolSchemaItem(const TSchemaItemParameter<bool>& DefaultValue)
@@ -51,5 +51,5 @@ bool CBoolSchemaItem::getDefaultValue() const {
return false;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/number_schema_item.cc b/src/components/smart_objects/src/number_schema_item.cc
index 9789434523..c383f6ecca 100644
--- a/src/components/smart_objects/src/number_schema_item.cc
+++ b/src/components/smart_objects/src/number_schema_item.cc
@@ -31,8 +31,8 @@
*/
#include "smart_objects/number_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
SmartType TNumberSchemaItem<int32_t>::getSmartType() const {
@@ -54,5 +54,5 @@ SmartType TNumberSchemaItem<double>::getSmartType() const {
return SmartType_Double;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index 2bed3d9a26..e0324d841e 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -41,35 +41,80 @@ const char connection_key[] = "connection_key";
const char binary_data[] = "binary_data";
const char app_id[] = "appID";
}
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
CObjectSchemaItem::SMember::SMember()
: mSchemaItem(CAlwaysFalseSchemaItem::create()), mIsMandatory(true) {}
-CObjectSchemaItem::SMember::SMember(const ISchemaItemPtr SchemaItem,
- const bool IsMandatory)
- : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {}
+CObjectSchemaItem::SMember::SMember(
+ const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory,
+ const std::string& Since,
+ const std::string& Until,
+ const bool IsDeprecated,
+ const bool IsRemoved,
+ const std::vector<CObjectSchemaItem::SMember>& history_vector)
+ : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {
+ if (Since.size() > 0) {
+ utils::SemanticVersion since_struct(Since);
+ if (since_struct.isValid()) {
+ mSince = since_struct;
+ }
+ }
+ if (Until.size() > 0) {
+ utils::SemanticVersion until_struct(Until);
+ if (until_struct.isValid()) {
+ mUntil = until_struct;
+ }
+ }
+ mIsDeprecated = IsDeprecated;
+ mIsRemoved = IsRemoved;
+ mHistoryVector = history_vector;
+}
-utils::SharedPtr<CObjectSchemaItem> CObjectSchemaItem::create(
- const Members& members) {
- return new CObjectSchemaItem(members);
+bool CObjectSchemaItem::SMember::CheckHistoryFieldVersion(
+ const utils::SemanticVersion& MessageVersion) const {
+ if (MessageVersion.isValid()) {
+ if (mSince != boost::none) {
+ if (MessageVersion < mSince.get()) {
+ return false; // Msg version predates `since` field
+ } else {
+ if (mUntil != boost::none && (MessageVersion >= mUntil.get())) {
+ return false; // Msg version newer than `until` field
+ } else {
+ return true; // Mobile msg version falls within specified version
+ // range
+ }
+ }
+ }
+
+ if (mUntil != boost::none && (MessageVersion >= mUntil.get())) {
+ return false; // Msg version newer than `until` field
+ } else {
+ return true; // Mobile msg version falls within specified version range
+ }
+ }
+
+ return true; // Not enough version information. Default true.
}
-Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
- rpc::ValidationReport report("RPC");
- return validate(object, &report);
+std::shared_ptr<CObjectSchemaItem> CObjectSchemaItem::create(
+ const Members& members) {
+ return std::shared_ptr<CObjectSchemaItem>(new CObjectSchemaItem(members));
}
-Errors::eType CObjectSchemaItem::validate(const SmartObject& object,
- rpc::ValidationReport* report__) {
+errors::eType CObjectSchemaItem::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(SmartType_Map) +
", got: " +
SmartObject::typeToString(object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
std::set<std::string> object_keys = object.enumerate();
@@ -78,35 +123,42 @@ Errors::eType CObjectSchemaItem::validate(const SmartObject& object,
++it) {
const std::string& key = it->first;
const SMember& member = it->second;
+ const SMember& correct_member = GetCorrectMember(member, MessageVersion);
std::set<std::string>::const_iterator key_it = object_keys.find(key);
if (object_keys.end() == key_it) {
- if (member.mIsMandatory) {
+ if (correct_member.mIsMandatory == true &&
+ correct_member.mIsRemoved == false) {
std::string validation_info = "Missing mandatory parameter: " + key;
report__->set_validation_info(validation_info);
- return Errors::MISSING_MANDATORY_PARAMETER;
+ return errors::MISSING_MANDATORY_PARAMETER;
}
continue;
}
const SmartObject& field = object.getElement(key);
- const Errors::eType result =
- member.mSchemaItem->validate(field, &report__->ReportSubobject(key));
- if (Errors::OK != result) {
+
+ errors::eType result = errors::OK;
+ // Check if MessageVersion matches schema version
+ result = correct_member.mSchemaItem->validate(
+ field, &report__->ReportSubobject(key), MessageVersion);
+ if (errors::OK != result) {
return result;
}
object_keys.erase(key_it);
}
- return Errors::OK;
+ return errors::OK;
}
-void CObjectSchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
+void CObjectSchemaItem::applySchema(
+ SmartObject& Object,
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_Map != Object.getType()) {
return;
}
if (RemoveFakeParameters) {
- RemoveFakeParams(Object);
+ RemoveFakeParams(Object, MessageVersion);
}
SmartObject default_value;
@@ -117,10 +169,12 @@ void CObjectSchemaItem::applySchema(SmartObject& Object,
if (!Object.keyExists(key)) {
if (member.mSchemaItem->setDefaultValue(default_value)) {
Object[key] = default_value;
- member.mSchemaItem->applySchema(Object[key], RemoveFakeParameters);
+ member.mSchemaItem->applySchema(
+ Object[key], RemoveFakeParameters, MessageVersion);
}
} else {
- member.mSchemaItem->applySchema(Object[key], RemoveFakeParameters);
+ member.mSchemaItem->applySchema(
+ Object[key], RemoveFakeParameters, MessageVersion);
}
}
}
@@ -173,22 +227,49 @@ size_t CObjectSchemaItem::GetMemberSize() {
CObjectSchemaItem::CObjectSchemaItem(const Members& members)
: mMembers(members) {}
-void CObjectSchemaItem::RemoveFakeParams(SmartObject& Object) {
+void CObjectSchemaItem::RemoveFakeParams(
+ SmartObject& Object, const utils::SemanticVersion& MessageVersion) {
for (SmartMap::const_iterator it = Object.map_begin();
it != Object.map_end();) {
const std::string& key = it->first;
- if (mMembers.end() == mMembers.find(key)
+ std::map<std::string, SMember>::const_iterator members_it =
+ mMembers.find(key);
+ if (mMembers.end() == members_it
// FIXME(EZamakhov): Remove illegal usage of filed in AM
&&
key.compare(connection_key) != 0 && key.compare(binary_data) != 0 &&
key.compare(app_id) != 0) {
++it;
Object.erase(key);
+
+ } else if (mMembers.end() != members_it &&
+ GetCorrectMember(members_it->second, MessageVersion)
+ .mIsRemoved) {
+ ++it;
+ Object.erase(key);
} else {
- it++;
+ ++it;
+ }
+ }
+}
+
+const CObjectSchemaItem::SMember& CObjectSchemaItem::GetCorrectMember(
+ const SMember& member, const utils::SemanticVersion& messageVersion) {
+ // Check if member is the correct version
+ if (member.CheckHistoryFieldVersion(messageVersion)) {
+ return member;
+ }
+ // Check for history tag items
+ if (!member.mHistoryVector.empty()) {
+ for (uint i = 0; i < member.mHistoryVector.size(); i++) {
+ if (member.mHistoryVector[i].CheckHistoryFieldVersion(messageVersion)) {
+ return member.mHistoryVector[i];
+ }
}
}
+ // Return member as default
+ return member;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index 22735d40d5..5e9358092a 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -32,16 +32,14 @@
#include "smart_objects/schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
-Errors::eType ISchemaItem::validate(const SmartObject& Object) {
- return Errors::ERROR;
-}
-
-Errors::eType ISchemaItem::validate(const SmartObject& object,
- rpc::ValidationReport* report__) {
- return Errors::ERROR;
+errors::eType ISchemaItem::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return errors::ERROR;
}
bool ISchemaItem::setDefaultValue(SmartObject& Object) {
@@ -53,7 +51,8 @@ bool ISchemaItem::hasDefaultValue(SmartObject& Object) {
}
void ISchemaItem::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {}
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {}
void ISchemaItem::unapplySchema(SmartObject& Object) {}
@@ -64,5 +63,5 @@ size_t ISchemaItem::GetMemberSize() {
return 0;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index a0925eef05..1322757ab1 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -42,8 +42,8 @@
#include <iterator>
#include <limits>
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
/**
* @brief Value that is used as invalid value for string type
@@ -491,7 +491,7 @@ std::string SmartObject::convert_string() const {
default:
break;
}
- return NsSmartDeviceLink::NsSmartObjects::invalid_cstr_value;
+ return ns_smart_device_link::ns_smart_objects::invalid_cstr_value;
}
custom_str::CustomString SmartObject::convert_custom_string() const {
@@ -870,16 +870,13 @@ bool SmartObject::erase(const std::string& Key) {
bool SmartObject::isValid() const {
rpc::ValidationReport report("RPC");
- return (Errors::OK == m_schema.validate(*this, &report));
+ 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__) {
- return m_schema.validate(*this, report__);
+errors::eType SmartObject::validate(
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
+ return m_schema.validate(*this, report__, MessageVersion);
}
void SmartObject::setSchema(const CSmartSchema& schema) {
@@ -890,5 +887,5 @@ CSmartSchema SmartObject::getSchema() {
return m_schema;
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index 7509ea80f1..f7cd22c4bc 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -32,22 +32,19 @@
#include "smart_objects/smart_schema.h"
#include "smart_objects/always_true_schema_item.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
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__) const {
- return mSchemaItem->validate(object, report__);
+errors::eType CSmartSchema::validate(
+ const SmartObject& object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) const {
+ return mSchemaItem->validate(object, report__, MessageVersion);
}
void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
@@ -55,8 +52,9 @@ void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
}
void CSmartSchema::applySchema(SmartObject& Object,
- const bool RemoveFakeParameters) {
- mSchemaItem->applySchema(Object, RemoveFakeParameters);
+ const bool RemoveFakeParameters,
+ const utils::SemanticVersion& MessageVersion) {
+ mSchemaItem->applySchema(Object, RemoveFakeParameters, MessageVersion);
}
void CSmartSchema::unapplySchema(SmartObject& Object) {
@@ -68,5 +66,5 @@ void CSmartSchema::BuildObjectBySchema(const SmartObject& pattern_object,
mSchemaItem->BuildObjectBySchema(pattern_object, result_object);
}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
index 1e4c8372f0..0288ad85e8 100644
--- a/src/components/smart_objects/src/string_schema_item.cc
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -33,32 +33,30 @@
#include "smart_objects/string_schema_item.h"
#include "utils/custom_string.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace custom_str = utils::custom_string;
-utils::SharedPtr<CStringSchemaItem> CStringSchemaItem::create(
+std::shared_ptr<CStringSchemaItem> CStringSchemaItem::create(
const TSchemaItemParameter<size_t>& MinLength,
const TSchemaItemParameter<size_t>& MaxLength,
const TSchemaItemParameter<std::string>& DefaultValue) {
- return new CStringSchemaItem(MinLength, MaxLength, DefaultValue);
+ return std::shared_ptr<CStringSchemaItem>(
+ 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__) {
+errors::eType CStringSchemaItem::validate(
+ const SmartObject& Object,
+ rpc::ValidationReport* report__,
+ const utils::SemanticVersion& MessageVersion) {
if (SmartType_String != Object.getType()) {
std::string validation_info = "Incorrect type, expected: " +
SmartObject::typeToString(SmartType_String) +
", got: " +
SmartObject::typeToString(Object.getType());
report__->set_validation_info(validation_info);
- return Errors::INVALID_VALUE;
+ return errors::INVALID_VALUE;
}
const custom_str::CustomString value = Object.asCustomString();
@@ -70,7 +68,7 @@ Errors::eType CStringSchemaItem::validate(const SmartObject& Object,
<< ", minimum allowed: " << length;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
if (mMaxLength.getValue(length) && (value.size() > length)) {
std::stringstream stream;
@@ -78,9 +76,9 @@ Errors::eType CStringSchemaItem::validate(const SmartObject& Object,
<< ", maximum allowed: " << length;
std::string validation_info = stream.str();
report__->set_validation_info(validation_info);
- return Errors::OUT_OF_RANGE;
+ return errors::OUT_OF_RANGE;
}
- return Errors::OK;
+ return errors::OK;
}
SmartType CStringSchemaItem::getSmartType() const {
@@ -99,5 +97,5 @@ CStringSchemaItem::CStringSchemaItem(
, mMinLength(MinLength)
, mMaxLength(MaxLength) {}
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
index 9d88178598..1f514672fd 100644
--- a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
@@ -41,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
/**
* Test AlwaysFalseSchemaItem
@@ -54,38 +54,38 @@ TEST(test_AlwaysFalseSchemaItemTest, simple_test) {
obj = 5;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
resultType = item->validate(obj["First"], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj["Second"], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_EQ(std::string("Some string"), obj["First"].asString());
EXPECT_EQ(555, obj["Second"].asInt());
obj[0] = true;
obj[1] = false;
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::ERROR, resultType);
+ EXPECT_EQ(errors::ERROR, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
index 40c827e17b..7f26a4968a 100644
--- a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
@@ -41,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
/**
* Test AlwaysTrueSchemaItem
@@ -54,38 +54,38 @@ TEST(test_AlwaysTrueSchemaItemTest, simple_test) {
obj = 5;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
resultType = item->validate(obj["First"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["Second"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Some string"), obj["First"].asString());
EXPECT_EQ(555, obj["Second"].asInt());
obj[0] = true;
obj[1] = false;
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc
index 9831f08442..28f435ee43 100644
--- a/src/components/smart_objects/test/ArraySchemaItem_test.cc
+++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc
@@ -46,7 +46,7 @@ namespace smart_object_test {
* Test ArraySchemaItem no schema item, no min and max size
**/
TEST(test_no_default_value, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item =
@@ -68,28 +68,28 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(38, obj[0].asInt());
EXPECT_TRUE(obj[1].asBool());
@@ -103,19 +103,19 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
ASSERT_EQ(std::string("New valid string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Obj - bool
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Object - number
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
@@ -125,7 +125,7 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
* only if all array elements are valid schema item objects
**/
TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(); // No min and max size
@@ -140,24 +140,24 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -172,21 +172,21 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[3][3] = "Another very very loooooong String";
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test ArraySchemaItem with min size
**/
TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -197,17 +197,17 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[2] = "New String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -218,7 +218,7 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
* Test ArraySchemaItem with min size
**/
TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -231,22 +231,22 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[1] = "true";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[2] = "New String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[3] = "Another String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -258,7 +258,7 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
* Test ArraySchemaItem with min and max size
**/
TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -271,27 +271,27 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[2] = "New String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[3] = "Another String";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj[4] = "Out of array";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
EXPECT_EQ(std::string("true"), obj[1].asString());
@@ -301,7 +301,7 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
}
TEST(test_map_validate, test_ArraySchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CArraySchemaItem::create(
@@ -314,29 +314,29 @@ TEST(test_map_validate, test_ArraySchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
obj["array"][1] = "true";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][2] = "New String";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][3] = "Another String";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
obj["array"][4] = "Out of array";
resultType = item->validate(obj["array"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj["array"][0].asString());
EXPECT_EQ(std::string("true"), obj["array"][1].asString());
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
index 8d67aa59b2..ed0043925b 100644
--- a/src/components/smart_objects/test/BoolSchemaItem_test.cc
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -34,8 +34,6 @@
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
#include "smart_objects/smart_object.h"
#include "smart_objects/bool_schema_item.h"
@@ -43,7 +41,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+using ns_smart_device_link::ns_smart_objects::ISchemaItemPtr;
/**
* Test BoolSchemaItem no default value
@@ -53,26 +51,26 @@ using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
* and leave SmartObject in previous state.
**/
TEST(test_no_default_value, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(); // No
- // default
- // value
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(); // No
+ // default
+ // value
obj = 5;
ASSERT_EQ(5, obj.asInt());
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -81,12 +79,12 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
@@ -100,11 +98,11 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
*value.
**/
TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
- NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(
+ ns_smart_device_link::ns_smart_objects::TSchemaItemParameter<bool>(
false)); // Default value = false
obj = 5;
@@ -112,14 +110,14 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
@@ -128,22 +126,22 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
EXPECT_FALSE(obj.asBool());
}
TEST(test_map_validate, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create(
- NsSmartDeviceLink::NsSmartObjects::TSchemaItemParameter<bool>(
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create(
+ ns_smart_device_link::ns_smart_objects::TSchemaItemParameter<bool>(
false)); // Default value = false
obj["aa"] = true;
@@ -151,10 +149,10 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["aa"], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -166,18 +164,18 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
obj["ind"] = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
TEST(test_array_validate, test_BoolSchemaItemTest) {
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
ISchemaItemPtr item =
- NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem::create();
+ ns_smart_device_link::ns_smart_objects::CBoolSchemaItem::create();
obj[0] = true;
obj[1] = false;
@@ -187,13 +185,13 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -205,13 +203,13 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(obj[1].asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
obj = false;
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
index 523b25a8d8..646e60bf61 100644
--- a/src/components/smart_objects/test/CObjectSchemaItem_test.cc
+++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
@@ -44,12 +44,13 @@
#include "smart_objects/object_schema_item.h"
#include "formatters/generic_json_formatter.h"
#include "formatters/CSmartFactory.h"
+#include "utils/semantic_version.h"
-namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
-namespace smartobj = NsSmartDeviceLink::NsSmartObjects;
+namespace formatters = ns_smart_device_link::ns_json_handler::formatters;
+namespace smartobj = ns_smart_device_link::ns_smart_objects;
-using namespace NsSmartDeviceLink::NsSmartObjects;
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
namespace test {
namespace components {
@@ -136,6 +137,36 @@ class ObjectSchemaItemTest : public ::testing::Test {
schemaMembersMap[Keys::SUCCESS] =
CObjectSchemaItem::SMember(CBoolSchemaItem::create(), false);
+ // Create fake param that has breaking history changes
+ std::vector<CObjectSchemaItem::SMember> fake_param_history_vector;
+
+ std::shared_ptr<ISchemaItem> fake_param_SchemaItem =
+ CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(99),
+ TSchemaItemParameter<std::string>()),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(100));
+
+ std::shared_ptr<ISchemaItem> fake_param_history_v1_SchemaItem =
+ CArraySchemaItem::create(
+ CStringSchemaItem::create(TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(99),
+ TSchemaItemParameter<std::string>()),
+ TSchemaItemParameter<size_t>(1),
+ TSchemaItemParameter<size_t>(100));
+
+ fake_param_history_vector.push_back(CObjectSchemaItem::SMember(
+ fake_param_history_v1_SchemaItem, true, "", "4.5.0", false, false));
+ schemaMembersMap["fakeParam"] =
+ CObjectSchemaItem::SMember(fake_param_SchemaItem,
+ false,
+ "4.5.0",
+ "",
+ false,
+ false,
+ fake_param_history_vector);
+
CObjectSchemaItem::Members rootMembersMap;
rootMembersMap[S_PARAMS] = CObjectSchemaItem::SMember(
CObjectSchemaItem::create(paramsMembersMap), true);
@@ -156,10 +187,40 @@ TEST_F(ObjectSchemaItemTest, validation_correct) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
+}
+
+TEST_F(ObjectSchemaItemTest, validation_correct_with_new_version) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 0;
+ obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ utils::SemanticVersion messageVersion(4, 5, 0);
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report, messageVersion));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
+TEST_F(ObjectSchemaItemTest, validation_invalid_data_with_old_version) {
+ SmartObject obj;
+ obj[S_PARAMS][S_FUNCTION_ID] = 0;
+ obj[S_PARAMS][S_CORRELATION_ID] = 0XFF0;
+ obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
+ obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 0;
+ obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
+ obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
+
+ utils::SemanticVersion messageVersion(3, 0, 0);
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report, messageVersion));
+}
+
TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
SmartObject obj;
obj[S_PARAMS][S_FUNCTION_ID] = 1;
@@ -170,7 +231,7 @@ TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -180,7 +241,7 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_MSG_PARAMS] = "some message parameters";
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = "some function";
@@ -190,33 +251,33 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = 0xABC;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = -0xFF1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
@@ -230,24 +291,24 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = 0x10;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = true;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = SmartObject();
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::INFO] = "info";
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -261,27 +322,27 @@ TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 2;
// S_CORRELATION_ID and S_PROTOCOL_VERSION is still missed
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = 0XFF2;
// S_PROTOCOL_VERSION is still missed
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ EXPECT_EQ(errors::MISSING_MANDATORY_PARAMETER,
schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -301,19 +362,19 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
obj[fake1] = SmartObject(static_cast<int64_t>(0));
// any fake parameter is OK
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][fake2] = SmartObject("123");
// any fake parameters are OK
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][fake3] = true;
// any fake parameters are OK
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
@@ -341,7 +402,7 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj[S_PARAMS].keyExists(fake2));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(fake3));
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// Check apply schema, remove fake parameter
@@ -356,7 +417,7 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::INFO));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::SUCCESS));
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[fake1] = SmartObject(static_cast<int64_t>(0));
@@ -372,7 +433,7 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_FALSE(obj[S_MSG_PARAMS].keyExists(fake3));
// Invalide state after enum convertion
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
@@ -388,18 +449,18 @@ TEST_F(ObjectSchemaItemTest, validation_empty_params) {
obj[S_MSG_PARAMS]["FAKE_PARAM3"] = SmartObject("2");
rpc::ValidationReport report("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(obj, false);
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(obj, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->unapplySchema(obj);
// Invalide state after enum convertion
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_EQ(errors::INVALID_VALUE, schema_item->validate(obj, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
@@ -436,12 +497,12 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
// S_FUNCTION_ID and RESULT_CODE are not converted to int
rpc::ValidationReport report("RPC");
- EXPECT_NE(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(errors::OK, schema_item->validate(object, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(object, false);
report = rpc::ValidationReport("RPC");
- EXPECT_EQ(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_EQ(errors::OK, schema_item->validate(object, &report));
EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// check conversion result
@@ -451,7 +512,7 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
schema_item->unapplySchema(object);
// S_FUNCTION_ID and RESULT_CODE are string
report = rpc::ValidationReport("RPC");
- EXPECT_NE(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(errors::OK, schema_item->validate(object, &report));
EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// check conversion result
@@ -466,8 +527,8 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
namespace FunctionID = test::components::smart_object_test::FunctionID;
typedef EnumConversionHelper<FunctionID::eType> FunctionConvertor;
@@ -541,5 +602,5 @@ const ResultType::eType ResultTypeConvertor::enum_values_[] = {
ResultType::USER_DISALLOWED,
ResultType::GENERIC_ERROR,
ResultType::DISALLOWED};
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+} // namespace ns_smart_objects
+} // namespace ns_smart_device_link
diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc
index 9914167e5a..edfa563336 100644
--- a/src/components/smart_objects/test/EnumSchemaItem_test.cc
+++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc
@@ -42,7 +42,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace TestType {
enum eType {
INVALID_ENUM = -1,
@@ -94,7 +94,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
obj = TestType::BLUETOOTH_OFF;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
@@ -103,7 +103,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
@@ -112,7 +112,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -121,7 +121,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - string
obj = "Some string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -145,7 +145,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
obj = TestType::BLUETOOTH_OFF;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_EQ(TestType::BLUETOOTH_OFF, obj.asInt());
@@ -154,7 +154,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -163,7 +163,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -172,7 +172,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - string
obj = "Some string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -181,12 +181,12 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - int in range of enum
obj = 6;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object - int out of enum range
obj = 15;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
@@ -203,31 +203,31 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
obj = TestType::BLUETOOTH_OFF;
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
item->unapplySchema(obj);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("FACTORY_DEFAULTS"), obj.asString());
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
obj = "TOO_MANY_REQUESTS";
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(TestType::TOO_MANY_REQUESTS, obj.asInt());
obj = "ENOUGH_REQUESTS";
item->applySchema(obj, false);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("ENOUGH_REQUESTS"), obj.asString());
}
@@ -235,8 +235,8 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const EnumConversionHelper<test::components::SmartObjects::SchemaItem::
diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc
index 0315bcedb3..eb227e4e9b 100644
--- a/src/components/smart_objects/test/NumberSchemaItem_test.cc
+++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc
@@ -40,7 +40,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
+using ns_smart_device_link::ns_smart_objects::ISchemaItemPtr;
/**
* Test NumberSchemaItem as INT with no default value
@@ -50,7 +50,7 @@ using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
* and leave SmartObject in previous state.
**/
TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -63,20 +63,20 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
// Obj string
@@ -84,18 +84,18 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
* Test NumberSchemaItem as INT with setted min value
**/
TEST(test_int_min_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -108,28 +108,28 @@ TEST(test_int_min_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 9;
ASSERT_EQ(9, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 10;
ASSERT_EQ(10, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as INT with setted max value
**/
TEST(test_int_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -143,28 +143,28 @@ TEST(test_int_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -750;
ASSERT_EQ(-750, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as INT with setted min and max value
**/
TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -178,35 +178,35 @@ TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -949;
ASSERT_EQ(-949, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = -950;
ASSERT_EQ(-950, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
* Test NumberSchemaItem as INT with correct default value
**/
TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -221,44 +221,44 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = -12001;
ASSERT_EQ(-12001, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
}
@@ -266,7 +266,7 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
* Test NumberSchemaItem as INT with default value out of range
**/
TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -281,49 +281,49 @@ TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 89;
ASSERT_EQ(89, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
}
TEST(test_int_map_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -339,15 +339,15 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["max"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["out_of_min"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["out_of_max"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -359,17 +359,17 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_int_array_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -385,21 +385,21 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -411,14 +411,14 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
@@ -430,7 +430,7 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
* and leave SmartObject in previous state.
**/
TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -443,20 +443,20 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
// Obj string
@@ -464,20 +464,20 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
ASSERT_EQ(std::string("Test"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
// Set default value
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with setted min value
**/
TEST(test_double_min_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -490,28 +490,28 @@ TEST(test_double_min_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 9.999999;
ASSERT_EQ(9.999999, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
/*
//Object int
obj = 10;
ASSERT_EQ(10, obj.asInt());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);*/
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);*/
}
/**
* Test NumberSchemaItem as DOUBLE with setted max value
**/
TEST(test_double_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -525,28 +525,28 @@ TEST(test_double_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 749.0001;
ASSERT_EQ(749.0001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -750.0;
ASSERT_EQ(-750.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with setted min and max value
**/
TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -560,35 +560,35 @@ TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 749.001;
ASSERT_EQ(749.001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -949.0;
ASSERT_EQ(-949.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = -949.00001;
ASSERT_EQ(-949.00001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
}
/**
* Test NumberSchemaItem as DOUBLE with correct default value
**/
TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -603,44 +603,44 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = -12000.01;
ASSERT_EQ(-12000.01, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
}
@@ -648,7 +648,7 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
* Test NumberSchemaItem as DOUBLE with default value out of range
**/
TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -663,49 +663,49 @@ TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 89.999;
ASSERT_EQ(89.999, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
// Object string
obj = "string";
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
}
TEST(test_double_map_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -721,15 +721,15 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["max"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["out_of_min"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["out_of_max"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
EXPECT_TRUE(resDefault);
@@ -740,17 +740,17 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["min"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_double_array_validate, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
@@ -766,21 +766,21 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OUT_OF_RANGE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -792,19 +792,19 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
EXPECT_EQ(-38.0, obj.asDouble());
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::OK, resultType);
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
+ EXPECT_EQ(ns_smart_device_link::ns_smart_objects::errors::INVALID_VALUE,
resultType);
}
TEST(test_int_double_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
ISchemaItemPtr item = TNumberSchemaItem<int>::create(
TSchemaItemParameter<int>(10),
@@ -817,11 +817,11 @@ TEST(test_int_double_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
}
TEST(test_double_int_value, test_NumberSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
ISchemaItemPtr item = TNumberSchemaItem<double>::create(
TSchemaItemParameter<double>(10.0),
@@ -834,7 +834,7 @@ TEST(test_double_int_value, test_NumberSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
index b11560914e..7d95a40b26 100644
--- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
+++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
@@ -36,8 +36,6 @@
#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
#include "smart_objects/schema_item.h"
@@ -58,8 +56,8 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsJSONHandler::strings;
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_json_handler::strings;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace TestType {
enum eType {
@@ -98,7 +96,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// SmartObjects --> JSON
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv2::
toString(srcObj, jsonString);
clock_gettime(CLOCK_REALTIME, &convertionEndTime);
@@ -116,7 +114,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// JSON --> SmartObjects
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv2::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv2::
fromString<FunctionIdTest::eType, MessageTypeTest::eType>(
jsonString,
dstObj,
@@ -138,7 +136,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// SmartObjects --> JSON
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv1::
toString(srcObj, jsonString);
clock_gettime(CLOCK_REALTIME, &convertionEndTime);
@@ -155,7 +153,7 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
clock_gettime(CLOCK_REALTIME, &convertionStartTime);
// JSON --> SmartObjects
- NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonSDLRPCv1::
+ ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonSDLRPCv1::
fromString<FunctionIdTest::eType, MessageTypeTest::eType>(jsonString,
dstObj);
@@ -255,17 +253,18 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
messageType_allowedEnumSubsetValues);
CObjectSchemaItem::Members paramsMembersMap;
- paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
- CObjectSchemaItem::SMember(functionId_SchemaItem, true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(functionId_SchemaItem, true);
+ paramsMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] =
CObjectSchemaItem::SMember(messageType_SchemaItem, true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ [ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
true);
@@ -331,35 +330,37 @@ class SmartObjectConvertionTimeTest : public ::testing::Test {
CObjectSchemaItem::SMember(tryAgainTime_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
- paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] =
- CObjectSchemaItem::SMember(
- TEnumSchemaItem<FunctionIdTest::eType>::create(
- functionId_allowedEnumSubsetValues),
- true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] =
+ CObjectSchemaItem::SMember(
+ TEnumSchemaItem<FunctionIdTest::eType>::create(
+ functionId_allowedEnumSubsetValues),
+ true);
+ paramsMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] =
CObjectSchemaItem::SMember(
TEnumSchemaItem<MessageTypeTest::eType>::create(
messageType_allowedEnumSubsetValues),
true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] =
+ [ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] =
+ [ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] =
CObjectSchemaItem::SMember(
TNumberSchemaItem<int>::create(TSchemaItemParameter<int>(1),
TSchemaItemParameter<int>(2)),
true);
paramsMembersMap
- [NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] =
+ [ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] =
CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> rootMembersMap;
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] =
- CObjectSchemaItem::SMember(CObjectSchemaItem::create(schemaMembersMap),
- true);
- rootMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] =
+ rootMembersMap
+ [ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] =
+ CObjectSchemaItem::SMember(
+ CObjectSchemaItem::create(schemaMembersMap), true);
+ rootMembersMap[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] =
CObjectSchemaItem::SMember(CObjectSchemaItem::create(paramsMembersMap),
true);
return CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
@@ -640,8 +641,8 @@ TEST_F(SmartObjectConvertionTimeTest, test_object_without_enum_convertion) {
} // namespace components
} // namespace test
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const EnumConversionHelper<test::components::SmartObjects::
diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc
index de8103771c..cfb6785db7 100644
--- a/src/components/smart_objects/test/SmartObjectDraft_test.cc
+++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc
@@ -44,8 +44,8 @@ namespace test {
namespace components {
namespace smart_object_test {
-using NsSmartDeviceLink::NsSmartObjects::SmartObject;
-using NsSmartDeviceLink::NsSmartObjects::SmartType;
+using ns_smart_device_link::ns_smart_objects::SmartObject;
+using ns_smart_device_link::ns_smart_objects::SmartType;
TEST(SmartObjectsDraftTest, primitive_types) {
SmartObject obj;
@@ -126,7 +126,7 @@ TEST(SmartObjectsDraftTest, test_public_interface) {
ASSERT_EQ(std::string("Hello, world"), obj.asString());
// ---- Binary ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
@@ -203,7 +203,7 @@ TEST(SmartObjectsDraftTest, test_helper_methods) {
ASSERT_EQ(std::string("Hello, world"), obj.asString());
// ---- Binary ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
diff --git a/src/components/smart_objects/test/SmartObjectInvalid_test.cc b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
index 68afbb6237..ff5949df6a 100644
--- a/src/components/smart_objects/test/SmartObjectInvalid_test.cc
+++ b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
@@ -40,7 +40,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
TEST(test_SmartObjectInvalidTest, simple_type_can_be_set_in_constructor) {
SmartObject objMap(SmartType_Map);
@@ -116,7 +116,7 @@ TEST(test_SmartObjectInvalidTest, invalid_object_remains_invalid) {
ASSERT_EQ(invalid_string_value, obj.asString());
// ---- BINARY ---- //
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData;
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData;
binaryData.push_back('\0');
binaryData.push_back('a');
obj = binaryData;
diff --git a/src/components/smart_objects/test/SmartObjectStress_test.cc b/src/components/smart_objects/test/SmartObjectStress_test.cc
index 698bd0415a..4c0234589f 100644
--- a/src/components/smart_objects/test/SmartObjectStress_test.cc
+++ b/src/components/smart_objects/test/SmartObjectStress_test.cc
@@ -40,7 +40,7 @@
namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
class StressTestHelper : public ::testing::Test {
private:
@@ -184,8 +184,8 @@ class StressTestHelper : public ::testing::Test {
std::string strVal("c:");
strVal += strDataVal;
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryVal(dataSize,
- randomChar);
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryVal(
+ dataSize, randomChar);
obj = binaryVal; // string with binary data filled with random chars
mVerifyMap[key_path] = strVal;
@@ -259,10 +259,10 @@ TEST_F(StressTestHelper, StressTest) {
if (!value.compare(0, 2, "c:")) {
std::string etalonData = value.substr(2);
- ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ ASSERT_EQ(ns_smart_device_link::ns_smart_objects::SmartType_Binary,
obj.getType());
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData =
obj.asBinary();
ASSERT_EQ(etalonData.size(), binaryData.size());
@@ -270,10 +270,10 @@ TEST_F(StressTestHelper, StressTest) {
{
std::string etalonData = value.substr(2);
- ASSERT_EQ(NsSmartDeviceLink::NsSmartObjects::SmartType_Binary,
+ ASSERT_EQ(ns_smart_device_link::ns_smart_objects::SmartType_Binary,
obj.getType());
- NsSmartDeviceLink::NsSmartObjects::SmartBinary binaryData =
+ ns_smart_device_link::ns_smart_objects::SmartBinary binaryData =
obj.asBinary();
ASSERT_EQ(etalonData.size(), binaryData.size());
diff --git a/src/components/smart_objects/test/SmartObjectUnit_test.cc b/src/components/smart_objects/test/SmartObjectUnit_test.cc
index 0a67b7e922..2c03d8a329 100644
--- a/src/components/smart_objects/test/SmartObjectUnit_test.cc
+++ b/src/components/smart_objects/test/SmartObjectUnit_test.cc
@@ -37,7 +37,7 @@ namespace test {
namespace components {
namespace smart_object_test {
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
class TestHelper : public ::testing::Test {
protected:
diff --git a/src/components/smart_objects/test/StringSchemaItem_test.cc b/src/components/smart_objects/test/StringSchemaItem_test.cc
index 4e4688d354..7bf0d0ed89 100644
--- a/src/components/smart_objects/test/StringSchemaItem_test.cc
+++ b/src/components/smart_objects/test/StringSchemaItem_test.cc
@@ -49,7 +49,7 @@ namespace smart_object_test {
* and leave SmartObject in previous state.
**/
TEST(test_no_default_value, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item =
@@ -61,7 +61,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_EQ(std::string("New valid string"), obj.asString());
@@ -70,7 +70,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
EXPECT_TRUE(obj.asBool());
@@ -79,12 +79,12 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
EXPECT_EQ(3.1415926, obj.asDouble());
}
@@ -98,7 +98,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
*default value.
**/
TEST(test_item_with_default_value, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -113,7 +113,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -122,7 +122,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
obj = true;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -131,12 +131,12 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
obj = 3.1415926;
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
EXPECT_EQ(std::string("Default string"), obj.asString());
}
@@ -144,7 +144,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
* Test StringSchemaItem with max length
**/
TEST(test_item_with_max_length, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -158,7 +158,7 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
@@ -168,17 +168,17 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
ASSERT_EQ(std::string("New very very loooooong string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
TEST(test_map_validate, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -193,19 +193,19 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj["str"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["long"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["bool"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj["num"], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["str"]);
EXPECT_TRUE(resDefault);
@@ -220,27 +220,27 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
EXPECT_EQ(std::string("Default string"), obj["num"].asString());
resultType = item->validate(obj["str"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["long"], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj["bool"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj["num"], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
TEST(test_array_validate, test_StringSchemaItemTest) {
- using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace ns_smart_device_link::ns_smart_objects;
SmartObject obj;
ISchemaItemPtr item = CStringSchemaItem::create(
@@ -256,22 +256,22 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
rpc::ValidationReport report("RPC");
int resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[4], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj[0]);
EXPECT_TRUE(resDefault);
@@ -290,24 +290,24 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
EXPECT_EQ(std::string("Default string"), obj[5].asString());
resultType = item->validate(obj[0], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[1], &report);
- EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
+ EXPECT_EQ(errors::OUT_OF_RANGE, resultType);
resultType = item->validate(obj[2], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[3], &report);
- EXPECT_EQ(Errors::INVALID_VALUE, resultType);
+ EXPECT_EQ(errors::INVALID_VALUE, resultType);
resultType = item->validate(obj[4], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resultType = item->validate(obj[5], &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
resultType = item->validate(obj, &report);
- EXPECT_EQ(Errors::OK, resultType);
+ EXPECT_EQ(errors::OK, resultType);
}
} // namespace smart_object_test
diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc
index 503652dcda..11273e332f 100644
--- a/src/components/smart_objects/test/smart_object_performance_test.cc
+++ b/src/components/smart_objects/test/smart_object_performance_test.cc
@@ -37,7 +37,7 @@
#include "smart_objects/smart_object.h"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
namespace test {
namespace components {
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
index 3c3de20e0e..eabaf0a5e4 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
@@ -44,7 +44,7 @@ class ApplicationManagerObserver;
class ApplicationManagerMetricWrapper : public MetricWrapper {
public:
- utils::SharedPtr<application_manager::AMTelemetryObserver::MessageMetric>
+ std::shared_ptr<application_manager::AMTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
index ecb9c8002a..31a3ceea12 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h
@@ -45,7 +45,7 @@ class ApplicationManagerObserver
: public application_manager::AMTelemetryObserver {
public:
explicit ApplicationManagerObserver(TelemetryMonitor* telemetry_monitor);
- virtual void OnMessage(utils::SharedPtr<MessageMetric> metric);
+ virtual void OnMessage(std::shared_ptr<MessageMetric> metric);
private:
TelemetryMonitor* telemetry_monitor_;
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
index daf602e9ca..dfe7f4b964 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
@@ -34,7 +34,7 @@
#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_
#include <string>
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/metric_wrapper.h"
#include "protocol_handler_observer.h"
@@ -42,7 +42,7 @@ namespace telemetry_monitor {
class ProtocolHandlerMecticWrapper : public MetricWrapper {
public:
- utils::SharedPtr<protocol_handler::PHTelemetryObserver::MessageMetric>
+ std::shared_ptr<protocol_handler::PHTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
index 69e5658382..27a4fda868 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h
@@ -45,13 +45,13 @@ class ProtocolHandlerObserver : public protocol_handler::PHTelemetryObserver {
explicit ProtocolHandlerObserver(TelemetryMonitor* telemetry_monitor);
virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time);
+ const date_time::TimeDuration& start_time);
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m);
+ virtual void EndMessageProcess(std::shared_ptr<MessageMetric> m);
private:
TelemetryMonitor* telemetry_monitor_;
- std::map<uint32_t, TimevalStruct> time_starts;
+ std::map<uint32_t, date_time::TimeDuration> time_starts;
};
} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_OBSERVER_H_
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 618901ffa8..ff7b9da9d6 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -46,11 +46,6 @@
#include "protocol_handler_observer.h"
#include "protocol_handler/protocol_handler_impl.h"
-namespace utils {
-template <typename T>
-class SharedPtr;
-}
-
namespace telemetry_monitor {
using ::utils::MessageQueue;
@@ -62,7 +57,7 @@ class Streamer : public threads::ThreadDelegate {
void threadMain() OVERRIDE;
void exitThreadMain() OVERRIDE;
- virtual void PushMessage(utils::SharedPtr<MetricWrapper> metric);
+ virtual void PushMessage(std::shared_ptr<MetricWrapper> metric);
volatile bool is_client_connected_;
private:
@@ -75,7 +70,7 @@ class Streamer : public threads::ThreadDelegate {
int32_t server_socket_fd_;
int32_t client_socket_fd_;
volatile bool stop_flag_;
- MessageQueue<utils::SharedPtr<MetricWrapper> > messages_;
+ MessageQueue<std::shared_ptr<MetricWrapper> > messages_;
DISALLOW_COPY_AND_ASSIGN(Streamer);
};
@@ -91,9 +86,8 @@ class TelemetryMonitor {
transport_manager);
virtual void Stop();
virtual void Start();
- virtual void SendMetric(utils::SharedPtr<MetricWrapper> metric);
- DEPRECATED void set_streamer(Streamer* streamer);
- void set_streamer(utils::SharedPtr<Streamer> streamer);
+ virtual void SendMetric(std::shared_ptr<MetricWrapper> metric);
+ void set_streamer(std::shared_ptr<Streamer> streamer);
const std::string& ip() const;
int16_t port() const;
@@ -101,7 +95,7 @@ class TelemetryMonitor {
std::string server_address_;
int16_t port_;
threads::Thread* thread_;
- utils::SharedPtr<Streamer> streamer_;
+ std::shared_ptr<Streamer> streamer_;
ApplicationManagerObserver app_observer;
TransportManagerObserver tm_observer;
ProtocolHandlerObserver ph_observer;
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
index b601e89b18..d1239c9d1b 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
@@ -41,7 +41,7 @@ namespace telemetry_monitor {
class TransportManagerMecticWrapper : public MetricWrapper {
public:
- utils::SharedPtr<transport_manager::TMTelemetryObserver::MessageMetric>
+ std::shared_ptr<transport_manager::TMTelemetryObserver::MessageMetric>
message_metric;
virtual Json::Value GetJsonMetric();
};
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
index bff5834586..d0bf4ba5bb 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_observer.h
@@ -49,7 +49,8 @@ class TransportManagerObserver : public transport_manager::TMTelemetryObserver {
private:
TelemetryMonitor* telemetry_monitor_;
- std::map<const protocol_handler::RawMessage*, TimevalStruct> time_starts;
+ std::map<const protocol_handler::RawMessage*, date_time::TimeDuration>
+ time_starts;
};
} // namespace telemetry_monitor
#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_OBSERVER_H_
diff --git a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
index b693d9df22..006aac196f 100644
--- a/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/application_manager_metric_wrapper.cc
@@ -41,10 +41,9 @@ Json::Value ApplicationManagerMetricWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "ApplicationManager";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
- const NsSmartDeviceLink::NsSmartObjects::SmartObject& params =
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
+ const ns_smart_device_link::ns_smart_objects::SmartObject& params =
message_metric->message->getElement(application_manager::strings::params);
result[strings::correlation_id] = utils::ConvertInt64ToLongLongInt(
params[application_manager::strings::correlation_id].asInt());
diff --git a/src/components/telemetry_monitor/src/application_manager_observer.cc b/src/components/telemetry_monitor/src/application_manager_observer.cc
index cb390eddeb..1e621c8a6e 100644
--- a/src/components/telemetry_monitor/src/application_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/application_manager_observer.cc
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "telemetry_monitor/application_manager_observer.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
@@ -41,8 +41,8 @@ ApplicationManagerObserver::ApplicationManagerObserver(
: telemetry_monitor_(telemetry_monitor) {}
void ApplicationManagerObserver::OnMessage(
- utils::SharedPtr<MessageMetric> metric) {
- ApplicationManagerMetricWrapper* m = new ApplicationManagerMetricWrapper();
+ std::shared_ptr<MessageMetric> metric) {
+ auto m = std::make_shared<ApplicationManagerMetricWrapper>();
m->message_metric = metric;
m->grabResources();
telemetry_monitor_->SendMetric(m);
diff --git a/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc b/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
index 335f0dbb29..1591e00af8 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_metric_wrapper.cc
@@ -40,9 +40,8 @@ Json::Value ProtocolHandlerMecticWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "ProtocolHandler";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
result[strings::message_id] = message_metric->message_id;
result[strings::connection_key] = message_metric->connection_key;
return result;
diff --git a/src/components/telemetry_monitor/src/protocol_handler_observer.cc b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
index 2244cb2259..19b04da392 100644
--- a/src/components/telemetry_monitor/src/protocol_handler_observer.cc
+++ b/src/components/telemetry_monitor/src/protocol_handler_observer.cc
@@ -44,7 +44,7 @@ ProtocolHandlerObserver::ProtocolHandlerObserver(
: telemetry_monitor_(telemetry_monitor) {}
void ProtocolHandlerObserver::StartMessageProcess(
- uint32_t message_id, const TimevalStruct& start_time) {
+ uint32_t message_id, const date_time::TimeDuration& start_time) {
if (message_id == 0) {
return;
}
@@ -58,17 +58,17 @@ void ProtocolHandlerObserver::StartMessageProcess(
}
void ProtocolHandlerObserver::EndMessageProcess(
- utils::SharedPtr<MessageMetric> m) {
+ std::shared_ptr<MessageMetric> m) {
uint32_t message_id = m->message_id;
- std::map<uint32_t, TimevalStruct>::const_iterator it =
+ std::map<uint32_t, date_time::TimeDuration>::const_iterator it =
time_starts.find(message_id);
if (it == time_starts.end()) {
LOG4CXX_WARN(logger_, "Cant find start time for message" << message_id);
return;
}
m->begin = time_starts[message_id];
- m->end = date_time::DateTime::getCurrentTime();
- ProtocolHandlerMecticWrapper* metric = new ProtocolHandlerMecticWrapper();
+ m->end = date_time::getCurrentTime();
+ auto metric = std::make_shared<ProtocolHandlerMecticWrapper>();
metric->message_metric = m;
metric->grabResources();
telemetry_monitor_->SendMetric(metric);
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index 53a5a2dc70..d62724a479 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -1,34 +1,34 @@
/*
-* Copyright (c) 2014, 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.
-*/
+ * Copyright (c) 2014, 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 "telemetry_monitor/telemetry_monitor.h"
@@ -42,8 +42,7 @@
#include "transport_manager/transport_manager_default.h"
#include "utils/resource_usage.h"
-#include "utils/make_shared.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_observable.h"
namespace telemetry_monitor {
@@ -60,13 +59,11 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address,
, ph_observer(this) {}
void TelemetryMonitor::Start() {
- streamer_ = streamer_ ? streamer_ : utils::MakeShared<Streamer>(this);
+ streamer_ = streamer_ ? streamer_ : std::make_shared<Streamer>(this);
thread_ = threads::CreateThread("TelemetryMonitor", streamer_.get());
}
-void TelemetryMonitor::set_streamer(Streamer* streamer) {}
-
-void TelemetryMonitor::set_streamer(utils::SharedPtr<Streamer> streamer) {
+void TelemetryMonitor::set_streamer(std::shared_ptr<Streamer> streamer) {
LOG4CXX_AUTO_TRACE(logger_);
if (thread_ && !thread_->is_running()) {
streamer_ = streamer;
@@ -115,7 +112,7 @@ void TelemetryMonitor::Stop() {
thread_ = NULL;
}
-void TelemetryMonitor::SendMetric(utils::SharedPtr<MetricWrapper> metric) {
+void TelemetryMonitor::SendMetric(std::shared_ptr<MetricWrapper> metric) {
if (streamer_ && streamer_->is_client_connected_) {
streamer_->PushMessage(metric);
}
@@ -149,7 +146,7 @@ void Streamer::threadMain() {
is_client_connected_ = true;
while (is_client_connected_) {
while (!messages_.empty()) {
- utils::SharedPtr<MetricWrapper> metric;
+ std::shared_ptr<MetricWrapper> metric;
if (!messages_.pop(metric)) {
continue;
}
@@ -251,8 +248,9 @@ bool Streamer::IsReady() const {
fd_set fds;
FD_ZERO(&fds);
FD_SET(client_socket_fd_, &fds);
- TimevalStruct tv = {0, 0};
- tv.tv_sec = 5; // set a 5 second timeout
+ // need to construct a timeval for the duration, can't use duration
+ struct timeval tv;
+ tv.tv_sec = 5;
tv.tv_usec = 0;
const int retval = select(client_socket_fd_ + 1, 0, &fds, 0, &tv);
@@ -282,7 +280,7 @@ bool Streamer::Send(const std::string& msg) {
return true;
}
-void Streamer::PushMessage(utils::SharedPtr<MetricWrapper> metric) {
+void Streamer::PushMessage(std::shared_ptr<MetricWrapper> metric) {
messages_.push(metric);
}
} // namespace telemetry_monitor
diff --git a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
index a891aa1118..789da92eaf 100644
--- a/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_metric_wrapper.cc
@@ -41,9 +41,8 @@ Json::Value TransportManagerMecticWrapper::GetJsonMetric() {
Json::Value result = MetricWrapper::GetJsonMetric();
result[strings::logger] = "TransportManager";
result[strings::begin] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
- result[strings::end] =
- Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ Json::Int64(date_time::getuSecs(message_metric->begin));
+ result[strings::end] = Json::Int64(date_time::getuSecs(message_metric->end));
result[strings::data_size] = static_cast<uint32_t>(message_metric->data_size);
return result;
}
diff --git a/src/components/telemetry_monitor/src/transport_manager_observer.cc b/src/components/telemetry_monitor/src/transport_manager_observer.cc
index b3e57ac22a..25817d6c73 100644
--- a/src/components/telemetry_monitor/src/transport_manager_observer.cc
+++ b/src/components/telemetry_monitor/src/transport_manager_observer.cc
@@ -44,20 +44,20 @@ TransportManagerObserver::TransportManagerObserver(
void TransportManagerObserver::StartRawMsg(
const protocol_handler::RawMessage* ptr) {
- time_starts[ptr] = date_time::DateTime::getCurrentTime();
+ time_starts[ptr] = date_time::getCurrentTime();
}
void TransportManagerObserver::StopRawMsg(
const protocol_handler::RawMessage* ptr) {
- std::map<const protocol_handler::RawMessage*, TimevalStruct>::const_iterator
- it;
+ std::map<const protocol_handler::RawMessage*,
+ date_time::TimeDuration>::const_iterator it;
it = time_starts.find(ptr);
if (it != time_starts.end()) {
- TransportManagerMecticWrapper* m = new TransportManagerMecticWrapper();
- m->message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ auto m = std::make_shared<TransportManagerMecticWrapper>();
+ m->message_metric = std::make_shared<
+ transport_manager::TMTelemetryObserver::MessageMetric>();
m->message_metric->begin = it->second;
- m->message_metric->end = date_time::DateTime::getCurrentTime();
+ m->message_metric->end = date_time::getCurrentTime();
m->message_metric->data_size = ptr->data_size();
m->grabResources();
telemetry_monitor_->SendMetric(m);
diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
index 9029c41bc4..2e6eaad9d8 100644
--- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
@@ -50,22 +50,20 @@ TEST(ApplicationManagerMetricWrapper, grabResources) {
TEST(ApplicationManagerMetricWrapper, GetJsonMetric) {
ApplicationManagerMetricWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
-
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
- metric_test.message_metric =
- new application_manager::AMTelemetryObserver::MessageMetric();
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
+
+ metric_test.message_metric = std::make_shared<
+ application_manager::AMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
obj["params"][application_manager::strings::correlation_id] = 11;
obj["params"][application_manager::strings::connection_key] = 12;
metric_test.message_metric->message =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj);
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>(
+ obj);
Json::Value jvalue = metric_test.GetJsonMetric();
EXPECT_EQ("null\n",
@@ -75,9 +73,9 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetric) {
EXPECT_EQ("null\n",
jvalue[telemetry_monitor::strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(),
jvalue[telemetry_monitor::strings::correlation_id].asInt64());
@@ -90,37 +88,34 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) {
utils::ResourseUsage* resources = utils::Resources::getCurrentResourseUsage();
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
- metric_test.message_metric =
- new application_manager::AMTelemetryObserver::MessageMetric();
+ metric_test.message_metric = std::make_shared<
+ application_manager::AMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
- NsSmartDeviceLink::NsSmartObjects::SmartObject obj;
+ ns_smart_device_link::ns_smart_objects::SmartObject obj;
obj["params"][application_manager::strings::correlation_id] = 11;
obj["params"][application_manager::strings::connection_key] = 12;
metric_test.message_metric->message =
- new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj);
+ std::make_shared<ns_smart_device_link::ns_smart_objects::SmartObject>(
+ obj);
Json::Value jvalue = metric_test.GetJsonMetric();
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::correlation_id].asInt(),
jvalue[telemetry_monitor::strings::correlation_id].asInt64());
EXPECT_EQ(obj["params"][application_manager::strings::connection_key].asInt(),
jvalue[telemetry_monitor::strings::connection_key].asInt());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
+ EXPECT_EQ(date_time::getuSecs(start_time),
jvalue[telemetry_monitor::strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
+ EXPECT_EQ(date_time::getuSecs(end_time),
jvalue[telemetry_monitor::strings::end].asInt64());
EXPECT_NEAR(
diff --git a/src/components/telemetry_monitor/test/application_manager_observer_test.cc b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
index 5b7a551247..deecfa57b7 100644
--- a/src/components/telemetry_monitor/test/application_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
@@ -35,7 +35,7 @@
#include "application_manager/telemetry_observer.h"
#include "telemetry_monitor/application_manager_metric_wrapper.h"
#include "telemetry_monitor/application_manager_observer.h"
-#include "utils/shared_ptr.h"
+
#include "telemetry_monitor/telemetry_monitor.h"
namespace test {
@@ -49,7 +49,7 @@ TEST(ApplicationManagerObserver, CallOnMessage) {
MockTelemetryMonitor mock_telemetry_monitor;
ApplicationManagerObserver app_observer(&mock_telemetry_monitor);
typedef application_manager::AMTelemetryObserver::MessageMetric AMMetric;
- utils::SharedPtr<AMMetric> ptr =
+ std::shared_ptr<AMMetric> ptr =
application_manager::AMTelemetryObserver::MessageMetricSharedPtr();
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_));
app_observer.OnMessage(ptr);
diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
index fdda58bd08..c2aebe72b3 100644
--- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
+++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
@@ -37,7 +37,6 @@
#include "gmock/gmock.h"
#include "telemetry_monitor/telemetry_monitor.h"
#include "telemetry_monitor/metric_wrapper.h"
-#include "utils/shared_ptr.h"
namespace test {
namespace components {
@@ -50,7 +49,7 @@ class MockTelemetryMonitor : public telemetry_monitor::TelemetryMonitor {
MOCK_METHOD0(Stop, void());
MOCK_METHOD0(Start, void());
MOCK_METHOD1(SendMetric,
- void(utils::SharedPtr<telemetry_monitor::MetricWrapper> metric));
+ void(std::shared_ptr<telemetry_monitor::MetricWrapper> metric));
};
} // namespace transport_manager_test
} // namespace components
diff --git a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
index 8253cf2553..c9130411e7 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
@@ -51,15 +51,12 @@ TEST(ProtocolHandlerMetricTest, grabResources) {
TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
ProtocolHandlerMecticWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
metric_test.message_metric =
- new protocol_handler::PHTelemetryObserver::MessageMetric();
+ std::make_shared<protocol_handler::PHTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->message_id = 5;
@@ -71,10 +68,8 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetric) {
EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(5, jvalue[strings::message_id].asInt64());
EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
}
@@ -85,15 +80,12 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
EXPECT_TRUE(resources != NULL);
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
+ date_time::TimeDuration end_time = date_time::seconds(10);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
metric_test.message_metric =
- new protocol_handler::PHTelemetryObserver::MessageMetric();
+ std::make_shared<protocol_handler::PHTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->message_id = 5;
@@ -107,10 +99,8 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
EXPECT_NE("null/n", jvalue[strings::utime].toStyledString());
EXPECT_NE("null/n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(5, jvalue[strings::message_id].asInt64());
EXPECT_EQ(2, jvalue[strings::connection_key].asInt());
diff --git a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
index 784e809da6..587bf21ce6 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc
@@ -47,13 +47,12 @@ TEST(ProtocolHandlerObserverTest, MessageProcess) {
ProtocolHandlerObserver pr_handler(&mock_telemetry_monitor);
uint32_t message_id = 1;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
pr_handler.StartMessageProcess(message_id, start_time);
typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType;
- utils::SharedPtr<MetricType> message_metric = new MetricType();
+ std::shared_ptr<MetricType> message_metric = std::make_shared<MetricType>();
message_metric->message_id = 1;
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_));
pr_handler.EndMessageProcess(message_metric);
@@ -64,13 +63,12 @@ TEST(ProtocolHandlerObserverTest, MessageProcessWithZeroMessageId) {
ProtocolHandlerObserver pr_handler(&mock_telemetry_monitor);
uint32_t message_id = 0;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
+
pr_handler.StartMessageProcess(message_id, start_time);
typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType;
- utils::SharedPtr<MetricType> message_metric = new MetricType();
+ std::shared_ptr<MetricType> message_metric = std::make_shared<MetricType>();
message_metric->message_id = 0;
EXPECT_CALL(mock_telemetry_monitor, SendMetric(_)).Times(0);
pr_handler.EndMessageProcess(message_metric);
diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
index 5235f0a469..b8d3f9063f 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -40,8 +40,6 @@
#include "connection_handler/mock_connection_handler.h"
#include "transport_manager/mock_transport_manager.h"
#include "telemetry_monitor/mock_telemetry_observable.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
using testing::Return;
using testing::_;
@@ -57,7 +55,7 @@ class StreamerMock : public Streamer {
StreamerMock(TelemetryMonitor* const server) : Streamer(server) {
is_client_connected_ = true;
}
- MOCK_METHOD1(PushMessage, void(utils::SharedPtr<MetricWrapper> metric));
+ MOCK_METHOD1(PushMessage, void(std::shared_ptr<MetricWrapper> metric));
};
TEST(TelemetryMonitorTest, MessageProcess) {
@@ -92,14 +90,14 @@ TEST(TelemetryMonitorTest, MessageProcess) {
EXPECT_CALL(am_observeble, SetTelemetryObserver(_));
EXPECT_CALL(transport_manager_mock, SetTelemetryObserver(_));
telemetry_monitor::TelemetryMonitor telemetry_monitor(server_address, port);
- utils::SharedPtr<StreamerMock> streamer_mock =
- utils::MakeShared<StreamerMock>(&telemetry_monitor);
+ std::shared_ptr<StreamerMock> streamer_mock =
+ std::make_shared<StreamerMock>(&telemetry_monitor);
// streamer_mock will be freed by telemetry_monitor on destruction
telemetry_monitor.Start();
telemetry_monitor.set_streamer(streamer_mock);
telemetry_monitor.Init(
&protocol_handler_mock, &am_observeble, &transport_manager_mock);
- utils::SharedPtr<telemetry_monitor::MetricWrapper> test_metric;
+ std::shared_ptr<telemetry_monitor::MetricWrapper> test_metric;
EXPECT_CALL(*streamer_mock, PushMessage(test_metric));
telemetry_monitor.SendMetric(test_metric);
}
diff --git a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
index 6eb479387a..40caa6e0d6 100644
--- a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
@@ -51,15 +51,11 @@ TEST(TransportManagerMetricWrapper, grabResources) {
TEST(TransportManagerMetricWrapper, GetJsonMetric) {
TransportManagerMecticWrapper metric_test;
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
metric_test.message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ std::make_shared<transport_manager::TMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
metric_test.message_metric->data_size = 1000;
@@ -69,10 +65,8 @@ TEST(TransportManagerMetricWrapper, GetJsonMetric) {
EXPECT_EQ("null\n", jvalue[strings::utime].toStyledString());
EXPECT_EQ("null\n", jvalue[strings::memory].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(1000, jvalue[strings::data_size].asInt());
}
@@ -82,15 +76,11 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
EXPECT_TRUE(resources != NULL);
EXPECT_TRUE(metric_test.grabResources());
- TimevalStruct start_time;
- start_time.tv_sec = 1;
- start_time.tv_usec = 0;
+ date_time::TimeDuration start_time = date_time::seconds(1);
- TimevalStruct end_time;
- end_time.tv_sec = 10;
- end_time.tv_usec = 0;
+ date_time::TimeDuration end_time = date_time::seconds(10);
metric_test.message_metric =
- new transport_manager::TMTelemetryObserver::MessageMetric();
+ std::make_shared<transport_manager::TMTelemetryObserver::MessageMetric>();
metric_test.message_metric->begin = start_time;
metric_test.message_metric->end = end_time;
@@ -98,10 +88,8 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
Json::Value jvalue = metric_test.GetJsonMetric();
EXPECT_EQ("\"TransportManager\"\n", jvalue[strings::logger].toStyledString());
- EXPECT_EQ(date_time::DateTime::getuSecs(start_time),
- jvalue[strings::begin].asInt64());
- EXPECT_EQ(date_time::DateTime::getuSecs(end_time),
- jvalue[strings::end].asInt64());
+ EXPECT_EQ(date_time::getuSecs(start_time), jvalue[strings::begin].asInt64());
+ EXPECT_EQ(date_time::getuSecs(end_time), jvalue[strings::end].asInt64());
EXPECT_EQ(1000, jvalue[strings::data_size].asInt());
EXPECT_NEAR(resources->stime, jvalue[strings::stime].asInt(), 1);
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index 4fa224393d..2f734b3a05 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -43,6 +43,12 @@ include_directories (
${LOG4CXX_INCLUDE_DIRECTORY}
)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/tcp/platform_specific/qnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include/transport_manager/tcp/platform_specific/linux")
+endif ()
+
set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
@@ -96,8 +102,23 @@ if(NOT BUILD_TESTS)
)
endif()
+# exclude platform-dependent files before running collect_sources
+list(APPEND EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/tcp/platform_specific
+ ${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific
+)
+
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+# then add platform-dependent files later
+set(PLATFORM_DEPENDENT_SOURCES)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES "${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific/qnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES "${COMPONENTS_DIR}/transport_manager/src/tcp/platform_specific/linux")
+endif ()
+list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
+
add_library("TransportManager" ${SOURCES})
target_link_libraries("TransportManager" ${LIBRARIES})
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h
new file mode 100644
index 0000000000..8154503077
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener.h
@@ -0,0 +1,41 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Destructor
+ */
+ virtual ~NetworkInterfaceListener() {}
+
+ /**
+ * @brief Initialize this listener
+ */
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ virtual void Deinit() = 0;
+
+ /**
+ * @brief Start this listener
+ */
+ virtual bool Start() = 0;
+
+ /**
+ * @brief Stop this listener
+ */
+ virtual bool Stop() = 0;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
new file mode 100644
index 0000000000..159b5ff21d
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/network_interface_listener_impl.h
@@ -0,0 +1,63 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
+
+#include <string>
+#include <memory>
+
+#include "utils/macro.h"
+#include "transport_manager/tcp/network_interface_listener.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class NetworkInterfaceListenerImpl : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ NetworkInterfaceListenerImpl(TcpClientListener* tcp_client_listener,
+ const std::string designated_interface);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~NetworkInterfaceListenerImpl();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+ private:
+ std::unique_ptr<NetworkInterfaceListener> platform_specific_impl_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_NETWORK_INTERFACE_LISTENER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h
new file mode 100644
index 0000000000..a7338b94be
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h
@@ -0,0 +1,196 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <netinet/in.h>
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+struct ifaddrmsg;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Struct to keep network interface's status flags and IP addresses
+ */
+class InterfaceStatus {
+ public:
+ InterfaceStatus() : flags_(0), has_ipv4_(false), has_ipv6_(false) {}
+ ~InterfaceStatus() {}
+
+ bool IsAvailable() const;
+ bool IsLoopback() const;
+ // only for debugging output
+ unsigned int GetFlags() const {
+ return flags_;
+ }
+
+ bool HasIPAddress() const;
+ std::string GetIPv4Address() const;
+ std::string GetIPv6Address() const;
+
+ void SetFlags(unsigned int flags) {
+ flags_ = flags;
+ }
+
+ // specify NULL to remove existing address
+ void SetIPv4Address(struct in_addr* addr);
+ void SetIPv6Address(struct in6_addr* addr);
+
+ private:
+ unsigned int flags_;
+ bool has_ipv4_;
+ bool has_ipv6_;
+ struct in_addr ipv4_address_;
+ struct in6_addr ipv6_address_;
+};
+
+typedef std::map<std::string, InterfaceStatus> InterfaceStatusTable;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class PlatformSpecificNetworkInterfaceListener
+ : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface = "");
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~PlatformSpecificNetworkInterfaceListener();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+#ifdef BUILD_TESTS
+ void SetTesting(bool enabled) {
+ testing_ = enabled;
+ }
+
+ int GetSocket() const {
+ return socket_;
+ }
+
+ threads::Thread* GetThread() const {
+ return thread_;
+ }
+
+ void OverwriteStatusTable(const InterfaceStatusTable dummy_table) {
+ status_table_ = dummy_table;
+ }
+
+ void testCallNotifyIPAddresses() {
+ NotifyIPAddresses();
+ }
+
+ const std::string& GetSelectedInterfaceName() const {
+ return selected_interface_;
+ }
+#endif // BUILD_TESTS
+
+ private:
+ // Struct to hold an event on a network interface.
+ // The event can be either an update on flags or an update on IP address.
+ struct EventParam {
+ unsigned int if_index;
+ unsigned int flags;
+ struct sockaddr_storage address;
+
+ EventParam(int interface_index, unsigned int interface_flags = 0)
+ : if_index(interface_index), flags(interface_flags) {}
+ };
+
+ // parent class which we will notify the events to
+ TcpClientListener* tcp_client_listener_;
+ // if configured, NetworkInterfaceListener will always look into the IP
+ // addresses of this interface
+ const std::string designated_interface_;
+
+ // a map to store status of each interface
+ InterfaceStatusTable status_table_;
+ // this is the name of the interface we are currently focusing on
+ std::string selected_interface_;
+ // previous IP addresses that we have notified
+ std::string notified_ipv4_addr_;
+ std::string notified_ipv6_addr_;
+
+ int socket_;
+ int pipe_fds_[2];
+ threads::Thread* thread_;
+
+#ifdef BUILD_TESTS
+ bool testing_;
+#endif
+
+ void Loop();
+ bool StopLoop();
+
+ // reset status_table_ by fetching current status of each interface
+ bool InitializeStatus();
+ // update status_table_ by applying the events
+ bool UpdateStatus(uint16_t type, std::vector<EventParam>& params);
+ // update notified_ipv4_addr_ and notified_ipv6_addr_ then notify the parent
+ // class of the change if necessary
+ void NotifyIPAddresses();
+ // Select an appropriate network interface that we will get IP addresses. Also
+ // update selected_interface_.
+ const std::string SelectInterface();
+ // convert ifaddrmsg to a list of EventParam structs
+ std::vector<EventParam> ParseIFAddrMessage(struct ifaddrmsg* message,
+ unsigned int size);
+ // for debugging
+ void DumpTable() const;
+
+ class ListenerThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit ListenerThreadDelegate(
+ PlatformSpecificNetworkInterfaceListener* parent);
+ virtual void threadMain();
+ void exitThreadMain();
+
+ private:
+ PlatformSpecificNetworkInterfaceListener* parent_;
+ };
+
+ DISALLOW_COPY_AND_ASSIGN(PlatformSpecificNetworkInterfaceListener);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_LINUX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h
new file mode 100644
index 0000000000..2cb5eb47a7
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h
@@ -0,0 +1,70 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <netinet/in.h>
+#include "transport_manager/tcp/network_interface_listener.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+class Thread;
+struct ifaddrmsg;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TcpClientListener;
+
+/**
+ * @brief Listener to detect various events on network interfaces
+ */
+class PlatformSpecificNetworkInterfaceListener
+ : public NetworkInterfaceListener {
+ public:
+ /**
+ * @brief Constructor
+ *
+ * @param tcp_client_listener an instance of TcpClientListener which receives
+ * status updates
+ * @param designated_interface if we want to listen only on a specific
+ * network interface, specify its name
+ */
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface = "");
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~PlatformSpecificNetworkInterfaceListener();
+
+ /**
+ * @brief Initialize this listener
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Deinitialize this listener
+ */
+ void Deinit() OVERRIDE;
+
+ /**
+ * @brief Start this listener
+ */
+ bool Start() OVERRIDE;
+
+ /**
+ * @brief Stop this listener
+ */
+ bool Stop() OVERRIDE;
+
+ private:
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_PLATFORM_SPECIFIC_QNX_PLATFORM_SPECIFIC_NETWORK_INTERFACE_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
index 2640049ecc..0f9529d8d8 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
@@ -36,15 +36,18 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
+#include "utils/lock.h"
#include "utils/threads/thread_delegate.h"
#include "transport_manager/transport_adapter/client_connection_listener.h"
class Thread;
+struct in_addr;
namespace transport_manager {
namespace transport_adapter {
class TransportAdapterController;
+class NetworkInterfaceListener;
/**
* @brief Listener of device adapter that use TCP transport.
@@ -57,11 +60,15 @@ class TcpClientListener : public ClientConnectionListener {
* @param controller Pointer to the device adapter controller.
* @param port Port No.
* @param enable_keepalive If true enables TCP keepalive on accepted
+ * @param designated_interface Specify the name of the network interface to
+ *listen on. If empty, then this process will listen on all network
+ *interfaces.
*connections
*/
TcpClientListener(TransportAdapterController* controller,
uint16_t port,
- bool enable_keepalive);
+ bool enable_keepalive,
+ const std::string designated_interface = "");
/**
* @brief Destructor.
@@ -101,7 +108,18 @@ class TcpClientListener : public ClientConnectionListener {
*/
virtual TransportAdapter::Error StopListening();
+ /**
+ * @brief Called from NetworkInterfaceListener when IP address of the network
+ * interface is changed.
+ */
+ virtual void OnIPAddressUpdated(const std::string ipv4_addr,
+ const std::string ipv6_addr);
+
#ifdef BUILD_TESTS
+ void set_network_interface_listener(NetworkInterfaceListener* listener) {
+ interface_listener_ = listener;
+ }
+
uint16_t port() const {
return port_;
}
@@ -113,19 +131,47 @@ class TcpClientListener : public ClientConnectionListener {
threads::Thread* thread() const {
return thread_;
}
+
+ static void set_testing(bool enabled) {
+ testing_ = enabled;
+ }
#endif // BUILD_TESTS
private:
const uint16_t port_;
const bool enable_keepalive_;
TransportAdapterController* controller_;
+ bool initialized_;
+ bool started_;
threads::Thread* thread_;
int socket_;
bool thread_stop_requested_;
+ int pipe_fds_[2];
+ NetworkInterfaceListener* interface_listener_;
+ const std::string designated_interface_;
+ std::string current_ip_address_;
+ sync_primitives::Lock start_stop_lock_;
+
+#ifdef BUILD_TESTS
+ static bool testing_;
+#endif // BUILD_TESTS
void Loop();
void StopLoop();
+ TransportAdapter::Error StartListeningThread();
+ TransportAdapter::Error StopListeningThread();
+
+ bool StartOnNetworkInterface();
+ bool StopOnNetworkInterface();
+ bool IsListeningOnSpecificInterface() const;
+
+ static int CreateIPv4ServerSocket(uint16_t port,
+ const std::string interface_name = "");
+ static void DestroyServerSocket(int sock);
+ static bool GetIPv4Address(const std::string interface_name,
+ struct in_addr* ip_address);
+
class ListeningThreadDelegate : public threads::ThreadDelegate {
public:
explicit ListeningThreadDelegate(TcpClientListener* parent);
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
index 5431b4455d..37f5a7fe49 100644
--- a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
@@ -58,6 +58,18 @@ class TcpTransportAdapter : public TransportAdapterImpl {
*/
virtual ~TcpTransportAdapter();
+ /**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ /**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const OVERRIDE;
+
protected:
/**
* @brief Return type of device.
@@ -77,6 +89,19 @@ class TcpTransportAdapter : public TransportAdapterImpl {
* @return True on success false otherwise
*/
virtual bool Restore();
+
+ private:
+ /**
+ * @brief Keeps transport specific configuration
+ *
+ * TCP transport uses following information:
+ * - "enabled": whether the transport is currently enabled or not. Value can
+ * be "true" or "false".
+ * - "tcp_ip_address": string representation of IP address (either IPv4 or
+ * IPv6)
+ * - "tcp_port": string representation of TCP port number (e.g. "12345")
+ */
+ TransportConfig transport_config_;
};
} // namespace transport_adapter
diff --git a/src/components/transport_manager/include/transport_manager/telemetry_observer.h b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
index 5e42289a03..a38255966b 100644
--- a/src/components/transport_manager/include/transport_manager/telemetry_observer.h
+++ b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
@@ -42,8 +42,8 @@ namespace transport_manager {
class TMTelemetryObserver {
public:
struct MessageMetric {
- TimevalStruct begin;
- TimevalStruct end;
+ date_time::TimeDuration begin;
+ date_time::TimeDuration end;
size_t data_size;
};
virtual void StartRawMsg(const protocol_handler::RawMessage* ptr) = 0;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
index 537e94b055..2374d8a126 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
@@ -35,7 +35,6 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
-#include "utils/shared_ptr.h"
#include "transport_manager/transport_adapter/transport_adapter.h"
namespace transport_manager {
@@ -67,7 +66,7 @@ class Connection {
virtual TransportAdapter::Error Disconnect() = 0;
};
-typedef utils::SharedPtr<Connection> ConnectionSPtr;
+typedef std::shared_ptr<Connection> ConnectionSPtr;
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
index 3792b94d7c..f1c679c123 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
@@ -40,7 +40,7 @@
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/common.h"
-#include "utils/atomic_object.h"
+#include <atomic>
#include "utils/threads/thread_delegate.h"
#include "utils/lock.h"
@@ -201,7 +201,7 @@ class ThreadedSocketConnection : public Connection {
FrameQueue frames_to_send_;
mutable sync_primitives::Lock frames_to_send_mutex_;
- sync_primitives::atomic_int socket_;
+ std::atomic_int socket_;
bool terminate_flag_;
bool unexpected_disconnect_;
const DeviceUID device_uid_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
index 0b38f82637..69d76b4b2b 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
@@ -204,6 +204,13 @@ class TransportAdapterController {
const ApplicationHandle& app_handle,
::protocol_handler::RawMessagePtr message,
const DataSendError&) = 0;
+
+ /**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ virtual void TransportConfigUpdated(const TransportConfig& new_config) = 0;
};
} // namespace transport_adapter
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
index 2b1ada79ad..078f93b32f 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
@@ -400,6 +400,13 @@ class TransportAdapterImpl : public TransportAdapter,
const DataSendError& error) OVERRIDE;
/**
+ * @brief Notification that transport's configuration is updated
+ *
+ * @param new_config The new configuration of the transport
+ */
+ void TransportConfigUpdated(const TransportConfig& new_config) OVERRIDE;
+
+ /**
* @brief DoTransportSwitch notifies listeners of transport adapter events
* that transport switching is requested by system
*/
@@ -420,6 +427,14 @@ class TransportAdapterImpl : public TransportAdapter,
SwitchableDevices GetSwitchableDevices() const OVERRIDE;
/**
+ * @brief Returns the transport's configuration information
+ */
+ virtual TransportConfig GetTransportConfiguration() const OVERRIDE {
+ // default is empty
+ return TransportConfig();
+ }
+
+ /**
* @brief Return name of device.
*
* @param device_id Device unique identifier.
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
index 424fa53dea..4606bac2d4 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
@@ -277,6 +277,15 @@ class TransportAdapterListener {
*/
virtual void OnTransportSwitchRequested(
const TransportAdapter* transport_adapter) = 0;
+
+ /**
+ * @brief Notification that the transport's specific configuration has been
+ * updated.
+ *
+ * @param transport_adapter pointer to the transport adapter
+ */
+ virtual void OnTransportConfigUpdated(
+ const TransportAdapter* transport_adapter) = 0;
};
} // transport_adapter namespace
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
index 8a8031c3cf..a744400279 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
@@ -272,6 +272,15 @@ class TransportAdapterListenerImpl
*/
void OnTransportSwitchRequested(const TransportAdapter* adapter) OVERRIDE;
+ /**
+ * @brief Notification that the transport's specific configuration has been
+ * updated.
+ *
+ * @param transport_adapter pointer to the transport adapter
+ */
+ void OnTransportConfigUpdated(
+ const transport_adapter::TransportAdapter* adapter) OVERRIDE;
+
private:
TransportManager* transport_manager_;
TransportAdapter* transport_adapter_;
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 eaa71ce3bb..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
@@ -64,7 +64,7 @@ typedef threads::MessageLoopThread<std::queue<protocol_handler::RawMessagePtr> >
RawMessageLoopThread;
typedef threads::MessageLoopThread<std::queue<TransportAdapterEvent> >
TransportAdapterEventLoopThread;
-typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::shared_ptr<timer::Timer> TimerSPtr;
typedef std::map<DeviceUID, TransportAdapter*> DeviceToAdapterMap;
/**
@@ -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/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h
index 1c6011dbb2..1db1a83a3a 100644
--- a/src/components/transport_manager/include/transport_manager/usb/common.h
+++ b/src/components/transport_manager/include/transport_manager/usb/common.h
@@ -35,8 +35,6 @@
#include <stdint.h>
-#include "utils/shared_ptr.h"
-
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_handler.h"
#else
@@ -64,7 +62,7 @@ static const uint16_t kApplePid8 = 0x12a8; // iPhone 5
static const int kUsbConfiguration = 1;
-typedef utils::SharedPtr<UsbHandler> UsbHandlerSptr;
+typedef std::shared_ptr<UsbHandler> UsbHandlerSptr;
class UsbDeviceListener {
public:
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
index 8ca1a32a28..ea31bb0376 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
@@ -54,9 +54,9 @@ class UsbDevice : public Device {
return usb_device_;
}
- protected:
virtual ~UsbDevice() {}
+ protected:
virtual bool IsSameAs(const Device* other_device) const {
return unique_device_id() == other_device->unique_device_id();
}
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
index 0d8a77c88f..62615cb30f 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -37,7 +37,6 @@
#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -55,8 +54,8 @@ TransportAdapter::Error BluetoothConnectionFactory::Init() {
TransportAdapter::Error BluetoothConnectionFactory::CreateConnection(
const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
LOG4CXX_AUTO_TRACE(logger_);
- utils::SharedPtr<BluetoothSocketConnection> connection =
- utils::MakeShared<BluetoothSocketConnection>(
+ std::shared_ptr<BluetoothSocketConnection> connection =
+ std::make_shared<BluetoothSocketConnection>(
device_uid, app_handle, controller_);
controller_->ConnectionCreated(connection, device_uid, app_handle);
TransportAdapter::Error error = connection->Start();
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
index 743c95f2e6..75ea799ce8 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -262,8 +262,8 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices(
deviceName[name_len - 1] = '\0';
}
- Device* bluetooth_device =
- new BluetoothDevice(bd_address, deviceName, sdl_rfcomm_channels[i]);
+ auto bluetooth_device = std::make_shared<BluetoothDevice>(
+ bd_address, deviceName, sdl_rfcomm_channels[i]);
if (bluetooth_device) {
LOG4CXX_INFO(logger_, "Bluetooth device created successfully");
discovered_devices->push_back(bluetooth_device);
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
index 0f83f32c60..b373744f79 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -80,8 +80,8 @@ void BluetoothTransportAdapter::Store() const {
if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<BluetoothDevice> bluetooth_device =
- DeviceSptr::static_pointer_cast<BluetoothDevice>(device);
+ std::shared_ptr<BluetoothDevice> bluetooth_device =
+ std::static_pointer_cast<BluetoothDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = bluetooth_device->name();
char address[18];
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/network_interface_listener_impl.cc b/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc
new file mode 100644
index 0000000000..85c479134d
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/network_interface_listener_impl.cc
@@ -0,0 +1,42 @@
+#include "transport_manager/tcp/network_interface_listener_impl.h"
+#include "platform_specific_network_interface_listener_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+NetworkInterfaceListenerImpl::NetworkInterfaceListenerImpl(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface)
+ : platform_specific_impl_(new PlatformSpecificNetworkInterfaceListener(
+ tcp_client_listener, designated_interface)) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+NetworkInterfaceListenerImpl::~NetworkInterfaceListenerImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool NetworkInterfaceListenerImpl::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Init();
+}
+
+void NetworkInterfaceListenerImpl::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ platform_specific_impl_->Deinit();
+}
+
+bool NetworkInterfaceListenerImpl::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Start();
+}
+
+bool NetworkInterfaceListenerImpl::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return platform_specific_impl_->Stop();
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
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
new file mode 100644
index 0000000000..047d43b7bf
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/platform_specific/linux/platform_specific_network_interface_listener.cc
@@ -0,0 +1,673 @@
+#include "transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h"
+
+#include <arpa/inet.h>
+#include <asm/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ifaddrs.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#include "transport_manager/tcp/tcp_client_listener.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+static std::string GetInterfaceName(unsigned int if_index);
+static bool SetNonblocking(int s);
+
+bool InterfaceStatus::IsAvailable() const {
+ // check if the interface is UP and RUNNING
+ return ((flags_ & IFF_UP) > 0) && ((flags_ & IFF_RUNNING) > 0);
+}
+
+bool InterfaceStatus::IsLoopback() const {
+ return flags_ & IFF_LOOPBACK;
+}
+
+bool InterfaceStatus::HasIPAddress() const {
+ return has_ipv4_ || has_ipv6_;
+}
+
+std::string InterfaceStatus::GetIPv4Address() const {
+ char buf[INET_ADDRSTRLEN] = "";
+ if (has_ipv4_ && IsAvailable()) {
+ inet_ntop(AF_INET, &ipv4_address_, buf, sizeof(buf));
+ }
+ return std::string(buf);
+}
+
+std::string InterfaceStatus::GetIPv6Address() const {
+ char buf[INET6_ADDRSTRLEN] = "";
+ if (has_ipv6_ && IsAvailable()) {
+ inet_ntop(AF_INET6, &ipv6_address_, buf, sizeof(buf));
+ }
+ return std::string(buf);
+}
+
+void InterfaceStatus::SetIPv4Address(struct in_addr* addr) {
+ if (addr == NULL) {
+ has_ipv4_ = false;
+ } else {
+ ipv4_address_ = *addr;
+ has_ipv4_ = true;
+ }
+}
+
+void InterfaceStatus::SetIPv6Address(struct in6_addr* addr) {
+ if (addr == NULL) {
+ has_ipv6_ = false;
+ } else {
+ ipv6_address_ = *addr;
+ has_ipv6_ = true;
+ }
+}
+
+PlatformSpecificNetworkInterfaceListener::
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface)
+ : tcp_client_listener_(tcp_client_listener)
+ , designated_interface_(designated_interface)
+ , selected_interface_("")
+ , notified_ipv4_addr_("")
+ , notified_ipv6_addr_("")
+ , socket_(-1)
+#ifdef BUILD_TESTS
+ , testing_(false)
+#endif // BUILD_TESTS
+{
+ pipe_fds_[0] = pipe_fds_[1] = -1;
+ thread_ = threads::CreateThread("PlatformSpecificNetworkInterfaceListener",
+ new ListenerThreadDelegate(this));
+}
+
+PlatformSpecificNetworkInterfaceListener::
+ ~PlatformSpecificNetworkInterfaceListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ Stop();
+ Deinit();
+
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ >= 0) {
+ LOG4CXX_WARN(logger_, "Network interface listener is already initialized");
+ return false;
+ }
+
+ socket_ = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ if (socket_ == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create netlink socket");
+ return false;
+ }
+
+ if (!SetNonblocking(socket_)) {
+ LOG4CXX_WARN(logger_, "Failed to configure netlink socket to non-blocking");
+ }
+
+ struct sockaddr_nl addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.nl_family = AF_NETLINK;
+ addr.nl_pad = 0;
+ addr.nl_pid = 0;
+ addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR;
+
+ if (bind(socket_, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to bind netlink socket");
+ close(socket_);
+ socket_ = -1;
+ return false;
+ }
+
+ if (pipe(pipe_fds_) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create internal pipe");
+ close(socket_);
+ socket_ = -1;
+ return false;
+ }
+
+ if (!SetNonblocking(pipe_fds_[0])) {
+ LOG4CXX_WARN(logger_, "Failed to configure pipe to non-blocking");
+ }
+
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ >= 0) {
+ close(socket_);
+ socket_ = -1;
+ }
+ if (pipe_fds_[1] >= 0) {
+ close(pipe_fds_[1]);
+ pipe_fds_[1] = -1;
+ }
+ if (pipe_fds_[0] >= 0) {
+ close(pipe_fds_[0]);
+ pipe_fds_[0] = -1;
+ }
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (socket_ < 0) {
+ LOG4CXX_WARN(logger_, "Interface listener is not initialized");
+ return false;
+ }
+
+ if (thread_->is_running()) {
+ LOG4CXX_WARN(logger_, "Interface listener is already started");
+ return false;
+ }
+
+ if (!thread_->start()) {
+ LOG4CXX_ERROR(logger_, "Failed to start interface listener");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "Network interface listener started");
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!thread_->is_running()) {
+ LOG4CXX_DEBUG(logger_, "interface listener is not running");
+ return false;
+ }
+
+ thread_->join();
+
+ LOG4CXX_INFO(logger_, "Network interface listener stopped");
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Loop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Initialize status_table_ by acquiring a list of interfaces and their
+ // current statuses. Also we will notify an event to the listener if IP
+ // address is already available.
+ InitializeStatus();
+ NotifyIPAddresses();
+
+ // I am not sure required buffer size for netlink data structures. Most of
+ // implementation I found online uses 4096 so I followed them.
+ char buf[4096];
+ fd_set rfds;
+
+ while (1) {
+ FD_ZERO(&rfds);
+ FD_SET(socket_, &rfds);
+ FD_SET(pipe_fds_[0], &rfds);
+ int nfds = socket_ > pipe_fds_[0] ? socket_ : pipe_fds_[0];
+
+ // wait for some data from netlink socket (socket_) and our internal pipe
+ int ret = select(nfds + 1, &rfds, NULL, NULL, NULL);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else {
+ LOG4CXX_WARN(logger_,
+ "select failed for netlink. Aborting interface listener.");
+ break;
+ }
+ }
+
+ // Received data from internal pipe, indicating StopLoop() is called.
+ // We'll break the while() loop and eventually exit this thread.
+ if (FD_ISSET(pipe_fds_[0], &rfds)) {
+ ret = read(pipe_fds_[0], buf, sizeof(buf));
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to read from pipe. Aborting interface listener.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(logger_,
+ "Pipe disconnected. Aborting interface listener.");
+ break;
+ } else {
+ LOG4CXX_DEBUG(logger_, "received terminating event through pipe");
+ break;
+ }
+ }
+
+#ifdef BUILD_TESTS
+ if (testing_) { // don't enable events from network interface while testing
+ continue;
+ }
+#endif // BUILD_TESTS
+
+ // received data from netlink socket
+ if (FD_ISSET(socket_, &rfds)) {
+ ret = recv(socket_, buf, sizeof(buf), 0);
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(logger_,
+ "Failed to read from netlink socket. Aborting interface "
+ "listener.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(
+ logger_,
+ "Netlink socket disconnected. Aborting interface listener.");
+ break;
+ } else {
+ struct nlmsghdr* header = reinterpret_cast<struct nlmsghdr*>(buf);
+ int len = ret;
+
+ // Parse the stream. We may receive multiple (header + data) pairs at a
+ // time so we use for-loop to go through.
+ for (; NLMSG_OK(header, len); header = NLMSG_NEXT(header, len)) {
+ if (header->nlmsg_type == NLMSG_ERROR) {
+ LOG4CXX_WARN(logger_, "received error event from netlink");
+ break;
+ }
+
+ std::vector<EventParam> params;
+
+ if (header->nlmsg_type == RTM_NEWLINK ||
+ header->nlmsg_type == RTM_DELLINK) {
+ // For these events, data part contains an ifinfomsg struct and a
+ // series of rtattr structures. See rtnetlink(7).
+ // We are only interested in interface index and flags.
+ struct ifinfomsg* ifinfo_msg =
+ reinterpret_cast<struct ifinfomsg*>(NLMSG_DATA(header));
+ EventParam param(ifinfo_msg->ifi_index, ifinfo_msg->ifi_flags);
+ params.push_back(param);
+
+ } else if (header->nlmsg_type == RTM_NEWADDR ||
+ header->nlmsg_type == RTM_DELADDR) {
+ // For these events, data part contains an ifaddrmsg struct and
+ // optionally some rtattr structures. We'll extract IP address(es)
+ // from them.
+ struct ifaddrmsg* ifaddr_msg =
+ reinterpret_cast<struct ifaddrmsg*>(NLMSG_DATA(header));
+ unsigned int size = IFA_PAYLOAD(header);
+ params = ParseIFAddrMessage(ifaddr_msg, size);
+
+ } else {
+ continue;
+ }
+
+ // update status_table_ based on received data
+ UpdateStatus(header->nlmsg_type, params);
+ }
+ }
+
+ // notify the listener if necessary
+ NotifyIPAddresses();
+ }
+ }
+}
+
+bool PlatformSpecificNetworkInterfaceListener::StopLoop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_, "Stopping network interface listener");
+
+ if (pipe_fds_[1] < 0) {
+ LOG4CXX_WARN(logger_, "StopLoop called in invalid state");
+ return false;
+ }
+
+ char dummy[1] = {0};
+ int ret = write(pipe_fds_[1], dummy, sizeof(dummy));
+ if (ret <= 0) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Failed to send stop message to interface listener");
+ return false;
+ }
+
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::InitializeStatus() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef BUILD_TESTS
+ if (testing_) {
+ // don't actually call getifaddrs()
+ return true;
+ }
+#endif // BUILD_TESTS
+
+ struct ifaddrs* if_list, *interface;
+ if (getifaddrs(&if_list) != 0) {
+ LOG4CXX_WARN(logger_,
+ "getifaddr failed, interface status won't be available until "
+ "a change occurs");
+ return false;
+ }
+
+ // clear existing table
+ status_table_.clear();
+
+ for (interface = if_list; interface != NULL;
+ interface = interface->ifa_next) {
+ if (interface->ifa_name == NULL || interface->ifa_name[0] == '\0') {
+ continue;
+ }
+ if (interface->ifa_addr == NULL) {
+ continue;
+ }
+
+ std::string ifname(interface->ifa_name);
+ InterfaceStatus& status = status_table_[ifname];
+
+ switch (interface->ifa_addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in* addr =
+ reinterpret_cast<struct sockaddr_in*>(interface->ifa_addr);
+ status.SetIPv4Address(&addr->sin_addr);
+ break;
+ }
+ case AF_INET6: {
+ struct sockaddr_in6* addr =
+ reinterpret_cast<struct sockaddr_in6*>(interface->ifa_addr);
+ status.SetIPv6Address(&addr->sin6_addr);
+ break;
+ }
+ default:
+ continue;
+ }
+ status.SetFlags(interface->ifa_flags);
+ }
+
+ freeifaddrs(if_list);
+
+ LOG4CXX_DEBUG(logger_, "Successfully acquired network interface status");
+ DumpTable();
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::UpdateStatus(
+ uint16_t type, std::vector<EventParam>& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ for (std::vector<EventParam>::iterator it = params.begin();
+ it != params.end();
+ ++it) {
+ std::string ifname = GetInterfaceName(it->if_index);
+ if (ifname.empty()) {
+ continue;
+ }
+
+ InterfaceStatus& status = status_table_[ifname];
+
+ switch (type) {
+ case RTM_NEWLINK: {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: interface " << ifname
+ << " created or updated");
+ status.SetFlags(it->flags);
+ break;
+ }
+ case RTM_DELLINK:
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: interface " << ifname << " removed");
+ status_table_.erase(ifname);
+ break;
+ case RTM_NEWADDR: {
+ sockaddr* addr = reinterpret_cast<sockaddr*>(&it->address);
+ if (addr->sa_family == AF_INET) {
+ sockaddr_in* addr_in = reinterpret_cast<sockaddr_in*>(addr);
+ status.SetIPv4Address(&addr_in->sin_addr);
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv4 address of interface "
+ << ifname << " updated to "
+ << status.GetIPv4Address());
+ } else if (addr->sa_family == AF_INET6) {
+ sockaddr_in6* addr_in6 = reinterpret_cast<sockaddr_in6*>(addr);
+ status.SetIPv6Address(&addr_in6->sin6_addr);
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv6 address of interface "
+ << ifname << " updated to "
+ << status.GetIPv6Address());
+ }
+ break;
+ }
+ case RTM_DELADDR: {
+ sockaddr* addr = reinterpret_cast<sockaddr*>(&it->address);
+ if (addr->sa_family == AF_INET) {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv4 address of interface "
+ << ifname << " removed");
+ status.SetIPv4Address(NULL);
+ } else if (addr->sa_family == AF_INET6) {
+ LOG4CXX_DEBUG(logger_,
+ "netlink event: IPv6 address of interface "
+ << ifname << " removed");
+ status.SetIPv6Address(NULL);
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_, "Unsupported netlink event (" << type << ")");
+ break;
+ }
+ }
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::NotifyIPAddresses() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string ipv4_addr;
+ std::string ipv6_addr;
+ const std::string interface_name = SelectInterface();
+
+ // note that if interface_name is empty (i.e. no interface is selected),
+ // the IP addresses will be empty
+ if (!interface_name.empty()) {
+ InterfaceStatusTable::iterator it = status_table_.find(interface_name);
+ if (status_table_.end() != it) {
+ InterfaceStatus& status = it->second;
+ ipv4_addr = status.GetIPv4Address();
+ ipv6_addr = status.GetIPv6Address();
+ }
+ }
+
+ if (notified_ipv4_addr_ != ipv4_addr || notified_ipv6_addr_ != ipv6_addr) {
+ LOG4CXX_INFO(logger_,
+ "IP address updated: \"" << notified_ipv4_addr_ << "\" -> \""
+ << ipv4_addr << "\", \""
+ << notified_ipv6_addr_ << "\" -> \""
+ << ipv6_addr << "\"");
+
+ notified_ipv4_addr_ = ipv4_addr;
+ notified_ipv6_addr_ = ipv6_addr;
+
+ tcp_client_listener_->OnIPAddressUpdated(notified_ipv4_addr_,
+ notified_ipv6_addr_);
+ }
+}
+
+const std::string PlatformSpecificNetworkInterfaceListener::SelectInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!designated_interface_.empty()) {
+ return designated_interface_;
+ }
+
+ InterfaceStatusTable::iterator it;
+
+ if (!selected_interface_.empty()) {
+ // if current network interface is still available and has IP address, then
+ // we use it
+ it = status_table_.find(selected_interface_);
+ if (it != status_table_.end()) {
+ InterfaceStatus& status = it->second;
+ if (status.IsAvailable() && status.HasIPAddress()) {
+ return selected_interface_;
+ }
+ }
+ }
+
+ // pick a network interface that has IP address
+ for (it = status_table_.begin(); it != status_table_.end(); ++it) {
+ InterfaceStatus& status = it->second;
+ // ignore loopback interfaces
+ if (status.IsLoopback()) {
+ continue;
+ }
+ // if the interface has to be UP and RUNNING, and must have an IP address
+ if (!(status.IsAvailable() && status.HasIPAddress())) {
+ continue;
+ }
+
+ selected_interface_ = it->first;
+ LOG4CXX_DEBUG(logger_,
+ "selecting network interface: " << selected_interface_);
+ return selected_interface_;
+ }
+
+ selected_interface_ = "";
+ return selected_interface_;
+}
+
+std::vector<PlatformSpecificNetworkInterfaceListener::EventParam>
+PlatformSpecificNetworkInterfaceListener::ParseIFAddrMessage(
+ struct ifaddrmsg* message, unsigned int size) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::vector<EventParam> params;
+
+ // Iterate through rtattr structs. (The first one can be acquired through
+ // IFA_RTA() macro)
+ for (struct rtattr* attr = IFA_RTA(message); RTA_OK(attr, size);
+ attr = RTA_NEXT(attr, size)) {
+ if (!(attr->rta_type == IFA_LOCAL || attr->rta_type == IFA_ADDRESS)) {
+ continue;
+ }
+
+ EventParam param(message->ifa_index);
+
+ if (message->ifa_family == AF_INET) {
+ // make sure the size of data is >= 4 bytes
+ if (RTA_PAYLOAD(attr) < sizeof(struct in_addr)) {
+ LOG4CXX_DEBUG(logger_,
+ "Invalid netlink event: insufficient IPv4 address data");
+ continue;
+ }
+
+ // Data part of rtattr contains IPv4 address. Copy it to param.address
+ struct in_addr* ipv4_addr =
+ reinterpret_cast<struct in_addr*>(RTA_DATA(attr));
+
+ struct sockaddr_in* sockaddr =
+ reinterpret_cast<struct sockaddr_in*>(&param.address);
+ sockaddr->sin_family = AF_INET;
+ sockaddr->sin_addr = *ipv4_addr;
+
+ } else if (message->ifa_family == AF_INET6) {
+ // make sure the size of data is >= 16 bytes
+ if (RTA_PAYLOAD(attr) < sizeof(struct in6_addr)) {
+ LOG4CXX_DEBUG(logger_,
+ "Invalid netlink event: insufficient IPv6 address data");
+ continue;
+ }
+
+ // Data part of rtattr contains IPv6 address. Copy it to param.address
+ struct in6_addr* ipv6_addr =
+ reinterpret_cast<struct in6_addr*>(RTA_DATA(attr));
+
+ struct sockaddr_in6* sockaddr =
+ reinterpret_cast<struct sockaddr_in6*>(&param.address);
+ sockaddr->sin6_family = AF_INET6;
+ sockaddr->sin6_addr = *ipv6_addr;
+
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Unsupported family (" << message->ifa_family << ")");
+ continue;
+ }
+
+ params.push_back(param);
+ }
+
+ return params;
+}
+
+void PlatformSpecificNetworkInterfaceListener::DumpTable() const {
+ LOG4CXX_DEBUG(logger_,
+ "Number of network interfaces: " << status_table_.size());
+
+ 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_,
+ " " << ifname << " : flags=" << status.GetFlags()
+ << " : available: " << (status.IsAvailable() ? "yes" : "no")
+ << " IPv4: " << status.GetIPv4Address()
+ << " IPv6: " << status.GetIPv6Address()
+ << (status.IsLoopback() ? " (loopback)" : ""));
+ }
+}
+
+PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ ListenerThreadDelegate(PlatformSpecificNetworkInterfaceListener* parent)
+ : parent_(parent) {}
+
+void PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ threadMain() {
+ parent_->Loop();
+}
+
+void PlatformSpecificNetworkInterfaceListener::ListenerThreadDelegate::
+ exitThreadMain() {
+ parent_->StopLoop();
+}
+
+static std::string GetInterfaceName(unsigned int if_index) {
+ char buf[IFNAMSIZ + 1] = "";
+ if_indextoname(if_index, buf);
+ return std::string(buf);
+}
+
+static bool SetNonblocking(int s) {
+ int prev_flag = fcntl(s, F_GETFL, 0);
+ if (prev_flag == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to acquire socket flag");
+ return false;
+ }
+
+ int ret = fcntl(s, F_SETFL, prev_flag | O_NONBLOCK);
+ if (ret == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to configure socket to non-blocking");
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc b/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc
new file mode 100644
index 0000000000..15b3814999
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/platform_specific/qnx/platform_specific_network_interface_listener.cc
@@ -0,0 +1,38 @@
+#include "transport_manager/tcp/platform_specific/qnx/platform_specific_network_interface_listener_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+PlatformSpecificNetworkInterfaceListener::
+ PlatformSpecificNetworkInterfaceListener(
+ TcpClientListener* tcp_client_listener,
+ const std::string designated_interface) {}
+
+PlatformSpecificNetworkInterfaceListener::
+ ~PlatformSpecificNetworkInterfaceListener() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+void PlatformSpecificNetworkInterfaceListener::Deinit() {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Start() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+bool PlatformSpecificNetworkInterfaceListener::Stop() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
index 207149eb8c..82c30744e7 100644
--- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -36,11 +36,14 @@
#include <memory.h>
#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
+#include <ifaddrs.h>
#ifdef __linux__
#include <linux/tcp.h>
#else // __linux__
@@ -53,9 +56,10 @@
#include <sstream>
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/threads/thread.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
#include "transport_manager/tcp/tcp_device.h"
#include "transport_manager/tcp/tcp_socket_connection.h"
@@ -64,72 +68,88 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+static bool SetNonblocking(int s);
+
+#ifdef BUILD_TESTS
+bool TcpClientListener::testing_ = false;
+#endif // BUILD_TESTS
+
TcpClientListener::TcpClientListener(TransportAdapterController* controller,
const uint16_t port,
- const bool enable_keepalive)
+ const bool enable_keepalive,
+ const std::string designated_interface)
: port_(port)
, enable_keepalive_(enable_keepalive)
, controller_(controller)
+ , initialized_(false)
+ , started_(false)
, thread_(0)
, socket_(-1)
- , thread_stop_requested_(false) {
+ , thread_stop_requested_(false)
+ , designated_interface_(designated_interface) {
+ pipe_fds_[0] = pipe_fds_[1] = -1;
thread_ = threads::CreateThread("TcpClientListener",
new ListeningThreadDelegate(this));
+ interface_listener_ =
+ new NetworkInterfaceListenerImpl(this, designated_interface);
}
TransportAdapter::Error TcpClientListener::Init() {
LOG4CXX_AUTO_TRACE(logger_);
thread_stop_requested_ = false;
- socket_ = socket(AF_INET, SOCK_STREAM, 0);
- if (-1 == socket_) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
- return TransportAdapter::FAIL;
- }
-
- sockaddr_in server_address = {0};
- server_address.sin_family = AF_INET;
- server_address.sin_port = htons(port_);
- server_address.sin_addr.s_addr = INADDR_ANY;
-
- int optval = 1;
- if (0 !=
- setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed");
+ if (!IsListeningOnSpecificInterface()) {
+ // Network interface is not specified. We will listen on all interfaces
+ // using INADDR_ANY. If socket creation fails, we will treat it an error.
+ socket_ = CreateIPv4ServerSocket(port_);
+ if (-1 == socket_) {
+ LOG4CXX_ERROR(logger_, "Failed to create TCP socket");
+ return TransportAdapter::FAIL;
+ }
+ } else {
+ // Network interface is specified and we wiill listen only on the interface.
+ // In this case, the server socket will be created once
+ // NetworkInterfaceListener notifies the interface's IP address.
+ LOG4CXX_INFO(logger_,
+ "TCP server socket will listen on "
+ << designated_interface_
+ << " once it has an IPv4 address.");
}
- if (bind(socket_,
- reinterpret_cast<sockaddr*>(&server_address),
- sizeof(server_address)) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ if (!interface_listener_->Init()) {
+ if (socket_ >= 0) {
+ close(socket_);
+ socket_ = -1;
+ }
return TransportAdapter::FAIL;
}
- const int kBacklog = 128;
- if (0 != listen(socket_, kBacklog)) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
- return TransportAdapter::FAIL;
- }
+ initialized_ = true;
return TransportAdapter::OK;
}
void TcpClientListener::Terminate() {
LOG4CXX_AUTO_TRACE(logger_);
- if (socket_ == -1) {
- LOG4CXX_WARN(logger_, "Socket has been closed");
+
+ if (!initialized_) {
return;
}
- if (shutdown(socket_, SHUT_RDWR) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to shutdown socket");
- }
- if (close(socket_) != 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+
+ if (!IsListeningOnSpecificInterface()) {
+ DestroyServerSocket(socket_);
+ socket_ = -1;
+ } else {
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ DestroyServerSocket(socket_);
+ socket_ = -1;
}
- socket_ = -1;
+
+ interface_listener_->Deinit();
+ initialized_ = false;
}
bool TcpClientListener::IsInitialised() const {
- return thread_;
+ return initialized_;
}
TcpClientListener::~TcpClientListener() {
@@ -138,6 +158,7 @@ TcpClientListener::~TcpClientListener() {
delete thread_->delegate();
threads::DeleteThread(thread_);
Terminate();
+ delete interface_listener_;
}
void SetKeepaliveOptions(const int fd) {
@@ -203,104 +224,151 @@ void SetKeepaliveOptions(const int fd) {
void TcpClientListener::Loop() {
LOG4CXX_AUTO_TRACE(logger_);
- while (!thread_stop_requested_) {
- sockaddr_in client_address;
- socklen_t client_address_size = sizeof(client_address);
- const int connection_fd = accept(
- socket_, (struct sockaddr*)&client_address, &client_address_size);
- if (thread_stop_requested_) {
- LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
- close(connection_fd);
- break;
- }
+ fd_set rfds;
+ char dummy[16];
- if (connection_fd < 0) {
- LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
- continue;
- }
-
- if (AF_INET != client_address.sin_family) {
- LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
- close(connection_fd);
- continue;
+ while (!thread_stop_requested_) {
+ FD_ZERO(&rfds);
+ FD_SET(socket_, &rfds);
+ FD_SET(pipe_fds_[0], &rfds);
+ int nfds = socket_ > pipe_fds_[0] ? socket_ : pipe_fds_[0];
+
+ int ret = select(nfds + 1, &rfds, NULL, NULL, NULL);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ } else {
+ LOG4CXX_WARN(logger_, "select failed for TCP server socket");
+ break;
+ }
}
- char device_name[32];
- strncpy(device_name,
- inet_ntoa(client_address.sin_addr),
- sizeof(device_name) / sizeof(device_name[0]));
- LOG4CXX_INFO(logger_, "Connected client " << device_name);
- LOG4CXX_INFO(logger_, "Port is: " << port_);
-
- if (enable_keepalive_) {
- SetKeepaliveOptions(connection_fd);
+ if (FD_ISSET(pipe_fds_[0], &rfds)) {
+ ret = read(pipe_fds_[0], dummy, sizeof(dummy));
+ if (ret < 0) {
+ if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) {
+ LOG4CXX_WARN(
+ logger_,
+ "Failed to read from pipe, aborting TCP server socket loop.");
+ break;
+ }
+ } else if (ret == 0) {
+ LOG4CXX_WARN(logger_,
+ "Pipe disconnected, aborting TCP server socket loop.");
+ break;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "received stop command of TCP server socket loop");
+ break;
+ }
}
- const auto device_uid =
- device_name + std::string(":") + std::to_string(port_);
+ if (FD_ISSET(socket_, &rfds)) {
+ sockaddr_in client_address;
+ socklen_t client_address_size = sizeof(client_address);
+ const int connection_fd = accept(
+ socket_, (struct sockaddr*)&client_address, &client_address_size);
+ if (thread_stop_requested_) {
+ LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
+ close(connection_fd);
+ break;
+ }
+
+ if (connection_fd < 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
+ continue;
+ }
+
+ if (AF_INET != client_address.sin_family) {
+ LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
+ close(connection_fd);
+ continue;
+ }
+
+ char device_name[32];
+ strncpy(device_name,
+ inet_ntoa(client_address.sin_addr),
+ sizeof(device_name) / sizeof(device_name[0]));
+ LOG4CXX_INFO(logger_, "Connected client " << device_name);
+ LOG4CXX_INFO(logger_, "Port is: " << port_);
+
+ if (enable_keepalive_) {
+ SetKeepaliveOptions(connection_fd);
+ }
+
+ const auto device_uid =
+ device_name + std::string(":") + std::to_string(port_);
#if defined(BUILD_TESTS)
- TcpDevice* tcp_device =
- new TcpDevice(client_address.sin_addr.s_addr, device_uid, device_name);
+ auto tcp_device = std::make_shared<TcpDevice>(
+ client_address.sin_addr.s_addr, device_uid, device_name);
#else
- TcpDevice* tcp_device =
- new TcpDevice(client_address.sin_addr.s_addr, device_uid);
+ auto tcp_device = std::make_shared<TcpDevice>(
+ client_address.sin_addr.s_addr, device_uid);
#endif // BUILD_TESTS
- DeviceSptr device = controller_->AddDevice(tcp_device);
- tcp_device = static_cast<TcpDevice*>(device.get());
- const ApplicationHandle app_handle =
- tcp_device->AddIncomingApplication(connection_fd);
-
- utils::SharedPtr<TcpSocketConnection> connection =
- utils::MakeShared<TcpSocketConnection>(
- device->unique_device_id(), app_handle, controller_);
- controller_->ConnectionCreated(
- connection, device->unique_device_id(), app_handle);
- connection->set_socket(connection_fd);
- const TransportAdapter::Error error = connection->Start();
- if (TransportAdapter::OK != error) {
- LOG4CXX_ERROR(logger_,
- "TCP connection::Start() failed with error: " << error);
+ DeviceSptr device = controller_->AddDevice(tcp_device);
+ auto tcp_device_raw = static_cast<TcpDevice*>(device.get());
+ const ApplicationHandle app_handle =
+ tcp_device_raw->AddIncomingApplication(connection_fd);
+
+ std::shared_ptr<TcpSocketConnection> connection =
+ std::make_shared<TcpSocketConnection>(
+ device->unique_device_id(), app_handle, controller_);
+ controller_->ConnectionCreated(
+ connection, device->unique_device_id(), app_handle);
+ connection->set_socket(connection_fd);
+ const TransportAdapter::Error error = connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_,
+ "TCP connection::Start() failed with error: " << error);
+ }
}
}
+
+ LOG4CXX_INFO(logger_, "TCP server socket loop is terminated.");
}
void TcpClientListener::StopLoop() {
LOG4CXX_AUTO_TRACE(logger_);
+ if (pipe_fds_[1] < 0) {
+ LOG4CXX_WARN(logger_, "StopLoop called in invalid state");
+ return;
+ }
+
thread_stop_requested_ = true;
- // We need to connect to the listening socket to unblock accept() call
- int byesocket = socket(AF_INET, SOCK_STREAM, 0);
- sockaddr_in server_address = {0};
- server_address.sin_family = AF_INET;
- server_address.sin_port = htons(port_);
- server_address.sin_addr.s_addr = INADDR_ANY;
- if (0 != connect(byesocket,
- reinterpret_cast<sockaddr*>(&server_address),
- sizeof(server_address))) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to connect byesocket");
- } else {
- // Can only shutdown socket if connected
- if (0 != shutdown(byesocket, SHUT_RDWR)) {
- LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to shutdown byesocket");
- }
+
+ char dummy[1] = {0};
+ int ret = write(pipe_fds_[1], dummy, sizeof(dummy));
+ if (ret <= 0) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Failed to send stop message to TCP server socket loop");
}
- close(byesocket);
}
TransportAdapter::Error TcpClientListener::StartListening() {
LOG4CXX_AUTO_TRACE(logger_);
- if (thread_->is_running()) {
+ if (started_) {
LOG4CXX_WARN(
logger_,
"TransportAdapter::BAD_STATE. Listener has already been started");
return TransportAdapter::BAD_STATE;
}
- if (!thread_->start()) {
- LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
+ if (!interface_listener_->Start()) {
return TransportAdapter::FAIL;
}
+
+ if (!IsListeningOnSpecificInterface()) {
+ TransportAdapter::Error ret = StartListeningThread();
+ if (TransportAdapter::OK != ret) {
+ LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed");
+ interface_listener_->Stop();
+ return ret;
+ }
+ }
+
+ started_ = true;
LOG4CXX_INFO(logger_, "Tcp client listener has started successfully");
return TransportAdapter::OK;
}
@@ -319,16 +387,286 @@ TcpClientListener::ListeningThreadDelegate::ListeningThreadDelegate(
TransportAdapter::Error TcpClientListener::StopListening() {
LOG4CXX_AUTO_TRACE(logger_);
- if (!thread_->is_running()) {
+ if (!started_) {
LOG4CXX_DEBUG(logger_, "TcpClientListener is not running now");
return TransportAdapter::BAD_STATE;
}
- thread_->join();
+ interface_listener_->Stop();
+
+ StopListeningThread();
+ started_ = false;
LOG4CXX_INFO(logger_, "Tcp client listener has stopped successfully");
return TransportAdapter::OK;
}
+TransportAdapter::Error TcpClientListener::StartListeningThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // StartListening() can be called from multiple threads
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+
+ if (pipe_fds_[0] < 0 || pipe_fds_[1] < 0) {
+ // recreate the pipe every time, so that the thread loop will not get
+ // leftover
+ // data inside pipe after it is started
+ if (pipe(pipe_fds_) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create internal pipe");
+ return TransportAdapter::FAIL;
+ }
+ if (!SetNonblocking(pipe_fds_[0])) {
+ LOG4CXX_WARN(logger_, "Failed to configure pipe to non-blocking");
+ }
+ }
+
+ thread_stop_requested_ = false;
+
+ if (!thread_->start()) {
+ return TransportAdapter::FAIL;
+ }
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error TcpClientListener::StopListeningThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // StopListening() can be called from multiple threads
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+
+ thread_->join();
+
+ close(pipe_fds_[1]);
+ pipe_fds_[1] = -1;
+ close(pipe_fds_[0]);
+ pipe_fds_[0] = -1;
+
+ return TransportAdapter::OK;
+}
+
+void TcpClientListener::OnIPAddressUpdated(const std::string ipv4_addr,
+ const std::string ipv6_addr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // Since we only create a TCP socket with IPv4 option (AF_INET), currently we
+ // do not use IPv6 address.
+ if (ipv4_addr != current_ip_address_) {
+ if (IsListeningOnSpecificInterface()) {
+ if (!current_ip_address_.empty()) {
+ // the server socket is running, terminate it
+ LOG4CXX_DEBUG(logger_,
+ "Stopping current TCP server socket on "
+ << designated_interface_);
+ StopOnNetworkInterface();
+ }
+ if (!ipv4_addr.empty()) {
+ // start (or restart) server socket with the new IP address
+ LOG4CXX_DEBUG(
+ logger_, "Starting TCP server socket on " << designated_interface_);
+ StartOnNetworkInterface();
+ }
+ }
+
+ current_ip_address_ = ipv4_addr;
+
+ std::string enabled = !current_ip_address_.empty() ? "true" : "false";
+ std::ostringstream oss;
+ oss << port_;
+
+ TransportConfig config;
+ config.insert(std::make_pair(tc_enabled, enabled));
+ config.insert(std::make_pair(tc_tcp_ip_address, current_ip_address_));
+ config.insert(std::make_pair(tc_tcp_port, oss.str()));
+
+ controller_->TransportConfigUpdated(config);
+ }
+}
+
+bool TcpClientListener::StartOnNetworkInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ // this method is only for the case that network interface is specified
+ if (IsListeningOnSpecificInterface()) {
+ {
+ // make sure that two threads will not update socket_ at the same time
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ if (socket_ < 0) {
+ socket_ = CreateIPv4ServerSocket(port_, designated_interface_);
+ if (-1 == socket_) {
+ LOG4CXX_WARN(logger_, "Failed to create TCP socket");
+ return false;
+ }
+ }
+ }
+
+ if (TransportAdapter::OK != StartListeningThread()) {
+ LOG4CXX_WARN(logger_, "Failed to start TCP client listener");
+ return false;
+ }
+ LOG4CXX_INFO(logger_,
+ "TCP server socket started on " << designated_interface_);
+ }
+ return true;
+}
+
+bool TcpClientListener::StopOnNetworkInterface() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (IsListeningOnSpecificInterface()) {
+ if (TransportAdapter::OK != StopListeningThread()) {
+ LOG4CXX_WARN(logger_, "Failed to stop TCP client listener");
+ return false;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(start_stop_lock_);
+ DestroyServerSocket(socket_);
+ socket_ = -1;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "TCP server socket on " << designated_interface_
+ << " stopped");
+ }
+ return true;
+}
+
+bool TcpClientListener::IsListeningOnSpecificInterface() const {
+ return !designated_interface_.empty();
+}
+
+int TcpClientListener::CreateIPv4ServerSocket(
+ uint16_t port, const std::string interface_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ struct in_addr ipv4_address;
+ memset(&ipv4_address, 0, sizeof(ipv4_address));
+ if (interface_name.empty()) {
+ ipv4_address.s_addr = htonl(INADDR_ANY);
+ } else if (!GetIPv4Address(interface_name, &ipv4_address)) {
+ return -1;
+ }
+
+ int sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (-1 == sock) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
+ return -1;
+ }
+
+ sockaddr_in server_address = {0};
+ server_address.sin_family = AF_INET;
+ server_address.sin_port = htons(port);
+ server_address.sin_addr = ipv4_address;
+
+ int optval = 1;
+ if (0 !=
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed");
+ }
+
+ if (bind(sock,
+ reinterpret_cast<sockaddr*>(&server_address),
+ sizeof(server_address)) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ close(sock);
+ return -1;
+ }
+
+ const int kBacklog = 128;
+ if (0 != listen(sock, kBacklog)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
+ close(sock);
+ return -1;
+ }
+
+ return sock;
+}
+
+void TcpClientListener::DestroyServerSocket(int sock) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (sock >= 0) {
+ if (shutdown(sock, SHUT_RDWR) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to shutdown socket");
+ }
+ if (close(sock) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+ }
+ }
+}
+
+bool TcpClientListener::GetIPv4Address(const std::string interface_name,
+ struct in_addr* ip_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef BUILD_TESTS
+ if (testing_) {
+ // don't actually call getifaddrs(), instead return a dummy address of
+ // INADDR_LOOPBACK
+ struct in_addr dummy_addr;
+ dummy_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (ip_address != NULL) {
+ *ip_address = dummy_addr;
+ }
+ return true;
+ }
+#endif // BUILD_TESTS
+
+ struct ifaddrs* if_list;
+ if (getifaddrs(&if_list) != 0) {
+ LOG4CXX_WARN(logger_, "getifaddrs failed");
+ return false;
+ }
+
+ struct ifaddrs* interface;
+ bool found = false;
+
+ for (interface = if_list; interface != NULL;
+ interface = interface->ifa_next) {
+ if (interface->ifa_name == NULL) {
+ continue;
+ }
+ if (interface_name == interface->ifa_name) {
+ if (interface->ifa_addr == NULL) {
+ continue;
+ }
+ switch (interface->ifa_addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in* addr =
+ reinterpret_cast<struct sockaddr_in*>(interface->ifa_addr);
+ if (ip_address != NULL) {
+ *ip_address = addr->sin_addr;
+ }
+ found = true;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+
+ freeifaddrs(if_list);
+
+ return found;
+}
+
+static bool SetNonblocking(int s) {
+ int prev_flag = fcntl(s, F_GETFL, 0);
+ if (prev_flag == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to acquire socket flag");
+ return false;
+ }
+
+ int ret = fcntl(s, F_SETFL, prev_flag | O_NONBLOCK);
+ if (ret == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to configure socket to non-blocking");
+ return false;
+ }
+
+ return true;
+}
+
} // namespace transport_adapter
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
index 114425076a..e202554f8f 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -35,7 +35,6 @@
#include "transport_manager/tcp/tcp_server_originated_socket_connection.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -56,8 +55,8 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection(
LOG4CXX_DEBUG(logger_,
"DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
- utils::SharedPtr<TcpServerOriginatedSocketConnection> connection =
- utils::MakeShared<TcpServerOriginatedSocketConnection>(
+ std::shared_ptr<TcpServerOriginatedSocketConnection> connection =
+ std::make_shared<TcpServerOriginatedSocketConnection>(
device_uid, app_handle, controller_);
controller_->ConnectionCreated(connection, device_uid, app_handle);
const TransportAdapter::Error error = connection->Start();
diff --git a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
index 516f2d3ec4..2f10bd9454 100644
--- a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
+++ b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
@@ -56,7 +56,7 @@ bool TcpServerOriginatedSocketConnection::Establish(ConnectError** error) {
DCHECK(error);
LOG4CXX_DEBUG(logger_, "error " << error);
DeviceSptr device = controller()->FindDevice(device_handle());
- if (!device.valid()) {
+ if (device.use_count() == 0) {
LOG4CXX_ERROR(logger_, "Device " << device_handle() << " not found");
*error = new ConnectError();
return false;
diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
index 0e9e63263b..b3dbf49628 100644
--- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
+++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
@@ -55,14 +55,35 @@ TcpTransportAdapter::TcpTransportAdapter(
const uint16_t port,
resumption::LastState& last_state,
const TransportManagerSettings& settings)
- : TransportAdapterImpl(NULL,
- new TcpConnectionFactory(this),
- new TcpClientListener(this, port, true),
- last_state,
- settings) {}
+ : TransportAdapterImpl(
+ NULL,
+ new TcpConnectionFactory(this),
+ new TcpClientListener(
+ this,
+ port,
+ true,
+ settings.transport_manager_tcp_adapter_network_interface()),
+ last_state,
+ settings) {}
TcpTransportAdapter::~TcpTransportAdapter() {}
+void TcpTransportAdapter::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ transport_config_ = new_config;
+
+ // call the method of parent class to trigger OnTransportConfigUpdated() for
+ // the listeners
+ TransportAdapterImpl::TransportConfigUpdated(new_config);
+}
+
+TransportConfig TcpTransportAdapter::GetTransportConfiguration() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return transport_config_;
+}
+
DeviceType TcpTransportAdapter::GetDeviceType() const {
return TCP;
}
@@ -79,8 +100,8 @@ void TcpTransportAdapter::Store() const {
if (!device) { // device could have been disconnected
continue;
}
- utils::SharedPtr<TcpDevice> tcp_device =
- DeviceSptr::static_pointer_cast<TcpDevice>(device);
+ std::shared_ptr<TcpDevice> tcp_device =
+ std::static_pointer_cast<TcpDevice>(device);
Json::Value device_dictionary;
device_dictionary["name"] = tcp_device->name();
struct in_addr address;
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 bdacd68006..346139cbd2 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
@@ -43,18 +43,24 @@
namespace transport_manager {
namespace transport_adapter {
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+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"))};
+ std::make_pair(DeviceType::TCP, std::string("WIFI")),
+ std::make_pair(DeviceType::IOS_USB_HOST_MODE,
+ std::string("USB_IOS_HOST_MODE")),
+ std::make_pair(DeviceType::IOS_USB_DEVICE_MODE,
+ std::string("USB_IOS_DEVICE_MODE")),
+ std::make_pair(DeviceType::IOS_CARPLAY_WIRELESS,
+ std::string("CARPLAY_WIRELESS_IOS"))};
}
TransportAdapterImpl::TransportAdapterImpl(
@@ -695,6 +701,16 @@ void TransportAdapterImpl::DataSendFailed(
LOG4CXX_TRACE(logger_, "exit");
}
+void TransportAdapterImpl::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end();
+ ++it) {
+ (*it)->OnTransportConfigUpdated(this);
+ }
+}
+
void TransportAdapterImpl::DoTransportSwitch() const {
LOG4CXX_AUTO_TRACE(logger_);
std::for_each(
@@ -803,16 +819,16 @@ ApplicationList TransportAdapterImpl::GetApplicationList(
const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
ApplicationList lst = device->GetApplicationList();
LOG4CXX_TRACE(logger_,
"exit with ApplicationList. It's size = "
- << lst.size() << " Condition: device.valid()");
+ << lst.size() << " Condition: device.use_count() != 0");
return lst;
}
- LOG4CXX_TRACE(
- logger_,
- "exit with empty ApplicationList. Condition: NOT device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with empty ApplicationList. Condition: NOT "
+ "device.use_count() != 0");
return ApplicationList();
}
@@ -875,7 +891,7 @@ bool TransportAdapterImpl::IsInitialised() const {
std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
return device->name();
} else {
return "";
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
index f1181ce921..544cdde999 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
@@ -275,7 +275,7 @@ void TransportAdapterListenerImpl::OnDataSendDone(
device,
app_id,
data_container,
- new BaseError());
+ std::make_shared<BaseError>());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -376,4 +376,23 @@ void TransportAdapterListenerImpl::OnTransportSwitchRequested(
LOG4CXX_WARN(logger_, "Failed to receive event from device");
}
}
+
+void TransportAdapterListenerImpl::OnTransportConfigUpdated(
+ const transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const TransportAdapterEvent event(EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
+
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+}
+
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index a364220a64..2b0296debb 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -44,7 +44,7 @@
#include "utils/macro.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
+
#include "utils/timer_task_impl.h"
#include "transport_manager/common.h"
#include "transport_manager/transport_manager_listener.h"
@@ -529,6 +529,8 @@ int TransportManagerImpl::Reinit() {
LOG4CXX_AUTO_TRACE(logger_);
DisconnectAllDevices();
TerminateAllAdapters();
+ device_to_adapter_map_.clear();
+ connection_id_counter_ = 0;
int ret = InitAllAdapters();
return ret;
}
@@ -1066,7 +1068,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_ERROR(logger_, "Transport adapter failed to send data");
// TODO(YK): potential error case -> thread unsafe
// update of message content
- if (event.event_data.valid()) {
+ if (event.event_data.use_count() != 0) {
event.event_data->set_waiting(true);
} else {
LOG4CXX_DEBUG(logger_, "Data is invalid");
@@ -1144,6 +1146,13 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "eevent_type = ON_UNEXPECTED_DISCONNECT");
break;
}
+ case EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED: {
+ LOG4CXX_DEBUG(logger_, "event_type = ON_TRANSPORT_CONFIG_UPDATED");
+ transport_adapter::TransportConfig config =
+ event.transport_adapter->GetTransportConfiguration();
+ RaiseEvent(&TransportManagerListener::OnTransportConfigUpdated, config);
+ break;
+ }
} // switch
LOG4CXX_TRACE(logger_, "exit");
}
@@ -1203,9 +1212,9 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal(
const DeviceHandle device_handle)
: transport_manager(transport_manager)
, transport_adapter(transport_adapter)
- , timer(utils::MakeShared<timer::Timer,
- const char*,
- ::timer::TimerTaskImpl<ConnectionInternal>*>(
+ , timer(std::make_shared<timer::Timer,
+ const char*,
+ ::timer::TimerTaskImpl<ConnectionInternal>*>(
"TM DiscRoutine",
new ::timer::TimerTaskImpl<ConnectionInternal>(
this, &ConnectionInternal::DisconnectFailedRoutine)))
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
index e9ab2bae8e..212e6e0ec3 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -224,7 +224,7 @@ void UsbConnection::OnOutTransfer(libusb_transfer* transfer) {
device_uid_, app_handle_, current_out_message_, DataSendError());
PopOutMessage();
}
- if (!current_out_message_.valid()) {
+ if (current_out_message_.use_count() == 0) {
libusb_free_transfer(transfer);
out_transfer_ = NULL;
waiting_out_transfer_cancel_ = false;
@@ -242,7 +242,7 @@ TransportAdapter::Error UsbConnection::SendData(
return TransportAdapter::BAD_STATE;
}
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (current_out_message_.valid()) {
+ if (current_out_message_.use_count() != 0) {
out_messages_.push_back(message);
} else {
current_out_message_ = message;
diff --git a/src/components/transport_manager/src/usb/qnx/usb_connection.cc b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
index 516a367ebc..b9386c5d9f 100644
--- a/src/components/transport_manager/src/usb/qnx/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
@@ -230,7 +230,7 @@ void UsbConnection::OnOutTransfer(usbd_urb* urb) {
}
}
- if ((!disconnecting_) && current_out_message_.valid()) {
+ if ((!disconnecting_) && (current_out_message_.use_count() != 0)) {
PostOutTransfer();
} else {
pending_out_transfer_ = false;
@@ -243,7 +243,7 @@ TransportAdapter::Error UsbConnection::SendData(
return TransportAdapter::BAD_STATE;
}
sync_primitives::AutoLock locker(out_messages_mutex_);
- if (current_out_message_.valid()) {
+ if (current_out_message_.use_count() != 0) {
out_messages_.push_back(message);
} else {
current_out_message_ = message;
diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc
index 1136dfad21..528855cd50 100644
--- a/src/components/transport_manager/src/usb/usb_connection_factory.cc
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -34,7 +34,6 @@
#include "transport_manager/usb/usb_device.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "utils/logger.h"
-#include "utils/make_shared.h"
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_connection.h"
@@ -65,21 +64,21 @@ TransportAdapter::Error UsbConnectionFactory::CreateConnection(
"enter DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
DeviceSptr device = controller_->FindDevice(device_uid);
- if (!device.valid()) {
+ if (device.use_count() == 0) {
LOG4CXX_ERROR(logger_, "device " << device_uid << " not found");
- LOG4CXX_TRACE(
- logger_,
- "exit with TransportAdapter::BAD_PARAM. Condition: !device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::BAD_PARAM. Condition: "
+ "device.use_count() == 0");
return TransportAdapter::BAD_PARAM;
}
UsbDevice* usb_device = static_cast<UsbDevice*>(device.get());
- utils::SharedPtr<UsbConnection> connection =
- utils::MakeShared<UsbConnection>(device_uid,
- app_handle,
- controller_,
- usb_handler_,
- usb_device->usb_device());
+ std::shared_ptr<UsbConnection> connection =
+ std::make_shared<UsbConnection>(device_uid,
+ app_handle,
+ controller_,
+ usb_handler_,
+ usb_device->usb_device());
controller_->ConnectionCreated(connection, device_uid, app_handle);
if (connection->Init()) {
LOG4CXX_INFO(logger_, "USB connection initialised");
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt
index 41aae296ac..240784436b 100644
--- a/src/components/transport_manager/test/CMakeLists.txt
+++ b/src/components/transport_manager/test/CMakeLists.txt
@@ -42,11 +42,18 @@ include_directories(
)
set(EXCLUDE_PATHS
+ platform_specific
raw_message_matcher.cc
)
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+set(PLATFORM_DEPENDENT_SOURCES)
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ collect_sources(PLATFORM_DEPENDENT_SOURCES platform_specific/linux)
+endif()
+list(APPEND SOURCES ${PLATFORM_DEPENDENT_SOURCES})
+
set(LIBRARIES
gmock
ConfigProfile
diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
index bb15c19d3b..9c7327e6fb 100644
--- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
+++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
@@ -57,8 +57,8 @@ class RawMessageMatcher : public MatcherInterface<RawMessagePtr> {
virtual bool MatchAndExplain(const RawMessagePtr ptr,
MatchResultListener* listener) const;
- virtual void DescribeTo(::std::ostream* os) const;
- virtual void DescribeNegationTo(::std::ostream* os) const;
+ virtual void DescribeTo(std::ostream* os) const;
+ virtual void DescribeNegationTo(std::ostream* os) const;
private:
const RawMessagePtr ptr_;
diff --git a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h
new file mode 100644
index 0000000000..d18500b02d
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_client_listener.h
@@ -0,0 +1,34 @@
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/tcp/tcp_client_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager::transport_adapter;
+
+class MockTcpClientListener : public TcpClientListener {
+ public:
+ MockTcpClientListener(TransportAdapterController* controller,
+ uint16_t port,
+ bool enable_keepalive,
+ const std::string designated_interface = "")
+ : TcpClientListener(
+ controller, port, enable_keepalive, designated_interface) {}
+ MOCK_METHOD0(Init, TransportAdapter::Error());
+ MOCK_METHOD0(Terminate, void());
+ MOCK_CONST_METHOD0(IsInitialised, bool());
+ MOCK_METHOD0(StartListening, TransportAdapter::Error());
+ MOCK_METHOD0(StopListening, TransportAdapter::Error());
+ MOCK_METHOD2(OnIPAddressUpdated,
+ void(const std::string ipv4_addr, const std::string ipv6_addr));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TCP_MOCK_TCP_CLIENT_LISTENER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
index 03e7630e8b..dce23189c8 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
@@ -122,6 +122,8 @@ class MockTransportAdapterListener : public TransportAdapterListener {
const ApplicationHandle&));
MOCK_METHOD1(OnTransportSwitchRequested,
void(const TransportAdapter* transport_adapter));
+ MOCK_METHOD1(OnTransportConfigUpdated,
+ void(const TransportAdapter* transport_adapter));
};
} // namespace transport_manager_test
diff --git a/src/components/transport_manager/test/network_interface_listener_test.cc b/src/components/transport_manager/test/network_interface_listener_test.cc
new file mode 100644
index 0000000000..55a35fb4ea
--- /dev/null
+++ b/src/components/transport_manager/test/network_interface_listener_test.cc
@@ -0,0 +1,57 @@
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <time.h>
+
+#include "gtest/gtest.h"
+#include "transport_manager/tcp/network_interface_listener_impl.h"
+#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kStartNotificationTimeoutMsec = 500;
+}
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::SaveArg;
+
+class NetworkInterfaceListenerTest : public ::testing::Test {
+ public:
+ NetworkInterfaceListenerTest()
+ : interface_listener_impl_(NULL)
+ , mock_tcp_client_listener_(NULL, 0, false, "") {}
+
+ virtual ~NetworkInterfaceListenerTest() {}
+
+ protected:
+ struct InterfaceEntry {
+ const char* name;
+ const char* ipv4_address;
+ const char* ipv6_address;
+ unsigned int flags;
+ };
+
+ void Deinit() {
+ delete interface_listener_impl_;
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
+ NetworkInterfaceListenerImpl* interface_listener_impl_;
+ MockTcpClientListener mock_tcp_client_listener_;
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
new file mode 100644
index 0000000000..da58466c29
--- /dev/null
+++ b/src/components/transport_manager/test/platform_specific/linux/linux_network_interface_listener_test.cc
@@ -0,0 +1,567 @@
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <time.h>
+
+#include "gtest/gtest.h"
+#include "platform_specific_network_interface_listener_impl.h"
+#include "transport_manager/tcp/mock_tcp_client_listener.h"
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kStartNotificationTimeoutMsec = 500;
+}
+
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::SaveArg;
+
+class NetworkInterfaceListenerTest : public ::testing::Test {
+ public:
+ NetworkInterfaceListenerTest()
+ : interface_listener_impl_(NULL)
+ , mock_tcp_client_listener_(NULL, 0, false, "") {}
+
+ virtual ~NetworkInterfaceListenerTest() {}
+
+ protected:
+ struct InterfaceEntry {
+ const char* name;
+ const char* ipv4_address;
+ const char* ipv6_address;
+ unsigned int flags;
+ };
+
+ void Init(const std::string interface_name) {
+ interface_listener_impl_ = new PlatformSpecificNetworkInterfaceListener(
+ &mock_tcp_client_listener_, interface_name);
+ // disable events from actual network interfaces
+ interface_listener_impl_->SetTesting(true);
+ }
+
+ void Deinit() {
+ delete interface_listener_impl_;
+ }
+
+ void SetDummyInterfaceTable(struct InterfaceEntry* entries) {
+ InterfaceStatusTable dummy_table;
+
+ while (entries->name != NULL) {
+ InterfaceStatus status;
+ if (entries->ipv4_address != NULL) {
+ struct in_addr addr;
+ ASSERT_EQ(1, inet_pton(AF_INET, entries->ipv4_address, &addr));
+ status.SetIPv4Address(&addr);
+ }
+ if (entries->ipv6_address != NULL) {
+ struct in6_addr addr6;
+ ASSERT_EQ(1, inet_pton(AF_INET6, entries->ipv6_address, &addr6));
+ status.SetIPv6Address(&addr6);
+ }
+ status.SetFlags(entries->flags);
+
+ dummy_table.insert(std::make_pair(entries->name, status));
+ entries++;
+ }
+
+ interface_listener_impl_->OverwriteStatusTable(dummy_table);
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
+ PlatformSpecificNetworkInterfaceListener* interface_listener_impl_;
+ MockTcpClientListener mock_tcp_client_listener_;
+};
+
+TEST_F(NetworkInterfaceListenerTest, Init) {
+ Init("");
+
+ EXPECT_TRUE(interface_listener_impl_->Init());
+ EXPECT_TRUE(0 <= interface_listener_impl_->GetSocket());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Deinit) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ interface_listener_impl_->Deinit();
+
+ EXPECT_EQ(-1, interface_listener_impl_->GetSocket());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Start_success) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ SetDummyInterfaceTable(entries);
+
+ // after stated, it is expected that the listener notifies current IP address
+ // (if it's available)
+ TestAsyncWaiter waiter;
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address, ""))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+
+ // the "isThreadRunning_" flag of the thread will be update slightly later
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->GetThread()->is_running());
+
+ EXPECT_TRUE(waiter.WaitFor(1, kStartNotificationTimeoutMsec));
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Start_twice) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(interface_listener_impl_->Start());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_success) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->Stop());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(interface_listener_impl_->GetThread()->is_running());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_twice) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ // ignore OnIPAddressUpdated call
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_TRUE(interface_listener_impl_->Start());
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(interface_listener_impl_->Stop());
+
+ EXPECT_FALSE(interface_listener_impl_->Stop());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, Stop_without_Start) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ EXPECT_FALSE(interface_listener_impl_->Stop());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressChanged) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "5.6.7.8", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+
+ // this test case doesn't call Start() - we only check the behavior of
+ // NotifyIPAddresses()
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries2[0].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_IPAddressNotChanged) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "172.16.23.30", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ // OnIPAddressUpdated() shouldn't be notified
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(0);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_GoesUnavailable) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address,
+ entries1[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Removed) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int0", "1.2.3.4", "fdc2:12af:327a::1", IFF_UP | IFF_RUNNING},
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries1[0].ipv4_address,
+ entries1[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, DesignatedInterface_Added) {
+ Init("dummy_int0");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries1[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+ struct InterfaceEntry entries2[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"dummy_int0", "1.2.3.4", NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ SetDummyInterfaceTable(entries2);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries2[1].ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SelectInterface) {
+ // automatically select network interface
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ std::string output_ipv4_address;
+ std::string output_ipv6_address;
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&output_ipv4_address),
+ SaveArg<1>(&output_ipv6_address)));
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ std::string selected_interface =
+ interface_listener_impl_->GetSelectedInterfaceName();
+
+ // the interface listener should pick one of the interfaces
+ EXPECT_TRUE((selected_interface == entries[0].name &&
+ output_ipv4_address == entries[0].ipv4_address &&
+ output_ipv6_address == "") ||
+ (selected_interface == entries[1].name &&
+ output_ipv4_address == entries[1].ipv4_address &&
+ output_ipv6_address == entries[1].ipv6_address));
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest,
+ AutoSelectInterface_SkipUnavailableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ // dummy_int1 should not be selected
+ struct InterfaceEntry* expected = &entries[1];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address,
+ expected->ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SkipEmptyInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING},
+ {"net_dummy2", NULL, NULL, IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ SetDummyInterfaceTable(entries);
+
+ // net_dummy2 should not be selected
+ struct InterfaceEntry* expected = &entries[0];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address, "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest,
+ AutoSelectInterface_SkipLoopbackInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1", "10.10.10.12", NULL, IFF_UP | IFF_RUNNING | IFF_LOOPBACK},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ // dummy_int1 should not be selected
+ struct InterfaceEntry* expected = &entries[1];
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(expected->ipv4_address,
+ expected->ipv6_address)).Times(1);
+
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(expected->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_DisableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"net_dummy0", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make the interface "not running"
+ entries[0].flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated("", "")).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ("", interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_EnableInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"net_dummy0", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make the interface "not running"
+ entries[0].flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ // make it running again
+ entries[0].flags |= IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(entries[0].ipv4_address,
+ entries[0].ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(entries[0].name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+TEST_F(NetworkInterfaceListenerTest, AutoSelectInterface_SwitchInterface) {
+ Init("");
+ EXPECT_TRUE(interface_listener_impl_->Init());
+
+ struct InterfaceEntry entries[] = {
+ {"dummy_int1",
+ "10.10.10.12",
+ "fd53:ba79:241d:30c1::78",
+ IFF_UP | IFF_RUNNING},
+ {"net_dummy2", "192.168.2.3", "fdc2:12af:327a::22", IFF_UP | IFF_RUNNING},
+ {NULL, NULL, NULL, 0}};
+
+ EXPECT_CALL(mock_tcp_client_listener_, OnIPAddressUpdated(_, _)).Times(1);
+ SetDummyInterfaceTable(entries);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ const std::string selected_interface =
+ interface_listener_impl_->GetSelectedInterfaceName();
+ struct InterfaceEntry* selected = &entries[0];
+ while (selected->name != NULL) {
+ if (selected->name == selected_interface) {
+ break;
+ }
+ selected++;
+ }
+ ASSERT_TRUE(selected->name != NULL);
+
+ // make the interface "not running"
+ selected->flags &= ~IFF_RUNNING;
+ SetDummyInterfaceTable(entries);
+
+ struct InterfaceEntry* switched;
+ if (selected == &entries[0]) {
+ switched = &entries[1];
+ } else {
+ switched = &entries[0];
+ }
+
+ EXPECT_CALL(mock_tcp_client_listener_,
+ OnIPAddressUpdated(switched->ipv4_address,
+ switched->ipv6_address)).Times(1);
+
+ interface_listener_impl_->testCallNotifyIPAddresses();
+
+ EXPECT_EQ(switched->name,
+ interface_listener_impl_->GetSelectedInterfaceName());
+
+ Deinit();
+}
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc
index b179f63ece..5205d6ae3c 100644
--- a/src/components/transport_manager/test/tcp_client_listener_test.cc
+++ b/src/components/transport_manager/test/tcp_client_listener_test.cc
@@ -30,21 +30,38 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+
#include "gtest/gtest.h"
#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "transport_manager/tcp/tcp_client_listener.h"
+#include "transport_manager/tcp/network_interface_listener.h"
#include "transport_manager/mock_transport_manager.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
-#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+
+#include "utils/test_async_waiter.h"
+#include "utils/threads/thread.h"
namespace test {
namespace components {
namespace transport_manager_test {
+using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Return;
using namespace ::transport_manager;
using namespace ::transport_manager::transport_adapter;
+namespace {
+const long kThreadStartWaitMsec = 10;
+const uint32_t kConnectionCreatedTimeoutMsec = 200;
+}
+
class MockTransportAdapterController : public TransportAdapterController {
public:
MOCK_METHOD1(AddDevice, DeviceSptr(DeviceSptr device));
@@ -95,37 +112,491 @@ class MockTransportAdapterController : public TransportAdapterController {
MOCK_METHOD2(DeviceDisconnected,
void(const DeviceUID& device_handle,
const DisconnectDeviceError& error));
+ MOCK_METHOD1(TransportConfigUpdated,
+ void(const transport_manager::transport_adapter::TransportConfig&
+ new_config));
};
-class TcpClientListenerTest : public ::testing::Test {
+class MockNetworkInterfaceListener : public NetworkInterfaceListener {
+ public:
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD0(Deinit, void());
+ MOCK_METHOD0(Start, bool());
+ MOCK_METHOD0(Stop, bool());
+};
+
+class TcpClientListenerTest : public ::testing::TestWithParam<std::string> {
public:
TcpClientListenerTest()
- : port_(0)
+ : port_(0) /* On Linux, binding to port 0 lets the system choose an
+ available port */
, enable_keep_alive_(false)
- , tcp_client_listener_(
- &adapter_controller_mock_, port_, enable_keep_alive_) {}
+ , interface_listener_mock_(NULL)
+ , tcp_client_listener_(NULL) {}
+ virtual ~TcpClientListenerTest() {
+ delete tcp_client_listener_;
+ }
protected:
+ void SetUp() OVERRIDE {
+ tcp_client_listener_ = new TcpClientListener(
+ &adapter_controller_mock_, port_, enable_keep_alive_, GetParam());
+ interface_listener_mock_ = new MockNetworkInterfaceListener();
+ tcp_client_listener_->set_testing(true);
+ tcp_client_listener_->set_network_interface_listener(
+ interface_listener_mock_);
+ }
+
+ bool InterfaceNameSpecified() const {
+ return "" != GetParam();
+ }
+
+ void SleepFor(long msec) const {
+ if (msec > 0) {
+ struct timespec ts = {0, msec * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+ }
+
uint16_t port_;
bool enable_keep_alive_;
MockTransportAdapterController adapter_controller_mock_;
- TcpClientListener tcp_client_listener_;
+ MockNetworkInterfaceListener* interface_listener_mock_;
+ TcpClientListener* tcp_client_listener_;
};
-TEST_F(TcpClientListenerTest, Ctor_test) {
- EXPECT_EQ(0, tcp_client_listener_.port());
- EXPECT_TRUE(NULL != tcp_client_listener_.thread());
- EXPECT_EQ(-1, tcp_client_listener_.get_socket());
+TEST_P(TcpClientListenerTest, Ctor_test) {
+ EXPECT_EQ(0, tcp_client_listener_->port());
+ EXPECT_TRUE(NULL != tcp_client_listener_->thread());
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+}
+
+TEST_P(TcpClientListenerTest, IsInitialised) {
+ // should return false until Init() is called
+ EXPECT_FALSE(tcp_client_listener_->IsInitialised());
+}
+
+TEST_P(TcpClientListenerTest, Init) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ if (InterfaceNameSpecified()) {
+ // TcpClientListener will create socket once IP address of the network is
+ // notified.
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+ } else {
+ // Interface name is not designated. In this case, TcpClientListener will
+ // create socket with Init().
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+ }
+
+ EXPECT_TRUE(tcp_client_listener_->IsInitialised());
+
+ // Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, Terminate) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+
+ tcp_client_listener_->Terminate();
+
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+}
+
+TEST_P(TcpClientListenerTest, StartListening) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ // the "isThreadRunning_" flag of the thread will be update slightly later
+ SleepFor(kThreadStartWaitMsec);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ } else {
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ // Stop() and Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StartListening_twice) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ // call again
+ EXPECT_EQ(TransportAdapter::BAD_STATE,
+ tcp_client_listener_->StartListening());
+
+ // Stop() and Deinit() will be called during destructor
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StopListening) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StopListening());
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, StopListening_twice) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StopListening());
+
+ // call again
+ EXPECT_EQ(TransportAdapter::BAD_STATE, tcp_client_listener_->StopListening());
+
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
-TEST_F(TcpClientListenerTest, IsInitialised) {
- EXPECT_TRUE(tcp_client_listener_.IsInitialised());
+TEST_P(TcpClientListenerTest, ClientConnection) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ if (InterfaceNameSpecified()) {
+ // set up a server socket by notifying a dummy IP address
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(1);
+ tcp_client_listener_->OnIPAddressUpdated(std::string("192.168.1.1"),
+ std::string(""));
+ }
+
+ // get the port number (assigned by system) that the socket is listening on
+ struct sockaddr_in server_addr;
+ socklen_t server_addr_len = sizeof(server_addr);
+ EXPECT_EQ(0,
+ getsockname(tcp_client_listener_->get_socket(),
+ reinterpret_cast<struct sockaddr*>(&server_addr),
+ &server_addr_len));
+
+ // try connecting to the socket
+ struct sockaddr_in client_addr;
+ client_addr.sin_family = AF_INET;
+ client_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ client_addr.sin_port = server_addr.sin_port;
+ socklen_t client_addr_len = sizeof(client_addr);
+
+ int s = socket(AF_INET, SOCK_STREAM, 0);
+ EXPECT_TRUE(0 <= s);
+
+ TestAsyncWaiter waiter;
+
+ // controller should be notified of AddDevice event
+ DeviceSptr mock_device = std::make_shared<MockTCPDevice>(
+ htonl(INADDR_LOOPBACK), "dummy_tcp_device");
+ EXPECT_CALL(adapter_controller_mock_, AddDevice(_))
+ .WillOnce(Return(mock_device));
+ EXPECT_CALL(adapter_controller_mock_, ConnectionCreated(_, _, _))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ // adapter_controller_mock_ may also receive ConnectDone() and
+ // ConnectionFinished() from ThreadedSocketConnection. Ignore them as hey are
+ // not part ly client listener's tests.
+ EXPECT_CALL(adapter_controller_mock_, ConnectDone(_, _)).Times(AtLeast(0));
+ EXPECT_CALL(adapter_controller_mock_, ConnectionFinished(_, _))
+ .Times(AtLeast(0));
+
+ EXPECT_EQ(0,
+ connect(s,
+ reinterpret_cast<struct sockaddr*>(&client_addr),
+ client_addr_len));
+
+ // since the connection is handled on another thread, wait for some time
+ EXPECT_TRUE(waiter.WaitFor(1, kConnectionCreatedTimeoutMsec));
+
+ close(s);
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
-TEST_F(TcpClientListenerTest, Init) {
- EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_.Init());
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_ValidIPv4Address) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config;
+ expected_config.insert(std::make_pair(tc_enabled, "true"));
+ expected_config.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr));
+ expected_config.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(expected_config))
+ .Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ // when the client listener runs with designated interface name, it should
+ // start the thread here
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
}
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_changed) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "172.16.2.3";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_same) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "192.168.1.1"; // same as before
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ // client listener should not generate TransportConfigUpdated event
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(0);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_disabled) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "false"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_IPv4Address_reenabled) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr_1 = "192.168.1.1";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ TransportConfig expected_config_1;
+ expected_config_1.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_1.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_1));
+ expected_config_1.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_1)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_1, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_2 = "";
+ TransportConfig expected_config_2;
+ expected_config_2.insert(std::make_pair(tc_enabled, "false"));
+ expected_config_2.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_2));
+ expected_config_2.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_2)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_2, test_ipv6_addr);
+
+ const std::string test_ipv4_addr_3 = "192.168.1.1";
+ TransportConfig expected_config_3;
+ expected_config_3.insert(std::make_pair(tc_enabled, "true"));
+ expected_config_3.insert(std::make_pair(tc_tcp_ip_address, test_ipv4_addr_3));
+ expected_config_3.insert(std::make_pair(tc_tcp_port, test_port));
+
+ EXPECT_CALL(adapter_controller_mock_,
+ TransportConfigUpdated(expected_config_3)).Times(1);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr_3, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_TRUE(0 <= tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_TRUE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+TEST_P(TcpClientListenerTest, OnIPAddressUpdated_EmptyIPv4Address) {
+ EXPECT_CALL(*interface_listener_mock_, Init()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->Init());
+ EXPECT_CALL(*interface_listener_mock_, Start()).WillOnce(Return(true));
+ EXPECT_EQ(TransportAdapter::OK, tcp_client_listener_->StartListening());
+
+ const std::string test_ipv4_addr = "";
+ const std::string test_ipv6_addr = "";
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", port_);
+ const std::string test_port(buf);
+
+ // if the client listener receives an empty IP address after started, it
+ // should ignore it
+ EXPECT_CALL(adapter_controller_mock_, TransportConfigUpdated(_)).Times(0);
+
+ tcp_client_listener_->OnIPAddressUpdated(test_ipv4_addr, test_ipv6_addr);
+
+ if (InterfaceNameSpecified()) {
+ EXPECT_EQ(-1, tcp_client_listener_->get_socket());
+
+ SleepFor(kThreadStartWaitMsec);
+
+ EXPECT_FALSE(tcp_client_listener_->thread()->is_running());
+ }
+
+ EXPECT_CALL(*interface_listener_mock_, Stop()).WillOnce(Return(true));
+ EXPECT_CALL(*interface_listener_mock_, Deinit()).Times(1);
+}
+
+INSTANTIATE_TEST_CASE_P(NetworkInterfaceName,
+ TcpClientListenerTest,
+ ::testing::Values(std::string(""),
+ std::string("dummy_interface0")));
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
index dd587569d3..959180948a 100644
--- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc
+++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
@@ -41,13 +41,12 @@
#include "transport_manager/tcp/mock_tcp_transport_adapter.h"
#include "transport_manager/mock_transport_manager_settings.h"
-#include "utils/make_shared.h"
-
namespace test {
namespace components {
namespace transport_manager_test {
using ::testing::Return;
+using ::testing::ReturnRef;
using ::testing::_;
using namespace ::protocol_handler;
@@ -61,6 +60,13 @@ class TcpAdapterTest : public ::testing::Test {
resumption::LastStateImpl last_state_;
const uint32_t port = 12345;
const std::string string_port = "12345";
+ std::string network_interface = "";
+
+ void SetUp() OVERRIDE {
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
+ }
};
TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
@@ -68,7 +74,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ std::shared_ptr<MockTCPDevice> mockdev =
+ std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -79,7 +86,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
.WillOnce(Return(mock_connection));
@@ -107,13 +114,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -125,7 +132,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
const int app_handle = 1;
std::vector<int> intList = {app_handle};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -162,13 +169,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -182,7 +189,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
std::vector<int> intList = {app_handle[0], app_handle[1], app_handle[2]};
const std::string ports[connection_count] = {"11111", "67890", "98765"};
const int int_port[connection_count] = {11111, 67890, 98765};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -220,7 +227,7 @@ TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ auto mockdev = std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -257,7 +264,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) {
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
std::string uniq_id = "unique_device_name";
- utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id);
+ std::shared_ptr<MockTCPDevice> mockdev =
+ std::make_shared<MockTCPDevice>(port, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -268,7 +276,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle))
.WillOnce(Return(mock_connection));
@@ -292,13 +300,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
port, last_state_, transport_manager_settings);
const uint32_t count_dev = 10;
- utils::SharedPtr<MockTCPDevice> mockdev[count_dev];
+ std::shared_ptr<MockTCPDevice> mockdev[count_dev];
std::string uniq_id[count_dev];
for (uint32_t i = 0; i < count_dev; i++) {
char numb[12];
std::snprintf(numb, 12, "%d", i);
uniq_id[i] = "unique_device_name" + std::string(numb);
- mockdev[i] = new MockTCPDevice(port, uniq_id[i]);
+ mockdev[i] = std::make_shared<MockTCPDevice>(port, uniq_id[i]);
EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false));
transport_adapter.AddDevice(mockdev[i]);
}
@@ -310,7 +318,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
const int app_handle = 1;
std::vector<int> intList = {app_handle};
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
for (uint32_t i = 0; i < count_dev; i++) {
EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i]))
.WillOnce(Return(mockdev[i]));
@@ -339,6 +347,37 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) {
}
}
+TEST_F(TcpAdapterTest, NotifyTransportConfigUpdated) {
+ MockTransportAdapterListener mock_adapter_listener;
+
+ MockTCPTransportAdapter transport_adapter(
+ port, last_state_, transport_manager_settings);
+ transport_adapter.AddListener(&mock_adapter_listener);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ EXPECT_CALL(mock_adapter_listener, OnTransportConfigUpdated(_)).Times(1);
+
+ transport_adapter.TransportConfigUpdated(config);
+}
+
+TEST_F(TcpAdapterTest, GetTransportConfiguration) {
+ MockTCPTransportAdapter transport_adapter(
+ port, last_state_, transport_manager_settings);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ transport_adapter.TransportConfigUpdated(config);
+
+ EXPECT_EQ(config, transport_adapter.GetTransportConfiguration());
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc
index 14b8850b49..a5d08035ae 100644
--- a/src/components/transport_manager/test/transport_adapter_listener_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc
@@ -129,7 +129,7 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) {
TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
unsigned char data[3] = {0x20, 0x07, 0x01};
::protocol_handler::RawMessagePtr data_container =
- new ::protocol_handler::RawMessage(1, 1, data, 3);
+ std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3);
EXPECT_CALL(tr_mock,
ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_SEND_DONE,
@@ -145,7 +145,7 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
TEST_F(TransportAdapterListenerTest, OnDataSendFailed) {
unsigned char data[3] = {0x20, 0x07, 0x01};
::protocol_handler::RawMessagePtr data_container =
- new ::protocol_handler::RawMessage(1, 1, data, 3);
+ std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3);
DataSendError err;
EXPECT_CALL(tr_mock,
@@ -230,6 +230,15 @@ TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) {
&adapter_mock, dev_id, app_handle, err);
}
+TEST_F(TransportAdapterListenerTest, OnTransportConfigUpdated) {
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
+ transport_listener.OnTransportConfigUpdated(&adapter_mock);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index 6d709e0c17..9e602332c6 100644
--- a/src/components/transport_manager/test/transport_adapter_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -45,7 +45,7 @@
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/raw_message.h"
-#include "utils/make_shared.h"
+
#include "resumption/last_state_impl.h"
#include "config_profile/profile.h"
@@ -156,10 +156,10 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev = new MockDevice(dev_id, uniq_id);
+ auto mockdev = std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
- std::vector<utils::SharedPtr<Device> > devList;
+ std::vector<std::shared_ptr<Device> > devList;
devList.push_back(mockdev);
EXPECT_CALL(*mockdev, IsSameAs(_)).WillOnce(Return(true));
@@ -189,8 +189,8 @@ TEST_F(TransportAdapterTest, AddDevice) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
@@ -277,8 +277,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -307,7 +307,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) {
EXPECT_CALL(*serverMock, IsInitialised()).Times(0);
EXPECT_CALL(*serverMock, CreateConnection(_, _)).Times(0);
EXPECT_CALL(transport_adapter, FindDevice(uniq_id))
- .WillOnce(Return(utils::SharedPtr<MockDevice>()));
+ .WillOnce(Return(std::shared_ptr<MockDevice>()));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::BAD_PARAM, res);
@@ -323,8 +323,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -354,8 +354,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -401,7 +401,7 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -425,8 +425,8 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -443,7 +443,7 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
EXPECT_CALL(*mock_connection, Disconnect())
@@ -467,8 +467,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
@@ -485,8 +485,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
- utils::SharedPtr<MockConnection> mock_connection =
- utils::MakeShared<MockConnection>();
+ std::shared_ptr<MockConnection> mock_connection =
+ std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
@@ -545,7 +545,7 @@ TEST_F(TransportAdapterTest, SendData) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -553,7 +553,8 @@ TEST_F(TransportAdapterTest, SendData) {
const unsigned int kSize = 3;
unsigned char data[kSize] = {0x20, 0x07, 0x01};
- const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize);
+ const RawMessagePtr kMessage =
+ std::make_shared<RawMessage>(1, 1, data, kSize);
EXPECT_CALL(*mock_connection, SendData(kMessage))
.WillOnce(Return(TransportAdapter::OK));
@@ -586,12 +587,13 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- MockConnection* mock_connection = new MockConnection();
+ auto mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
const unsigned int kSize = 3;
unsigned char data[kSize] = {0x20, 0x07, 0x01};
- const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize);
+ const RawMessagePtr kMessage =
+ std::make_shared<RawMessage>(1, 1, data, kSize);
EXPECT_CALL(*mock_connection, SendData(kMessage)).Times(0);
res = transport_adapter.SendData(dev_id, app_handle, kMessage);
@@ -712,8 +714,8 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- utils::SharedPtr<MockDevice> mockdev =
- utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ std::shared_ptr<MockDevice> mockdev =
+ std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -744,7 +746,7 @@ TEST_F(TransportAdapterTest, FindEstablishedConnection) {
TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle);
EXPECT_EQ(TransportAdapter::OK, res);
- ConnectionSPtr mock_connection = new MockConnection();
+ ConnectionSPtr mock_connection = std::make_shared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle);
EXPECT_CALL(transport_adapter, Store());
@@ -763,14 +765,14 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
- utils::SharedPtr<MockDevice> mock_device =
- utils::MakeShared<MockDevice>("test_device_name", "test_device_uid0");
+ std::shared_ptr<MockDevice> mock_device =
+ std::make_shared<MockDevice>("test_device_name", "test_device_uid0");
transport_adapter.AddDevice(mock_device);
EXPECT_CALL(*mock_device, LaunchApp(bundle_id)).Times(0);
EXPECT_CALL(transport_adapter, FindDevice("test_device_uid1"))
- .WillOnce(Return(utils::SharedPtr<MockDevice>()));
+ .WillOnce(Return(std::shared_ptr<MockDevice>()));
transport_adapter.RunAppOnDevice("test_device_uid1", bundle_id);
}
@@ -782,8 +784,8 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) {
MockTransportAdapterImpl transport_adapter(
NULL, NULL, NULL, last_state_, transport_manager_settings);
- utils::SharedPtr<MockDevice> mock_device =
- utils::MakeShared<MockDevice>("test_device_name", device_uid);
+ std::shared_ptr<MockDevice> mock_device =
+ std::make_shared<MockDevice>("test_device_name", device_uid);
transport_adapter.AddDevice(mock_device);
@@ -800,7 +802,7 @@ TEST_F(TransportAdapterTest, StopDevice) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- auto mockdev = utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ auto mockdev = std::make_shared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
@@ -809,6 +811,35 @@ TEST_F(TransportAdapterTest, StopDevice) {
transport_adapter.StopDevice(uniq_id);
}
+TEST_F(TransportAdapterTest, TransportConfigUpdated) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ MockTransportAdapterListener mock_listener;
+ transport_adapter.AddListener(&mock_listener);
+
+ TransportConfig config;
+ config[tc_enabled] = std::string("true");
+ config[tc_tcp_ip_address] = std::string("192.168.1.1");
+ config[tc_tcp_port] = std::string("12345");
+
+ EXPECT_CALL(mock_listener, OnTransportConfigUpdated(_));
+ transport_adapter.TransportConfigUpdated(config);
+}
+
+TEST_F(TransportAdapterTest, GetTransportConfigration) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ TransportConfig empty_config;
+
+ EXPECT_EQ(empty_config, transport_adapter.GetTransportConfiguration());
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_manager_default_test.cc b/src/components/transport_manager/test/transport_manager_default_test.cc
index d095a51cb6..8e8a964228 100644
--- a/src/components/transport_manager/test/transport_manager_default_test.cc
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -74,6 +74,10 @@ TEST(TestTransportManagerDefault, Init_LastStateNotUsed) {
.WillRepeatedly(Return(false));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
.WillRepeatedly(Return(12345u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
@@ -106,6 +110,10 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed) {
.WillRepeatedly(Return(true));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
.WillRepeatedly(Return(12345u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
@@ -137,6 +145,10 @@ TEST(TestTransportManagerDefault, Init_LastStateUsed_InvalidPort) {
.WillRepeatedly(Return(true));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
.WillRepeatedly(Return(1u));
+ std::string network_interface = "";
+ EXPECT_CALL(transport_manager_settings,
+ transport_manager_tcp_adapter_network_interface())
+ .WillRepeatedly(ReturnRef(network_interface));
transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index eebb247908..5f13adcd44 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -42,8 +42,7 @@
#include "transport_manager/mock_transport_manager_impl.h"
#include "transport_manager/mock_transport_manager_settings.h"
#include "resumption/last_state_impl.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
+
#include "utils/test_async_waiter.h"
using ::testing::_;
@@ -55,7 +54,7 @@ using ::testing::DoAll;
using ::protocol_handler::RawMessage;
using ::protocol_handler::RawMessagePtr;
-using utils::MakeShared;
+using std::make_shared;
namespace test {
namespace components {
@@ -85,7 +84,7 @@ class TransportManagerImplTest : public ::testing::Test {
"app_info_storage");
tm_.Init(last_state_);
mock_adapter_ = new MockTransportAdapter();
- tm_listener_ = MakeShared<MockTransportManagerListener>();
+ tm_listener_ = std::make_shared<MockTransportManagerListener>();
#ifdef TELEMETRY_MONITOR
tm_.SetTelemetryObserver(&mock_metric_observer_);
@@ -96,14 +95,14 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(mock_adapter_));
connection_key_ = 1;
- error_ = MakeShared<BaseError>();
+ error_ = std::make_shared<BaseError>();
const unsigned int version_protocol_ = 1;
const unsigned int kSize = 12;
unsigned char data[kSize] = {
0x20, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- test_message_ =
- MakeShared<RawMessage>(connection_key_, version_protocol_, data, kSize);
+ test_message_ = std::make_shared<RawMessage>(
+ connection_key_, version_protocol_, data, kSize);
}
DeviceInfo ConstructDeviceInfo(const std::string& mac_address,
@@ -331,7 +330,7 @@ class TransportManagerImplTest : public ::testing::Test {
#endif // TELEMETRY_MONITOR
MockTransportAdapter* mock_adapter_;
- utils::SharedPtr<MockTransportManagerListener> tm_listener_;
+ std::shared_ptr<MockTransportManagerListener> tm_listener_;
MockTransportManagerImpl tm_;
const ApplicationHandle application_id_ = 1;
ConnectionUID connection_key_;
@@ -1144,7 +1143,7 @@ TEST_F(TransportManagerImplTest,
test_message_,
error_));
- auto second_mock_adapter = utils::MakeShared<MockTransportAdapter>();
+ auto second_mock_adapter = std::make_shared<MockTransportAdapter>();
const auto usb_serial = "USB_serial";
DeviceInfo second_device =
@@ -1220,7 +1219,7 @@ TEST_F(TransportManagerImplTest,
test_message_,
error_));
- auto second_mock_adapter = utils::MakeShared<MockTransportAdapter>();
+ auto second_mock_adapter = std::make_shared<MockTransportAdapter>();
DeviceInfo second_device =
ConstructDeviceInfo("MA:CA:DR:ES:S", "USB_IOS", "SecondDeviceName");
@@ -1323,6 +1322,29 @@ TEST_F(TransportManagerImplTest,
tm_.OnDeviceListUpdated(mock_adapter_);
}
+TEST_F(TransportManagerImplTest, OnTransportConfigUpdated) {
+ TransportAdapterEvent test_event(EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED,
+ mock_adapter_,
+ "",
+ 0,
+ test_message_,
+ error_);
+
+ transport_adapter::TransportConfig config;
+ config[transport_manager::transport_adapter::tc_enabled] =
+ std::string("true");
+ config[transport_manager::transport_adapter::tc_tcp_ip_address] =
+ std::string("192.168.1.1");
+ config[transport_manager::transport_adapter::tc_tcp_port] =
+ std::string("12345");
+
+ EXPECT_CALL(*mock_adapter_, GetTransportConfiguration())
+ .WillOnce(Return(config));
+
+ EXPECT_CALL(*tm_listener_, OnTransportConfigUpdated(config));
+ tm_.TestHandle(test_event);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index b256a2fadc..9db1312844 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
@@ -102,7 +103,7 @@ set(PATHS
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- # --- QDB Wrapper
+ # --- QDB Wrapper
add_subdirectory(./src/qdb_wrapper)
else ()
# --- SQLite Wrapper
@@ -110,11 +111,17 @@ else ()
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- list(APPEND LIBRARIES dl pthread ${RTLIB})
+ list(APPEND LIBRARIES dl pthread ${RTLIB})
endif()
add_library("Utils" ${SOURCES})
+GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+list(APPEND LIBRARIES boost_system -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_thread -L${BOOST_LIBS_DIRECTORY})
+list(APPEND LIBRARIES boost_date_time -L${BOOST_LIBS_DIRECTORY})
target_link_libraries("Utils" ${LIBRARIES})
+add_dependencies("Utils" Boost)
+
if(ENABLE_LOG)
add_dependencies("Utils" install-3rd_party_logger)
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index d6a9edd072..b20b43c251 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -56,18 +56,14 @@ typedef std::queue<LogMessage> LogMessageQueue;
typedef threads::MessageLoopThread<LogMessageQueue>
LogMessageLoopThreadTemplate;
-class LogMessageHandler : public LogMessageLoopThreadTemplate::Handler {
- public:
- virtual void Handle(const LogMessage message) OVERRIDE;
-};
-
-class LogMessageLoopThread : public LogMessageLoopThreadTemplate {
+class LogMessageLoopThread : public LogMessageLoopThreadTemplate,
+ public LogMessageLoopThreadTemplate::Handler {
public:
LogMessageLoopThread();
~LogMessageLoopThread();
+ void Handle(const LogMessage message) OVERRIDE;
private:
- LogMessageHandler* handler_;
DISALLOW_COPY_AND_ASSIGN(LogMessageLoopThread);
};
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/include/utils/timer.h b/src/components/utils/include/utils/timer.h
index ab3d48ef6f..e391db992c 100644
--- a/src/components/utils/include/utils/timer.h
+++ b/src/components/utils/include/utils/timer.h
@@ -218,7 +218,7 @@ class Timer {
mutable sync_primitives::Lock state_lock_;
- mutable std::auto_ptr<TimerDelegate> delegate_;
+ mutable std::unique_ptr<TimerDelegate> delegate_;
threads::Thread* thread_;
/**
diff --git a/src/components/utils/src/conditional_variable_boost.cc b/src/components/utils/src/conditional_variable_boost.cc
new file mode 100644
index 0000000000..c07b8284ea
--- /dev/null
+++ b/src/components/utils/src/conditional_variable_boost.cc
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2013, 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 "utils/conditional_variable.h"
+
+#include <errno.h>
+#include <time.h>
+
+#include "utils/lock.h"
+#include "utils/logger.h"
+
+namespace {
+const long kNanosecondsPerSecond = 1000000000;
+const long kMillisecondsPerSecond = 1000;
+const long kNanosecondsPerMillisecond = 1000000;
+} // namespace
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+ConditionalVariable::ConditionalVariable() {}
+
+ConditionalVariable::~ConditionalVariable() {}
+
+void ConditionalVariable::NotifyOne() {
+ cond_var_.notify_one();
+}
+
+void ConditionalVariable::Broadcast() {
+ cond_var_.notify_all();
+}
+
+bool ConditionalVariable::Wait(BaseLock& lock) {
+ // NOTE this grossness is due to boost mutex and recursive mutex not sharing a
+ // superclass
+
+ lock.AssertTakenAndMarkFree();
+ // What kind of lock are we ?
+ if (Lock* test_lock = dynamic_cast<Lock*>(&lock)) {
+ // Regular lock
+ cond_var_.wait<boost::mutex>(test_lock->mutex_);
+ } else if (RecursiveLock* test_rec_lock =
+ dynamic_cast<RecursiveLock*>(&lock)) {
+ // Recursive lock
+ cond_var_.wait<boost::recursive_mutex>(test_rec_lock->mutex_);
+ } else {
+ // unknown, give up the lock
+ LOG4CXX_ERROR(logger_, "Unknown lock type!");
+ NOTREACHED();
+ }
+ lock.AssertFreeAndMarkTaken();
+
+ return true;
+}
+
+bool ConditionalVariable::Wait(AutoLock& auto_lock) {
+ BaseLock& lock = auto_lock.GetLock();
+ return Wait(lock);
+}
+
+ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
+ AutoLock& auto_lock, uint32_t milliseconds) {
+ BaseLock& lock = auto_lock.GetLock();
+
+ WaitStatus wait_status = kNoTimeout;
+ lock.AssertTakenAndMarkFree();
+ bool timeout = true;
+
+ // What kind of lock are we ?
+ if (Lock* test_lock = dynamic_cast<Lock*>(&lock)) {
+ // Regular lock
+ // cond_var_.wait<boost::mutex>(test_lock->mutex_);
+ timeout = cond_var_.timed_wait<boost::mutex>(
+ test_lock->mutex_, boost::posix_time::milliseconds(milliseconds));
+ } else if (RecursiveLock* test_rec_lock =
+ dynamic_cast<RecursiveLock*>(&lock)) {
+ // Recursive lock
+ // cond_var_.wait<boost::recursive_mutex>(test_rec_lock->mutex_);
+ timeout = cond_var_.timed_wait<boost::recursive_mutex>(
+ test_rec_lock->mutex_, boost::posix_time::milliseconds(milliseconds));
+ } else {
+ // this is an unknown lock, we have an issue
+ LOG4CXX_ERROR(logger_, "Unknown lock type!");
+ NOTREACHED();
+ }
+
+ if (!timeout) {
+ wait_status = kTimeout;
+ }
+ lock.AssertFreeAndMarkTaken();
+
+ return wait_status;
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/conditional_variable_posix.cc b/src/components/utils/src/conditional_variable_posix.cc
deleted file mode 100644
index 50ebc74556..0000000000
--- a/src/components/utils/src/conditional_variable_posix.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2013, 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 "utils/conditional_variable.h"
-
-#include <errno.h>
-#include <time.h>
-
-#include "utils/lock.h"
-#include "utils/logger.h"
-
-namespace {
-const long kNanosecondsPerSecond = 1000000000;
-const long kMillisecondsPerSecond = 1000;
-const long kNanosecondsPerMillisecond = 1000000;
-}
-
-namespace sync_primitives {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-
-ConditionalVariable::ConditionalVariable() {
- pthread_condattr_t attrs;
- int initialized = pthread_condattr_init(&attrs);
- if (initialized != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to initialize "
- "conditional variable attributes");
- pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC);
- initialized = pthread_cond_init(&cond_var_, &attrs);
- if (initialized != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to initialize "
- "conditional variable");
- int rv = pthread_condattr_destroy(&attrs);
- if (rv != 0)
- LOG4CXX_ERROR(logger_,
- "Failed to destroy "
- "conditional variable attributes");
-}
-
-ConditionalVariable::~ConditionalVariable() {
- pthread_cond_destroy(&cond_var_);
-}
-
-void ConditionalVariable::NotifyOne() {
- int signaled = pthread_cond_signal(&cond_var_);
- if (signaled != 0)
- LOG4CXX_ERROR(logger_, "Failed to signal conditional variable");
-}
-
-void ConditionalVariable::Broadcast() {
- int signaled = pthread_cond_broadcast(&cond_var_);
- if (signaled != 0)
- LOG4CXX_ERROR(logger_, "Failed to broadcast conditional variable");
-}
-
-bool ConditionalVariable::Wait(Lock& lock) {
- lock.AssertTakenAndMarkFree();
- int wait_status = pthread_cond_wait(&cond_var_, &lock.mutex_);
- lock.AssertFreeAndMarkTaken();
- if (wait_status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
- return false;
- }
- return true;
-}
-
-bool ConditionalVariable::Wait(AutoLock& auto_lock) {
- Lock& lock = auto_lock.GetLock();
- lock.AssertTakenAndMarkFree();
- int wait_status = pthread_cond_wait(&cond_var_, &lock.mutex_);
- lock.AssertFreeAndMarkTaken();
- if (wait_status != 0) {
- LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
- return false;
- }
- return true;
-}
-
-ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
- AutoLock& auto_lock, uint32_t milliseconds) {
- struct timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
- timespec wait_interval;
- wait_interval.tv_sec = now.tv_sec + (milliseconds / kMillisecondsPerSecond);
- wait_interval.tv_nsec =
- now.tv_nsec +
- (milliseconds % kMillisecondsPerSecond) * kNanosecondsPerMillisecond;
- wait_interval.tv_sec += wait_interval.tv_nsec / kNanosecondsPerSecond;
- wait_interval.tv_nsec %= kNanosecondsPerSecond;
- Lock& lock = auto_lock.GetLock();
- lock.AssertTakenAndMarkFree();
- int timedwait_status =
- pthread_cond_timedwait(&cond_var_, &lock.mutex_, &wait_interval);
- lock.AssertFreeAndMarkTaken();
- WaitStatus wait_status = kNoTimeout;
- switch (timedwait_status) {
- case 0: {
- wait_status = kNoTimeout;
- break;
- }
- case EINTR: {
- wait_status = kNoTimeout;
- break;
- }
- case ETIMEDOUT: {
- wait_status = kTimeout;
- break;
- }
- default: {
- LOG4CXX_ERROR(
- logger_,
- "Failed to timewait for conditional variable timedwait_status: "
- << timedwait_status);
- }
- }
- return wait_status;
-}
-
-} // namespace sync_primitives
diff --git a/src/components/utils/src/date_time.cc b/src/components/utils/src/date_time.cc
index fdf0926eb2..3ca6050b3f 100644
--- a/src/components/utils/src/date_time.cc
+++ b/src/components/utils/src/date_time.cc
@@ -30,94 +30,71 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/time.h>
-#include <stdint.h>
#include "utils/date_time.h"
-namespace date_time {
+#include <stdint.h>
+#include <sys/time.h>
+#include "boost/date_time/posix_time/posix_time.hpp"
-TimevalStruct DateTime::getCurrentTime() {
- TimevalStruct currentTime;
- timezone timeZone;
+namespace bpt = boost::posix_time;
+using namespace boost::date_time;
+namespace date_time {
- gettimeofday(&currentTime, &timeZone);
+/* Set of helper functions for the TimeDuration struct
+ */
- return currentTime;
+TimeDuration getCurrentTime() {
+ return bpt::microsec_clock::local_time() - bpt::from_time_t(0);
+}
+TimeDuration TimeDurationZero() {
+ return TimeDuration(0, 0, 0, 0);
+}
+int64_t getSecs(const TimeDuration& t) {
+ return t.total_seconds();
}
-int64_t date_time::DateTime::getSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec);
+int64_t getmSecs(const TimeDuration& t) {
+ return t.total_milliseconds();
}
-int64_t DateTime::getmSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec) * MILLISECONDS_IN_SECOND +
- times.tv_usec / MICROSECONDS_IN_MILLISECOND;
+int64_t getuSecs(const TimeDuration& t) {
+ return t.total_microseconds();
}
-int64_t DateTime::getuSecs(const TimevalStruct& time) {
- const TimevalStruct times = ConvertionUsecs(time);
- return static_cast<int64_t>(times.tv_sec) * MILLISECONDS_IN_SECOND *
- MICROSECONDS_IN_MILLISECOND +
- times.tv_usec;
+int64_t get_just_mSecs(const TimeDuration& t) {
+ return t.total_milliseconds() % MILLISECONDS_IN_SECOND;
}
-int64_t DateTime::calculateTimeSpan(const TimevalStruct& sinceTime) {
- return calculateTimeDiff(getCurrentTime(), sinceTime);
+int64_t get_just_uSecs(const TimeDuration& t) {
+ return t.total_microseconds() % MICROSECONDS_IN_SECOND;
}
-int64_t DateTime::calculateTimeDiff(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- TimevalStruct ret;
- if (Greater(times1, times2)) {
- ret = Sub(times1, times2);
- } else {
- ret = Sub(times2, times1);
- }
- return getmSecs(ret);
+int64_t calculateTimeSpan(const TimeDuration& sinceTime) {
+ return calculateTimeDiff(getCurrentTime(), sinceTime);
}
-void DateTime::AddMilliseconds(TimevalStruct& time, uint32_t milliseconds) {
- const uint32_t sec = milliseconds / MILLISECONDS_IN_SECOND;
- const uint32_t usec =
- (milliseconds % MILLISECONDS_IN_SECOND) * MICROSECONDS_IN_MILLISECOND;
- time.tv_sec += sec;
- time.tv_usec += usec;
- time = ConvertionUsecs(time);
+int64_t calculateTimeDiff(const TimeDuration& time1,
+ const TimeDuration& time2) {
+ return std::abs((time1 + -time2).total_milliseconds());
}
-TimevalStruct DateTime::Sub(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- TimevalStruct ret;
- timersub(&times1, &times2, &ret);
- return ret;
+void AddMilliseconds(TimeDuration& t, uint32_t milliseconds) {
+ t += bpt::milliseconds(milliseconds);
}
-bool DateTime::Greater(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return timercmp(&times1, &times2, > );
+bool Greater(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 > time2;
}
-bool DateTime::Less(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return timercmp(&times1, &times2, < );
+bool Less(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 < time2;
}
-bool DateTime::Equal(const TimevalStruct& time1, const TimevalStruct& time2) {
- const TimevalStruct times1 = ConvertionUsecs(time1);
- const TimevalStruct times2 = ConvertionUsecs(time2);
- return !timercmp(&times1, &times2, != );
+bool Equal(const TimeDuration& time1, const TimeDuration& time2) {
+ return time1 == time2;
}
-TimeCompare date_time::DateTime::compareTime(const TimevalStruct& time1,
- const TimevalStruct& time2) {
+TimeCompare compareTime(const TimeDuration& time1, const TimeDuration& time2) {
if (Greater(time1, time2))
return GREATER;
if (Less(time1, time2))
@@ -125,28 +102,4 @@ TimeCompare date_time::DateTime::compareTime(const TimevalStruct& time1,
return EQUAL;
}
-TimevalStruct date_time::DateTime::ConvertionUsecs(const TimevalStruct& time) {
- if (time.tv_usec >= MICROSECONDS_IN_SECOND) {
- TimevalStruct time1;
- time1.tv_sec = static_cast<int64_t>(time.tv_sec) +
- (time.tv_usec / MICROSECONDS_IN_SECOND);
- time1.tv_usec = static_cast<int64_t>(time.tv_usec) % MICROSECONDS_IN_SECOND;
- return time1;
- }
- return time;
-}
-
} // namespace date_time
-
-bool operator<(const TimevalStruct& time1, const TimevalStruct& time2) {
- return date_time::DateTime::Less(time1, time2);
-}
-
-bool operator==(const TimevalStruct& time1, const TimevalStruct& time2) {
- return date_time::DateTime::Equal(time1, time2);
-}
-
-const TimevalStruct operator-(const TimevalStruct& time1,
- const TimevalStruct& time2) {
- return date_time::DateTime::Sub(time1, time2);
-}
diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_boost.cc
index e5e6d7fad0..2299bcf77d 100644
--- a/src/components/utils/src/lock_posix.cc
+++ b/src/components/utils/src/lock_boost.cc
@@ -30,94 +30,51 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "utils/lock.h"
#include <errno.h>
#include <stdint.h>
-#include <stdio.h>
#include <string.h>
#include <cstring>
+#include "utils/lock.h"
#include "utils/logger.h"
namespace sync_primitives {
CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
-Lock::Lock()
-#ifndef NDEBUG
- : lock_taken_(0)
- , is_mutex_recursive_(false)
-#endif // NDEBUG
-{
- Init(false);
-}
-
-Lock::Lock(bool is_recursive)
-#ifndef NDEBUG
- : lock_taken_(0)
- , is_mutex_recursive_(is_recursive)
-#endif // NDEBUG
-{
- Init(is_recursive);
-}
+Lock::Lock() : lock_taken_(0) {}
Lock::~Lock() {
-#ifndef NDEBUG
if (lock_taken_ > 0) {
- LOG4CXX_FATAL(logger_, "Destroying non-released mutex " << &mutex_);
- NOTREACHED();
- }
-#endif
- int32_t status = pthread_mutex_destroy(&mutex_);
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to destroy mutex " << &mutex_ << ": "
- << strerror(status));
- NOTREACHED();
+ LOG4CXX_FATAL(logger_, "Destroying non-released regular mutex " << &mutex_);
}
}
void Lock::Acquire() {
- const int32_t status = pthread_mutex_lock(&mutex_);
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to acquire mutex " << &mutex_ << ": "
- << strerror(status));
- NOTREACHED();
- } else {
- AssertFreeAndMarkTaken();
- }
+ mutex_.lock();
+ AssertFreeAndMarkTaken();
}
void Lock::Release() {
AssertTakenAndMarkFree();
- const int32_t status = pthread_mutex_unlock(&mutex_);
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to unlock mutex" << &mutex_ << ": "
- << strerror(status));
- NOTREACHED();
- }
+ mutex_.unlock();
}
bool Lock::Try() {
- const int32_t status = pthread_mutex_trylock(&mutex_);
- if (status == 0) {
-#ifndef NDEBUG
- lock_taken_++;
-#endif
- return true;
+ bool status = mutex_.try_lock();
+ if (status) {
+ AssertFreeAndMarkTaken();
}
- return false;
+ return status;
}
-#ifndef NDEBUG
void Lock::AssertFreeAndMarkTaken() {
- if ((lock_taken_ > 0) && !is_mutex_recursive_) {
+ if (lock_taken_ != 0) {
LOG4CXX_FATAL(logger_, "Locking already taken not recursive mutex");
NOTREACHED();
}
lock_taken_++;
}
+
void Lock::AssertTakenAndMarkFree() {
if (lock_taken_ == 0) {
LOG4CXX_FATAL(logger_, "Unlocking a mutex that is not taken");
@@ -125,25 +82,46 @@ void Lock::AssertTakenAndMarkFree() {
}
lock_taken_--;
}
-#endif
-void Lock::Init(bool is_recursive) {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
+// Recursive lock looks the same on the surface, some code duplication is
+// necessary since they don't have a shared parent superclass
+RecursiveLock::RecursiveLock() : lock_taken_(0) {}
- const int32_t mutex_type =
- is_recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_ERRORCHECK;
+RecursiveLock::~RecursiveLock() {
+ if (lock_taken_ > 0) {
+ LOG4CXX_FATAL(logger_,
+ "Destroying non-released recursive mutex " << &mutex_);
+ }
+}
- pthread_mutexattr_settype(&attr, mutex_type);
- const int32_t status = pthread_mutex_init(&mutex_, &attr);
+void RecursiveLock::Acquire() {
+ mutex_.lock();
+ AssertFreeAndMarkTaken();
+}
- pthread_mutexattr_destroy(&attr);
+void RecursiveLock::Release() {
+ AssertTakenAndMarkFree();
+ mutex_.unlock();
+}
- if (status != 0) {
- LOG4CXX_FATAL(logger_,
- "Failed to initialize mutex. " << std::strerror(status));
- DCHECK(status != 0);
+bool RecursiveLock::Try() {
+ bool status = mutex_.try_lock();
+ if (status) {
+ AssertFreeAndMarkTaken();
}
+ return status;
+}
+
+void RecursiveLock::AssertFreeAndMarkTaken() {
+ lock_taken_++;
+}
+
+void RecursiveLock::AssertTakenAndMarkFree() {
+ if (lock_taken_ == 0) {
+ LOG4CXX_FATAL(logger_, "Unlocking a recursive mutex that is not taken");
+ NOTREACHED();
+ }
+ lock_taken_--;
}
} // namespace sync_primitives
diff --git a/src/components/utils/src/log_message_loop_thread.cc b/src/components/utils/src/log_message_loop_thread.cc
index 2b7f28fbfd..182eb64534 100644
--- a/src/components/utils/src/log_message_loop_thread.cc
+++ b/src/components/utils/src/log_message_loop_thread.cc
@@ -35,7 +35,7 @@
namespace logger {
-void LogMessageHandler::Handle(const LogMessage message) {
+void LogMessageLoopThread::Handle(const LogMessage message) {
message.logger->forcedLog(message.level,
message.entry,
message.timeStamp,
@@ -44,14 +44,13 @@ void LogMessageHandler::Handle(const LogMessage message) {
}
LogMessageLoopThread::LogMessageLoopThread()
- : LogMessageLoopThreadTemplate("Logger",
- handler_ = new LogMessageHandler()) {}
+ : LogMessageLoopThreadTemplate("Logger", this) {}
LogMessageLoopThread::~LogMessageLoopThread() {
// we'll have to drop messages
// while deleting logger thread
logger_status = DeletingLoggerThread;
- delete handler_;
+ LogMessageLoopThreadTemplate::Shutdown();
}
} // namespace logger
diff --git a/src/components/utils/src/logger.cc b/src/components/utils/src/logger.cc
index 4e93ca3d14..af21aeac77 100644
--- a/src/components/utils/src/logger.cc
+++ b/src/components/utils/src/logger.cc
@@ -39,6 +39,9 @@ void deinit_logger() {
CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
LOG4CXX_DEBUG(logger_, "Logger deinitialization");
logger::set_logs_enabled(false);
+ if (logger::logger_status == logger::LoggerThreadCreated) {
+ logger::flush_logger();
+ }
logger::delete_log_message_loop_thread();
log4cxx::LoggerPtr rootLogger = log4cxx::Logger::getRootLogger();
log4cxx::spi::LoggerRepositoryPtr repository =
diff --git a/src/components/utils/test/atomic_object_test.cc b/src/components/utils/src/semantic_version.cc
index 44975fd004..4b8d37b913 100644
--- a/src/components/utils/test/atomic_object_test.cc
+++ b/src/components/utils/src/semantic_version.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2018, Livio
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,29 +29,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "utils/semantic_version.h"
-#include "utils/atomic_object.h"
-#include "gtest/gtest.h"
+namespace utils {
-namespace test {
-namespace components {
-namespace utils_test {
+const SemanticVersion version_4_5(4, 5, 0);
-TEST(AtomicObjectTest, Construct) {
- sync_primitives::atomic_int var(5);
- EXPECT_EQ(5, var);
-
- var = 8;
- EXPECT_EQ(8, var);
-
- sync_primitives::atomic_bool flag = true;
-
- EXPECT_TRUE(flag == true);
-
- flag = false;
- EXPECT_FALSE(flag == true);
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
+} // namespace utils \ No newline at end of file
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/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
index 65abad65c2..f01dad8d58 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -36,8 +36,6 @@
#include "utils/lock.h"
#include "utils/threads/async_runner.h"
#include "utils/conditional_variable.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
@@ -92,7 +90,7 @@ class AsyncRunnerTest : public ::testing::Test {
protected:
ThreadDelegate** delegates_;
- ::utils::SharedPtr<AsyncRunner> async_runner_;
+ std::shared_ptr<AsyncRunner> async_runner_;
void CreateThreadsArray() {
delegates_ = new ThreadDelegate* [kDelegatesAmount];
@@ -103,7 +101,7 @@ class AsyncRunnerTest : public ::testing::Test {
}
void CreateAsyncRunner() {
- async_runner_ = ::utils::MakeShared<AsyncRunner>("test");
+ async_runner_ = std::make_shared<AsyncRunner>("test");
}
};
@@ -128,8 +126,8 @@ TEST_F(AsyncRunnerTest, StopThenRun_ExpectDelegateNotStarted) {
// Check that delegate was not started due to Stop() called before AsyncRun()
EXPECT_CALL(mock_thread_delegate, threadMain()).Times(0);
{
- ::utils::SharedPtr<AsyncRunner> async_runner =
- ::utils::MakeShared<AsyncRunner>("test");
+ std::shared_ptr<AsyncRunner> async_runner =
+ std::make_shared<AsyncRunner>("test");
async_runner->Stop();
async_runner->AsyncRun(&mock_thread_delegate);
}
diff --git a/src/components/utils/test/conditional_variable_test.cc b/src/components/utils/test/conditional_variable_test.cc
index 48e2e53200..1ef29685e6 100644
--- a/src/components/utils/test/conditional_variable_test.cc
+++ b/src/components/utils/test/conditional_variable_test.cc
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <iostream>
#include <pthread.h>
+#include <iostream>
#include "gtest/gtest.h"
+#include "utils/conditional_variable.h"
#include "utils/lock.h"
#include "utils/macro.h"
-#include "utils/conditional_variable.h"
namespace test {
namespace components {
@@ -102,6 +102,7 @@ TEST_F(ConditionalVariableTest,
cond_var_.WaitFor(test_lock, 2000);
std::string last_value("changed again by thread 1");
EXPECT_EQ(last_value, test_value_);
+ pthread_join(thread1, NULL);
}
TEST_F(ConditionalVariableTest,
diff --git a/src/components/utils/test/date_time_test.cc b/src/components/utils/test/date_time_test.cc
index a209ab4d43..00085813aa 100644
--- a/src/components/utils/test/date_time_test.cc
+++ b/src/components/utils/test/date_time_test.cc
@@ -30,6 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <boost/thread/thread.hpp>
#include "gtest/gtest.h"
#include "utils/date_time.h"
@@ -38,364 +39,270 @@ namespace components {
namespace utils_test {
using namespace date_time;
+
+namespace bpt = boost::posix_time;
TEST(DateTimeTest, GetCurrentTime) {
// arrange
- const TimevalStruct time1 = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time1 = getCurrentTime();
// assert
- ASSERT_NE(0, time1.tv_sec);
- ASSERT_GE(time1.tv_usec, 0);
+ ASSERT_NE(0, time1.total_seconds());
+ ASSERT_GE(get_just_uSecs(time1), 0);
// act
- const TimevalStruct time2 = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time2 = getCurrentTime();
// assert
- ASSERT_NE(0, time2.tv_sec);
- ASSERT_GE(time2.tv_usec, 0);
- ASSERT_GE(time2.tv_sec, time1.tv_sec);
+ ASSERT_NE(0, time2.total_seconds());
+ ASSERT_GE(get_just_uSecs(time1), 0);
+ ASSERT_GE(time2.total_seconds(), time1.total_seconds());
}
TEST(DateTimeTest, GetSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 1;
- time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time));
+ ASSERT_EQ(1, getSecs(time1));
}
TEST(DateTimeTest, GetmSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 1;
- time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
+ int expected = 1 * MILLISECONDS_IN_SECOND + 2;
- int64_t expect_value =
- time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- time.tv_usec / date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
+ ASSERT_EQ(expected, getmSecs(time1));
}
TEST(DateTimeTest, GetuSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 3;
- time.tv_usec = 4;
-
- int64_t expect_value = time.tv_sec *
- date_time::DateTime::MILLISECONDS_IN_SECOND *
- date_time::DateTime::MICROSECONDS_IN_MILLISECOND +
- time.tv_usec;
+ date_time::TimeDuration time1 = bpt::seconds(3) + bpt::microseconds(4);
+ int expect_value =
+ 3 * MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND + 4;
+
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getuSecs(time));
+ ASSERT_EQ(expect_value, getuSecs(time1));
}
TEST(DateTimeTest, GetuSecsmSecs) {
// arrange
- TimevalStruct time;
- time.tv_sec = 5;
- time.tv_usec = 6;
+ date_time::TimeDuration time1 = bpt::seconds(5) + bpt::microseconds(6);
- int64_t expect_value = date_time::DateTime::getuSecs(time) /
- date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ int64_t expect_value = getuSecs(time1) / MICROSECONDS_IN_MILLISECOND;
// assert
- ASSERT_EQ(expect_value, date_time::DateTime::getmSecs(time));
+ ASSERT_EQ(expect_value, getmSecs(time1));
}
TEST(DateTimeTest, CalculateTimeSpan) {
// arrange
- const TimevalStruct time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration time1 = getCurrentTime();
const uint32_t sleep_time_mSec = 10;
- usleep(sleep_time_mSec * date_time::DateTime::MICROSECONDS_IN_MILLISECOND);
+ // sleep current thread
+ boost::this_thread::sleep(boost::posix_time::milliseconds(sleep_time_mSec));
// assert
- ASSERT_GE(date_time::DateTime::calculateTimeSpan(time), sleep_time_mSec);
+ ASSERT_GE(calculateTimeSpan(time1), sleep_time_mSec);
}
TEST(DateTimeTest, CalculateTimeDiff) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(2) + bpt::milliseconds(2);
+ date_time::TimeDuration time2 = bpt::seconds(3) + bpt::milliseconds(4);
// time2 to time1
- TimevalStruct diff1;
- diff1.tv_sec = time2.tv_sec - time1.tv_sec;
- diff1.tv_usec = time2.tv_usec - time1.tv_usec;
-
- const int64_t mSecDiff =
- static_cast<int64_t>(diff1.tv_sec) * 1000 + diff1.tv_usec / 1000;
+ date_time::TimeDuration diff1 = bpt::seconds(1) + bpt::milliseconds(2);
// assert
- ASSERT_EQ(mSecDiff, date_time::DateTime::calculateTimeDiff(time2, time1));
+ ASSERT_EQ(diff1.total_milliseconds(), calculateTimeDiff(time2, time1));
- // time1 to time2
- TimevalStruct diff2;
- diff2.tv_sec = time1.tv_sec - time2.tv_sec;
- diff2.tv_usec = time1.tv_usec - time2.tv_usec;
-
- const int64_t mSecDiff2 =
- -(static_cast<int64_t>(diff2.tv_sec) * 1000 + diff2.tv_usec / 1000);
+ // time1 to time2, but calculateTimeDiff returns an absolute value
+ date_time::TimeDuration diff2 = -diff1.invert_sign();
// assert
- ASSERT_EQ(mSecDiff2, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(diff2.total_milliseconds(), calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, CalculateEqualTimeDiff) {
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
- TimevalStruct time2;
- time2.tv_sec = 1;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time2 = bpt::seconds(1) + bpt::milliseconds(2);
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(0, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, compareTime) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time1 = bpt::seconds(1) + bpt::milliseconds(2);
- TimevalStruct time2;
- time2.tv_sec = 2;
- time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ date_time::TimeDuration time2 = bpt::seconds(2) + bpt::milliseconds(4);
// assert
- ASSERT_EQ(LESS, date_time::DateTime::compareTime(time1, time2));
- ASSERT_EQ(GREATER, date_time::DateTime::compareTime(time2, time1));
- ASSERT_NE(EQUAL, date_time::DateTime::compareTime(time2, time1));
+ ASSERT_EQ(LESS, compareTime(time1, time2));
+ ASSERT_EQ(GREATER, compareTime(time2, time1));
+ ASSERT_NE(EQUAL, compareTime(time2, time1));
// act
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+ date_time::TimeDuration time3 = time2 - time1;
// assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+ ASSERT_EQ(EQUAL, compareTime(time1, time3));
}
TEST(DateTimeTest, GetSecs_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 0;
- time1.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 = bpt::microseconds(MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
+ ASSERT_EQ(1, getSecs(time1));
}
TEST(DateTimeTest, compareTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(1, date_time::DateTime::getSecs(time1));
- ASSERT_EQ(1, date_time::DateTime::getSecs(time2));
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time2));
-}
-
-TEST(DateTimeTest, compareEqualTime_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
-
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = date_time::DateTime::MICROSECONDS_IN_SECOND;
-
- // assert
- ASSERT_TRUE(date_time::DateTime::Equal(time1, time2));
+ ASSERT_EQ(1, getSecs(time1));
+ ASSERT_EQ(1, getSecs(time2));
+ ASSERT_EQ(EQUAL, compareTime(time1, time2));
+ ASSERT_TRUE(Equal(time1, time2));
}
TEST(DateTimeTest, compareLessTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_TRUE(date_time::DateTime::Less(time1, time2));
+ ASSERT_TRUE(Less(time1, time2));
}
TEST(DateTimeTest, compareGreaterTime_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::milliseconds(2 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_TRUE(date_time::DateTime::Greater(time2, time1));
+ ASSERT_TRUE(Greater(time2, time1));
}
TEST(DateTimeTest, CalculateTimeSub_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 1;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(1);
- TimevalStruct time2;
- time2.tv_sec = 0;
- time2.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time2 = bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
+ date_time::TimeDuration time3 = time2 - time1;
// assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time1, time3));
+ ASSERT_EQ(EQUAL, compareTime(time1, time3));
}
TEST(DateTimeTest, CalculateTimeDiff_UsecConvertedInSec) {
// arrange
- TimevalStruct time1;
- time1.tv_sec = 2;
- time1.tv_usec = 5 * date_time::DateTime::MICROSECONDS_IN_SECOND;
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 =
+ bpt::seconds(2) + bpt::microseconds(5 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration time2 =
+ bpt::seconds(3) + bpt::microseconds(1 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(3000, date_time::DateTime::calculateTimeDiff(time1, time2));
+ ASSERT_EQ(3000, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(3000, calculateTimeDiff(time1, time2));
}
TEST(DateTimeTest, CalculateEqualTimeDiff_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 2;
- time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_SECOND;
-
- TimevalStruct time2;
- time2.tv_sec = 3;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time1 =
+ bpt::seconds(2) + bpt::microseconds(2 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration time2 =
+ bpt::seconds(3) + bpt::microseconds(1 * MICROSECONDS_IN_SECOND);
// assert
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time2, time1));
- ASSERT_EQ(0, date_time::DateTime::calculateTimeDiff(time1, time2));
-}
+ ASSERT_EQ(0, calculateTimeDiff(time2, time1));
+ ASSERT_EQ(0, calculateTimeDiff(time1, time2));
-TEST(DateTimeTest, CalculateEqualTimeSub_UsecConvertedInSec) {
- // arrange
- TimevalStruct time1;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
+ date_time::TimeDuration time3 = time2 - time1;
+ date_time::TimeDuration time4 = time1 - time2;
- TimevalStruct time2;
- time2.tv_sec = 2;
- time2.tv_usec = 1 * date_time::DateTime::MICROSECONDS_IN_SECOND;
+ date_time::TimeDuration time_expected(0, 0, 0, 0);
- TimevalStruct time3 = date_time::DateTime::Sub(time2, time1);
- TimevalStruct time4 = date_time::DateTime::Sub(time1, time2);
-
- TimevalStruct time_expected;
- time_expected.tv_sec = 0;
- time_expected.tv_usec = 0;
- // assert
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time_expected, time3));
- ASSERT_EQ(EQUAL, date_time::DateTime::compareTime(time_expected, time4));
+ ASSERT_EQ(EQUAL, compareTime(time_expected, time3));
+ ASSERT_EQ(EQUAL, compareTime(time_expected, time4));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondMultiplesSecond_ExpectChangeTime) {
- TimevalStruct time1;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7000;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(10, time1.tv_sec);
- ASSERT_EQ(0, time1.tv_usec);
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, getSecs(time1));
+ ASSERT_EQ(0, get_just_mSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondNotMultiplesSecond_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7500;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(10, time1.tv_sec);
- ASSERT_EQ(500000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, time1.total_seconds());
+ ASSERT_EQ(500000, get_just_uSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMilliSecondLessThenSeconds_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 500;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(3, time1.tv_sec);
- ASSERT_EQ(500000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(3, getSecs(time1));
+ ASSERT_EQ(500000, get_just_uSecs(time1));
}
TEST(DateTimeTest,
AddMilliseconds_SetMillisecondEqualNull_ExpectNotChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 0;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(3, time1.tv_sec);
- ASSERT_EQ(0, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(3, getSecs(time1));
+ ASSERT_EQ(0, get_just_mSecs(time1));
}
TEST(DateTimeTest, AddMilliseconds_SetOverlowMicrosecond_ExpectChangeTime) {
- TimevalStruct time1;
+ date_time::TimeDuration time1 = bpt::seconds(3);
uint32_t milliseconds = 7600;
- time1.tv_sec = 3;
- time1.tv_usec = 500000;
- date_time::DateTime::AddMilliseconds(time1, milliseconds);
- ASSERT_EQ(11, time1.tv_sec);
- ASSERT_EQ(100000, time1.tv_usec);
+
+ AddMilliseconds(time1, milliseconds);
+ ASSERT_EQ(10, getSecs(time1));
+ ASSERT_EQ(600000, get_just_uSecs(time1));
}
-TEST(DateTimeTest, Operator_minus_TimevalStruct_positive) {
- TimevalStruct time1;
- TimevalStruct time2;
- TimevalStruct time3;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- time2.tv_sec = 3;
- time2.tv_usec = 0;
- time3.tv_sec = 2;
- time3.tv_usec = 9000000;
- ASSERT_EQ(0, date_time::DateTime::getSecs(time1 - time2));
- ASSERT_EQ(8000000, date_time::DateTime::getuSecs(time3 - time1));
+TEST(DateTimeTest, Operator_minus_TimeDuration_positive) {
+ date_time::TimeDuration time1 = bpt::seconds(3);
+ date_time::TimeDuration time2 = bpt::seconds(3);
+ date_time::TimeDuration time3 =
+ bpt::seconds(2) + bpt::microseconds(9 * MICROSECONDS_IN_SECOND);
+ date_time::TimeDuration diff1 = time1 - time2;
+ ASSERT_EQ(0, getSecs(diff1));
+ ASSERT_EQ(8000000, getuSecs(time3 - time1));
}
-TEST(DateTimeTest, Operator_minus_TimevalStruct_negative) {
- TimevalStruct time1;
- TimevalStruct time2;
- time1.tv_sec = 3;
- time1.tv_usec = 0;
- time2.tv_sec = 2;
- time2.tv_usec = 9000000;
- ASSERT_NE(1, date_time::DateTime::getSecs(time1 - time2));
- ASSERT_NE(-8000000, date_time::DateTime::getSecs(time2 - time1));
+TEST(DateTimeTest, Operator_minus_TimeDuration_negative) {
+ date_time::TimeDuration time1 = bpt::seconds(3);
+ date_time::TimeDuration time2 =
+ bpt::seconds(2) + bpt::microseconds(9 * MICROSECONDS_IN_SECOND);
+
+ ASSERT_NE(1, getSecs(time1 - time2));
+ ASSERT_NE(-8000000, getSecs(time2 - time1));
}
} // namespace utils_test
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_icon_request.cc b/src/components/utils/test/include/utils/mock_signals_posix.h
index 44049338a8..1aad2d5873 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_icon_request.cc
+++ b/src/components/utils/test/include/utils/mock_signals_posix.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2018, Ford Motor Company
* All rights reserved.
*
@@ -30,33 +30,30 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sdl_rpc_plugin/commands/hmi/ui_set_icon_request.h"
-
-namespace sdl_rpc_plugin {
-using namespace application_manager;
-
-namespace commands {
-
-UISetIconRequest::UISetIconRequest(
- const application_manager::commands::MessageSharedPtr& message,
- ApplicationManager& application_manager,
- rpc_service::RPCService& rpc_service,
- HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handle)
- : RequestToHMI(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handle) {}
-
-UISetIconRequest::~UISetIconRequest() {}
-
-void UISetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- SendRequest();
-}
-
-} // namespace commands
-
-} // namespace application_manager
+#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/lock_posix_test.cc b/src/components/utils/test/lock_boost_test.cc
index a78659ab31..0da735a990 100644
--- a/src/components/utils/test/lock_posix_test.cc
+++ b/src/components/utils/test/lock_boost_test.cc
@@ -38,8 +38,9 @@ namespace components {
namespace utils_test {
using sync_primitives::Lock;
+using sync_primitives::RecursiveLock;
-TEST(LockPosixTest, DefaultCtorTest_ExpectNonRecursiveMutexCreated) {
+TEST(LockBoostTest, TestNonRecursive) {
// Create Lock object
Lock test_mutex;
// Lock mutex
@@ -50,20 +51,9 @@ TEST(LockPosixTest, DefaultCtorTest_ExpectNonRecursiveMutexCreated) {
test_mutex.Release();
}
-TEST(LockPosixTest, CtorTestWithFalseArgument_ExpectNonRecursiveMutexCreated) {
+TEST(LockBoostTest, TestRecursive) {
// Create Lock object
- Lock test_mutex(false);
- // Lock mutex
- test_mutex.Acquire();
- // Check if created mutex is non-recursive
- EXPECT_FALSE(test_mutex.Try());
- // Release mutex before destroy
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, CtorTestWithTrueArgument_ExpectRecursiveMutexCreated) {
- // Create Lock object
- Lock test_mutex(true);
+ RecursiveLock test_mutex;
// Lock mutex
test_mutex.Acquire();
// Check if created mutex is recursive
@@ -73,17 +63,7 @@ TEST(LockPosixTest, CtorTestWithTrueArgument_ExpectRecursiveMutexCreated) {
test_mutex.Release();
}
-TEST(LockPosixTest, AcquireMutex_ExpectMutexLocked) {
- // Create Lock object (non-recursive mutex)
- Lock test_mutex;
- // Lock mutex
- test_mutex.Acquire();
- // Try to lock it again. If locked expect false
- EXPECT_FALSE(test_mutex.Try());
- test_mutex.Release();
-}
-
-TEST(LockPosixTest, ReleaseMutex_ExpectMutexReleased) {
+TEST(LockBoostTest, ReleaseMutex_ExpectMutexReleased) {
// Create Lock object (non-recursive mutex)
Lock test_mutex;
// Lock mutex
@@ -95,7 +75,7 @@ TEST(LockPosixTest, ReleaseMutex_ExpectMutexReleased) {
test_mutex.Release();
}
-TEST(LockPosixTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
+TEST(LockBoostTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
// Create Lock object (non-recursive mutex)
Lock test_mutex;
// Lock mutex
@@ -105,9 +85,9 @@ TEST(LockPosixTest, TryLockNonRecursiveMutex_ExpectMutexNotLockedTwice) {
test_mutex.Release();
}
-TEST(LockPosixTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
+TEST(LockBoostTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
// Create Lock object (recursive mutex)
- Lock test_mutex(true);
+ RecursiveLock test_mutex;
// Lock mutex
test_mutex.Try();
// Try to lock it again. Expect true and internal counter increase
diff --git a/src/components/utils/test/log_message_loop_thread_test.cc b/src/components/utils/test/log_message_loop_thread_test.cc
index 032c7ecae1..92287fb45b 100644
--- a/src/components/utils/test/log_message_loop_thread_test.cc
+++ b/src/components/utils/test/log_message_loop_thread_test.cc
@@ -57,7 +57,7 @@ TEST(LogMessageLoopThread, DestroyLogMessage_loggerStatusDeletingLogger) {
logger::logger_status = LoggerThreadNotCreated;
}
-class MockLogMessageTest : public LogMessageHandler {
+class MockLogMessageTest : public LogMessageLoopThread {
public:
MOCK_CONST_METHOD1(Handle, void(const LogMessage message));
};
diff --git a/src/components/utils/test/message_queue_test.cc b/src/components/utils/test/message_queue_test.cc
index ddc1aa1d81..9aa70933d6 100644
--- a/src/components/utils/test/message_queue_test.cc
+++ b/src/components/utils/test/message_queue_test.cc
@@ -158,6 +158,8 @@ TEST_F(MessageQueueTest,
ASSERT_EQ(test_val_1, test_line);
// Check the size of queue after 1 element was removed
ASSERT_EQ(0u, test_queue.size());
+ pthread_join(thread1, NULL);
+ pthread_join(thread2, NULL);
}
TEST_F(MessageQueueTest,
@@ -169,6 +171,7 @@ TEST_F(MessageQueueTest,
test_queue.wait();
check_value = true;
ASSERT_TRUE(check_value);
+ pthread_join(thread1, NULL);
}
} // namespace utils_test
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index 4ec14ac1cc..d45e600034 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -57,25 +57,25 @@ const TimePair testing_time_pairs[] = {TimePair(0, 50),
class MessageMeterTest : public ::testing::TestWithParam<TimePair> {
protected:
void SetUp() OVERRIDE {
- usecs = date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
+ usecs = date_time::MICROSECONDS_IN_MILLISECOND;
id1 = 0x0;
id2 = 0xABCDEF;
id3 = 0xFEBCDA;
const TimePair time_pair = GetParam();
EXPECT_GT(usecs, time_pair.second) << "Wrong time (msecs) value";
+ time_range = date_time::seconds(time_pair.first) +
+ date_time::microseconds(time_pair.second * usecs);
- time_range.tv_sec = time_pair.first;
- time_range.tv_usec = time_pair.second * usecs;
- EXPECT_LT(0, date_time::DateTime::getuSecs(time_range))
+ EXPECT_LT(0, date_time::getuSecs(time_range))
<< "Wrong test case with null range value";
meter.set_time_range(time_range);
- time_range_msecs = date_time::DateTime::getmSecs(time_range);
+ time_range_msecs = date_time::getmSecs(time_range);
}
void TearDown() OVERRIDE {}
::utils::MessageMeter<int> meter;
- TimevalStruct time_range = {0, 0};
+ date_time::TimeDuration time_range = date_time::TimeDurationZero();
int64_t time_range_msecs;
int usecs;
int id1, id2, id3;
@@ -83,27 +83,25 @@ class MessageMeterTest : public ::testing::TestWithParam<TimePair> {
TEST(MessageMeterTest, DefaultTimeRange) {
const ::utils::MessageMeter<int> default_meter;
- const TimevalStruct time_second{1, 0};
+ const date_time::TimeDuration time_second = date_time::seconds(1);
EXPECT_EQ(time_second, default_meter.time_range());
}
TEST(MessageMeterTest, TimeRangeSetter) {
::utils::MessageMeter<int> meter;
- TimevalStruct time_range{0, 0};
+ date_time::TimeDuration time_range;
const int test_count_secs = 1000;
- // Skip 1000th msec value as wrong for TimevalStruct
+ // Skip 1000th msec value as wrong for date_time::TimeDuration
const int test_count_msecs = 999;
for (int sec = test_count_secs; sec >= 0; --sec) {
for (int msec = test_count_msecs; msec >= 0; --msec) {
- time_range.tv_sec = sec;
- time_range.tv_usec =
- msec * date_time::DateTime::MICROSECONDS_IN_MILLISECOND;
- // Setter TimevalStruct
+ time_range = date_time::seconds(sec) + date_time::milliseconds(msec);
+
+ // Setter date_time::TimeDuration
meter.set_time_range(time_range);
EXPECT_EQ(time_range, meter.time_range()) << sec << "." << msec << " sec";
// Setter mSecs
- meter.set_time_range(sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
- msec);
+ meter.set_time_range(sec * date_time::MILLISECONDS_IN_SECOND + msec);
EXPECT_EQ(time_range, meter.time_range()) << sec << "." << msec << " sec";
}
}
@@ -113,7 +111,7 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
::utils::MessageMeter<int> meter;
const int id1 = 1;
const int id2 = 2;
- const TimevalStruct null_time_range{0, 0};
+ const date_time::TimeDuration null_time_range = date_time::TimeDurationZero();
meter.set_time_range(null_time_range);
for (int i = 0; i < 10000; ++i) {
// 1st Connection
@@ -129,10 +127,10 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
TEST_P(MessageMeterTest,
DISABLED_TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
size_t messages = 0;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
// Add messages for less range period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
++messages;
@@ -153,10 +151,10 @@ TEST_P(MessageMeterTest,
TEST_P(MessageMeterTest,
DISABLED_TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
size_t messages = 0;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
// Add messages for less range period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
++messages;
@@ -188,14 +186,14 @@ TEST_P(MessageMeterTest,
TEST_P(MessageMeterTest,
DISABLED_Frequency_CountingOverPeriod_CorrectCountOfMessages) {
const size_t one_message = 1;
- const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+ const date_time::TimeDuration start_time = date_time::getCurrentTime();
EXPECT_EQ(one_message, meter.TrackMessage(id1));
EXPECT_EQ(one_message, meter.TrackMessage(id2));
EXPECT_EQ(one_message, meter.TrackMessage(id3));
// Check messages count over period
int64_t time_span;
- while ((time_span = date_time::DateTime::calculateTimeSpan(start_time)) <
+ while ((time_span = date_time::calculateTimeSpan(start_time)) <
time_range_msecs) {
usleep(time_range_msecs);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_response.h b/src/components/utils/test/mock_signals_posix.cc
index 654dff25b5..47531b4a9f 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_icon_response.h
+++ b/src/components/utils/test/mock_signals_posix.cc
@@ -30,47 +30,47 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "utils/mock_signals_posix.h"
+#include "utils/signals.h"
-#include "application_manager/commands/response_from_hmi.h"
+namespace utils {
-namespace sdl_rpc_plugin {
-namespace app_mngr = application_manager;
+bool Signals::UnsubscribeFromTermination() {
+ return MockSignalsPosix::signals_posix_mock()->UnsubscribeFromTermination();
+}
-namespace commands {
+bool Signals::WaitTerminationSignals(sighandler_t sig_handler) {
+ return MockSignalsPosix::signals_posix_mock()->WaitTerminationSignals(
+ sig_handler);
+}
-/**
- * @brief UISetIconResponse command class
- **/
-class UISetIconResponse : public app_mngr::commands::ResponseFromHMI {
- public:
- /**
- * @brief UISetIconResponse class constructor
- *
- * @param message Incoming SmartObject message
- **/
- UISetIconResponse(const app_mngr::commands::MessageSharedPtr& message,
- app_mngr::rpc_service::RPCService& rpc_service,
- app_mngr::HMICapabilities& hmi_capabilities,
- policy::PolicyHandlerInterface& policy_handle);
+bool Signals::UnsubscribeFromLowVoltageSignals(
+ const main_namespace::LowVoltageSignalsOffset& offset_data) {
+ return MockSignalsPosix::signals_posix_mock()
+ ->UnsubscribeFromLowVoltageSignals(offset_data);
+}
- /**
- * @brief UISetIconResponse class destructor
- **/
- virtual ~UISetIconResponse();
+void Signals::SendSignal(const int signo, const pid_t pid) {
+ MockSignalsPosix::signals_posix_mock()->SendSignal(signo, pid);
+}
- /**
- * @brief Execute command
- **/
- virtual void Run();
+void Signals::ExitProcess(const int status) {
+ MockSignalsPosix::signals_posix_mock()->ExitProcess(status);
+}
- private:
- DISALLOW_COPY_AND_ASSIGN(UISetIconResponse);
-};
+void Signals::WaitPid(pid_t cpid, int* status, int options) {
+ MockSignalsPosix::signals_posix_mock()->WaitPid(cpid, status, options);
+}
-} // namespace commands
+pid_t Signals::Fork() {
+ return MockSignalsPosix::signals_posix_mock()->Fork();
+}
-} // namespace application_manager
+MockSignalsPosix* MockSignalsPosix::signals_posix_mock() {
+ static ::testing::NiceMock<MockSignalsPosix> signals_posix_mock;
+ return &signals_posix_mock;
+}
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+} // namespace utils
diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc
deleted file mode 100644
index 99fe4f7dd7..0000000000
--- a/src/components/utils/test/shared_ptr_test.cc
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 2015, 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 <stdlib.h>
-#include <vector>
-#include <iostream>
-#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-
-namespace test {
-namespace components {
-namespace utils_test {
-
-class CMockObject {
- public:
- CMockObject(int id);
- virtual ~CMockObject();
- virtual int getId() const;
-
- MOCK_METHOD0(destructor, void());
-
- private:
- int mId_;
-};
-
-class CExtendedMockObject : public CMockObject {
- public:
- CExtendedMockObject(int id);
-};
-
-using ::testing::NiceMock;
-
-CMockObject::CMockObject(int id) : mId_(id) {}
-
-CMockObject::~CMockObject() {
- destructor();
-}
-
-int CMockObject::getId() const {
- return mId_;
-}
-
-CExtendedMockObject::CExtendedMockObject(int id) : CMockObject(id) {}
-
-typedef utils::SharedPtr<CMockObject> tMockObjectPtr;
-typedef utils::SharedPtr<CExtendedMockObject> tExtendedMockObjectPtr;
-
-TEST(SharedPtrTest, DefaultConstructorTest) {
- // Constructor checks
- tMockObjectPtr p0;
- ASSERT_EQ(0, p0.get());
- ASSERT_FALSE(p0.valid());
-}
-
-TEST(SharedPtrTest, ConstructorWithOneParameterTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- // Constructor checks
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, CopyConstructorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- // Constructor checks
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(p1);
- ASSERT_EQ(1, p2->getId());
- ASSERT_EQ(2u, *(p2.get_ReferenceCounter()));
- tMockObjectPtr p3 = p2;
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(3u, *(p3.get_ReferenceCounter()));
- {
- tMockObjectPtr p4 = p3;
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(4u, *(p3.get_ReferenceCounter()));
- }
- // Check reference counter decreased
- ASSERT_EQ(3u, *(p3.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, SecondConstructorWithOneParameterTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(2);
- EXPECT_CALL(*object1, destructor()).Times(0);
-
- // Constructors checks
- tExtendedMockObjectPtr p1(object1);
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(p1);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(2u, *(p2.get_ReferenceCounter()));
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, AssignmentOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
-
- p5 = p2;
-
- // Check reference counter for new SharedPtr increased
- ASSERT_EQ(2, p5->getId());
- ASSERT_EQ(2u, *(p5.get_ReferenceCounter()));
-
- // Check reference counter for old SharedPtr decreased
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(3u, *(p1.get_ReferenceCounter()));
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, SecondAssignmentOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
- // Use assignment operator
- p5 = p2;
-
- // Check reference counter for new SharedPtr increased
- ASSERT_EQ(2, p5->getId());
- ASSERT_EQ(2u, *(p5.get_ReferenceCounter()));
-
- // Check reference counter for old SharedPtr decreased
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(3u, *(p1.get_ReferenceCounter()));
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, EqualOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- ASSERT_EQ(1, p3->getId());
- ASSERT_EQ(2u, *(p3.get_ReferenceCounter()));
-
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
-
- tMockObjectPtr p5(p4);
- ASSERT_EQ(1, p5->getId());
- ASSERT_EQ(4u, *(p5.get_ReferenceCounter()));
- // Checks
- ASSERT_TRUE(p1 == p3);
- ASSERT_TRUE(p1 == p4);
- ASSERT_TRUE(p4 == p3);
- ASSERT_FALSE(p1 == p2);
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, LessThanOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- // Checks
- if (object1 < object2) {
- ASSERT_TRUE(p1 < p2);
- } else {
- ASSERT_FALSE(p1 < p2);
- }
-
- EXPECT_CALL(*object1, destructor());
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, StaticPointerCastTest_DerivedToBase_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Derived class to SharedPtr to Base class
- p1 = utils::SharedPtr<CExtendedMockObject>::static_pointer_cast<CMockObject>(
- ep1);
- // Checks
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(2u, *(p1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, StaticPointerCastTest_BaseToDerived_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Base class to SharedPtr to Derived class
- ep1 = utils::SharedPtr<CMockObject>::static_pointer_cast<CExtendedMockObject>(
- p1);
- // Checks
- ASSERT_EQ(1, ep1->getId());
- ASSERT_EQ(2u, *(ep1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, DynamicPointerCastTest_DerivedToBase_ExpectCastOk) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(0);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Derived class to SharedPtr to Base class
- p1 = utils::SharedPtr<CExtendedMockObject>::dynamic_pointer_cast<CMockObject>(
- ep1);
- // Checks
- ASSERT_EQ(2, p1->getId());
- ASSERT_EQ(2u, *(p1.get_ReferenceCounter()));
- ASSERT_TRUE(p1 == ep1);
-
- EXPECT_CALL(*object2, destructor());
-}
-
-TEST(SharedPtrTest, DynamicPointerCastTest_BaseToDerived_ExpectNullPtr) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(0);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- ASSERT_EQ(1, p1->getId());
- ASSERT_EQ(1u, *(p1.get_ReferenceCounter()));
-
- tExtendedMockObjectPtr ep1(object2);
- ASSERT_EQ(2, ep1->getId());
- ASSERT_EQ(1u, *(ep1.get_ReferenceCounter()));
- // Cast from SharedPtr to Base class to SharedPtr to Derived class
- ep1 =
- utils::SharedPtr<CMockObject>::dynamic_pointer_cast<CExtendedMockObject>(
- p1);
- // Checks
- ASSERT_EQ(NULL, ep1);
-
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, ArrowOperatorTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tExtendedMockObjectPtr ep1(object1);
- // Check
- ASSERT_EQ(1, ep1->getId());
-
- tMockObjectPtr p1(ep1);
- // Check
- ASSERT_EQ(1, p1->getId());
-
- tExtendedMockObjectPtr ep2(object2);
- // Check
- ASSERT_EQ(2, ep2->getId());
-}
-
-TEST(SharedPtrTest, DereferenceOperatorTest) {
- // Arrange
- CExtendedMockObject* object1 = new CExtendedMockObject(1);
- CExtendedMockObject* object2 = new CExtendedMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tExtendedMockObjectPtr ep1(object1);
- // Check
- ASSERT_EQ(1, (*ep1).getId());
-
- tMockObjectPtr p1(ep1);
- // Check
- ASSERT_EQ(1, (*p1).getId());
-
- tExtendedMockObjectPtr ep2(object2);
- // Check
- ASSERT_EQ(2, (*ep2).getId());
-}
-
-TEST(SharedPtrTest, BoolOperatorTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2;
-
- // Checks
- ASSERT_TRUE(p1);
- ASSERT_FALSE(p2);
- EXPECT_CALL(*object1, destructor());
-}
-
-TEST(SharedPtrTest, ResetWithoutArgsTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(2);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2(object2);
- ASSERT_EQ(2, p2->getId());
- ASSERT_EQ(1u, *(p2.get_ReferenceCounter()));
-
- tMockObjectPtr p3(p1);
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
- // Act
- p2.reset();
- // Check
- EXPECT_EQ(NULL, p2.get());
- EXPECT_EQ(1u, *(p2.get_ReferenceCounter()));
- p4.reset();
- // Check
- EXPECT_EQ(NULL, p4.get());
- EXPECT_EQ(1u, *(p4.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, ResetWithArgumentTest) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- CMockObject* object2 = new CMockObject(27);
-
- EXPECT_CALL(*object1, destructor()).Times(1);
- EXPECT_CALL(*object2, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p3(p1);
- tMockObjectPtr p4(p3);
- ASSERT_EQ(1, p4->getId());
- ASSERT_EQ(3u, *(p4.get_ReferenceCounter()));
- // Act
- p4.reset(object2);
- // Check
- EXPECT_EQ(27, (*p4).getId());
- EXPECT_EQ(1u, *(p4.get_ReferenceCounter()));
-}
-
-TEST(SharedPtrTest, GetMethodTest_ExpectObjPointer) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
- tMockObjectPtr p1(object1);
- // Check
- ASSERT_EQ(object1, p1.get());
-}
-
-TEST(SharedPtrTest, ValidMethodTest_ExpectCorrectValidation) {
- // Arrange
- CMockObject* object1 = new CMockObject(1);
- EXPECT_CALL(*object1, destructor()).Times(1);
-
- tMockObjectPtr p1(object1);
- tMockObjectPtr p2;
- // Check
- ASSERT_TRUE(p1.valid());
- ASSERT_FALSE(p2.valid());
-}
-
-TEST(SharedPtrTest, DISABLED_StressTest) {
- // Arrange
- const size_t kNumIterations = 1024U * 1024U;
-
- size_t objectCreated = 0U;
- size_t pointersCopied = 0U;
- std::vector<tMockObjectPtr> objects;
-
- for (size_t i = 0U; i < kNumIterations; ++i) {
- if ((true == objects.empty()) || (0 == rand() % 256)) {
- CMockObject* object = new CMockObject(0);
- EXPECT_CALL(*object, destructor());
- objects.push_back(object);
- ++objectCreated;
- } else {
- size_t objectIndex = static_cast<size_t>(rand()) % objects.size();
-
- if (rand() % 2) {
- objects.push_back(objects[objectIndex]);
- ++pointersCopied;
- } else {
- objects.erase(objects.begin() + objectIndex);
- }
- }
- }
- printf("%zu objects created, %zu pointers copied\n",
- objectCreated,
- pointersCopied);
-}
-
-} // namespace utils_test
-} // namespace components
-} // namespace test
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index cf3e2c692c..58a2cf5873 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -5,7 +5,8 @@ include(ExternalProject)
set(intergen_SOURCES "${CMAKE_CURRENT_LIST_DIR}/intergen")
set(intergen_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/intergen")
set(intergen_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/intergen")
-set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR})
+set(intergen_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_INSTALL_PREFIX=${intergen_INSTALL_DIR} -DCMAKE_CXX_FLAGS="-std=gnu++0x")
+
ExternalProject_Add(intergen
SOURCE_DIR ${intergen_SOURCES}
diff --git a/tools/InterfaceGenerator/MsgVersionGenerate.py b/tools/InterfaceGenerator/MsgVersionGenerate.py
index 86251cd419..4a24a3239f 100644
--- a/tools/InterfaceGenerator/MsgVersionGenerate.py
+++ b/tools/InterfaceGenerator/MsgVersionGenerate.py
@@ -12,14 +12,25 @@ def generate_msg_version(file_name, path_to_storage):
"""
tree = xml.etree.ElementTree.parse(file_name)
root = tree.getroot()
- if (root.tag == "interface" and "version" in root.attrib):
+ if (root.tag == "interface" and "version" and "minVersion" in root.attrib):
check_version_format(root.attrib["version"])
array = (root.attrib["version"]).split(".")
major_version = array[0]
minor_version = array[1]
patch_version = array[2]
- if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit):
- data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version)
+
+ check_minimum_version_format(root.attrib["minVersion"])
+ minimum_version_array = (root.attrib["minVersion"]).split(".")
+ if (len(minimum_version_array) == 2):
+ minimum_version_array.append("0")
+ minimum_major_version = minimum_version_array[0]
+ minimum_minor_version = minimum_version_array[1]
+ minimum_patch_version = minimum_version_array[2]
+
+ if (major_version.isdigit() and minor_version.isdigit() and patch_version.isdigit() and
+ minimum_major_version.isdigit() and minimum_minor_version.isdigit() and minimum_patch_version.isdigit()):
+ data_for_storage = prepare_data_for_storage(major_version, minor_version, patch_version,
+ minimum_major_version, minimum_minor_version, minimum_patch_version)
store_data_to_file(path_to_storage, data_for_storage)
else:
raise RPCBase.ParseError("Attribute version has incorect value in MOBILE_API.xml")
@@ -45,7 +56,16 @@ def check_version_format(version):
raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
"Need format of version major_version.minor_version.patch_version")
-def prepare_data_for_storage(major_version, minor_version, patch_version):
+
+def check_minimum_version_format(version):
+ """Checks correctness of format of version
+ """
+ p = re.compile('\d+\\.\d+\\.\d+|\d+\\.\d+')
+ result = p.match(version)
+ if result == None or (result.end() != len(version)):
+ raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
+ "Need format of minVersion major_version.minor_version or major_version.minor_version.patch_version")
+def prepare_data_for_storage(major_version, minor_version, patch_version, minimum_major_version, minimum_minor_version, minimum_patch_version):
"""Prepares data to store to file.
"""
temp = Template(
@@ -80,8 +100,12 @@ def prepare_data_for_storage(major_version, minor_version, patch_version):
u'''const uint16_t major_version = $m_version;\n'''
u'''const uint16_t minor_version = $min_version;\n'''
u'''const uint16_t patch_version = $p_version;\n'''
+ u'''const uint16_t minimum_major_version = $min_major_version;\n'''
+ u'''const uint16_t minimum_minor_version = $min_minor_version;\n'''
+ u'''const uint16_t minimum_patch_version = $min_patch_version;\n'''
u'''} // namespace application_manager\n'''
u'''#endif // GENERATED_MSG_VERSION_H''')
- data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version)
+ data_to_file = temp.substitute(m_version = major_version, min_version = minor_version, p_version = patch_version,
+ min_major_version = minimum_major_version, min_minor_version = minimum_minor_version, min_patch_version = minimum_patch_version)
return data_to_file
diff --git a/tools/InterfaceGenerator/generator/Model.py b/tools/InterfaceGenerator/generator/Model.py
index ee458d934a..e7cce732ed 100755
--- a/tools/InterfaceGenerator/generator/Model.py
+++ b/tools/InterfaceGenerator/generator/Model.py
@@ -124,7 +124,8 @@ class InterfaceItemBase(object):
"""
def __init__(self, name, description=None, design_description=None,
- issues=None, todos=None, platform=None, default_value=None, scope=None):
+ issues=None, todos=None, platform=None, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
self.name = name
self.description = description if description is not None else []
self.design_description = \
@@ -134,6 +135,11 @@ class InterfaceItemBase(object):
self.platform = platform
self.default_value = default_value
self.scope = scope
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
+ self.history = history
class EnumElement(InterfaceItemBase):
@@ -149,13 +155,18 @@ class EnumElement(InterfaceItemBase):
def __init__(self, name, description=None, design_description=None,
issues=None, todos=None, platform=None, internal_name=None,
- value=None):
+ value=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(EnumElement, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform)
+ platform=platform, history=history)
self.internal_name = internal_name
self.value = value
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
+
@property
def primary_name(self):
@@ -180,15 +191,19 @@ class Enum(InterfaceItemBase):
def __init__(self, name, description=None, design_description=None,
issues=None, todos=None, platform=None, internal_scope=None,
- elements=None, scope=None):
+ elements=None, scope=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(Enum, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, history=history)
self.internal_scope = internal_scope
self.elements = \
elements if elements is not None else collections.OrderedDict()
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
class EnumSubset(InterfaceItemBase):
@@ -204,15 +219,19 @@ class EnumSubset(InterfaceItemBase):
def __init__(self, name, enum, description=None, design_description=None,
issues=None, todos=None, platform=None,
- allowed_elements=None):
+ allowed_elements=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(EnumSubset, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform)
+ platform=platform, history=history)
self.enum = enum
self.allowed_elements = \
allowed_elements if allowed_elements is not None else {}
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed = removed
class Param(InterfaceItemBase):
@@ -229,15 +248,20 @@ class Param(InterfaceItemBase):
def __init__(self, name, param_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, is_mandatory=True, default_value=None, scope=None):
+ platform=None, is_mandatory=True, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(Param, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, default_value=default_value, scope=scope)
+ platform=platform, default_value=default_value, scope=scope, history=history)
self.is_mandatory = is_mandatory
self.param_type = param_type
self.default_value = default_value
+ self.since = since
+ self.until = until
+ self.deprecated = deprecated
+ self.removed=removed
class FunctionParam(Param):
@@ -251,11 +275,13 @@ class FunctionParam(Param):
def __init__(self, name, param_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, is_mandatory=True, default_value=None, scope=None):
+ platform=None, is_mandatory=True, default_value=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(FunctionParam, self).__init__(
name, param_type=param_type, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, is_mandatory=is_mandatory, default_value=default_value, scope=scope)
+ platform=platform, is_mandatory=is_mandatory, default_value=default_value,
+ scope=scope, since=since, until=until, deprecated=deprecated, removed=removed, history=history)
self.default_value = default_value
@@ -270,11 +296,13 @@ class Struct(InterfaceItemBase):
"""
def __init__(self, name, description=None, design_description=None,
- issues=None, todos=None, platform=None, members=None, scope=None):
+ issues=None, todos=None, platform=None, members=None, scope=None,
+ since=None, until=None, deprecated=None, removed=None, history=None):
super(Struct, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, since=since, until=until,
+ deprecated=deprecated, removed=removed, history=history)
self.members = \
members if members is not None else collections.OrderedDict()
@@ -293,11 +321,11 @@ class Function(InterfaceItemBase):
def __init__(self, name, function_id, message_type, description=None,
design_description=None, issues=None, todos=None,
- platform=None, params=None, scope=None):
+ platform=None, params=None, scope=None, since=None, until=None, deprecated=None, removed=None, history=None):
super(Function, self).__init__(
name, description=description,
design_description=design_description, issues=issues, todos=todos,
- platform=platform, scope=scope)
+ platform=platform, scope=scope, since=since, until=until, deprecated=deprecated, removed=removed, history=history)
self.function_id = function_id
self.message_type = message_type
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
index d13ac29c9b..c6a0145ac6 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
@@ -505,7 +505,6 @@ class CodeGenerator(object):
String with structs implementation source code.
"""
-
processed_enums = []
return self._struct_impl_template.substitute(
namespace=namespace,
@@ -518,9 +517,46 @@ class CodeGenerator(object):
schema_items_decl=self._gen_schema_items_decls(
struct.members.values()),
schema_item_fill=self._gen_schema_items_fill(
- struct.members.values())),
+ struct.members.values(), struct.since, struct.until, struct.deprecated, struct.removed)),
1))
+
+ def _enum_has_history_present(self, enum):
+ '''
+ Check if any elements in an enum has history signature
+ '''
+ for element in enum.param_type.elements.values():
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+ def _element_has_history_present(self, element):
+ '''
+ Check if a specific element has a history signature
+ '''
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+ def _enum_param_type_has_history_present(self, param_type):
+ '''
+ Check if any elements in an enum has history signature
+ '''
+ for element in param_type.elements.values():
+ if ( element.history is not None or
+ element.since is not None or
+ element.until is not None or
+ element.removed is not None ):
+ return True
+ return False
+
+
def _gen_schema_loc_decls(self, members, processed_enums):
"""Generate local declarations of variables for schema.
@@ -540,6 +576,7 @@ class CodeGenerator(object):
for member in members:
if type(member.param_type) is Model.Enum and \
member.param_type.name not in processed_enums:
+ has_history = self._enum_has_history_present(member)
local_var = self._gen_schema_loc_emum_var_name(
member.param_type)
result = u"\n".join(
@@ -555,6 +592,46 @@ class CodeGenerator(object):
enum=member.param_type.name,
value=x.primary_name)
for x in member.param_type.elements.values()])])
+
+ if has_history == True:
+ history_result = u"\n"
+ history_result += self._impl_code_loc_decl_enum_history_set_template.substitute(
+ type=member.param_type.name)
+ history_result += u"\n"
+ history_result += u"\n".join(
+ [self._impl_code_loc_decl_enum_history_set_value_init_template.substitute(
+ enum=member.param_type.name,
+ value=x.primary_name)
+ for x in member.param_type.elements.values() if self._element_has_history_present(x)])
+ history_result += u"\n"
+ history_map_result = []
+
+ for x in member.param_type.elements.values():
+ if self._element_has_history_present(x):
+ history_map_result.append(
+ self._impl_code_loc_decl_enum_history_set_insert_template.
+ substitute(
+ enum=member.param_type.name,
+ value=x.primary_name,
+ since=x.since if x.since is not None else "",
+ until=x.until if x.until is not None else "",
+ removed=x.removed if x.removed is not None else u"false"))
+ if(x.history is not None) :
+ history_list = x.history
+ for item in history_list:
+ history_map_result.append(
+ self._impl_code_loc_decl_enum_history_set_insert_template.
+ substitute(
+ enum=member.param_type.name,
+ value=x.primary_name,
+ since=item.since if item.since is not None else "",
+ until=item.until if item.until is not None else "",
+ removed=item.removed if item.removed is not None else u"false"))
+
+ history_result += u"\n".join(history_map_result)
+ result += "\n"
+ result += history_result
+
processed_enums.append(member.param_type.name)
result = u"".join([result, u"\n\n"]) if result else u""
elif type(member.param_type) is Model.EnumSubset:
@@ -599,10 +676,40 @@ class CodeGenerator(object):
"""
- result = u"\n\n".join(
- [self._gen_schema_item_decl(x) for x in members])
+ result_array = []
+ for x in members:
+ result_array.append(self._gen_schema_item_decl(x))
+ count = 0
+ if x.history is not None:
+ history_list = x.history
+ for item in history_list:
+ item.name += "_history_v" + str(len(history_list)-count)
+ result_array.append(self._gen_schema_item_decl(item))
+ count += 1
+ result_array.append(self._gen_history_vector_decl(history_list, x.name))
+
+ result = u"\n\n".join(result_array)
+ return result
+
+ def _gen_history_vector_decl(self, history_list, name):
+ """Generate History Vector Declaration.
+
+ Generates the declaration and initialization
+ of a vector of schema items
+
+ Arguments:
+ history_list -> list of history items
+ name -> name of parent parameter name
+
+ Returns:
+ String with history array code.
+ """
+ result_array = []
+ result_array.append(self._impl_code_shared_ptr_vector_template.substitute(var_name = name))
+ result = u"\n".join(result_array)
+ return result
+
- return u"".join([result, u"\n\n"]) if result else u""
def _gen_schema_item_decl(self, member):
"""Generate schema item declaration.
@@ -696,16 +803,30 @@ class CodeGenerator(object):
code = self._impl_code_struct_item_template.substitute(
name=param.name)
elif type(param) is Model.Enum:
- code = self._impl_code_enum_item_template.substitute(
- type=param.name,
- params=u"".join(
- [self._gen_schema_loc_emum_var_name(param),
- u", ",
- self._gen_schema_item_param_values(
- [[u"".join([param.name, u"::eType"]),
- u"".join([param.name, u"::",
- default_value.primary_name]) if
- default_value is not None else None]])]))
+ if self._enum_param_type_has_history_present(param):
+ code = self._impl_code_enum_item_with_history_template.substitute(
+ type=param.name,
+ params=u"".join(
+ [self._gen_schema_loc_emum_var_name(param),
+ u", ",
+ self._impl_gen_schema_enum_history_map_template.substitute(name=param.name),
+ u", ",
+ self._gen_schema_item_param_values(
+ [[u"".join([param.name, u"::eType"]),
+ u"".join([param.name, u"::",
+ default_value.primary_name]) if
+ default_value is not None else None]])]))
+ else:
+ code = self._impl_code_enum_item_template.substitute(
+ type=param.name,
+ params=u"".join(
+ [self._gen_schema_loc_emum_var_name(param),
+ u", ",
+ self._gen_schema_item_param_values(
+ [[u"".join([param.name, u"::eType"]),
+ u"".join([param.name, u"::",
+ default_value.primary_name]) if
+ default_value is not None else None]])]))
elif type(param) is Model.EnumSubset:
code = self._impl_code_enum_item_template.substitute(
type=param.enum.name,
@@ -746,7 +867,7 @@ class CodeGenerator(object):
return result
- def _gen_schema_items_fill(self, members):
+ def _gen_schema_items_fill(self, members=None, since=None, until=None, deprecated=None, removed=None):
"""Generate schema items fill code.
Generates source code that fills new schema with items.
@@ -758,10 +879,16 @@ class CodeGenerator(object):
String with function schema items fill code.
"""
-
- result = u"\n".join(
- [self._gen_schema_item_fill(x) for x in members])
-
+ result_array = []
+ for x in members:
+ #If history, create Smember History vector first
+ if x.history is not None:
+ history_list = x.history
+ for item in history_list:
+ result_array.append(self._gen_history_vector_item_fill(item, x.name))
+ result_array.append(self._gen_schema_item_fill(x, since, until, deprecated, removed))
+
+ result = u"\n".join(result_array)
return u"".join([result, u"\n\n"]) if result else u""
def _gen_schema_params_fill(self, message_type_name):
@@ -781,7 +908,34 @@ class CodeGenerator(object):
raise GenerateError("Unexpected call to the unimplemented function.")
- def _gen_schema_item_fill(self, member):
+ def _check_member_history(self, member):
+ """
+ Checks set of rules that history items are valid
+ Raises error if rules are violated
+ """
+ if (member.since is None and
+ member.until is None and
+ member.deprecated is None and
+ member.removed is None and
+ member.history is None):
+ return
+ if (member.history is not None and member.since is None):
+ raise GenerateError("Error: Missing since version parameter for " + member.name)
+ if (member.until is not None):
+ raise GenerateError("Error: Until should only exist in history tag for " + member.name)
+ if (member.history is None):
+ if(member.until is not None or
+ member.deprecated is not None or
+ member.removed is not None):
+ raise GenerateError("Error: No history present for " + member.name)
+ if (member.deprecated is not None and member.removed is not None):
+ raise GenerateError("Error: Deprecated and removed should not be present together for " + member.name)
+ if(member.history is not None):
+ for item in member.history:
+ if item.since is None or item.until is None:
+ raise GenerateError("Error: History items require since and until parameters for " + member.name)
+
+ def _gen_schema_item_fill(self, member, since, until, deprecated, removed):
"""Generate schema item fill code.
Generates source code that fills new schema with item.
@@ -793,11 +947,62 @@ class CodeGenerator(object):
String with schema item fill code.
"""
+ self._check_member_history(member)
+
+ if (since is not None or
+ member.since is not None):
+ if member.history is not None:
+ return self._impl_code_item_fill_template_with_version_and_history_vector.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else since if since is not None else "",
+ until=member.until if member.until is not None else until if until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else deprecated if deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else removed if removed is not None else u"false",
+ vector_name=member.name)
+ else:
+ return self._impl_code_item_fill_template_with_version.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else since if since is not None else "",
+ until=member.until if member.until is not None else until if until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else deprecated if deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else removed if removed is not None else u"false")
+ else:
+ return self._impl_code_item_fill_template.substitute(
+ name=member.name,
+ var_name=self._gen_schema_item_var_name(member),
+ is_mandatory=u"true" if member.is_mandatory is True else u"false")
- return self._impl_code_item_fill_template.substitute(
- name=member.name,
- var_name=self._gen_schema_item_var_name(member),
- is_mandatory=u"true" if member.is_mandatory is True else u"false")
+ def _gen_history_vector_item_fill(self, member, vector_name):
+ """Generate schema item fill code.
+
+ Generates source code that fills history vector with item.
+
+ Keyword arguments:
+ member -- struct member/function parameter to process.
+
+ Returns:
+ String with schema item fill code.
+
+ """
+
+ if (member.since is not None or
+ member.until is not None or
+ member.deprecated is not None or
+ member.removed is not None):
+ return self._impl_code_append_history_vector_template.substitute(
+ vector_name=vector_name,
+ name=member.name,
+ mandatory=u"true" if member.is_mandatory is True else u"false",
+ since=member.since if member.since is not None else "",
+ until=member.until if member.until is not None else "",
+ deprecated=member.deprecated if member.deprecated is not None else u"false",
+ removed=member.removed if member.removed is not None else u"false")
+ else:
+ print "Warning! History item does not have any version history. Omitting %s" % member.name
@staticmethod
def _gen_schema_item_var_name(member):
@@ -899,7 +1104,7 @@ class CodeGenerator(object):
schema_items_decl=self._gen_schema_items_decls(
function.params.values()),
schema_item_fill=self._gen_schema_items_fill(
- function.params.values()),
+ function.params.values(), function.since, function.until, function.deprecated, function.removed),
schema_params_fill=self._gen_schema_params_fill(
function.message_type.name)),
1))
@@ -1283,7 +1488,6 @@ class CodeGenerator(object):
u'''#include "formatters/CSmartFactory.h"\n'''
u'''#include "smart_objects/smart_schema.h"\n'''
u'''#include "smart_objects/schema_item.h"\n'''
- u'''#include "utils/shared_ptr.h"\n'''
u'''#include "$header_file_name"\n'''
u'''\n'''
u'''$namespace_open'''
@@ -1368,10 +1572,10 @@ class CodeGenerator(object):
u'''#include "smart_objects/number_schema_item.h"\n'''
u'''#include "smart_objects/schema_item_parameter.h"\n'''
u'''\n'''
- u'''using namespace NsSmartDeviceLink::NsSmartObjects;\n'''
+ u'''using namespace ns_smart_device_link::ns_smart_objects;\n'''
u'''\n'''
u'''$namespace::$class_name::$class_name()\n'''
- u''' : NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, '''
+ u''' : ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, '''
u'''messageType::eType, StructIdentifiers::eType>() {\n'''
u''' TStructsSchemaItems struct_schema_items;\n'''
u''' InitStructSchemes(struct_schema_items);\n'''
@@ -1386,7 +1590,7 @@ class CodeGenerator(object):
u'''message_type_items);\n'''
u'''}\n'''
u'''\n'''
- u'''utils::SharedPtr<ISchemaItem> $namespace::$class_name::'''
+ u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
u'''ProvideObjectSchemaItemForStruct(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const StructIdentifiers::eType struct_id) {\n'''
@@ -1396,7 +1600,7 @@ class CodeGenerator(object):
u''' return it->second;\n'''
u''' }\n'''
u'''\n'''
- u''' return NsSmartDeviceLink::NsSmartObjects::'''
+ u''' return ns_smart_device_link::ns_smart_objects::'''
u'''CAlwaysFalseSchemaItem::create();\n'''
u'''}\n'''
u'''\n'''
@@ -1423,13 +1627,13 @@ class CodeGenerator(object):
u'''\n'''
u'''//-------------- String to value enum mapping ----------------\n'''
u'''\n'''
- u'''namespace NsSmartDeviceLink {\n'''
- u'''namespace NsSmartObjects {\n'''
+ u'''namespace ns_smart_device_link {\n'''
+ u'''namespace ns_smart_objects {\n'''
u'''\n'''
u'''$enum_string_coversions'''
u'''\n'''
- u'''} // NsSmartObjects\n'''
- u'''} // NsSmartDeviceLink\n'''
+ u'''} // ns_smart_objects\n'''
+ u'''} // ns_smart_device_link\n'''
u'''\n''')
_enum_to_str_converter_template = string.Template(
@@ -1465,7 +1669,7 @@ class CodeGenerator(object):
u'''\n''')
_struct_schema_item_template = string.Template(
- u'''utils::SharedPtr<ISchemaItem> struct_schema_item_${name} = '''
+ u'''std::shared_ptr<ISchemaItem> struct_schema_item_${name} = '''
u'''InitStructSchemaItem_${name}(struct_schema_items);\n'''
u'''struct_schema_items.insert(std::make_pair('''
u'''StructIdentifiers::${name}, struct_schema_item_${name}));\n'''
@@ -1474,15 +1678,15 @@ class CodeGenerator(object):
u'''struct_schema_item_${name})));''')
_function_schema_template = string.Template(
- u'''functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::'''
- u'''NsJSONHandler::'''
+ u'''functions_schemes_.insert(std::make_pair(ns_smart_device_link::'''
+ u'''ns_json_handler::'''
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>'''
u'''(FunctionID::$function_id, messageType::$message_type), '''
u'''InitFunction_${function_id}_${message_type}('''
u'''struct_schema_items, function_id_items, message_type_items)));''')
_struct_impl_template = string.Template(
- u'''utils::SharedPtr<ISchemaItem> $namespace::$class_name::'''
+ u'''std::shared_ptr<ISchemaItem> $namespace::$class_name::'''
u'''InitStructSchemaItem_${struct_name}(\n'''
u''' const TStructsSchemaItems &struct_schema_items) {\n'''
u'''$code'''
@@ -1499,12 +1703,31 @@ class CodeGenerator(object):
_impl_code_loc_decl_enum_template = string.Template(
u'''std::set<${type}::eType> ${var_name};''')
+ _impl_code_loc_decl_enum_history_set_template = string.Template(
+ u'''std::map<${type}::eType, std::vector<ElementSignature>> ${type}_element_signatures;''')
+
_impl_code_loc_decl_enum_insert_template = string.Template(
u'''${var_name}.insert(${enum}::${value});''')
+ _impl_code_loc_decl_enum_history_set_value_init_template = string.Template(
+ u'''${enum}_element_signatures[${enum}::${value}] = std::vector<ElementSignature>();'''
+ )
+
+ _impl_code_loc_decl_enum_history_set_insert_template = string.Template(
+ u'''${enum}_element_signatures[${enum}::${value}].push_back(ElementSignature("${since}", "${until}", ${removed}));''')
+
+ _impl_gen_schema_enum_history_map_template = string.Template(
+ u'''${name}_element_signatures''')
+
_impl_code_item_decl_temlate = string.Template(
u'''${comment}'''
- u'''utils::SharedPtr<ISchemaItem> ${var_name} = ${item_decl};''')
+ u'''std::shared_ptr<ISchemaItem> ${var_name} = ${item_decl};''')
+
+ _impl_code_shared_ptr_vector_template = string.Template(
+ u'''std::vector<CObjectSchemaItem::SMember> ${var_name}_history_vector;''')
+
+ _impl_code_append_history_vector_template = string.Template(
+ u'''${vector_name}_history_vector.push_back(CObjectSchemaItem::SMember(${name}_SchemaItem, ${mandatory}, "${since}", "${until}", ${deprecated}, ${removed}));''')
_impl_code_integer_item_template = string.Template(
u'''TNumberSchemaItem<${type}>::create(${params})''')
@@ -1525,6 +1748,9 @@ class CodeGenerator(object):
_impl_code_enum_item_template = string.Template(
u'''TEnumSchemaItem<${type}::eType>::create(${params})''')
+ _impl_code_enum_item_with_history_template = string.Template(
+ u'''TEnumSchemaItem<${type}::eType>::createWithSignatures(${params})''')
+
_impl_code_item_param_value_template = string.Template(
u'''TSchemaItemParameter<$type>($value)''')
@@ -1532,6 +1758,14 @@ class CodeGenerator(object):
u'''schema_members["${name}"] = CObjectSchemaItem::'''
u'''SMember(${var_name}, ${is_mandatory});''')
+ _impl_code_item_fill_template_with_version = string.Template(
+ u'''schema_members["${name}"] = CObjectSchemaItem::'''
+ u'''SMember(${var_name}, ${is_mandatory}, "${since}", "${until}", ${deprecated}, ${removed});''')
+
+ _impl_code_item_fill_template_with_version_and_history_vector = string.Template(
+ u'''schema_members["${name}"] = CObjectSchemaItem::'''
+ u'''SMember(${var_name}, ${is_mandatory}, "${since}", "${until}", ${deprecated}, ${removed}, ${vector_name}_history_vector);''')
+
_function_impl_template = string.Template(
u'''CSmartSchema $namespace::$class_name::'''
u'''InitFunction_${function_id}_${message_type}(\n'''
@@ -1553,11 +1787,11 @@ class CodeGenerator(object):
u'''\n'''
u'''CObjectSchemaItem::Members '''
u'''root_members_map;\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MSG_PARAMS] = '''
u'''CObjectSchemaItem::SMember(CObjectSchemaItem::'''
u'''create(schema_members), true);\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PARAMS] = '''
u'''CObjectSchemaItem::SMember(CObjectSchemaItem::'''
u'''create(params_members), true);\n\n'''
@@ -1566,7 +1800,7 @@ class CodeGenerator(object):
_class_h_template = string.Template(
u'''$comment\n'''
- u'''class $class_name : public NsSmartDeviceLink::NsJSONHandler::'''
+ u'''class $class_name : public ns_smart_device_link::ns_json_handler::'''
u'''CSmartFactory<FunctionID::eType, messageType::eType, '''
u'''StructIdentifiers::eType> {\n'''
u''' public:\n'''
@@ -1580,7 +1814,7 @@ class CodeGenerator(object):
u''' * @brief Type that maps of struct IDs to schema items.\n'''
u''' */\n'''
u''' typedef std::map<const StructIdentifiers::eType, '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::'''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::'''
u'''ISchemaItem> > TStructsSchemaItems;\n'''
u'''\n'''
u''' /**\n'''
@@ -1589,10 +1823,10 @@ class CodeGenerator(object):
u''' * @param struct_schema_items Struct schema items.\n'''
u''' * @param struct_id ID of structure to provide.\n'''
u''' *\n'''
- u''' * @return utils::SharedPtr of strucute\n'''
+ u''' * @return std::shared_ptr of strucute\n'''
u''' */\n'''
u''' static '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> '''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
u'''ProvideObjectSchemaItemForStruct(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const StructIdentifiers::eType struct_id);\n'''
@@ -1623,12 +1857,12 @@ class CodeGenerator(object):
u'''$init_struct_decls'''
u'''};''')
- _function_return_comment = u''' * @return NsSmartDeviceLink::''' \
- u'''NsSmartObjects::CSmartSchema\n'''
+ _function_return_comment = u''' * @return ns_smart_device_link::''' \
+ u'''ns_smart_objects::CSmartSchema\n'''
_function_decl_template = string.Template(
u'''$comment\n'''
- u'''static NsSmartDeviceLink::NsSmartObjects::CSmartSchema '''
+ u'''static ns_smart_device_link::ns_smart_objects::CSmartSchema '''
u'''InitFunction_${function_id}_${message_type}(\n'''
u''' const TStructsSchemaItems &struct_schema_items,\n'''
u''' const std::set<FunctionID::eType> &function_id_items,\n'''
@@ -1637,7 +1871,7 @@ class CodeGenerator(object):
_struct_decl_template = string.Template(
u'''$comment\n'''
u'''static '''
- u'''utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> '''
+ u'''std::shared_ptr<ns_smart_device_link::ns_smart_objects::ISchemaItem> '''
u'''InitStructSchemaItem_${struct_name}(\n'''
u''' const TStructsSchemaItems &struct_schema_items);''')
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py b/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
index cf9887d39d..6924ec67aa 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py
@@ -94,7 +94,7 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
_error_response_insert_template = string.Template(
u'''functions_schemes_.insert(std::make_pair('''
- u'''NsSmartDeviceLink::NsJSONHandler::'''
+ u'''ns_smart_device_link::ns_json_handler::'''
u'''SmartSchemaKey<FunctionID::eType, messageType::eType>('''
u'''FunctionID::${function_id}, messageType::error_response), '''
u'''error_response_schema));\n''')
@@ -102,32 +102,32 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
_error_response_schema_template = (
u'''CObjectSchemaItem::Members '''
u'''params_members;\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember('''
u'''TEnumSchemaItem<FunctionID::eType>::create('''
u'''function_id_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember('''
u'''TEnumSchemaItem<messageType::eType>::create('''
u'''message_type_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kCode] = CObjectSchemaItem::SMember('''
u'''TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kMessage] = CObjectSchemaItem::SMember('''
u'''CStringSchemaItem::create(), true);\n'''
u'''\n'''
u'''CObjectSchemaItem::Members root_members_map;\n'''
- u'''root_members_map[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''root_members_map[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PARAMS] = CObjectSchemaItem::SMember('''
u'''CObjectSchemaItem::create(params_members), true);\n'''
u'''\n'''
@@ -136,30 +136,30 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
u'''\n''')
_base_params = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::'''
u'''SMember(TEnumSchemaItem<FunctionID::eType>::'''
u'''create(function_id_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::'''
u'''SMember(TEnumSchemaItem<messageType::eType>::'''
u'''create(message_type_items), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
_correlation_id_param = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
_additional_response_params = (
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::'''
+ u'''params_members[ns_smart_device_link::ns_json_handler::'''
u'''strings::kCode] = CObjectSchemaItem::'''
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
)
diff --git a/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py b/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
index b3fb61f4a9..c3244f7e95 100755
--- a/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
+++ b/tools/InterfaceGenerator/generator/generators/SmartFactorySDLRPC.py
@@ -67,23 +67,23 @@ class CodeGenerator(SmartFactoryBase.CodeGenerator):
"""
base_params = \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_FUNCTION_ID] = CObjectSchemaItem::''' \
u'''SMember(TEnumSchemaItem<FunctionID::eType>::''' \
u'''create(function_id_items), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_MESSAGE_TYPE] = CObjectSchemaItem::''' \
u'''SMember(TEnumSchemaItem<messageType::eType>::''' \
u'''create(message_type_items), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n''' \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
correlation_id_param = \
- u'''params_members[NsSmartDeviceLink::NsJSONHandler::''' \
+ u'''params_members[ns_smart_device_link::ns_json_handler::''' \
u'''strings::S_CORRELATION_ID] = CObjectSchemaItem::''' \
u'''SMember(TNumberSchemaItem<int>::create(), true);\n'''
diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
index 4853916dad..21f07e6ac5 100755
--- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py
+++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py
@@ -6,7 +6,7 @@ Contains base parser for SDLRPC v1/v2 and JSON RPC XML format.
import collections
import xml.etree.ElementTree
-
+import re
from generator import Model
@@ -203,16 +203,35 @@ class Parser(object):
internal_scope = None
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "internal_scope":
internal_scope = attributes[attribute]
elif attribute == "scope":
scope = attributes[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
else:
raise ParseError("Unexpected attribute '" + attribute +
"' in enum '" + params["name"] + "'")
params["internal_scope"] = internal_scope
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
elements = collections.OrderedDict()
for subelement in subelements:
@@ -236,13 +255,32 @@ class Parser(object):
params, subelements, attrib = self._parse_base_item(element, prefix)
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attrib:
if attribute == "scope":
scope = attrib[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attrib[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attrib[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attrib[attribute]
else:
raise ParseError("Unexpected attribute '" + attribute +
"' in struct '" + params["name"] + "'")
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
members = collections.OrderedDict()
for subelement in subelements:
@@ -271,13 +309,32 @@ class Parser(object):
attributes)
scope = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "scope":
scope = attributes[attribute]
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
params["function_id"] = function_id
params["message_type"] = message_type
params["scope"] = scope
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
function_params = collections.OrderedDict()
for subelement in subelements:
@@ -359,6 +416,8 @@ class Parser(object):
issues = []
todos = []
subelements = []
+ history = None
+ warnings = []
if "name" not in element.attrib:
raise ParseError("Name is not specified for " + element.tag)
@@ -379,6 +438,12 @@ class Parser(object):
todos.append(self._parse_simple_element(subelement))
elif subelement.tag == "issue":
issues.append(self._parse_issue(subelement))
+ elif subelement.tag == "history":
+ if history is not None:
+ raise ParseError("Elements can only have one history tag: " + element.tag)
+ history = self._parse_history(subelement, prefix, element)
+ elif subelement.tag == "warning":
+ warnings.append(self._parse_simple_element(subelement))
else:
subelements.append(subelement)
@@ -386,6 +451,7 @@ class Parser(object):
params["design_description"] = design_description
params["issues"] = issues
params["todos"] = todos
+ params["history"] = history
return params, subelements, attrib
@@ -443,6 +509,11 @@ class Parser(object):
internal_name = None
value = None
+ since = None
+ until = None
+ deprecated = None
+ removed = None
+ result = None
for attribute in attributes:
if attribute == "internal_name":
internal_name = attributes[attribute]
@@ -452,9 +523,22 @@ class Parser(object):
except:
raise ParseError("Invalid value for enum element: '" +
attributes[attribute] + "'")
+ elif attribute == "since":
+ result = self._parse_version(attributes[attribute])
+ since = result
+ elif attribute == "until":
+ result = self._parse_version(attributes[attribute])
+ until = result
+ elif attribute == "deprecated":
+ deprecated = attributes[attribute]
+ elif attribute == "removed":
+ removed = attributes[attribute]
params["internal_name"] = internal_name
params["value"] = value
-
+ params["since"] = since
+ params["until"] = until
+ params["deprecated"] = deprecated
+ params["removed"] = removed
# Magic usage is correct
# pylint: disable=W0142
return Model.EnumElement(**params)
@@ -548,6 +632,25 @@ class Parser(object):
"""
params, subelements, attrib = self._parse_base_item(element, "")
+ since_version = self._extract_attrib(attrib, "since")
+ if since_version is not None:
+ result = self._parse_version(since_version)
+ params["since"] = result
+
+ until_version = self._extract_attrib(attrib, "until")
+ if until_version is not None:
+ result = self._parse_version(until_version)
+ params["until"] = result
+
+ deprecated = self._extract_attrib(attrib, "deprecated")
+ if deprecated is not None:
+ params["deprecated"] = deprecated
+
+ removed = self._extract_attrib(attrib, "removed")
+ if removed is not None:
+ params["removed"] = removed
+
+
is_mandatory = self._extract_attrib(attrib, "mandatory")
if is_mandatory is None:
raise ParseError("'mandatory' is not specified for parameter '" +
@@ -765,3 +868,48 @@ class Parser(object):
print ("Ignoring attribute '" +
name + "'")
return True
+
+ def _parse_version(self, version):
+ """
+ Validates if a version supplied is in the correct
+ format of Major.Minor.Patch. If Major.Minor format
+ is supplied, a patch version of 0 will be added to
+ the end.
+ """
+ p = re.compile('\d+\\.\d+\\.\d+|\d+\\.\d+')
+ result = p.match(version)
+ if result == None or (result.end() != len(version)):
+ raise RPCBase.ParseError("Incorrect format of version please check MOBILE_API.xml. "
+ "Need format of major_version.minor_version or major_version.minor_version.patch_version")
+
+ version_array = version.split(".")
+ if (len(version_array) == 2):
+ version_array.append("0")
+ dot_str = "."
+ return dot_str.join(version_array)
+
+ def _parse_history(self, history, prefix, parent):
+ if history.tag != "history":
+ raise ParseError("Invalid history tag: " + interface.tag)
+
+ items = []
+
+ for subelement in history:
+ if subelement.tag == "enum" and parent.tag == "enum":
+ items.append(self._parse_enum(subelement, prefix))
+ elif subelement.tag == "element" and parent.tag == "element":
+ items.append(self._parse_enum_element(subelement))
+ elif subelement.tag == "description" and parent.tag == "description":
+ items.append(self._parse_simple_element(subelement))
+ elif subelement.tag == "struct" and parent.tag == "struct":
+ items.append(self._parse_struct(subelement, prefix))
+ elif subelement.tag == "param" and parent.tag == "param":
+ items.append(self._parse_function_param(subelement, prefix))
+ elif subelement.tag == "function" and parent.tag == "function":
+ items.append(self.__parse_function(subelement, prefix))
+ else:
+ raise ParseError("A history tag must be nested within the element it notes the history for. Fix item: '" +
+ parent.attrib["name"] + "'")
+
+ return items
+
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
index b21e320038..c4813d00a8 100755
--- a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
+++ b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py
@@ -17,61 +17,61 @@ from generator import Model
EXPECTED_RESULT_REQUEST = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
EXPECTED_RESULT_RESPONSE = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::kCode] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
EXPECTED_RESULT_NOTIFICATION = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
)
@@ -79,33 +79,33 @@ EXPECTED_RESULT_NOTIFICATION = (
EXPECTED_PRE_FUNCTION_CODE = (
u""" std::map<std::string, CObjectSchemaItem::SMember> """
u"""params_members;\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler"""
+ u""" params_members[ns_smart_device_link::ns_json_handler"""
u"""::strings::kCode] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u""" params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::kMessage] = CObjectSchemaItem::SMember("""
u"""CStringSchemaItem::create(), true);\n"""
u"""\n"""
u""" std::map<std::string, CObjectSchemaItem::SMember> """
u"""root_members_map;\n"""
- u""" root_members_map[NsSmartDeviceLink::NsJSONHandler::"""
+ u""" root_members_map[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PARAMS] = CObjectSchemaItem::SMember("""
u"""CObjectSchemaItem::create(params_members), true);\n"""
u"""\n"""
@@ -113,7 +113,7 @@ EXPECTED_PRE_FUNCTION_CODE = (
u"""root_members_map));\n"""
u"""\n"""
u""" functions_schemes_.insert(std::make_pair("""
- u"""NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<"""
+ u"""ns_smart_device_link::ns_json_handler::SmartSchemaKey<"""
u"""FunctionID::eType, messageType::eType>("""
u"""FunctionID::request, messageType::error_response)"""
u""", error_response_schema));\n"""
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
index 111ffb3cbc..35e4aeb6ce 100755
--- a/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
+++ b/tools/InterfaceGenerator/test/generator/generators/test_SmartFactorySDLRPC.py
@@ -17,23 +17,23 @@ from generator import Model
EXPECTED_NOTIFICATION_RESULT = (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<FunctionID::eType>::create("""
u"""function_id_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember("""
u"""TEnumSchemaItem<messageType::eType>::create("""
u"""message_type_items), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n"""
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n""")
EXPECTED_REQ_RESP_RESULT = "".join([EXPECTED_NOTIFICATION_RESULT, (
- u"""params_members[NsSmartDeviceLink::NsJSONHandler::"""
+ u"""params_members[ns_smart_device_link::ns_json_handler::"""
u"""strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember("""
u"""TNumberSchemaItem<int>::create(), true);\n""")])
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
index 458c27543b..49369d2559 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.cc
@@ -50,7 +50,7 @@
#include "SmartObjects/TNumberSchemaItem.hpp"
#include "SmartObjects/TSchemaItemParameter.hpp"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
XXX::YYY::ZZZ::Test::Test()
: CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType>() {
@@ -77,7 +77,7 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::ProvideObjectSchemaItemForStruct(
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::create();
}
void XXX::YYY::ZZZ::Test::InitStructSchemes(
@@ -96,24 +96,24 @@ void XXX::YYY::ZZZ::Test::InitFunctionSchemes(
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items) {
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kMessage] = CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kMessage] = CObjectSchemaItem::SMember(CStringSchemaItem::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
CSmartSchema error_response_schema(CObjectSchemaItem::create(root_members_map));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::error_response), error_response_schema));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::error_response), error_response_schema));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
}
//------------- Functions schemes initialization -------------
@@ -153,15 +153,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_name1_request(
schema_members["param2"] = CObjectSchemaItem::SMember(param2_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -173,16 +173,16 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_1_response(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::kCode] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -194,14 +194,14 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_2_notification(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -298,8 +298,8 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::InitStructSchemaItem_Struct2(
//-------------- String to value enum mapping ----------------
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const std::map<XXX::YYY::ZZZ::Enum1::eType, std::string> &TEnumSchemaItem<XXX::YYY::ZZZ::Enum1::eType>::getEnumElementsStringRepresentation() {
@@ -380,6 +380,6 @@ const std::map<XXX::YYY::ZZZ::messageType::eType, std::string> &TEnumSchemaItem<
return enum_string_representation;
}
-} // NsSmartObjects
-} // NsSmartDeviceLink
+} // ns_smart_objects
+} // ns_smart_device_link
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
index b265603480..d7310e4d0f 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_jsonrpc.h
@@ -223,7 +223,7 @@ enum eType {
* param2 - value2
* param1 - value1
*/
-class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
+class Test : public ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
public:
/**
* @brief Constructor.
@@ -234,7 +234,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Type that maps of struct IDs to schema items.
*/
- typedef std::map<const StructIdentifiers::eType, NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> > TStructsSchemaItems;
+ typedef std::map<const StructIdentifiers::eType, ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> > TStructsSchemaItems;
/**
* @brief Helper that allows to make reference to struct
@@ -244,7 +244,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
*
* @return TSharedPtr of strucute
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> ProvideObjectSchemaItemForStruct(
const TStructsSchemaItems &struct_schema_items,
const StructIdentifiers::eType struct_id);
@@ -268,9 +268,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function1.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_name1_request(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_name1_request(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -278,9 +278,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_1_response(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_1_response(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -288,9 +288,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_2_notification(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_2_notification(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -304,7 +304,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct1(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct1(
const TStructsSchemaItems &struct_schema_items);
/**
@@ -314,7 +314,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct2(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct2(
const TStructsSchemaItems &struct_schema_items);
};
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
index 53e5b7f78a..a62f485eb9 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.cc
@@ -50,7 +50,7 @@
#include "SmartObjects/TNumberSchemaItem.hpp"
#include "SmartObjects/TSchemaItemParameter.hpp"
-using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace ns_smart_device_link::ns_smart_objects;
XXX::YYY::ZZZ::Test::Test()
: CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType>() {
@@ -76,7 +76,7 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::ProvideObjectSchemaItemForStruct(
return it->second;
}
- return NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem::create();
+ return ns_smart_device_link::ns_smart_objects::CAlwaysFalseSchemaItem::create();
}
void XXX::YYY::ZZZ::Test::InitStructSchemes(
@@ -94,9 +94,9 @@ void XXX::YYY::ZZZ::Test::InitFunctionSchemes(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items) {
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
- functions_schemes_.insert(std::make_pair(NsSmartDeviceLink::NsJSONHandler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::name1, messageType::request), InitFunction_name1_request(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_1, messageType::response), InitFunction_val_1_response(struct_schema_items, function_id_items, message_type_items)));
+ functions_schemes_.insert(std::make_pair(ns_smart_device_link::ns_json_handler::SmartSchemaKey<FunctionID::eType, messageType::eType>(FunctionID::val_2, messageType::notification), InitFunction_val_2_notification(struct_schema_items, function_id_items, message_type_items)));
}
//------------- Functions schemes initialization -------------
@@ -136,15 +136,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_name1_request(
schema_members["param2"] = CObjectSchemaItem::SMember(param2_SchemaItem, true);
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -156,15 +156,15 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_1_response(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -176,14 +176,14 @@ CSmartSchema XXX::YYY::ZZZ::Test::InitFunction_val_2_notification(
std::map<std::string, CObjectSchemaItem::SMember> schema_members;
std::map<std::string, CObjectSchemaItem::SMember> params_members;
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
- params_members[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(function_id_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(message_type_items), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+ params_members[ns_smart_device_link::ns_json_handler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
std::map<std::string, CObjectSchemaItem::SMember> root_members_map;
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
- root_members_map[NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_MSG_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(schema_members), true);
+ root_members_map[ns_smart_device_link::ns_json_handler::strings::S_PARAMS] = CObjectSchemaItem::SMember(CObjectSchemaItem::create(params_members), true);
return CSmartSchema(CObjectSchemaItem::create(root_members_map));
}
@@ -280,8 +280,8 @@ TSharedPtr<ISchemaItem> XXX::YYY::ZZZ::Test::InitStructSchemaItem_Struct2(
//-------------- String to value enum mapping ----------------
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
+namespace ns_smart_device_link {
+namespace ns_smart_objects {
template <>
const std::map<XXX::YYY::ZZZ::Enum1::eType, std::string> &TEnumSchemaItem<XXX::YYY::ZZZ::Enum1::eType>::getEnumElementsStringRepresentation() {
@@ -361,6 +361,6 @@ const std::map<XXX::YYY::ZZZ::messageType::eType, std::string> &TEnumSchemaItem<
return enum_string_representation;
}
-} // NsSmartObjects
-} // NsSmartDeviceLink
+} // ns_smart_objects
+} // ns_smart_device_link
diff --git a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
index 826ea55ce1..cf22f0711f 100644
--- a/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
+++ b/tools/InterfaceGenerator/test/generator/generators/test_expected_sdlrpc.h
@@ -218,7 +218,7 @@ enum eType {
* param2 - value2
* param1 - value1
*/
-class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
+class Test : public ns_smart_device_link::ns_json_handler::CSmartFactory<FunctionID::eType, messageType::eType, StructIdentifiers::eType> {
public:
/**
* @brief Constructor.
@@ -229,7 +229,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Type that maps of struct IDs to schema items.
*/
- typedef std::map<const StructIdentifiers::eType, NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> > TStructsSchemaItems;
+ typedef std::map<const StructIdentifiers::eType, ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> > TStructsSchemaItems;
/**
* @brief Helper that allows to make reference to struct
@@ -239,7 +239,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
*
* @return TSharedPtr of strucute
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> ProvideObjectSchemaItemForStruct(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> ProvideObjectSchemaItemForStruct(
const TStructsSchemaItems &struct_schema_items,
const StructIdentifiers::eType struct_id);
@@ -263,9 +263,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function1.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_name1_request(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_name1_request(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -273,9 +273,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_1_response(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_1_response(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -283,9 +283,9 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
/**
* @brief Method that generates schema for function Function2.
*
- * @return NsSmartDeviceLink::NsSmartObjects::CSmartSchema
+ * @return ns_smart_device_link::ns_smart_objects::CSmartSchema
*/
- static NsSmartDeviceLink::NsSmartObjects::CSmartSchema InitFunction_val_2_notification(
+ static ns_smart_device_link::ns_smart_objects::CSmartSchema InitFunction_val_2_notification(
const TStructsSchemaItems &struct_schema_items,
const std::set<FunctionID::eType> &function_id_items,
const std::set<messageType::eType> &message_type_items);
@@ -299,7 +299,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct1(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct1(
const TStructsSchemaItems &struct_schema_items);
/**
@@ -309,7 +309,7 @@ class Test : public NsSmartDeviceLink::NsJSONHandler::CSmartFactory<FunctionID::
* @note Issue2
* @note Issue3
*/
- static NsSmartDeviceLink::NsSmartObjects::TSharedPtr<NsSmartDeviceLink::NsSmartObjects::ISchemaItem> InitStructSchemaItem_Struct2(
+ static ns_smart_device_link::ns_smart_objects::TSharedPtr<ns_smart_device_link::ns_smart_objects::ISchemaItem> InitStructSchemaItem_Struct2(
const TStructsSchemaItems &struct_schema_items);
};
diff --git a/tools/cmake/modules/FindDBus.cmake b/tools/cmake/modules/FindDBus.cmake
deleted file mode 100644
index 1d0f29dd75..0000000000
--- a/tools/cmake/modules/FindDBus.cmake
+++ /dev/null
@@ -1,59 +0,0 @@
-# - Try to find DBus
-# Once done, this will define
-#
-# DBUS_FOUND - system has DBus
-# DBUS_INCLUDE_DIRS - the DBus include directories
-# DBUS_LIBRARIES - link these to use DBus
-#
-# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. 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.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS 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 ITS
-# 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.
-
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_DBUS QUIET dbus-1)
-
-FIND_LIBRARY(DBUS_LIBRARIES
- NAMES dbus-1
- HINTS ${PC_DBUS_LIBDIR}
- ${PC_DBUS_LIBRARY_DIRS}
-)
-
-FIND_PATH(DBUS_INCLUDE_DIR
- NAMES dbus/dbus.h
- HINTS ${PC_DBUS_INCLUDEDIR}
- ${PC_DBUS_INCLUDE_DIRS}
-)
-
-GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} PATH)
-FIND_PATH(DBUS_ARCH_INCLUDE_DIR
- NAMES dbus/dbus-arch-deps.h
- HINTS ${PC_DBUS_INCLUDEDIR}
- ${PC_DBUS_INCLUDE_DIRS}
- ${_DBUS_LIBRARY_DIR}
- ${DBUS_INCLUDE_DIR}
- PATH_SUFFIXES include
-)
-
-SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES) \ No newline at end of file
diff --git a/tools/cmake/modules/FindQt5DBus.cmake b/tools/cmake/modules/FindQt5DBus.cmake
deleted file mode 100644
index d850010e97..0000000000
--- a/tools/cmake/modules/FindQt5DBus.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-execute_process(
- COMMAND ${CMAKE_SOURCE_DIR}/FindQt.sh -v ${qt_version} Qt5DBusConfig.cmake
- OUTPUT_VARIABLE config_file
-)
-
-if(config_file STREQUAL "")
- message(FATAL_ERROR "Qt5 DBus module not found")
-endif(config_file STREQUAL "")
-
-include(${config_file})
diff --git a/tools/intergen/GenerateInterfaceLibrary.cmake b/tools/intergen/GenerateInterfaceLibrary.cmake
index bec35e1e3a..31b06880c6 100644
--- a/tools/intergen/GenerateInterfaceLibrary.cmake
+++ b/tools/intergen/GenerateInterfaceLibrary.cmake
@@ -11,20 +11,14 @@ set(GENERATED_LIB_HEADER_DEPENDENCIES
# |generated_interface_names| should contain list of generated interfaces
# if |AUTO_FUNC_IDS| is added to argument list, intergen is called with "-a"
# flag telling intergen to generate function ids automatically
-# if |DBUS_SUPPORT| is added to argument list, intergen is called with "-d"
-# flag that enables DBus serialization code generation
# from xml_file (intergen creates separate directory for every interface).
# Their names are written lowercase_underscored_style.
function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
- set(options AUTO_FUNC_IDS DBUS_SUPPORT)
+ set(options AUTO_FUNC_IDS)
cmake_parse_arguments(GenerateInterfaceLibrary "${options}" "" "" ${ARGN})
if (GenerateInterfaceLibrary_AUTO_FUNC_IDS)
set(AUTOID "-a")
endif()
- if (GenerateInterfaceLibrary_DBUS_SUPPORT)
- set(NEED_DBUS "-d")
- list(APPEND GENERATED_LIB_HEADER_DEPENDENCIES ${DBUS_INCLUDE_DIRS})
- endif()
foreach(interface_name ${generated_interface_names})
set(HEADERS
@@ -41,7 +35,7 @@ function (GenerateInterfaceLibrary xml_file_name generated_interface_names)
${interface_name}/interface.cc
)
add_custom_command( OUTPUT ${HEADERS} ${SOURCES}
- COMMAND ${INTERGEN_CMD} -f ${CMAKE_CURRENT_SOURCE_DIR}/${xml_file_name} -j ${AUTOID} ${NEED_DBUS} -i ${interface_name}
+ COMMAND ${INTERGEN_CMD} -f ${CMAKE_CURRENT_SOURCE_DIR}/${xml_file_name} -j ${AUTOID} -i ${interface_name}
DEPENDS ${INTERGEN_CMD} ${xml_file_name}
COMMENT "Generating interface ${interface_name} from ${xml_file_name}"
VERBATIM
diff --git a/tools/intergen/cppgen/CMakeLists.txt b/tools/intergen/cppgen/CMakeLists.txt
index c6e052a2ae..d20f3d9ab3 100644
--- a/tools/intergen/cppgen/CMakeLists.txt
+++ b/tools/intergen/cppgen/CMakeLists.txt
@@ -27,7 +27,6 @@ set (SOURCES
src/cppgen/namespace.cc
src/cppgen/naming_convention.cc
src/cppgen/struct_type_constructor.cc
- src/cppgen/struct_type_dbus_serializer.cc
src/cppgen/struct_type_from_json_method.cc
src/cppgen/struct_type_is_initialized_method.cc
src/cppgen/struct_type_is_valid_method.cc
@@ -58,7 +57,6 @@ set (HEADERS
include/cppgen/namespace.h
include/cppgen/naming_convention.h
include/cppgen/struct_type_constructor.h
- include/cppgen/struct_type_dbus_serializer.h
include/cppgen/struct_type_from_json_method.h
include/cppgen/struct_type_is_initialized_method.h
include/cppgen/struct_type_is_valid_method.h
diff --git a/tools/intergen/cppgen/include/cppgen/generator_preferences.h b/tools/intergen/cppgen/include/cppgen/generator_preferences.h
index 5278a24417..d0a58950e2 100644
--- a/tools/intergen/cppgen/include/cppgen/generator_preferences.h
+++ b/tools/intergen/cppgen/include/cppgen/generator_preferences.h
@@ -43,18 +43,15 @@ struct TypePreferences {
int minimum_interger_size;
bool avoid_unsigned;
bool generate_json;
- bool generate_dbus;
TypePreferences(int minimum_interger_size,
bool avoid_unsigned,
- bool generate_json,
- bool generate_dbus);
+ bool generate_json);
};
struct Preferences {
Preferences(int minimum_interger_size,
bool avoid_unsigned,
bool generate_json,
- bool generate_dbus,
const std::set<std::string>& requested_interfaces);
TypePreferences type_preferences;
std::set<std::string> requested_interfaces;
diff --git a/tools/intergen/cppgen/include/cppgen/message_factory_function.h b/tools/intergen/cppgen/include/cppgen/message_factory_function.h
index da63b4453a..aa8a0ab6c4 100644
--- a/tools/intergen/cppgen/include/cppgen/message_factory_function.h
+++ b/tools/intergen/cppgen/include/cppgen/message_factory_function.h
@@ -46,8 +46,7 @@ class Interface;
class MessageFactoryFunction: public CppFunction {
public:
enum SerializationType {
- kJson,
- kDbus
+ kJson
};
// Methods
diff --git a/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h b/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h
deleted file mode 100644
index 64872f3265..0000000000
--- a/tools/intergen/cppgen/include/cppgen/struct_type_dbus_serializer.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2014, 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 CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
-#define CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
-
-#include "cppgen/cpp_function.h"
-
-namespace codegen {
-class Interface;
-class Struct;
-class TypePreferences;
-
-class StructTypeDbusMessageSignatureMethod: public CppFunction {
- public:
- StructTypeDbusMessageSignatureMethod(const TypePreferences* preferences,
- const Struct* strct,
- bool substructure);
- ~StructTypeDbusMessageSignatureMethod();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- const TypePreferences* preferences_;
- bool substructure_;
- const Struct* strct_;
-};
-
-class StructTypeFromDbusReaderConstructor : public CppStructConstructor {
- public:
- StructTypeFromDbusReaderConstructor(const TypePreferences* preferences,
- const Struct* strct,
- bool substructure,
- const std::string& base_class_name);
- ~StructTypeFromDbusReaderConstructor();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- const TypePreferences* preferences_;
- bool substructure_;
- const Struct* strct_;
-};
-
-class StructTypeToDbusWriterMethod : public CppFunction {
- public:
- StructTypeToDbusWriterMethod(const Struct* strct,
- bool substructure);
- ~StructTypeToDbusWriterMethod();
- private:
- // CppFunction interface
- void DefineBody(std::ostream* os) const;
- private:
- bool substructure_;
- const Struct* strct_;
-};
-
-} // namespace codegen
-
-#endif // CPPGEN_STRUCT_TYPE_DBUS_SERIALIZER_H
diff --git a/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc b/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
index 49bd758b6e..519e6a06e2 100644
--- a/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/cpp_interface_code_generator.cc
@@ -183,9 +183,6 @@ void CppInterfaceCodeGenerator::GenerateMessageFactories() {
if (preferences_->generate_json) {
ser_types[ser_types_count++] = MessageFactoryFunction::kJson;
}
- if (preferences_->generate_dbus) {
- ser_types[ser_types_count++] = MessageFactoryFunction::kDbus;
- }
for (size_t i = 0; i < ser_types_count; ++i) {
MessageFactoryFunction request_factory(interface_,
diff --git a/tools/intergen/cppgen/src/cppgen/declaration_generator.cc b/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
index 46e459198e..649ffd8c68 100644
--- a/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/declaration_generator.cc
@@ -47,7 +47,6 @@
#include "cppgen/module_manager.h"
#include "cppgen/naming_convention.h"
#include "cppgen/struct_type_constructor.h"
-#include "cppgen/struct_type_dbus_serializer.h"
#include "cppgen/struct_type_from_json_method.h"
#include "cppgen/struct_type_is_initialized_method.h"
#include "cppgen/struct_type_is_valid_method.h"
@@ -98,14 +97,6 @@ void DeclareExternalTypes(const TypePreferences& prefs, Namespace* ns) {
Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kClass, "Value"));
}
- if (prefs.generate_dbus) {
- ns->nested("dbus").ForwardDeclare(
- Namespace::ForwardDeclaration(
- Namespace::ForwardDeclaration::kClass, "MessageReader"));
- ns->nested("dbus").ForwardDeclare(
- Namespace::ForwardDeclaration(
- Namespace::ForwardDeclaration::kClass, "MessageWriter"));
- }
}
}
@@ -172,13 +163,6 @@ void DeclarationGenerator::GenerateCodeForStruct(const Struct* strct) {
StructTypeFromJsonConstructor(strct, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(strct).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(
- preferences_, strct, true, base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(strct, true).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- strct, true).Declare(&o, true);
- }
StructTypeIsValidMethod(strct).Declare(&o, true);
StructTypeIsInitializedMethod(strct).Declare(&o, true);
StructTypeStructEmptyMethod(strct).Declare(&o, true);
@@ -284,13 +268,6 @@ void DeclarationGenerator::GenerateCodeForRequest(const Request& request,
StructTypeFromJsonConstructor(&request, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(&request).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &request, false,
- base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(&request, false).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &request, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&request).Declare(&o, true);
StructTypeIsInitializedMethod(&request).Declare(&o, true);
StructTypeStructEmptyMethod(&request).Declare(&o, true);
@@ -336,14 +313,6 @@ void DeclarationGenerator::GenerateCodeForResponse(const Response& response) {
StructTypeToJsonMethod(&response).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &response, false,
- base_class_name).Declare(&o, true);
- StructTypeToDbusWriterMethod(&response, false).Declare(&o , true);
-
- StructTypeDbusMessageSignatureMethod(preferences_,
- &response, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&response).Declare(&o, true);
StructTypeIsInitializedMethod(&response).Declare(&o, true);
StructTypeStructEmptyMethod(&response).Declare(&o, true);
@@ -389,13 +358,6 @@ void DeclarationGenerator::GenerateCodeForNotification(
StructTypeFromJsonConstructor(&notification, base_class_name).Declare(&o , true);
StructTypeToJsonMethod(&notification).Declare(&o , true);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &notification, false,
- base_class_name).Declare(&o , true);
- StructTypeToDbusWriterMethod(&notification, false).Declare(&o , true);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &notification, false).Declare(&o, true);
- }
StructTypeIsValidMethod(&notification).Declare(&o, true);
StructTypeIsInitializedMethod(&notification).Declare(&o, true);
StructTypeStructEmptyMethod(&notification).Declare(&o, true);
diff --git a/tools/intergen/cppgen/src/cppgen/definition_generator.cc b/tools/intergen/cppgen/src/cppgen/definition_generator.cc
index e2ad0ded04..b5e404fa71 100644
--- a/tools/intergen/cppgen/src/cppgen/definition_generator.cc
+++ b/tools/intergen/cppgen/src/cppgen/definition_generator.cc
@@ -40,7 +40,6 @@
#include "cppgen/message_handle_with_method.h"
#include "cppgen/module_manager.h"
#include "cppgen/struct_type_constructor.h"
-#include "cppgen/struct_type_dbus_serializer.h"
#include "cppgen/struct_type_from_json_method.h"
#include "cppgen/struct_type_is_initialized_method.h"
#include "cppgen/struct_type_is_valid_method.h"
@@ -97,13 +96,6 @@ void DefinitionGenerator::GenerateCodeForStruct(const Struct* strct) {
StructTypeFromJsonConstructor(strct, base_class_name).Define(&o , false);
StructTypeToJsonMethod(strct).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, strct, true,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(strct, true).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- strct, true).Define(&o, false);
- }
StructTypeIsValidMethod(strct).Define(&o, false);
StructTypeIsInitializedMethod(strct).Define(&o, false);
StructTypeStructEmptyMethod(strct).Define(&o, false);
@@ -137,13 +129,6 @@ void DefinitionGenerator::GenerateCodeForResponse(const Response& response) {
StructTypeFromJsonConstructor(&response, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&response).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &response, false,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(&response, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &response, false).Define(&o, false);
- }
MessageHandleWithMethod(response.name()).Define(&o, false);
StructTypeIsValidMethod(&response).Define(&o, false);
StructTypeIsInitializedMethod(&response).Define(&o, false);
@@ -173,13 +158,6 @@ void DefinitionGenerator::GenerateCodeForNotification(
StructTypeFromJsonConstructor(&notification, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&notification).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &notification, false,
- base_class_name).Define(&o, false);
- StructTypeToDbusWriterMethod(&notification, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &notification, false).Define(&o, false);
- }
MessageHandleWithMethod(notification.name()).Define(&o, false);
StructTypeIsValidMethod(&notification).Define(&o, false);
StructTypeIsInitializedMethod(&notification).Define(&o, false);
@@ -209,13 +187,6 @@ void DefinitionGenerator::GenerateCodeForRequest(const Request& request,
StructTypeFromJsonConstructor(&request, base_class_name).Define(&o , false);
StructTypeToJsonMethod(&request).Define(&o , false);
}
- if (preferences_->generate_dbus) {
- StructTypeFromDbusReaderConstructor(preferences_, &request, false,
- base_class_name).Define(&o , false);
- StructTypeToDbusWriterMethod(&request, false).Define(&o , false);
- StructTypeDbusMessageSignatureMethod(preferences_,
- &request, false).Define(&o, false);
- }
StructTypeIsValidMethod(&request).Define(&o, false);
StructTypeIsInitializedMethod(&request).Define(&o, false);
StructTypeStructEmptyMethod(&request).Define(&o, false);
diff --git a/tools/intergen/cppgen/src/cppgen/generator_preferences.cc b/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
index ca5b12e2d9..cc3bbe0819 100644
--- a/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
+++ b/tools/intergen/cppgen/src/cppgen/generator_preferences.cc
@@ -44,21 +44,18 @@ namespace codegen {
TypePreferences::TypePreferences(int minimum_interger_size,
bool avoid_unsigned,
- bool generate_json,
- bool generate_dbus)
+ bool generate_json)
: minimum_interger_size(minimum_interger_size),
avoid_unsigned(avoid_unsigned),
- generate_json(generate_json),
- generate_dbus(generate_dbus) {
+ generate_json(generate_json) {
}
Preferences::Preferences(int minimum_interger_size,
bool avoid_unsigned,
bool generate_json,
- bool generate_dbus,
const std::set<std::string>& requested_interfaces)
: type_preferences(minimum_interger_size, avoid_unsigned,
- generate_json, generate_dbus),
+ generate_json),
requested_interfaces(requested_interfaces) {
}
diff --git a/tools/intergen/cppgen/src/cppgen/handler_interface.cc b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
index 57b41523fd..a078b7af9a 100644
--- a/tools/intergen/cppgen/src/cppgen/handler_interface.cc
+++ b/tools/intergen/cppgen/src/cppgen/handler_interface.cc
@@ -76,7 +76,7 @@ void HandlerInterface::CollectMethods() {
assert(!"Unexpected function message type");
}
}
- std::auto_ptr<CppClass::Method> destructor(
+ std::unique_ptr<CppClass::Method> destructor(
new CppClass::Method(this, CppClass::kPublic,
"~"+name(), "",
CppFunction::kVirtual));
@@ -93,7 +93,7 @@ void HandlerInterface::AddFunctionMessageHandlers(
message_ns.ForwardDeclare(Namespace::ForwardDeclaration(
Namespace::ForwardDeclaration::kStruct,
func_msg->name()));
- std::auto_ptr<CppClass::Method> method(
+ std::unique_ptr<CppClass::Method> method(
new CppClass::Method(
this, CppClass::kPublic, "Handle" + func_msg->name(),
"void", CppFunction::kVirtual | CppFunction::kAbstract));
diff --git a/tools/intergen/cppgen/src/cppgen/message_factory_function.cc b/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
index 2cfc3ea0cd..bce7ef50b2 100644
--- a/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
+++ b/tools/intergen/cppgen/src/cppgen/message_factory_function.cc
@@ -47,15 +47,15 @@ MessageFactoryFunction::MessageFactoryFunction(
SerializationType serialization_type,
FunctionMessage::MessageType factory_type)
: CppFunction("",
- serialization_type == kJson ? "NewFromJson" : "NewFromDbus",
+ "NewFromJson",
Capitalize(
FunctionMessage::MessageTypeToString(
factory_type)) + "*"),
interface_(interface),
factory_type_(factory_type) {
Add(MessageFactoryFunction::Parameter(
- serialization_type == kJson ? "json" : "reader",
- serialization_type == kJson ? "const Json::Value*": "dbus::MessageReader*"));
+ "json",
+ "const Json::Value*"));
Add(MessageFactoryFunction::Parameter("function_id", "FunctionID"));
}
diff --git a/tools/intergen/cppgen/src/cppgen/module_manager.cc b/tools/intergen/cppgen/src/cppgen/module_manager.cc
index 494e279e5c..104e3fa856 100644
--- a/tools/intergen/cppgen/src/cppgen/module_manager.cc
+++ b/tools/intergen/cppgen/src/cppgen/module_manager.cc
@@ -105,12 +105,6 @@ ModuleManager::ModuleManager(const std::string& name,
functions_source_.Include(
CppFile::Header("rpc_base/rpc_base_json_inl.h", true));
}
- if (prefs.generate_dbus) {
- structs_source_.Include(
- CppFile::Header("rpc_base/rpc_base_dbus_inl.h", true));
- functions_source_.Include(
- CppFile::Header("rpc_base/rpc_base_dbus_inl.h", true));
- }
}
ModuleManager::~ModuleManager() {
diff --git a/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc b/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc
deleted file mode 100644
index 5040652e43..0000000000
--- a/tools/intergen/cppgen/src/cppgen/struct_type_dbus_serializer.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Copyright (c) 2014, 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 "cppgen/struct_type_dbus_serializer.h"
-
-#include "cppgen/naming_convention.h"
-#include "cppgen/type_name_code_generator.h"
-#include "model/composite_type.h"
-#include "utils/safeformat.h"
-
-using typesafe_format::strmfmt;
-
-namespace codegen {
-
-StructTypeDbusMessageSignatureMethod::StructTypeDbusMessageSignatureMethod(
- const TypePreferences* preferences,
- const Struct* strct,
- bool substructure)
- : CppFunction(strct->name(), "GetDbusSignature", "void", kStatic),
- preferences_(preferences),
- substructure_(substructure),
- strct_(strct) {
- Add(Parameter("signature", "std::string*"));
-}
-
-StructTypeDbusMessageSignatureMethod::~StructTypeDbusMessageSignatureMethod() {
-}
-
-void StructTypeDbusMessageSignatureMethod::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- if (!fields.empty()) {
- if (substructure_) {
- *os << "(*signature) += DBUS_STRUCT_BEGIN_CHAR;\n";
- }
- for (Struct::FieldsList::const_iterator i = fields.begin(),
- end = fields.end(); i != end; ++i) {
- // Field is considered optional if it has mandatory=false attribute and
- // if it does NOT have default values. Fields that have default values are
- // always available no mater if they present in input or not
- bool field_is_optional = false;
- if (!i->is_mandatory()) {
- if (i->default_value() == NULL) {
- field_is_optional = true;
- }
- }
- std::string field_type = RpcTypeNameGenerator(&strct_->interface(),
- preferences_,
- i->type(),
- field_is_optional).result();
- strmfmt(*os, "rpc::DbusSignature< {0} >({1});\n",
- field_type, parameters_[0].name);
-
- }
- if (substructure_) {
- *os << "(*signature) += DBUS_STRUCT_END_CHAR;\n";
- }
- }
-}
-
-StructTypeFromDbusReaderConstructor::StructTypeFromDbusReaderConstructor(
- const TypePreferences* preferences,
- const Struct* strct,
- bool substructure,
- const std::string& base_class_name)
- : CppStructConstructor(strct->name()),
- preferences_(preferences),
- strct_(strct),
- substructure_(substructure) {
- Add(Parameter("reader__", "dbus::MessageReader*"));
- std::string base_initializer = "reader__";
- if (!strct->frankenstruct()) {
- base_initializer = "InitHelper(true)";
- }
- Add(Initializer(base_class_name, base_initializer));
- // In case of non-substructure use initializer list to initialize fields
- // From MessageReader passed in
- if (!substructure_) {
- const Struct::FieldsList& fields = strct->fields();
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- Add(Initializer(AvoidKeywords(i->name()),
- "reader__"));
- }
- }
-}
-
-StructTypeFromDbusReaderConstructor::~StructTypeFromDbusReaderConstructor() {
-}
-
-void StructTypeFromDbusReaderConstructor::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- // If initializing substructure (a structure that is used as
- // a field of other structure) additional structure reading iterator
- // should be created
- if (substructure_ && !fields.empty()) {
- *os << "dbus::MessageReader subreader__ = reader__->TakeStructReader();\n";
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- // Field is considered optional if it has mandatory=false attribute and
- // if it does NOT have default values. Fields that have default values are
- // always available no mater if they present in input or not
- bool field_is_optional = false;
- if (!i->is_mandatory()) {
- if (i->default_value() == NULL) {
- field_is_optional = true;
- }
- }
- std::string field_type = RpcTypeNameGenerator(&strct_->interface(),
- preferences_,
- i->type(),
- field_is_optional).result();
- strmfmt(*os, "{0} = {1}(&subreader__);\n", i->name(), field_type);
- }
- }
-}
-
-StructTypeToDbusWriterMethod::StructTypeToDbusWriterMethod(
- const Struct* strct,
- bool substructure)
- : CppFunction(strct->name(), "ToDbusWriter", "void", kConst),
- substructure_(substructure),
- strct_(strct) {
- Add(Parameter("writer__", "dbus::MessageWriter*"));
-}
-
-StructTypeToDbusWriterMethod::~StructTypeToDbusWriterMethod() {
-
-}
-
-void StructTypeToDbusWriterMethod::DefineBody(std::ostream* os) const {
- const Struct::FieldsList& fields = strct_->fields();
- if (!fields.empty()) {
- std::string writer_ptr_name = parameters_[0].name;
- if (substructure_) {
- strmfmt(*os, "dbus::MessageWriter subwriter__({0}, dbus::kStruct, NULL);\n",
- writer_ptr_name);
- writer_ptr_name = "&subwriter__";
- }
- for (Struct::FieldsList::const_iterator i = fields.begin(), end = fields.end();
- i != end; ++i) {
- strmfmt(*os, "{0}.ToDbusWriter({1});\n",
- i->name(),
- writer_ptr_name);
- }
- }
-}
-
-
-} // namespace codegen
diff --git a/tools/intergen/test/CMakeLists.txt b/tools/intergen/test/CMakeLists.txt
index f2973dd71c..7695ec419c 100644
--- a/tools/intergen/test/CMakeLists.txt
+++ b/tools/intergen/test/CMakeLists.txt
@@ -30,11 +30,7 @@
if(BUILD_TESTS)
include(${CMAKE_SOURCE_DIR}/tools/intergen/GenerateInterfaceLibrary.cmake)
-if (${HMI_DBUS_API})
- GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface DBUS_SUPPORT)
-else()
- GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface)
-endif()
+GenerateInterfaceLibrary("test_interface.xml" test_rpc_interface)
set (TEST_HMI_INTERFACES
common
@@ -45,11 +41,7 @@ set (TEST_HMI_INTERFACES
ui
)
-if (${HMI_DBUS_API})
- GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS DBUS_SUPPORT)
-else()
- GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS)
-endif()
+GenerateInterfaceLibrary("test_hmi_interface.xml" "${TEST_HMI_INTERFACES}" AUTO_FUNC_IDS)
include_directories (
${CMAKE_SOURCE_DIR}/src/components/rpc_base/include
@@ -70,16 +62,5 @@ set (SOURCES
generated_interface_json_tests.cc
)
-if (${HMI_DBUS_API})
- # Build dbus tests
- include_directories(
- ${CMAKE_SOURCE_DIR}/src/components/dbus/include
- ${DBUS_INCLUDE_DIRS}
- )
- set (LIBRARIES ${LIBRARIES} DBus)
- set (SOURCES ${SOURCES} generated_interface_dbus_tests.cc)
-endif ()
-
-
create_test(test_generated_interface "${SOURCES}" "${LIBRARIES}")
endif()
diff --git a/tools/intergen/test/generated_interface_dbus_tests.cc b/tools/intergen/test/generated_interface_dbus_tests.cc
deleted file mode 100644
index a510ccd77a..0000000000
--- a/tools/intergen/test/generated_interface_dbus_tests.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2015, 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 "gmock/gmock.h"
-
-#include <test_rpc_interface/interface.h>
-#include <test_rpc_interface/functions.h>
-
-#include "dbus/dbus_message.h"
-
-namespace test {
-using namespace rpc::test_rpc_interface;
-
-TEST(GeneratedInterfaceDbusTests, TestFailedDbusDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_TRUE(reader.has_failed());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_FALSE(dm.is_valid());
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- writer.PutUint16(22);
- writer.PutUint16(42);
- dbus::MessageWriter array_writer(&writer, dbus::kArray, DBUS_TYPE_BYTE_AS_STRING);
- array_writer.PutByte(11);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_TRUE(dm.is_valid());
- ASSERT_EQ(dm.targetID, 22);
- ASSERT_EQ(dm.messageLength, 42);
- ASSERT_EQ(dm.messageData.size(), 1u);
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusSerializationDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- request::DiagnosticMessage dm;
- dm.targetID = 70;
- dm.messageLength = 1;
- dm.messageData.push_back(42);
- dm.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msg);
- request::DiagnosticMessage dm(&reader);
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_TRUE(dm.is_initialized());
- ASSERT_TRUE(dm.is_valid());
- ASSERT_EQ(dm.targetID, 70);
- ASSERT_EQ(dm.messageLength, 1);
- ASSERT_EQ(dm.messageData.size(), 1u);
- ASSERT_EQ(dm.messageData[0], 42u);
- }
-}
-
-TEST(GeneratedInterfaceDbusTests, TestDbusAddSubMenuSerializatioDeserialization) {
- dbus::MessageRef msg(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
- {
- dbus::MessageWriter writer(msg);
- notification::DummyNotification dn;
- TdStruct tds;
- tds.resArrMap["Hello"].push_back(R_SUCCESS);
- (*tds.optionalResArrMap)["World"].push_back(R_INVALID_DATA);
- dn.tds.push_back(tds);
- ASSERT_TRUE(dn.is_valid());
- dn.ToDbusWriter(&writer);
- }
- {
- dbus::MessageReader reader(msg);
- notification::DummyNotification dn(&reader);
- ASSERT_TRUE(dn.is_initialized());
- ASSERT_TRUE(dn.is_valid());
- ASSERT_FALSE(reader.has_failed());
- ASSERT_FALSE(reader.HasNext());
- ASSERT_EQ(dn.tds[0].resArrMap["Hello"][0], R_SUCCESS);
- ASSERT_EQ((*dn.tds[0].optionalResArrMap)["World"][0], R_INVALID_DATA);
- }
-}
-
-} // namespace test
diff --git a/tools/intergen/test/test_hmi_interface.xml b/tools/intergen/test/test_hmi_interface.xml
index 16f2892327..7573d35ef9 100644
--- a/tools/intergen/test/test_hmi_interface.xml
+++ b/tools/intergen/test/test_hmi_interface.xml
@@ -66,6 +66,7 @@
<enum name="ButtonName">
<description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
<element name="OK"/>
+ <element name="PLAY_PAUSE"/>
<element name="SEEKLEFT"/>
<element name="SEEKRIGHT"/>
<element name="TUNEUP"/>
@@ -2777,938 +2778,573 @@
</description>
</param>
</function>
-
-<!--Qt HMI version of GetVehicleData-->
- <function name="GetGpsData" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetGpsData" messagetype="response">
- <param name="gps" type="Common.GPSData" mandatory="true">
+ <function name="SubscribeVehicleData" messagetype="request">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+ <param name="gps" type="Boolean" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
-
- <function name="GetSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSpeed" messagetype="response">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <param name="speed" type="Boolean" mandatory="false">
<description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="GetRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetRpm" messagetype="response">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <param name="rpm" type="Boolean" mandatory="false">
<description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="GetFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <param name="fuelLevel" type="Boolean" mandatory="false">
<description>The fuel level in the tank (percentage)</description>
</param>
- </function>
-
- <function name="GetFuelLevelState" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetFuelLevelState" messagetype="response">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
<description>The fuel level state</description>
</param>
- </function>
-
- <function name="GetInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="GetExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
+ <param name="externalTemperature" type="Boolean" mandatory="false">
<description>The external temperature in degrees celsius</description>
</param>
- </function>
-
- <function name="GetVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
- </param>
- </function>
-
- <function name="GetPrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetPrndl" messagetype="response">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <param name="prndl" type="Boolean" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="GetTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <param name="tirePressure" type="Boolean" mandatory="false">
<description>See TireStatus</description>
</param>
- </function>
-
- <function name="GetOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetOdometer" messagetype="response">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
+ <param name="odometer" type="Boolean" mandatory="false">
<description>Odometer in km</description>
</param>
- </function>
-
- <function name="GetBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <param name="beltStatus" type="Boolean" mandatory="false">
<description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="GetBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <param name="bodyInformation" type="Boolean" mandatory="false">
<description>The body information including power modes</description>
</param>
- </function>
-
- <function name="GetDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <param name="deviceStatus" type="Boolean" mandatory="false">
<description>The device status including signal and battery strength</description>
</param>
- </function>
-
- <function name="GetDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <param name="driverBraking" type="Boolean" mandatory="false">
<description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="GetWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <param name="wiperStatus" type="Boolean" mandatory="false">
<description>The status of the wipers</description>
</param>
- </function>
-
- <function name="GetHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <param name="headLampStatus" type="Boolean" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="GetEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEngineTorque" messagetype="response">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <param name="engineTorque" type="Boolean" mandatory="false">
<description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
-
- <function name="GetAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
<description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="GetSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="GetECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="GetECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
- </function>
-
- <function name="GetAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
+ <param name="airbagStatus" type="Boolean" mandatory="false">
<description>The status of the air bags</description>
</param>
- </function>
-
- <function name="GetEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
<description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="GetClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
<description>The status modes of the cluster</description>
</param>
- </function>
-
- <function name="GetMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
- </param>
- </function>
- <function name="GetMyKey" messagetype="response">
- <param name="myKey" type="Common.MyKey" mandatory="true">
+ <param name="myKey" type="Boolean" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
-<!--end Qt HMI version of GetVehicleData-->
-
-<!--Qt HMI version of OnVehicleData-->
- <function name="OnGpsData" messagetype="notification">
- <param name="gps" type="Common.GPSData" mandatory="true">
+ <function name="SubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
-
- <function name="OnSpeed" messagetype="notification">
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
<description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="OnRpm" messagetype="notification">
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
<description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="OnFuelLevel" messagetype="notification">
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
<description>The fuel level in the tank (percentage)</description>
</param>
- </function>
-
- <function name="OnFuelLevelState" messagetype="notification">
- <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
<description>The fuel level state</description>
</param>
- </function>
-
- <function name="OnInstantFuelConsumption" messagetype="notification">
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
<description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="OnExternalTemperature" messagetype="notification">
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
- <description>The external temperature in degrees celsius</description>
- </param>
- </function>
-
- <function name="OnVin" messagetype="notification">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number.</description>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
</param>
- </function>
-
- <function name="OnPrndl" messagetype="notification">
- <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="OnTirePressure" messagetype="notification">
- <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
<description>See TireStatus</description>
</param>
- </function>
-
- <function name="OnOdometer" messagetype="notification">
- <param name="odometer" type="Integer" minvalue="0" maxvalue="2000000" mandatory="true">
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
<description>Odometer in km</description>
</param>
- </function>
-
- <function name="OnBeltStatus" messagetype="notification">
- <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="OnBodyInformation" messagetype="notification">
- <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
<description>The body information including power modes</description>
</param>
- </function>
-
- <function name="OnDeviceStatus" messagetype="notification">
- <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The device status including signal and battery strength</description>
</param>
- </function>
-
- <function name="OnDriverBraking" messagetype="notification">
- <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="OnWiperStatus" messagetype="notification">
- <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
<description>The status of the wipers</description>
</param>
- </function>
-
- <function name="OnHeadLampStatus" messagetype="notification">
- <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="OnEngineTorque" messagetype="notification">
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
<description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
-
- <function name="OnAccPedalPosition" messagetype="notification">
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
<description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="OnSteeringWheelAngle" messagetype="notification">
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="OnMyKey" messagetype="notification">
- <param name="myKey" type="Common.MyKey" mandatory="true">
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
-<!--end Qt HMI version of OnVehicleData-->
-
-<!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
- <function name="SubscribeGps" messagetype="request">
+ <function name="UnsubscribeVehicleData" messagetype="request">
+ <description>
+ This function is used to unsubscribe the notifications from the subscribeVehicleData function.
+ </description>
<param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <description>ID of application that requested this RPC.</description>
</param>
- </function>
- <function name="SubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
+ <param name="gps" type="Boolean" mandatory="false">
<description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeGps" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="UnsubscribeGps" messagetype="response">
- <param name="gps" type="Common.VehicleDataResult" mandatory="true">
- <description>See GPSData</description>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="SubscribeSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="SubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
- <function name="UnsubscribeSpeed" messagetype="response">
- <param name="speed" type="Common.VehicleDataResult" mandatory="true">
- <description>The vehicle speed in kilometers per hour</description>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
</param>
- </function>
-
- <function name="SubscribeRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="SubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="UnsubscribeRpm" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="UnsubscribeRpm" messagetype="response">
- <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
- <description>The number of revolutions per minute of the engine</description>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
-
- <function name="SubscribeFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
- <function name="SubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel" messagetype="response">
- <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level in the tank (percentage)</description>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
-
- <function name="SubscribeFuelLevel_State" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
</param>
- </function>
- <function name="SubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
- <function name="UnsubscribeFuelLevel_State" messagetype="response">
- <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
- <description>The fuel level state</description>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="SubscribeInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="SubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
- <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
- <description>The instantaneous fuel consumption in microlitres</description>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="SubscribeExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="SubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
- <function name="UnsubscribeExternalTemperature" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <function name="UnsubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeExternalTemperature" messagetype="response">
- <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
- <description>The external temperature in degrees celsius</description>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="SubscribePrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="SubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
- <description>See PRNDL</description>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribePrndl" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribePrndl" messagetype="response">
- <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
<description>See PRNDL</description>
</param>
- </function>
-
- <function name="SubscribeVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="SubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="UnsubscribeVin" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="UnsubscribeVin" messagetype="response">
- <param name="vin" type="String" maxlength="17" mandatory="true">
- <description>Vehicle identification number</description>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
-
- <function name="SubscribeTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="SubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
- <function name="UnsubscribeTirePressure" messagetype="response">
- <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
- <description>See TireStatus</description>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
</param>
- </function>
-
- <function name="SubscribeOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="SubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
- <function name="UnsubscribeOdometer" messagetype="response">
- <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
- <description>Odometer in km</description>
+ <param name="engineOilLife" type="Common.VehicleDataResult" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
-
- <function name="SubscribeBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="SubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
- <function name="UnsubscribeBeltStatus" messagetype="response">
- <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the seat belts</description>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
-
- <function name="SubscribeBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
+ <!-- / Ford Specific Data Items -->
</function>
- <function name="SubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
+ <function name="GetVehicleData" messagetype="request">
+ <description>Non periodic vehicle data read request.</description>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="UnsubscribeBodyInformation" messagetype="response">
- <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
- <description>The body information including power modes</description>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
-
- <function name="SubscribeDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="SubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
- <function name="UnsubscribeDeviceStatus" messagetype="response">
- <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The device status including signal and battery strength</description>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
</param>
- </function>
-
- <function name="SubscribeDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
</param>
- </function>
- <function name="SubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
- <function name="UnsubscribeDriverBraking" messagetype="response">
- <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the brake pedal</description>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
-
- <function name="SubscribeWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="SubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
</param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
</param>
- </function>
- <function name="UnsubscribeWiperStatus" messagetype="response">
- <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the wipers</description>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
</param>
- </function>
-
- <function name="SubscribeHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
</param>
- </function>
- <function name="SubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
+ <param name="headLampStatus" type="Boolean" mandatory="false">
<description>Status of the head lamps</description>
</param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
</param>
- </function>
- <function name="UnsubscribeHeadLampStatus" messagetype="response">
- <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>Status of the head lamps</description>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
</param>
- </function>
-
- <function name="SubscribeEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
- <function name="SubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ <param name="engineOilLife" type="Boolean" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeEngineTorque" messagetype="response">
- <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
-
- <function name="SubscribeAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
- <function name="SubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="UnsubscribeAccPedalPosition" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
</function>
- <function name="UnsubscribeAccPedalPosition" messagetype="response">
- <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
- <description>Accelerator pedal position (percentage depressed)</description>
+ <function name="GetVehicleData" messagetype="response">
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
-
- <function name="SubscribeSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
- <function name="SubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
- <description>Current angle of the steering wheel (in deg)</description>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
- <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
<description>Current angle of the steering wheel (in deg)</description>
</param>
- </function>
-
- <function name="SubscribeECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
</param>
- </function>
- <function name="SubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
<description>Emergency Call notification and confirmation data</description>
</param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
</param>
- </function>
- <function name="UnsubscribeECallInfo" messagetype="response">
- <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
- <description>Emergency Call notification and confirmation data</description>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
</param>
- </function>
-
- <function name="SubscribeAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
</param>
- </function>
- <function name="SubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
</param>
</function>
- <function name="UnsubscribeAirbagStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <function name="OnVehicleData" messagetype="notification">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
</param>
- </function>
- <function name="UnsubscribeAirbagStatus" messagetype="response">
- <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status of the air bags</description>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
</param>
- </function>
-
- <function name="SubscribeEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
</param>
- </function>
- <function name="SubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
</param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
</param>
- </function>
- <function name="UnsubscribeEmergencyEvent" messagetype="response">
- <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to an emergency event (and if it occurred)</description>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
</param>
- </function>
-
- <function name="SubscribeClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
</param>
- </function>
- <function name="SubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
</param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
</param>
- </function>
- <function name="UnsubscribeClusterModeStatus" messagetype="response">
- <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
- <description>The status modes of the cluster</description>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
</param>
- </function>
-
- <function name="SubscribeMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
</param>
- </function>
- <function name="SubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
- <description>Information related to the MyKey feature</description>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
</param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="request">
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of application requested this RPC.</description>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
</param>
- </function>
- <function name="UnsubscribeMyKey" messagetype="response">
- <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
<description>Information related to the MyKey feature</description>
</param>
</function>
-<!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
</interface>
</interfaces>
diff --git a/tools/intergen/tool/intergen.cc b/tools/intergen/tool/intergen.cc
index bad87b178b..8fc8302dcc 100644
--- a/tools/intergen/tool/intergen.cc
+++ b/tools/intergen/tool/intergen.cc
@@ -54,7 +54,6 @@ struct Options {
char* interface_xml;
bool auto_generate_function_ids;
bool generate_json_code;
- bool generate_dbus_code;
std::set<std::string> requested_interfaces;
std::set<std::string> excluded_scopes;
bool avoid_unsigned;
@@ -63,7 +62,6 @@ struct Options {
: interface_xml(NULL),
auto_generate_function_ids(false),
generate_json_code(false),
- generate_dbus_code(false),
avoid_unsigned(false),
minimum_word_size(8) {
}
@@ -138,10 +136,6 @@ int main(int argc, char* argv[]) {
options.generate_json_code = true;
break;
}
- case 'd': {
- options.generate_dbus_code = true;
- break;
- }
default: {
cerr << "Invalid option: '" << opt << "'" << '\n';
return EXIT_FAILURE;
@@ -165,7 +159,6 @@ int main(int argc, char* argv[]) {
codegen::Preferences(options.minimum_word_size,
options.avoid_unsigned,
options.generate_json_code,
- options.generate_dbus_code,
options.requested_interfaces));
if (bad.empty()) {
return EXIT_SUCCESS;