summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h')
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h57
1 files changed, 48 insertions, 9 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
index aff7430c6a..efe1f107f3 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
@@ -31,8 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -87,12 +87,38 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
private:
/**
* @brief Prepare result code, result and info for sending to mobile
+ * @brief Response params
+ * success for sending to mobile application
+ * result code for sending to mobile application
+ * info for sending to mobile application
+ */
+ struct ResponseParams {
+ bool success;
+ mobile_apis::Result::eType result_code;
+ std::string info;
+ ResponseParams()
+ : success(false), result_code(mobile_apis::Result::INVALID_ENUM) {}
+ };
+
+ 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
*/
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
+ 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
+ * @return result for sending to mobile application.
+ */
+ const ResponseParams& PrepareResponseParameters();
+
/**
* @brief Sends TTS Speak request
*/
@@ -133,10 +159,23 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
*/
bool IsWaitingHMIResponse();
- /* flag display state of speak and ui perform audio
- during perform audio pass thru*/
- bool awaiting_tts_speak_response_;
- bool awaiting_ui_response_;
+ /**
+ * @brief Pair of result_code and success for mobile app
+ */
+ typedef std::pair<mobile_apis::Result::eType, bool> AudioPassThruResults;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app in
+ * audioPassThru communication.
+ * @param ui_response contains result_code from UI
+ * @param tts_response contains result_code from TTS
+ * @return pair of result code (UI error code has precedence than TTS's,
+ * error_code from TTS is turned to WARNINGS) and
+ * result for mobile app
+ */
+ AudioPassThruResults PrepareAudioPassThruResultCodeForResponse(
+ const ResponseInfo& ui_response, const ResponseInfo& tts_response);
hmi_apis::Common_Result::eType result_tts_speak_;
hmi_apis::Common_Result::eType result_ui_;
@@ -149,4 +188,4 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_