diff options
Diffstat (limited to 'src/components/application_manager/include/application_manager/commands/mobile')
104 files changed, 1200 insertions, 452 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h index 2c36d8425e..22a0c7e85f 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h @@ -52,7 +52,8 @@ class AddCommandRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit AddCommandRequest(const MessageSharedPtr& message); + AddCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddCommandRequest class destructor @@ -72,7 +73,6 @@ class AddCommandRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /* * @brief Check if command name doesn't exist in application * Please see SDLAQ-CRS-407 for more information diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h index 67a49a8e17..84bcdebc31 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h @@ -51,7 +51,8 @@ class AddCommandResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit AddCommandResponse(const MessageSharedPtr& message); + AddCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h index befeb76d9f..1f12523953 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h @@ -51,7 +51,8 @@ class AddSubMenuRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit AddSubMenuRequest(const MessageSharedPtr& message); + AddSubMenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddSubMenuRequest class destructor @@ -71,7 +72,6 @@ class AddSubMenuRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /* * @brief Check if submenu name is valid * diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h index 62c404951a..4d71e5f017 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h @@ -51,7 +51,8 @@ class AddSubMenuResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit AddSubMenuResponse(const MessageSharedPtr& message); + AddSubMenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddSubMenuResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h index 02423f0630..472ff45551 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h @@ -53,7 +53,8 @@ class AlertManeuverRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit AlertManeuverRequest(const MessageSharedPtr& message); + AlertManeuverRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertManeuverRequest class destructor @@ -81,8 +82,10 @@ class AlertManeuverRequest : public CommandRequestImpl { */ bool IsWhiteSpaceExist(); - mobile_apis::Result::eType tts_speak_result_code_; - mobile_apis::Result::eType navi_alert_maneuver_result_code_; + mobile_apis::Result::eType tts_speak_result_code_; + mobile_apis::Result::eType navi_alert_maneuver_result_code_; + std::string info_navi_; + std::string info_tts_; Pending pending_requests_; DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h index 5f0827699b..c02322e298 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h @@ -51,7 +51,8 @@ class AlertManeuverResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit AlertManeuverResponse(const MessageSharedPtr& message); + AlertManeuverResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertManeuverResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h index 705a1d1454..bc99665d82 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h @@ -52,7 +52,8 @@ class AlertRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit AlertRequest(const MessageSharedPtr& message); + AlertRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertRequest class destructor @@ -71,7 +72,8 @@ class AlertRequest : public CommandRequestImpl { /* * @brief Will caled by request controller, when default will be expired. - * If Alert request has soft buttons, timeout response should not be sent to mobile + * If Alert request has soft buttons, timeout response should not be sent to + * mobile */ virtual void onTimeOut(); @@ -83,7 +85,6 @@ class AlertRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); protected: - private: /* * @brief Checks if request parameters are valid @@ -102,15 +103,16 @@ class AlertRequest : public CommandRequestImpl { * @brief Sends TTS Speak request * * @param app_id Id of application requested this RPC - */ - void SendSpeakRequest(int32_t app_id); - - /* - * @brief Sends Basic communication playtone notification * - * @param app_id Id of application requested this RPC + * @param tts_chunks_exists if tts chunks exists in + * message contains true, otherwise contains false + * + * @param length_tts_chunks contains length of array + * tts chunks. */ - void SendPlayToneNotification(int32_t app_id); + void SendSpeakRequest(int32_t app_id, + bool tts_chunks_exists, + size_t length_tts_chunks); /* * @brief Tells if there are sent requests without responses @@ -124,14 +126,14 @@ class AlertRequest : public CommandRequestImpl { */ bool CheckStringsOfAlertRequest(); - bool awaiting_ui_alert_response_; - bool awaiting_tts_speak_response_; - bool awaiting_tts_stop_speaking_response_; - bool response_success_; - bool flag_other_component_sent_; - mobile_apis::Result::eType response_result_; - smart_objects::SmartObject response_params_; - mobile_apis::Result::eType tts_speak_response_; + bool awaiting_ui_alert_response_; + bool awaiting_tts_speak_response_; + bool awaiting_tts_stop_speaking_response_; + bool is_alert_succeeded_; + bool is_ui_alert_sent_; + mobile_apis::Result::eType alert_result_; + smart_objects::SmartObject alert_response_params_; + mobile_apis::Result::eType tts_speak_result_; DISALLOW_COPY_AND_ASSIGN(AlertRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h index 59b38933a7..acac21d738 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h @@ -51,7 +51,8 @@ class AlertResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit AlertResponse(const MessageSharedPtr& message); + AlertResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h index d36f16a976..c81ed0b5d3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h @@ -39,22 +39,26 @@ #include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/pending.h" #include "utils/macro.h" +#include "utils/custom_string.h" namespace application_manager { namespace commands { +namespace custom_str = utils::custom_string; + /** * @brief ChangeRegistrationRequest command class **/ -class ChangeRegistrationRequest : public CommandRequestImpl { +class ChangeRegistrationRequest : public CommandRequestImpl { public: /** * @brief ChangeRegistrationRequest class constructor * * @param message Incoming SmartObject message **/ - explicit ChangeRegistrationRequest(const MessageSharedPtr& message); + ChangeRegistrationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ChangeRegistrationRequest class destructor @@ -107,9 +111,9 @@ class ChangeRegistrationRequest : public CommandRequestImpl { * * @return true if all of result codes is success */ - bool AllHmiResponsesSuccess(const hmi_apis::Common_Result::eType ui, - const hmi_apis::Common_Result::eType vr, - const hmi_apis::Common_Result::eType tts); + bool AllHmiResponsesSuccess(const hmi_apis::Common_Result::eType ui, + const hmi_apis::Common_Result::eType vr, + const hmi_apis::Common_Result::eType tts); /** * @brief Checks change_registration params(ttsName, appname, @@ -118,42 +122,49 @@ class ChangeRegistrationRequest : public CommandRequestImpl { * @return true if command contains \t\n \\t \\n of whitespace otherwise * returns false. */ - bool IsWhiteSpaceExist(); - - /** - * @brief Check parameters (name, vr) for - * coincidence with already known parameters of registered applications - * - * @return SUCCESS if there is no coincidence of app.name/VR synonyms, - * otherwise appropriate error code returns - */ - mobile_apis::Result::eType CheckCoincidence(); - - /** - * @brief Predicate for using with CheckCoincidence method to compare with VR synonym SO - * - * @return TRUE if there is coincidence of VR, otherwise FALSE - */ - struct CoincidencePredicateVR { - explicit CoincidencePredicateVR(const std::string &newItem) - :newItem_(newItem) - {}; - - bool operator()(smart_objects::SmartObject obj) { - const std::string vr_synonym = obj.asString(); - return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str())); - }; - - const std::string &newItem_; - }; - - Pending pending_requests_; - - hmi_apis::Common_Result::eType ui_result_; - hmi_apis::Common_Result::eType vr_result_; - hmi_apis::Common_Result::eType tts_result_; - - DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest); + bool IsWhiteSpaceExist(); + + /** + * @brief Check parameters (name, vr) for + * coincidence with already known parameters of registered applications + * + * @return SUCCESS if there is no coincidence of app.name/VR synonyms, + * otherwise appropriate error code returns + */ + mobile_apis::Result::eType CheckCoincidence(); + + /** + * @brief Checks if requested name is allowed by policy + * @param app_name Application name + * @return true, if allowed, otherwise - false + */ + bool IsNicknameAllowed(const custom_str::CustomString& app_name) const; + + /** + * @brief Predicate for using with CheckCoincidence method to compare with VR + * synonym SO + * + * @return TRUE if there is coincidence of VR, otherwise FALSE + */ + struct CoincidencePredicateVR { + CoincidencePredicateVR(const custom_str::CustomString& newItem) + : newItem_(newItem){}; + + bool operator()(const smart_objects::SmartObject& obj) const { + const custom_str::CustomString& vr_synonym = obj.asCustomString(); + return newItem_.CompareIgnoreCase(vr_synonym); + }; + + const custom_str::CustomString& newItem_; + }; + + Pending pending_requests_; + + hmi_apis::Common_Result::eType ui_result_; + hmi_apis::Common_Result::eType vr_result_; + hmi_apis::Common_Result::eType tts_result_; + + DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h index 2cac5f2d58..6ff3fd9a4a 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h @@ -51,7 +51,8 @@ class ChangeRegistrationResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit ChangeRegistrationResponse(const MessageSharedPtr& message); + ChangeRegistrationResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ChangeRegistrationResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h index b9992fc1fe..32fed1eee1 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h @@ -53,188 +53,186 @@ namespace commands { **/ class CreateInteractionChoiceSetRequest : public CommandRequestImpl { public: - /** - * @brief CreateInteractionChoiceSetRequest class constructor - * - * @param message Incoming SmartObject message - **/ - explicit CreateInteractionChoiceSetRequest(const MessageSharedPtr& message); - - /** - * @brief CreateInteractionChoiceSetRequest class destructor - **/ - virtual ~CreateInteractionChoiceSetRequest(); - - /** - * @brief Execute command - **/ - virtual void Run(); - + /** + * @brief CreateInteractionChoiceSetRequest class constructor + * + * @param message Incoming SmartObject message + **/ + CreateInteractionChoiceSetRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief CreateInteractionChoiceSetRequest class destructor + **/ + virtual ~CreateInteractionChoiceSetRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); private: - /** - * @brief Interface method that is called whenever new event received - * - * @param event The received event - */ - virtual void on_event(const event_engine::Event& event); - - /** - * @brief Function is called by RequestController when request execution time - * has exceed it's limit - */ - virtual void onTimeOut(); - /** - * @brief DeleteChoices allows to walk through the sent commands collection - * in order to sent appropriate DeleteCommand request. - */ - void DeleteChoices(); - - /** - * @brief Calls after all responses from HMI were received. - * Terminates request and sends successful response to mobile - * if all responses were SUCCESS or calls DeleteChoices in other case. - */ - void OnAllHMIResponsesReceived(); - - /** - * @brief The VRCommand struct - * Collect minimum information about sent VR commands, for correctly - * processing deleting sent commands if error from HMI received - */ - struct VRCommandInfo { - VRCommandInfo(): - cmd_id_(0), - succesful_response_received_(false) {} - explicit VRCommandInfo(uint32_t cmd_id): - cmd_id_(cmd_id), - succesful_response_received_(false) {} - uint32_t cmd_id_; - bool succesful_response_received_; - }; - - typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap; - SentCommandsMap sent_commands_map_; - - int32_t choice_set_id_; - size_t expected_chs_count_; - size_t received_chs_count_; - - /** - * @brief Flag for stop sending VR commands to HMI, in case one of responses - * failed - */ - volatile bool error_from_hmi_; - sync_primitives::Lock error_from_hmi_lock_; - - /** - * @brief Flag shows if request already was expired by timeout - */ - volatile bool is_timed_out_; - sync_primitives::Lock is_timed_out_lock_; - - sync_primitives::Lock vr_commands_lock_; - /* - * @brief Sends VR AddCommand request to HMI - * - * @param app_id Application ID - * - */ - void SendVRAddCommandRequests(ApplicationSharedPtr const app); - - /* - * @brief Checks incoming choiseSet params. - * @param app Registred mobile application - * - * @return Mobile result code - */ - mobile_apis::Result::eType CheckChoiceSet(ApplicationConstSharedPtr app); - - /* - * @brief Predicate for using with CheckChoiceSet method to compare choice ID param - * - * return TRUE if there is coincidence of choice ID, otherwise FALSE - */ - struct CoincidencePredicateChoiceID { - explicit CoincidencePredicateChoiceID(const uint32_t newItem) - : newItem_(newItem) - {} - - bool operator()(smart_objects::SmartObject obj) { - return obj[strings::choice_id].asUInt() == newItem_; - } - - const uint32_t newItem_; - }; - - /* - * @brief Predicate for using with CheckChoiceSet method to compare menu name param - * - * return TRUE if there is coincidence of menu name, otherwise FALSE - */ - struct CoincidencePredicateMenuName { - explicit CoincidencePredicateMenuName(const std::string& newItem) - : newItem_(newItem) - {}; - - bool operator()(smart_objects::SmartObject obj) { - return obj[strings::menu_name].asString() == newItem_; - } - - const std::string& newItem_; - }; - - /* - * @brief Predicate for using with CheckChoiceSet method to compare VR commands param - * - * return TRUE if there is coincidence of VR commands, otherwise FALSE - */ - struct CoincidencePredicateVRCommands { - explicit CoincidencePredicateVRCommands( - const smart_objects::SmartObject& newItem): newItem_(newItem) {} - - bool operator()(smart_objects::SmartObject obj) { - return compareStr(obj, newItem_); - } - - const smart_objects::SmartObject& newItem_; - }; - - /* - * @brief Checks if incoming choice set doesn't has similar VR synonyms. - * - * @param choice1 Choice to compare - * @param choice2 Choice to compare - * - * return Return TRUE if there are similar VR synonyms in choice set, - * otherwise FALSE - */ - bool compareSynonyms( + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); + + /** + * @brief Function is called by RequestController when request execution time + * has exceed it's limit + */ + virtual void onTimeOut(); + /** + * @brief DeleteChoices allows to walk through the sent commands collection + * in order to sent appropriate DeleteCommand request. + */ + void DeleteChoices(); + + /** + * @brief Calls after all responses from HMI were received. + * Terminates request and sends successful response to mobile + * if all responses were SUCCESS or calls DeleteChoices in other case. + */ + void OnAllHMIResponsesReceived(); + + /** + * @brief The VRCommand struct + * Collect minimum information about sent VR commands, for correctly + * processing deleting sent commands if error from HMI received + */ + struct VRCommandInfo { + VRCommandInfo() + : cmd_id_(0), succesful_response_received_(false) {} + VRCommandInfo(uint32_t cmd_id) + : cmd_id_(cmd_id), succesful_response_received_(false) {} + uint32_t cmd_id_; + bool succesful_response_received_; + }; + + typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap; + SentCommandsMap sent_commands_map_; + + int32_t choice_set_id_; + size_t expected_chs_count_; + size_t received_chs_count_; + + /** + * @brief Flag for stop sending VR commands to HMI, in case one of responses + * failed + */ + volatile bool error_from_hmi_; + sync_primitives::Lock error_from_hmi_lock_; + + /** + * @brief Flag shows if request already was expired by timeout + */ + volatile bool is_timed_out_; + sync_primitives::Lock is_timed_out_lock_; + + sync_primitives::Lock vr_commands_lock_; + /* + * @brief Sends VR AddCommand request to HMI + * + * @param app_id Application ID + * + */ + void SendVRAddCommandRequests(ApplicationSharedPtr const app); + + /* + * @brief Checks incoming choiseSet params. + * @param app Registred mobile application + * + * @return Mobile result code + */ + mobile_apis::Result::eType CheckChoiceSet(ApplicationConstSharedPtr app); + + /* + * @brief Predicate for using with CheckChoiceSet method to compare choice ID + *param + * + * return TRUE if there is coincidence of choice ID, otherwise FALSE + */ + struct CoincidencePredicateChoiceID { + CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {} + + bool operator()(smart_objects::SmartObject obj) { + return obj[strings::choice_id].asUInt() == newItem_; + } + + const uint32_t newItem_; + }; + + /* + * @brief Predicate for using with CheckChoiceSet method to compare menu name + *param + * + * return TRUE if there is coincidence of menu name, otherwise FALSE + */ + struct CoincidencePredicateMenuName { + CoincidencePredicateMenuName(const std::string& newItem) + : newItem_(newItem){}; + + bool operator()(smart_objects::SmartObject obj) { + return obj[strings::menu_name].asString() == newItem_; + } + + const std::string& newItem_; + }; + + /* + * @brief Predicate for using with CheckChoiceSet method to compare VR commands + *param + * + * return TRUE if there is coincidence of VR commands, otherwise FALSE + */ + struct CoincidencePredicateVRCommands { + CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem) + : newItem_(newItem) {} + + bool operator()(smart_objects::SmartObject obj) { + return compareStr(obj, newItem_); + } + + const smart_objects::SmartObject& newItem_; + }; + + /* + * @brief Checks if incoming choice set doesn't has similar VR synonyms. + * + * @param choice1 Choice to compare + * @param choice2 Choice to compare + * + * return Return TRUE if there are similar VR synonyms in choice set, + * otherwise FALSE + */ + bool compareSynonyms( const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1, const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2); - /* - * @brief Checks VR synonyms ignoring differences in case. - * - * @param str1 VR synonym to compare - * @param str2 VR synonym to compare - * - * return Return TRUE if there are similar VR synonyms in choice set, - * otherwise FALSE - */ - static bool compareStr( + /* + * @brief Checks VR synonyms ignoring differences in case. + * + * @param str1 VR synonym to compare + * @param str2 VR synonym to compare + * + * return Return TRUE if there are similar VR synonyms in choice set, + * otherwise FALSE + */ + static bool compareStr( const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1, const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2); - /** - * @brief Checks choice set params(menuName, tertiaryText, ...) - * When type is String there is a check on the contents \t\n \\t \\n - * @param choice_set which must check - * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise - */ - bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set); + /** + * @brief Checks choice set params(menuName, tertiaryText, ...) + * When type is String there is a check on the contents \t\n \\t \\n + * @param choice_set which must check + * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise + */ + bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set); - DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest); + DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h index 965573f4a4..6a7faf705c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h @@ -51,7 +51,8 @@ class CreateInteractionChoiceSetResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit CreateInteractionChoiceSetResponse(const MessageSharedPtr& message); + CreateInteractionChoiceSetResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief CreateInteractionChoiceSetResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h index bae0fedd54..6a19014c96 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h @@ -51,7 +51,8 @@ class DeleteCommandRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteCommandRequest(const MessageSharedPtr& message); + DeleteCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteCommandRequest class destructor @@ -71,7 +72,6 @@ class DeleteCommandRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest); /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h index 0fe0f0959b..b61035ca1b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h @@ -51,7 +51,8 @@ class DeleteCommandResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteCommandResponse(const MessageSharedPtr& message); + DeleteCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h index 4927227465..adaf2686bc 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h @@ -53,7 +53,8 @@ class DeleteFileRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteFileRequest(const MessageSharedPtr& message); + DeleteFileRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteFileRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h index cfe6aaa4fa..e001e46a22 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h @@ -51,7 +51,8 @@ class DeleteFileResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteFileResponse(const MessageSharedPtr& message); + DeleteFileResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteFileResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h index 283b882fad..716a1d82de 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h @@ -52,7 +52,8 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message); + DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteInteractionChoiceSetRequest class destructor @@ -65,7 +66,6 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl { virtual void Run(); private: - /* * @brief Check if requested choice set ID in use by perform interaction * diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h index 1f641e15b3..86e20bc6d4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h @@ -51,7 +51,8 @@ class DeleteInteractionChoiceSetResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message); + DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteInteractionChoiceSetResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h index 6687218051..7c48de5d8e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h @@ -52,7 +52,8 @@ class DeleteSubMenuRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteSubMenuRequest(const MessageSharedPtr& message); + DeleteSubMenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteSubMenuRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h index 0bb080e93e..76232aee4b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h @@ -51,7 +51,8 @@ class DeleteSubMenuResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit DeleteSubMenuResponse(const MessageSharedPtr& message); + DeleteSubMenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteSubMenuResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h index 4cda040b42..34c8b0e872 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h @@ -51,7 +51,8 @@ class DiagnosticMessageRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit DiagnosticMessageRequest(const MessageSharedPtr& message); + DiagnosticMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DiagnosticMessageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h index 1b6a6024f4..439f11a57e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h @@ -51,7 +51,8 @@ class DiagnosticMessageResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit DiagnosticMessageResponse(const MessageSharedPtr& message); + DiagnosticMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DiagnosticMessageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h index ea8556f6e0..1b945fc5fb 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h @@ -48,7 +48,8 @@ class DialNumberRequest : public CommandRequestImpl { /** * \brief DialNumberRequest class constructor **/ - explicit DialNumberRequest(const MessageSharedPtr& message); + DialNumberRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief DialNumberRequest class destructor @@ -58,11 +59,11 @@ class DialNumberRequest : public CommandRequestImpl { /** * @brief Initialize request params **/ - bool Init() OVERRIDE; + bool Init() OVERRIDE; /** - * @brief Execute command - **/ + * @brief Execute command + **/ void Run() OVERRIDE; /** @@ -73,13 +74,12 @@ class DialNumberRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /** * @brief Removes from number param all characters * except the + character and digits. * */ - void StripNumberParam(std::string &number); + void StripNumberParam(std::string& number); DISALLOW_COPY_AND_ASSIGN(DialNumberRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h index 0cdeb9eb90..4a6980bd04 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h @@ -1,5 +1,6 @@ /* - Copyright (c) 2016, Ford Motor Company + + Copyright (c) 2013, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without @@ -50,17 +51,18 @@ class DialNumberResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit DialNumberResponse(const MessageSharedPtr& message); + DialNumberResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DialNumberResponse class destructor **/ - ~DialNumberResponse() OVERRIDE; + virtual ~DialNumberResponse(); /** * @brief Execute command **/ - void Run() OVERRIDE; + virtual void Run(); private: DISALLOW_COPY_AND_ASSIGN(DialNumberResponse); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h index f291f7a748..add6d2497e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h @@ -51,7 +51,8 @@ class EndAudioPassThruRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit EndAudioPassThruRequest(const MessageSharedPtr& message); + EndAudioPassThruRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief EndAudioPassThruRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h index 5ad5f85e6e..381a397fbd 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h @@ -51,7 +51,8 @@ class EndAudioPassThruResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit EndAudioPassThruResponse(const MessageSharedPtr& message); + EndAudioPassThruResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief EndAudioPassThruResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h index 1fb931d508..9ccef12152 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h @@ -45,15 +45,14 @@ class GenericResponse : public CommandResponseImpl { /** * \brief GenericResponse class constructor **/ - explicit GenericResponse(const MessageSharedPtr& message) - : CommandResponseImpl(message) { - } + GenericResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} /** * \brief GenericResponse class destructor **/ - virtual ~GenericResponse() { - } + virtual ~GenericResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h index d76ac253bc..d962937e39 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h @@ -51,7 +51,8 @@ class GetDTCsRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit GetDTCsRequest(const MessageSharedPtr& message); + GetDTCsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetDTCsRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h index 69ff1fca59..abe970d60f 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h @@ -51,7 +51,8 @@ class GetDTCsResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit GetDTCsResponse(const MessageSharedPtr& message); + GetDTCsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetDTCsResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h index db9db7b0a7..eda77e59b0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h @@ -53,7 +53,8 @@ class GetVehicleDataRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit GetVehicleDataRequest(const MessageSharedPtr& message); + GetVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetVehicleDataRequest class destructor @@ -65,7 +66,6 @@ class GetVehicleDataRequest : public CommandRequestImpl { **/ virtual void Run(); - protected: virtual void on_event(const event_engine::Event& event); @@ -83,7 +83,7 @@ class GetVehicleDataRequest : public CommandRequestImpl { typedef std::vector<HmiRequest> HmiRequests; HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h index f0306df6aa..4fadaf2b01 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h @@ -51,7 +51,8 @@ class GetVehicleDataResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit GetVehicleDataResponse(const MessageSharedPtr& message); + GetVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h new file mode 100644 index 0000000000..bf23121177 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h @@ -0,0 +1,77 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief GetWayPointsRequest command class + **/ +class GetWayPointsRequest : public CommandRequestImpl { + public: + /** + * \brief GetWayPointsRequest class constructor + **/ + GetWayPointsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * \brief GetWayPointsRequest class destructor + **/ + virtual ~GetWayPointsRequest(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h new file mode 100644 index 0000000000..cb4f840763 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h @@ -0,0 +1,72 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief GetWayPointsResponse command class + **/ +class GetWayPointsResponse : public CommandResponseImpl { + public: + /** + * \brief GetWayPointsResponse class constructor + **/ + GetWayPointsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * \brief GetWayPointsResponse class destructor + **/ + virtual ~GetWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(GetWayPointsResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h index 86171f1ff8..d8d28b7e9d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h @@ -51,7 +51,8 @@ class ListFilesRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit ListFilesRequest(const MessageSharedPtr& message); + ListFilesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ListFilesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h index 6f8e80bae2..a211ee5968 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h @@ -51,7 +51,8 @@ class ListFilesResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit ListFilesResponse(const MessageSharedPtr& message); + ListFilesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ListFilesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h index 8753660470..7ef2e7e5d2 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h @@ -51,8 +51,8 @@ class OnAppInterfaceUnregisteredNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnAppInterfaceUnregisteredNotification( - const MessageSharedPtr& message); + OnAppInterfaceUnregisteredNotification( + const MessageSharedPtr& message, ApplicationManager& application_manager); /** * @brief OnAppInterfaceUnregisteredNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h index 67bc319771..b74d8fbe41 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h @@ -42,7 +42,8 @@ namespace application_manager { namespace commands { /** - * @brief OnAudioPassThruNotification class used to send notification with binary data written from + * @brief OnAudioPassThruNotification class used to send notification with + *binary data written from * microphone to mobile device while PerformAudioPassThru is active. **/ class OnAudioPassThruNotification : public CommandNotificationImpl { @@ -52,7 +53,8 @@ class OnAudioPassThruNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnAudioPassThruNotification(const MessageSharedPtr& message); + OnAudioPassThruNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnAudioPassThruNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h index d1297ba980..80355993e1 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h @@ -55,7 +55,8 @@ class OnButtonEventNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnButtonEventNotification(const MessageSharedPtr& message); + OnButtonEventNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnButtonEventNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h index 0ebdb6d7c6..1443e58a70 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h @@ -55,7 +55,8 @@ class OnButtonPressNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnButtonPressNotification(const MessageSharedPtr& message); + OnButtonPressNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnButtonEventCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h index 751b1e7dd2..3f9a0ad6c2 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h @@ -54,7 +54,8 @@ class OnCommandNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnCommandNotification(const MessageSharedPtr& message); + OnCommandNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnCommandNotification class destructor @@ -65,6 +66,7 @@ class OnCommandNotification : public CommandNotificationImpl { * @brief Execute command **/ virtual void Run(); + private: DISALLOW_COPY_AND_ASSIGN(OnCommandNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h index 2f2a3c81fc..ee3c19c707 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h @@ -53,7 +53,8 @@ class OnDriverDistractionNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnDriverDistractionNotification(const MessageSharedPtr& message); + OnDriverDistractionNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnDriverDistractionNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h index be83047863..9f9fad16d4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h @@ -52,7 +52,8 @@ class OnHashChangeNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnHashChangeNotification(const MessageSharedPtr& message); + OnHashChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnHashChangeNotification class destructor @@ -68,7 +69,7 @@ class OnHashChangeNotification : public CommandNotificationImpl { DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification); }; -} // namespace mobile +} // namespace mobile } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h index 11d82925ec..a82182eea0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h @@ -51,7 +51,8 @@ class OnHMIStatusNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnHMIStatusNotification(const MessageSharedPtr& message); + OnHMIStatusNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnHMIStatusNotification class destructor @@ -63,7 +64,7 @@ class OnHMIStatusNotification : public CommandNotificationImpl { **/ virtual void Run(); -private: + private: DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h index 70a8bf745b..878f4fa720 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h @@ -35,6 +35,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_ #include "application_manager/commands/command_notification_from_mobile_impl.h" +#include "application_manager/application_manager.h" #include "interfaces/MOBILE_API.h" #include "utils/macro.h" @@ -45,15 +46,16 @@ namespace commands { /** * @brief OnHMIStatusNotificationFromMobile class **/ -class OnHMIStatusNotificationFromMobile : - public CommandNotificationFromMobileImpl { +class OnHMIStatusNotificationFromMobile + : public CommandNotificationFromMobileImpl { public: /** * @brief OnHMIStatusNotificationFromMobile class constructor * * @param message Incoming SmartObject message **/ - explicit OnHMIStatusNotificationFromMobile(const MessageSharedPtr& message); + OnHMIStatusNotificationFromMobile(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnHMIStatusNotificationFromMobile class destructor @@ -65,7 +67,7 @@ class OnHMIStatusNotificationFromMobile : **/ virtual void Run(); -private: + private: DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotificationFromMobile); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h index e0d6a258e9..911ca70cdf 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h @@ -53,7 +53,8 @@ class OnKeyBoardInputNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnKeyBoardInputNotification(const MessageSharedPtr& message); + OnKeyBoardInputNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnKeyBoardInputNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h index d163114890..c62652ff67 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h @@ -51,7 +51,8 @@ class OnLanguageChangeNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnLanguageChangeNotification(const MessageSharedPtr& message); + OnLanguageChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnLanguageChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h index 3cffe8ff49..d5f7aa96b8 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h @@ -51,7 +51,8 @@ class OnPermissionsChangeNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnPermissionsChangeNotification(const MessageSharedPtr& message); + OnPermissionsChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnPermissionsChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h index 0763e680a8..143b076033 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h @@ -53,7 +53,8 @@ class OnSystemRequestNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnSystemRequestNotification(const MessageSharedPtr& message); + OnSystemRequestNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnSystemRequestNotification class destructor @@ -72,7 +73,7 @@ class OnSystemRequestNotification : public CommandNotificationImpl { * @param message Message */ void AddHeader(BinaryMessage& message) const; - void ParsePTString(std::string& pt_string) const; + size_t ParsePTString(std::string& pt_string) const; #endif DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h index 5c34caba36..e7b895dceb 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h @@ -51,7 +51,8 @@ class OnTBTClientStateNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnTBTClientStateNotification(const MessageSharedPtr& message); + OnTBTClientStateNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTBTClientStateNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h index 1aba3087dd..abbf6787db 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h @@ -53,7 +53,8 @@ class OnTouchEventNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnTouchEventNotification(const MessageSharedPtr& message); + OnTouchEventNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTouchEventNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h index 7e64f19639..de6172de64 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h @@ -53,7 +53,8 @@ class OnVehicleDataNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - explicit OnVehicleDataNotification(const MessageSharedPtr& message); + OnVehicleDataNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVehicleDataNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h new file mode 100644 index 0000000000..c204e1669c --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h @@ -0,0 +1,69 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_ + +#include "application_manager/commands/command_notification_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +class OnWayPointChangeNotification : public CommandNotificationImpl { + public: + /** + * @brief OnWayPointChangeNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnWayPointChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief OnWayPointChangeNotification class destructor + **/ + virtual ~OnWayPointChangeNotification(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification); +}; + +} // namespace commands +} // namespace application_manager +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_ 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 62ca1257bb..b69cb969e1 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 @@ -52,7 +52,8 @@ class PerformAudioPassThruRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit PerformAudioPassThruRequest(const MessageSharedPtr& message); + PerformAudioPassThruRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformAudioPassThruRequest class destructor @@ -114,12 +115,19 @@ class PerformAudioPassThruRequest : public CommandRequestImpl { bool IsWhiteSpaceExist(); /** + * @brief Waiting for TTS.Speak response, after default timeout send + * GENERIC_ERROR response + * @return if receive TTS.Speak return TRUE, FALSE otherwise + */ + bool WaitTTSSpeak(); + + /** * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request * TTS_StopSpeaking to HMI */ void FinishTTSSpeak(); - //flag display state of speak during perform audio pass thru + // flag display state of speak during perform audio pass thru bool is_active_tts_speak_; mobile_apis::Result::eType result_tts_speak_; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h index d659e59be0..d227c4fef3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h @@ -51,7 +51,8 @@ class PerformAudioPassThruResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit PerformAudioPassThruResponse(const MessageSharedPtr& message); + PerformAudioPassThruResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformAudioPassThruResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h index 02575c1126..f64b2ab334 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h @@ -36,7 +36,6 @@ #include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" -#include "utils/timer_thread.h" #include "utils/macro.h" namespace application_manager { @@ -48,15 +47,15 @@ namespace commands { /** * @brief PerformInteractionRequest command class **/ -class PerformInteractionRequest : public CommandRequestImpl { - +class PerformInteractionRequest : public CommandRequestImpl { public: /** * @brief PerformInteractionRequest class constructor * * @param message Incoming SmartObject message **/ - explicit PerformInteractionRequest(const MessageSharedPtr& message); + PerformInteractionRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformInteractionRequest class destructor @@ -86,7 +85,7 @@ class PerformInteractionRequest : public CommandRequestImpl { * has exceed it's limit * */ - virtual void onTimeOut(); + virtual void onTimeOut(); /* * @brief Function will be called when VR_OnCommand event @@ -95,7 +94,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * @param message which should send to mobile side * */ - void ProcessVRResponse(const smart_objects::SmartObject& message); + void ProcessVRResponse(const smart_objects::SmartObject& message, + smart_objects::SmartObject& msg_params); /* * @brief Sends PerformInteraction response to mobile side @@ -103,9 +103,9 @@ class PerformInteractionRequest : public CommandRequestImpl { * @param message which should send to mobile side * */ - void ProcessPerformInteractionResponse - (const smart_objects::SmartObject& message); - + void ProcessPerformInteractionResponse( + const smart_objects::SmartObject& message, + smart_objects::SmartObject& msg_params); /* * @brief Sends UI PerformInteraction request to HMI @@ -132,12 +132,6 @@ class PerformInteractionRequest : public CommandRequestImpl { */ void SendUIShowVRHelpRequest(ApplicationSharedPtr const app); - /** - * @brief Creates and Sends Perform interaction to UI. - */ - void CreateUIPerformInteraction(const smart_objects::SmartObject& msg_params, - application_manager::ApplicationSharedPtr const app); - /* * @brief Checks if incoming choice set doesn't has similar menu names. * @@ -146,7 +140,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * return Return TRUE if there are no similar menu names in choice set, * otherwise FALSE */ - bool CheckChoiceSetMenuNames(application_manager::ApplicationSharedPtr const app); + bool CheckChoiceSetMenuNames( + application_manager::ApplicationSharedPtr const app); /* * @brief Checks if incoming choice set doesn't has similar VR synonyms. @@ -156,7 +151,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * return Return TRUE if there are no similar VR synonyms in choice set, * otherwise FALSE */ - bool CheckChoiceSetVRSynonyms(application_manager::ApplicationSharedPtr const app); + bool CheckChoiceSetVRSynonyms( + application_manager::ApplicationSharedPtr const app); /* * @brief Checks if request with non-sequential positions of vrHelpItems @@ -167,7 +163,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * @return TRUE if vrHelpItems positions are sequential, * otherwise FALSE */ - bool CheckVrHelpItemPositions(application_manager::ApplicationSharedPtr const app); + bool CheckVrHelpItemPositions( + application_manager::ApplicationSharedPtr const app); /* * @brief Disable PerformInteraction state in application and @@ -197,13 +194,50 @@ class PerformInteractionRequest : public CommandRequestImpl { */ bool CheckChoiceIDFromResponse(ApplicationSharedPtr app, int32_t choice_id); - // members - mobile_apis::Result::eType vr_perform_interaction_code_; + /** + * @brief Checks for a match of choice ID, in + * choice sets. + * @param app contains pointer to application. + * @param choice_set_id_list_length contains amount + * of choice set ids. + * @param choice_set_id_list array of choice set ids + * @return If request contains several choice sets with + * same choice id returns false, otherwise returns + * true. + */ + bool CheckChoiceIDFromRequest( + ApplicationSharedPtr app, + const size_t choice_set_id_list_length, + const smart_objects::SmartObject& choice_set_id_list) const; + + /** + * @brief Tells if there are sent requests without responses + * @return If there is request without response method returns TRUE + * otherwise returns FALSE + */ + const bool HasHMIResponsesToWait() const; + + /** + * @brief Check VR response result code, in case GENERIC_ERROR, REJECTED, + * send resultCode FALSE, in case WARNINGS send resultCode TRUE + */ + void CheckResponseResultCode(); + + /** + * @brief Check UI & VR result codes, send response to mobile + * @param msg_param Message params to send + */ + void SendBothModeResponse(const smart_objects::SmartObject& msg_param); + mobile_apis::InteractionMode::eType interaction_mode_; - bool ui_response_recived_; - bool vr_response_recived_; - bool app_pi_was_active_before_; - static uint32_t pi_requests_count_; + bool ui_response_recived_; + bool vr_response_recived_; + bool ui_result_; + bool vr_result_; + bool app_pi_was_active_before_; + static uint32_t pi_requests_count_; + mobile_apis::Result::eType vr_resultCode_; + mobile_apis::Result::eType ui_resultCode_; DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h index 4ecc149fb4..1274996747 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h @@ -51,7 +51,8 @@ class PerformInteractionResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit PerformInteractionResponse(const MessageSharedPtr& message); + PerformInteractionResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformInteractionResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h index 8a94a708a1..e3af8ac69b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h @@ -36,7 +36,7 @@ #include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" -#include "application_manager/application_manager_impl.h" +#include "application_manager/application_manager.h" namespace application_manager { @@ -52,7 +52,8 @@ class PutFileRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit PutFileRequest(const MessageSharedPtr& message); + PutFileRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PutFileRequest class destructor @@ -65,13 +66,13 @@ class PutFileRequest : public CommandRequestImpl { virtual void Run(); private: - int64_t offset_; - std::string sync_file_name_; - int64_t length_; - mobile_apis::FileType::eType file_type_; - bool is_persistent_file_; + int64_t offset_; + std::string sync_file_name_; + int64_t length_; + mobile_apis::FileType::eType file_type_; + bool is_persistent_file_; - void SendOnPutFileNotification(); + void SendOnPutFileNotification(); DISALLOW_COPY_AND_ASSIGN(PutFileRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h index 89ff6ad08f..f561f9fdbc 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h @@ -51,7 +51,8 @@ class PutFileResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit PutFileResponse(const MessageSharedPtr& message); + PutFileResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PutFileResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h index e2e5dbf3da..c88f16dab0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h @@ -51,7 +51,8 @@ class ReadDIDRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit ReadDIDRequest(const MessageSharedPtr& message); + ReadDIDRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ReadDIDRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h index 80b9b5ea48..2e493fa0ec 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h @@ -51,7 +51,8 @@ class ReadDIDResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit ReadDIDResponse(const MessageSharedPtr& message); + ReadDIDResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ReadDIDResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h index e5bcf40da9..dc7f9fb755 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h @@ -34,9 +34,10 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_ -#include <string.h> #include "application_manager/commands/command_request_impl.h" +#include "application_manager/policies/policy_handler_interface.h" #include "utils/macro.h" +#include "utils/custom_string.h" namespace policy { struct DeviceInfo; @@ -48,6 +49,8 @@ class Application; namespace commands { +namespace custom_str = utils::custom_string; + /** * @brief Register app interface request command class **/ @@ -56,7 +59,8 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { /** * \brief RegisterAppInterfaceRequest class constructor **/ - explicit RegisterAppInterfaceRequest(const MessageSharedPtr& message); + RegisterAppInterfaceRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief RegisterAppInterfaceRequest class destructor @@ -79,10 +83,21 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { *@param application_impl application * **/ - void SendRegisterAppInterfaceResponseToMobile( - mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS); + void SendRegisterAppInterfaceResponseToMobile(); private: + smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification( + const uint32_t connection_key, ApplicationSharedPtr app); + + /** + * @brief Sends OnAppRegistered notification to HMI + * + *@param application_impl application with changed HMI status + * + **/ + void SendOnAppRegisteredNotificationToHMI(const Application& application_impl, + bool resumption = false, + bool need_restore_vr = false); /* * @brief Check new ID along with known mobile application ID * @@ -100,22 +115,21 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { mobile_apis::Result::eType CheckCoincidence(); /* - * @brief Predicate for using with CheckCoincidence method to compare with VR synonym SO + * @brief Predicate for using with CheckCoincidence method to compare with VR + * synonym SO * * return TRUE if there is coincidence of VR, otherwise FALSE */ struct CoincidencePredicateVR { - explicit CoincidencePredicateVR(const std::string &newItem) - :newItem_(newItem) - {}; - - bool operator()(smart_objects::SmartObject obj) { - const std::string vr_synonym = obj.asString(); - return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str())); - }; + CoincidencePredicateVR(const custom_str::CustomString& newItem) + : newItem_(newItem) {} - const std::string &newItem_; - }; + bool operator()(const smart_objects::SmartObject& obj) { + const custom_str::CustomString& vr_synonym = obj.asCustomString(); + return newItem_.CompareIgnoreCase(vr_synonym); + } + const custom_str::CustomString& newItem_; + }; /** * @brief Check request parameters against policy table data @@ -153,11 +167,11 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { */ void SendSubscribeCustomButtonNotification(); -private: + private: std::string response_info_; mobile_apis::Result::eType result_checking_app_hmi_type_; - + policy::PolicyHandlerInterface& GetPolicyHandler(); DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h index 1244cb65f8..b125cc7c55 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h @@ -47,15 +47,14 @@ class RegisterAppInterfaceResponse : public CommandResponseImpl { /** * \brief RegisterAppInterfaceResponse class constructor **/ - explicit RegisterAppInterfaceResponse(const MessageSharedPtr& response) - : CommandResponseImpl(response) { - } + RegisterAppInterfaceResponse(const MessageSharedPtr& response, + ApplicationManager& application_manager) + : CommandResponseImpl(response, application_manager) {} /** * \brief RegisterAppInterfaceResponse class destructor **/ - virtual ~RegisterAppInterfaceResponse() { - } + virtual ~RegisterAppInterfaceResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h index d7abe38c11..0053c14f3c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h @@ -52,7 +52,8 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit ResetGlobalPropertiesRequest(const MessageSharedPtr& message); + ResetGlobalPropertiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ResetGlobalPropertiesRequest class destructor @@ -103,7 +104,8 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl { * * @return TRUE on success, otherwise FALSE */ - bool ResetVrHelpTitleItems(application_manager::ApplicationSharedPtr const app); + bool ResetVrHelpTitleItems( + application_manager::ApplicationSharedPtr const app); /* * @brief Check if there some not delivered hmi responses exist diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h index 7c0b8eb00b..39e28486d4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h @@ -51,7 +51,8 @@ class ResetGlobalPropertiesResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit ResetGlobalPropertiesResponse(const MessageSharedPtr& message); + ResetGlobalPropertiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ResetGlobalPropertiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h index a810f4eb2d..b3058c9a26 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h @@ -50,7 +50,8 @@ class ScrollableMessageRequest : public CommandRequestImpl { /** * @brief ScrollableMessageRequest class constructor **/ - explicit ScrollableMessageRequest(const MessageSharedPtr& message); + ScrollableMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SliderCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h index f0c0ea8f7a..aa0ac01e9d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h @@ -45,13 +45,13 @@ class ScrollableMessageResponse : public CommandResponseImpl { /** * \brief ScrollableMessageResponse class constructor **/ - explicit ScrollableMessageResponse(const MessageSharedPtr& message); + ScrollableMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakResponseCommand class destructor **/ - virtual ~ScrollableMessageResponse() { - } + virtual ~ScrollableMessageResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h index 581c779aa5..570e70d007 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h @@ -34,6 +34,7 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_ +#include <list> #include "application_manager/commands/command_request_impl.h" namespace application_manager { @@ -48,7 +49,8 @@ class SendLocationRequest : public CommandRequestImpl { /** * @brief SendLocationRquest class constructor */ - explicit SendLocationRequest(const MessageSharedPtr& message); + SendLocationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SendLocationRquest class destructor @@ -67,8 +69,13 @@ class SendLocationRequest : public CommandRequestImpl { */ virtual void on_event(const event_engine::Event& event); - private: + /** + * @brief CheckFieldsCompatibility checks if fields are compatible with each + * other. + * @return true if compatible, otherwise return false + */ + bool CheckFieldsCompatibility(); /** * @brief Checks sendlocation params(locationName, locationDescription, ...). @@ -77,7 +84,8 @@ class SendLocationRequest : public CommandRequestImpl { */ bool IsWhiteSpaceExist(); - bool CheckHMICapabilities(std::list<hmi_apis::Common_TextFieldName::eType>& fields_names); + bool CheckHMICapabilities( + std::vector<hmi_apis::Common_TextFieldName::eType>& fields_names); DISALLOW_COPY_AND_ASSIGN(SendLocationRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h index fe88a2af29..0be0be8ca3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h @@ -36,7 +36,6 @@ #include "application_manager/commands/command_response_impl.h" #include "application_manager/message.h" - namespace application_manager { namespace commands { @@ -45,7 +44,8 @@ class SendLocationResponse : public CommandResponseImpl { /** * @brief SendLocationResponse class constructor */ - explicit SendLocationResponse(const MessageSharedPtr& message); + SendLocationResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SendLocationResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h index da21decd81..42eedad19b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h @@ -49,17 +49,15 @@ class SetAppIconRequest : public CommandRequestImpl { /** * @brief Contains information about the type of image */ - typedef enum { - STATIC = 0, - DYNAMIC - } ImageType; + typedef enum { STATIC = 0, DYNAMIC } ImageType; /** * @brief SetIconRequest class constructor * * @param message Incoming SmartObject message **/ - explicit SetAppIconRequest(const MessageSharedPtr& message); + SetAppIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetIconRequest class destructor @@ -101,11 +99,11 @@ class SetAppIconRequest : public CommandRequestImpl { bool IsEnoughSpaceForIcon(const uint64_t icon_size) const; DISALLOW_COPY_AND_ASSIGN(SetAppIconRequest); -private: + private: /** * @brief Checks, if icons saving to configured folder is enabled */ - static int8_t is_icons_saving_enabled_; + bool is_icons_saving_enabled_; }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h index 02be7fe37e..6061cf5702 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h @@ -51,7 +51,8 @@ class SetAppIconResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SetAppIconResponse(const MessageSharedPtr& message); + SetAppIconResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetIconResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h index 925a1cd67f..06e8d70f79 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h @@ -51,7 +51,8 @@ class SetDisplayLayoutRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit SetDisplayLayoutRequest(const MessageSharedPtr& message); + SetDisplayLayoutRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetDisplayLayoutRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h index dbf3de8d88..a2040307b0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h @@ -51,7 +51,8 @@ class SetDisplayLayoutResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SetDisplayLayoutResponse(const MessageSharedPtr& message); + SetDisplayLayoutResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetDisplayLayoutResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h index d9e18dd76f..aa26a70393 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h @@ -1,6 +1,5 @@ /* - - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2015, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without @@ -36,6 +35,7 @@ #include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" +#include "application_manager/application.h" namespace application_manager { @@ -51,7 +51,8 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit SetGlobalPropertiesRequest(const MessageSharedPtr& message); + SetGlobalPropertiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetGlobalPropertiesRequest class destructor @@ -71,21 +72,42 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /* - * @brief Chec if HelpItems order is correct - * - * @return TRUE on success, otherwise FALSE - */ - bool CheckVrHelpItemsOrder(); + // 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 ApplicationSharedPtr app, + const smart_objects::SmartObject& msg_params, + smart_objects::SmartObject& out_params); + + static bool PrepareUIRequestDefaultVRHelpData( + const ApplicationSharedPtr app, smart_objects::SmartObject& out_params); + + static void PrepareUIRequestMenuAndKeyboardData( + const ApplicationSharedPtr app, + const smart_objects::SmartObject& msg_params, + smart_objects::SmartObject& out_params); + + // Send TTS request to HMI + void SendTTSRequest(const smart_objects::SmartObject& params, + bool use_events); + + // Send UI request to HMI + void SendUIRequest(const smart_objects::SmartObject& params, bool use_events); - /* + // VRHelp shall contain sequential positions and start from 1 + static bool CheckVrHelpItemsOrder(const smart_objects::SmartObject& vr_help); + + /** * @brief Check if there some not delivered hmi responses exist * * @return true if all responses received */ bool IsPendingResponseExist(); - /* + /** * @brief Checks if request has at least one parameter * * @param params request parameters @@ -103,8 +125,6 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { */ bool IsWhiteSpaceExist(); - DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest); - bool is_ui_send_; bool is_tts_send_; @@ -113,6 +133,8 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { hmi_apis::Common_Result::eType ui_result_; hmi_apis::Common_Result::eType tts_result_; + + DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h index dd80e738e3..c5beda084d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h @@ -51,7 +51,8 @@ class SetGlobalPropertiesResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SetGlobalPropertiesResponse(const MessageSharedPtr& message); + SetGlobalPropertiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetGlobalPropertiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h index d46094032a..96d4ac6f1e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h @@ -35,6 +35,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_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 application_manager { @@ -49,17 +50,15 @@ class SetIconRequest : public CommandRequestImpl { /** * @brief Contains information about the type of image */ - typedef enum { - STATIC = 0, - DYNAMIC - } ImageType; + typedef enum { STATIC = 0, DYNAMIC } ImageType; /** * @brief SetIconRequest class constructor * * @param message Incoming SmartObject message **/ - explicit SetIconRequest(const MessageSharedPtr& message); + SetIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetIconRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h index 88dceaf5a2..83be0d4a4b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h @@ -35,6 +35,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_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 application_manager { @@ -51,7 +52,7 @@ class SetIconResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SetIconResponse(const MessageSharedPtr& message); + SetIconResponse(const MessageSharedPtr& message, ApplicationManager& app_man); /** * @brief SetIconResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h index e4fae5c0b3..283dd41622 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h @@ -49,7 +49,8 @@ class SetMediaClockRequest : public CommandRequestImpl { /** * \brief SetMediaClockRequest class constructor **/ - explicit SetMediaClockRequest(const MessageSharedPtr& message); + SetMediaClockRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief ShowCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h index 46844bd2f3..3f41ae2dab 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h @@ -45,7 +45,8 @@ class SetMediaClockTimerResponse : public CommandResponseImpl { /** * \brief SetMediaClockTimerResponse class constructor **/ - explicit SetMediaClockTimerResponse(const MessageSharedPtr& message); + SetMediaClockTimerResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SetMediaClockTimerResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h index a22ee9852a..f015d740df 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h @@ -52,7 +52,8 @@ class ShowConstantTBTRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit ShowConstantTBTRequest(const MessageSharedPtr& message); + ShowConstantTBTRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ShowConstantTBTRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h index 6a102b1984..73aad5de89 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h @@ -51,7 +51,8 @@ class ShowConstantTBTResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit ShowConstantTBTResponse(const MessageSharedPtr& message); + ShowConstantTBTResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ShowConstantTBTResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h index 091cab3bfd..cbe2ca396a 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h @@ -50,7 +50,8 @@ class ShowRequest : public CommandRequestImpl { /** * \brief ShowRequest class constructor **/ - explicit ShowRequest(const MessageSharedPtr& message); + ShowRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief ShowRequest class destructor @@ -70,7 +71,6 @@ class ShowRequest : public CommandRequestImpl { virtual void on_event(const event_engine::Event& event); private: - /* * @brief Check if all strings have valid syntax in request * diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h index c327bc3b3a..0a54fb9cde 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h @@ -45,7 +45,8 @@ class ShowResponse : public CommandResponseImpl { /** * \brief ShowResponse class constructor **/ - explicit ShowResponse(const MessageSharedPtr& message); + ShowResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief ShowResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h index de24438ddd..2446c9ff20 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h @@ -49,7 +49,8 @@ class SliderRequest : public CommandRequestImpl { /** * \brief SliderRequest class constructor **/ - explicit SliderRequest(const MessageSharedPtr& message); + SliderRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SliderRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h index 1888388e7c..bc0efaadd0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h @@ -45,7 +45,8 @@ class SliderResponse : public CommandResponseImpl { /** * \brief SliderResponse class constructor **/ - explicit SliderResponse(const MessageSharedPtr& message); + SliderResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakResponseCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h index 7d3b2096af..dc22652b27 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h @@ -49,7 +49,8 @@ class SpeakRequest : public CommandRequestImpl { /** * \brief SpeakRequest class constructor **/ - explicit SpeakRequest(const MessageSharedPtr& message); + SpeakRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h index cbf1ec40de..2808526603 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h @@ -45,7 +45,8 @@ class SpeakResponse : public CommandResponseImpl { /** * \brief SpeakResponse class constructor **/ - explicit SpeakResponse(const MessageSharedPtr& message); + SpeakResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h index 12168e2473..b5a22d40a9 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h @@ -52,7 +52,8 @@ class SubscribeButtonRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit SubscribeButtonRequest(const MessageSharedPtr& message); + SubscribeButtonRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SubscribeButtonRequest class destructor @@ -65,7 +66,6 @@ class SubscribeButtonRequest : public CommandRequestImpl { virtual void Run(); private: - /** * @brief Checks if button subscription allowed. In case non-media * application trying to subscribe on buttons(tune, seek) negative result will diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h index 8366884540..38e0dd2dc6 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h @@ -51,7 +51,8 @@ class SubscribeButtonResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SubscribeButtonResponse(const MessageSharedPtr& message); + SubscribeButtonResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SubscribeButtonResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h index 288500e7e8..6b2c2bb616 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h @@ -35,6 +35,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_ #include "application_manager/commands/command_request_impl.h" +#include "application_manager/application.h" #include "utils/macro.h" namespace application_manager { @@ -51,7 +52,8 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit SubscribeVehicleDataRequest(const MessageSharedPtr& message); + SubscribeVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SubscribeButtonCommandRequest class destructor @@ -82,12 +84,45 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl { typedef std::vector<HmiRequest> HmiRequests; HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API private: - bool IsAnythingAlreadySubscribed( + /** + * @brief Checks, if any app is subscribed for particular VI parameter + * @param param_id VI parameter id + * @return true, if there are registered apps subscribed for VI parameter, + * otherwise - false + */ + bool IsSomeoneSubscribedFor(const uint32_t param_id) const; + + /** + * @brief Adds VI parameters being subscribed by another or the same app to + * response with appropriate results + * @param msg_params 'message_params' response section reference + */ + void AddAlreadySubscribedVI(smart_objects::SmartObject& msg_params) const; + + /** + * @brief Removes subscription for VI parameters which subsription attempt + * returned an error + * @param app Pointer to application sent subscribe request + * @param msg_params 'message_parameters' response section reference + */ + void UnsubscribeFailedSubscriptions( + ApplicationSharedPtr app, const smart_objects::SmartObject& msg_params) const; + /** + * @brief VI parameters which had been already subscribed by another apps + * befor particular app subscribed for these parameters + */ + VehicleInfoSubscriptions vi_already_subscribed_by_another_apps_; + + /** + * @brief VI parameters which had been subscribed already by particular app + */ + VehicleInfoSubscriptions vi_already_subscribed_by_this_app_; + DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h index d2771c0712..7e3cffc387 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h @@ -51,7 +51,8 @@ class SubscribeVehicleDataResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SubscribeVehicleDataResponse(const MessageSharedPtr& message); + SubscribeVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeVehicleDataCommandRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h new file mode 100644 index 0000000000..50b3a6f2cb --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h @@ -0,0 +1,77 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief SubsribeWayPointsRequest command class + **/ +class SubscribeWayPointsRequest : public CommandRequestImpl { + public: + /** + * \brief SubscribeWayPointsRequest class constructor + **/ + SubscribeWayPointsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * \brief SubscribeWayPointsRequest class destructor + **/ + virtual ~SubscribeWayPointsRequest(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h new file mode 100644 index 0000000000..cfdc0eede7 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h @@ -0,0 +1,72 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief SubscribeWayPointsResponse command class + **/ +class SubscribeWayPointsResponse : public CommandResponseImpl { + public: + /** + * \brief SubscribeWayPointsResponse class constructor + **/ + SubscribeWayPointsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * \brief SubscribeWayPointsResponse class destructor + **/ + virtual ~SubscribeWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h index 25accb1db2..de87512e92 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h @@ -36,6 +36,9 @@ #include <string> #include "application_manager/commands/command_request_impl.h" +#include "application_manager/application_manager.h" +#include "application_manager/event_engine/event.h" +#include "smart_objects/smart_object.h" namespace NsSmartDeviceLink { namespace NsSmartObjects { @@ -57,7 +60,8 @@ class SystemRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit SystemRequest(const MessageSharedPtr& message); + SystemRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SystemRequest class destructor @@ -76,17 +80,17 @@ class SystemRequest : public CommandRequestImpl { */ virtual void on_event(const event_engine::Event& event); -private: + private: /** * @brief Validates data coming within QueryApps response * @param data Data * @return true, if data is valid, otherwise - false */ - bool ValidateQueryAppData(const smart_objects::SmartObject& data) const; + bool ValidateQueryAppData(smart_objects::SmartObject& data) const; private: static uint32_t index; - std::string processing_file_; + std::string processing_file_; DISALLOW_COPY_AND_ASSIGN(SystemRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h index ca2fb99970..3f48db7f0e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h @@ -36,7 +36,6 @@ #include "application_manager/commands/command_response_impl.h" - namespace application_manager { namespace commands { @@ -51,7 +50,8 @@ class SystemResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit SystemResponse(const MessageSharedPtr& message); + SystemResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SystemResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h index a5a53736e2..acc7374e18 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h @@ -49,15 +49,14 @@ class UnregisterAppInterfaceRequest : public CommandRequestImpl { /** * \brief UnregisterAppInterfaceRequest class constructor **/ - explicit UnregisterAppInterfaceRequest(const MessageSharedPtr& message) - : CommandRequestImpl(message) { - } + UnregisterAppInterfaceRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} /** * \brief UnregisterAppInterfaceRequest class destructor **/ - virtual ~UnregisterAppInterfaceRequest() { - } + virtual ~UnregisterAppInterfaceRequest() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h index 5c8928a6c8..1a459e109c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h @@ -47,15 +47,14 @@ class UnregisterAppInterfaceResponse : public CommandResponseImpl { /** * \brief UnregisterAppInterfaceResponse class constructor **/ - explicit UnregisterAppInterfaceResponse(const MessageSharedPtr& response) - : CommandResponseImpl(response) { - } + UnregisterAppInterfaceResponse(const MessageSharedPtr& response, + ApplicationManager& application_manager) + : CommandResponseImpl(response, application_manager) {} /** * \brief UnregisterAppInterfaceResponse class destructor **/ - virtual ~UnregisterAppInterfaceResponse() { - } + virtual ~UnregisterAppInterfaceResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h index 58c9dc8de9..62600d51d7 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h @@ -51,7 +51,8 @@ class UnsubscribeButtonRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit UnsubscribeButtonRequest(const MessageSharedPtr& message); + UnsubscribeButtonRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeButtonRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h index 972da48065..06dbe84578 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h @@ -51,7 +51,8 @@ class UnsubscribeButtonResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit UnsubscribeButtonResponse(const MessageSharedPtr& message); + UnsubscribeButtonResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeButtonResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h index dd52a77224..a6bade2fd6 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h @@ -35,6 +35,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_ #include "application_manager/commands/command_request_impl.h" +#include "application_manager/application.h" #include "utils/macro.h" namespace application_manager { @@ -51,7 +52,8 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit UnsubscribeVehicleDataRequest(const MessageSharedPtr& message); + UnsubscribeVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeVehicleDataRequest class destructor @@ -82,11 +84,40 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { typedef std::vector<HmiRequest> HmiRequests; HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API private: - bool IsAnythingAlreadyUnsubscribed( - const smart_objects::SmartObject& msg_params) const; + /** + * @brief Checks, if any app is subscribed for particular VI parameter + * @param param_id VI parameter id + * @return true, if there are registered apps subscribed for VI parameter, + * otherwise - false + */ + bool IsSomeoneSubscribedFor(const uint32_t param_id) const; + + /** + * @brief Adds VI parameters being unsubscribed by another or the same app to + * response with appropriate results + * @param msg_params 'message_params' response section reference + */ + void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const; + + /** + * @brief Allows to update hash after sending response to mobile. + */ + void UpdateHash() const; + + /** + * @brief VI parameters which still being subscribed by another apps after + * particular app had been unsubscribed from these parameters + */ + VehicleInfoSubscriptions vi_still_subscribed_by_another_apps_; + + /** + * @brief VI parameters which had been unsubscribed already by particular app + */ + VehicleInfoSubscriptions vi_already_unsubscribed_by_this_app_; + DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h index 3fb932ecf3..a34a36688c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h @@ -51,7 +51,8 @@ class UnsubscribeVehicleDataResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit UnsubscribeVehicleDataResponse(const MessageSharedPtr& message); + UnsubscribeVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h new file mode 100644 index 0000000000..2831551667 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h @@ -0,0 +1,74 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace application_manager { + +namespace commands { + +class UnSubscribeWayPointsRequest : public CommandRequestImpl { + public: + /** + * \brief UnSubscribeWayPointsRequest class constructor + **/ + UnSubscribeWayPointsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * \brief UnSubscribeWayPointsRequest class destructor + **/ + virtual ~UnSubscribeWayPointsRequest(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h new file mode 100644 index 0000000000..70211330a9 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h @@ -0,0 +1,72 @@ +/* + * 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief UnsubscribeWayPointsResponse command class + **/ +class UnsubscribeWayPointsResponse : public CommandResponseImpl { + public: + /** + * \brief UnsubscribeWayPointsResponse class constructor + **/ + UnsubscribeWayPointsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * \brief UnsubscribeWayPointsResponse class destructor + **/ + virtual ~UnsubscribeWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h index c65c2bc534..e15e81caf5 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h @@ -52,7 +52,8 @@ class UpdateTurnListRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - explicit UpdateTurnListRequest(const MessageSharedPtr& message); + UpdateTurnListRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateTurnListRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h index fdbf64826c..481ad9f219 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h @@ -51,7 +51,8 @@ class UpdateTurnListResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - explicit UpdateTurnListResponse(const MessageSharedPtr& message); + UpdateTurnListResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateTurnListResponse class destructor |