summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/add_command_request.cc
diff options
context:
space:
mode:
authorAlexander Kutsan <akutsan@luxoft.com>2017-11-13 14:07:10 +0200
committerAlexander Kutsan <akutsan@luxoft.com>2017-11-13 14:54:43 +0200
commit02cdccc4e3d90b48c0966c3f7d6f644dbb0e1ea9 (patch)
tree643ae6d0676a8b01368ec01034efe1d12e52a708 /src/components/application_manager/src/commands/mobile/add_command_request.cc
parent10b632f27b3e04ed1e75363d0674c44279f7ac1f (diff)
downloadsdl_core-02cdccc4e3d90b48c0966c3f7d6f644dbb0e1ea9.tar.gz
Common functionality awaiting of certain HMI requests
Add private methods in CommandImpl: - StartAwaitForInterface - EndAwaitForInterface - IsInterfaceAwaited Add usage of this methods across of commands that splited to multiple HMI interfaces
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/add_command_request.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc
index c748ddcbb6..69948b8122 100644
--- a/src/components/application_manager/src/commands/mobile/add_command_request.cc
+++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc
@@ -192,10 +192,12 @@ void AddCommandRequest::Run() {
}
if (send_ui_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
}
if (send_vr_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
}
}
@@ -317,6 +319,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_AddCommand: {
LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -328,6 +331,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::VR_AddCommand: {
LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
is_vr_received_ = true;
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());