diff options
Diffstat (limited to 'src/components/application_manager/include/application_manager/commands/request_from_hmi.h')
-rw-r--r-- | src/components/application_manager/include/application_manager/commands/request_from_hmi.h | 50 |
1 files changed, 42 insertions, 8 deletions
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 927a45c6a6..4464056175 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 @@ -55,16 +55,22 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver { virtual bool CleanUp(); virtual void Run(); virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::MobileEvent& event) OVERRIDE; /** * @brief SendResponse allows to send response to hmi * @param correlation_id the correlation id for the rfesponse. * @param function_id the function id for which response will be sent * @param result_code the result code. + * @param response_params extra response params. + * @param source command source. */ - void SendResponse(const bool success, - const uint32_t correlation_id, - const hmi_apis::FunctionID::eType function_id, - const hmi_apis::Common_Result::eType result_code); + void SendResponse( + const bool success, + const uint32_t correlation_id, + const hmi_apis::FunctionID::eType function_id, + const hmi_apis::Common_Result::eType result_code, + const smart_objects::SmartObject* response_params = NULL, + commands::Command::CommandSource source = commands::Command::SOURCE_HMI); /** * @brief SendResponse allows to send error response to hmi @@ -72,11 +78,39 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver { * @param function_id the function id for which response will be sent * @param result_code the result code. * @param error_message info message for error. + * @param source command source. */ - void SendErrorResponse(const uint32_t correlation_id, - const hmi_apis::FunctionID::eType function_id, - const hmi_apis::Common_Result::eType result_code, - const std::string error_message); + void SendErrorResponse( + const uint32_t correlation_id, + const hmi_apis::FunctionID::eType function_id, + const hmi_apis::Common_Result::eType result_code, + const std::string error_message, + commands::Command::CommandSource source = commands::Command::SOURCE_HMI); + + void SendProviderRequest( + const mobile_apis::FunctionID::eType& mobile_function_id, + const hmi_apis::FunctionID::eType& hmi_function_id, + const smart_objects::SmartObject* msg, + bool use_events = false); + + void SendMobileRequest(const mobile_apis::FunctionID::eType& function_id, + const ApplicationSharedPtr app, + const smart_objects::SmartObject* msg_params, + bool use_events); + + void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id, + const smart_objects::SmartObject* msg_params, + bool use_events); + + bool ProcessHMIInterfacesAvailability( + const uint32_t hmi_correlation_id, + const hmi_apis::FunctionID::eType& function_id); + + protected: + bool IsMobileResultSuccess(mobile_apis::Result::eType result_code) const; + + bool IsHMIResultSuccess(hmi_apis::Common_Result::eType result_code, + HmiInterfaces::InterfaceID interface) const; private: /** |