diff options
author | Alexander Kutsan <akutsan@luxoft.com> | 2017-08-10 15:31:01 +0300 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2017-08-16 22:50:03 +0300 |
commit | b5a0e3cc04aa111661d15562a2b1b53d25e1cdb8 (patch) | |
tree | 0613b13aefc948d2196e3201b20f9c06caf0d3a4 /src/components | |
parent | e8f4b4fef6ccb7106fe0a0c4e2b4e828e20ee926 (diff) | |
download | sdl_core-b5a0e3cc04aa111661d15562a2b1b53d25e1cdb8.tar.gz |
Implementation of system capabilities
Diffstat (limited to 'src/components')
28 files changed, 1293 insertions, 36 deletions
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index e61411d063..9a50ca549e 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -335,6 +335,10 @@ set (HMI_COMMANDS_SOURCES ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_request.cc ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_response.cc ${COMMANDS_SOURCE_DIR}/hmi/ui_set_icon_request.cc + ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_request.cc + ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_response.cc + ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_request.cc + ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_response.cc ) set (HMI_COMMANDS_SOURCES_JSON diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h new file mode 100644 index 0000000000..58654d81d9 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_ + +#include "application_manager/commands/hmi/request_to_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief RCGetCapabilitiesRequest command class + **/ +class RCGetCapabilitiesRequest : public RequestToHMI { + public: + /** + * @brief RCGetCapabilitiesRequest class constructor + * + * @param message Incoming SmartObject message + **/ + RCGetCapabilitiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief RCGetCapabilitiesRequest class destructor + **/ + virtual ~RCGetCapabilitiesRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h new file mode 100644 index 0000000000..006f38cbb5 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_ + +#include "application_manager/commands/hmi/response_from_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief RCGetCapabilitiesResponse command class + **/ +class RCGetCapabilitiesResponse : public ResponseFromHMI { + public: + /** + * @brief RCGetCapabilitiesResponse class constructor + * + * @param message Incoming SmartObject message + **/ + RCGetCapabilitiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief RCGetCapabilitiesResponse class destructor + **/ + virtual ~RCGetCapabilitiesResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h new file mode 100644 index 0000000000..40e05c2b1f --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_ + +#include "application_manager/commands/hmi/request_to_hmi.h" +#include "application_manager/message_helper.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief RCIsReadyRequest command class + **/ +class RCIsReadyRequest : public RequestToHMI, + public event_engine::EventObserver { + public: + /** + * @brief RCIsReadyRequest class constructor + * + * @param message Incoming SmartObject message + **/ + RCIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief RCIsReadyRequest class destructor + **/ + virtual ~RCIsReadyRequest(); + + /** + * @brief Execute command + **/ + void Run() OVERRIDE; + + /** + * @brief On event callback + **/ + void on_event(const event_engine::Event& event) OVERRIDE; + + /** + * @brief onTimeOut from requrst Controller + */ + void onTimeOut() OVERRIDE; + + /** + * @brief Send request to HMI for fetching of cappabilities + */ + void SendMessageToHMI(); + + private: + DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h new file mode 100644 index 0000000000..547b89a30d --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_ + +#include "application_manager/commands/hmi/response_from_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief RCIsReadyResponse command class + **/ +class RCIsReadyResponse : public ResponseFromHMI { + public: + /** + * @brief RCIsReadyResponse class constructor + * + * @param message Incoming SmartObject message + **/ + RCIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief RCIsReadyResponse class destructor + **/ + virtual ~RCIsReadyResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(RCIsReadyResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index bdc1b0c633..cbab1fcc80 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -91,6 +91,9 @@ class HMICapabilitiesImpl : public HMICapabilities { bool is_ivi_cooperating() const OVERRIDE; void set_is_ivi_cooperating(const bool value) OVERRIDE; + bool is_rc_cooperating() const OVERRIDE; + void set_is_rc_cooperating(const bool value) OVERRIDE; + /* * @brief Interface used to store information about software version of the *target @@ -471,6 +474,11 @@ class HMICapabilitiesImpl : public HMICapabilities { */ const smart_objects::SmartObject* video_streaming_capability() const OVERRIDE; + void set_rc_capability( + const smart_objects::SmartObject& rc_capability) OVERRIDE; + + const smart_objects::SmartObject* rc_capability() const OVERRIDE; + void Init(resumption::LastState* last_state) OVERRIDE; /* @@ -526,6 +534,7 @@ class HMICapabilitiesImpl : public HMICapabilities { bool is_ui_cooperating_; bool is_navi_cooperating_; bool is_ivi_cooperating_; + bool is_rc_cooperating_; bool attenuated_supported_; hmi_apis::Common_Language::eType ui_language_; @@ -552,6 +561,7 @@ class HMICapabilitiesImpl : public HMICapabilities { smart_objects::SmartObject* navigation_capability_; smart_objects::SmartObject* phone_capability_; smart_objects::SmartObject* video_streaming_capability_; + smart_objects::SmartObject* rc_capability_; ApplicationManager& app_mngr_; HMILanguageHandler hmi_language_handler_; diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h index df1e2a9067..59ec32694a 100644 --- a/src/components/application_manager/include/application_manager/hmi_interfaces.h +++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h @@ -59,7 +59,8 @@ class HmiInterfaces { HMI_INTERFACE_UI, HMI_INTERFACE_Navigation, HMI_INTERFACE_VehicleInfo, - HMI_INTERFACE_SDL + HMI_INTERFACE_SDL, + HMI_INTERFACE_RC }; /** diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 78085078e0..6fbb477507 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -173,6 +173,7 @@ extern const char* system_capabilities; extern const char* navigation_capability; extern const char* phone_capability; extern const char* video_streaming_capability; +extern const char* rc_capability; // PutFile extern const char* sync_file_name; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index e6f0db0c0d..965efa4226 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -725,6 +725,11 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { hmi_apis::FunctionID::VehicleInfo_IsReady, *this)); ManageHMICommand(is_ivi_ready); + utils::SharedPtr<smart_objects::SmartObject> is_rc_ready( + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady, + *this)); + ManageHMICommand(is_rc_ready); + utils::SharedPtr<smart_objects::SmartObject> button_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Buttons_GetCapabilities, *this)); diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 6ecb2bf3a2..10030b3837 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -89,6 +89,9 @@ const std::string CreateInfoForUnsupportedResult( case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): { return "VehicleInfo is not supported by system"; } + case (HmiInterfaces::InterfaceID::HMI_INTERFACE_RC): { + return "Remote control is not supported by system"; + } default: #ifdef ENABLE_LOG CREATE_LOGGERPTR_LOCAL(logger, "Commands"); diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc new file mode 100644 index 0000000000..32b296a3b9 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/hmi/rc_get_capabilities_request.h" + +namespace application_manager { + +namespace commands { + +RCGetCapabilitiesRequest::RCGetCapabilitiesRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} + +RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {} + +void RCGetCapabilitiesRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + SendRequest(); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc new file mode 100644 index 0000000000..649a91939c --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "application_manager/commands/hmi/rc_get_capabilities_response.h" + +namespace application_manager { + +namespace commands { + +RCGetCapabilitiesResponse::RCGetCapabilitiesResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} + +RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {} + +void RCGetCapabilitiesResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); + + if ((*message_)[strings::msg_params].keyExists(strings::rc_capability)) { + hmi_capabilities.set_rc_capability( + (*message_)[strings::msg_params][strings::rc_capability]); + } +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc new file mode 100644 index 0000000000..71b803d198 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/hmi/rc_is_ready_request.h" + +namespace application_manager { + +namespace commands { + +RCIsReadyRequest::RCIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) + , EventObserver(application_manager.event_dispatcher()) {} + +RCIsReadyRequest::~RCIsReadyRequest() {} + +void RCIsReadyRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id()); + SendRequest(); +} + +void RCIsReadyRequest::on_event(const event_engine::Event& event) { + LOG4CXX_AUTO_TRACE(logger_); + const smart_objects::SmartObject& message = event.smart_object(); + switch (event.id()) { + case hmi_apis::FunctionID::RC_IsReady: { + LOG4CXX_DEBUG(logger_, "Received RC_IsReady event"); + unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady); + const bool is_available = ChangeInterfaceState( + application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC); + + HMICapabilities& hmi_capabilities = + application_manager_.hmi_capabilities(); + hmi_capabilities.set_is_rc_cooperating(is_available); + if (!CheckAvailabilityHMIInterfaces(application_manager_, + HmiInterfaces::HMI_INTERFACE_RC)) { + LOG4CXX_INFO(logger_, + "HmiInterfaces::HMI_INTERFACE_VR isn't available"); + return; + } + SendMessageToHMI(); + break; + } + default: { + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + return; + } + } +} + +void RCIsReadyRequest::onTimeOut() { + // Note(dtrunov): According to new requirment APPLINK-27956 + SendMessageToHMI(); +} + +void RCIsReadyRequest::SendMessageToHMI() { + utils::SharedPtr<smart_objects::SmartObject> get_capabilities( + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::RC_GetCapabilities, application_manager_)); + application_manager_.ManageHMICommand(get_capabilities); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc new file mode 100644 index 0000000000..6756b294f3 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "application_manager/commands/hmi/rc_is_ready_response.h" + +namespace application_manager { + +namespace commands { + +RCIsReadyResponse::RCIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} + +RCIsReadyResponse::~RCIsReadyResponse() {} + +void RCIsReadyResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + event_engine::Event event(hmi_apis::FunctionID::RC_IsReady); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc index ca0fb1b355..af4acbea13 100644 --- a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc @@ -59,6 +59,16 @@ void GetSystemCapabilityRequest::Run() { } break; } + case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: { + if (hmi_capabilities.rc_capability()) { + response_params[strings::system_capability][strings::rc_capability] = + *hmi_capabilities.rc_capability(); + } else { + SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); + return; + } + break; + } case mobile_apis::SystemCapabilityType::VIDEO_STREAMING: if (hmi_capabilities.video_streaming_capability()) { response_params[strings::system_capability] @@ -68,13 +78,16 @@ void GetSystemCapabilityRequest::Run() { SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); return; } + SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); + return; break; case mobile_apis::SystemCapabilityType::AUDIO_STREAMING: SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; + break; default: // Return unsupported resource SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); - return; + break; } SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); } diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 99a77d5ba7..35a48a740d 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -369,6 +369,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr) , is_ui_cooperating_(false) , is_navi_cooperating_(false) , is_ivi_cooperating_(false) + , is_rc_cooperating_(false) , attenuated_supported_(false) , ui_language_(hmi_apis::Common_Language::INVALID_ENUM) , vr_language_(hmi_apis::Common_Language::INVALID_ENUM) @@ -393,6 +394,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr) , navigation_capability_(NULL) , phone_capability_(NULL) , video_streaming_capability_(NULL) + , rc_capability_(NULL) , app_mngr_(app_mngr) , hmi_language_handler_(app_mngr) { InitCapabilities(); @@ -402,6 +404,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr) is_ui_cooperating_ = true; is_navi_cooperating_ = true; is_ivi_cooperating_ = true; + is_rc_cooperating_ = true; } } @@ -423,6 +426,7 @@ HMICapabilitiesImpl::~HMICapabilitiesImpl() { delete navigation_capability_; delete phone_capability_; delete video_streaming_capability_; + delete rc_capability_; } bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const { @@ -463,6 +467,10 @@ void HMICapabilitiesImpl::set_is_ivi_cooperating(const bool value) { is_ivi_cooperating_ = value; } +void HMICapabilitiesImpl::set_is_rc_cooperating(const bool value) { + is_rc_cooperating_ = value; +} + void HMICapabilitiesImpl::set_attenuated_supported(const bool state) { attenuated_supported_ = state; } @@ -666,6 +674,12 @@ void HMICapabilitiesImpl::set_video_streaming_capability( } video_streaming_capability_ = new smart_objects::SmartObject(video_streaming_capability); +void HMICapabilitiesImpl::set_rc_capability( + const smart_objects::SmartObject& rc_capability) { + if (rc_capability_) { + delete rc_capability_; + } + rc_capability_ = new smart_objects::SmartObject(rc_capability); } void HMICapabilitiesImpl::Init(resumption::LastState* last_state) { @@ -699,6 +713,10 @@ bool HMICapabilitiesImpl::is_ivi_cooperating() const { return is_ivi_cooperating_; } +bool HMICapabilitiesImpl::is_rc_cooperating() const { + return is_rc_cooperating_; +} + const smart_objects::SmartObject* HMICapabilitiesImpl::ui_supported_languages() const { return ui_supported_languages_; @@ -796,6 +814,9 @@ const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability() const smart_objects::SmartObject* HMICapabilitiesImpl::video_streaming_capability() const { return video_streaming_capability_; + + const smart_objects::SmartObject* HMICapabilitiesImpl::rc_capability() const { + return rc_capability_; } bool HMICapabilitiesImpl::load_capabilities_from_file() { @@ -1109,6 +1130,15 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { } set_video_streaming_capability(vs_capability_so); } + if (check_existing_json_member(system_capabilities, + "remoteControlCapability")) { + Json::Value rc_capability = + system_capabilities.get("remoteControlCapability", ""); + smart_objects::SmartObject rc_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability, + rc_capability_so); + set_rc_capability(rc_capability_so); + } } } // UI end diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index d02d9060eb..6fffd050b8 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -279,6 +279,11 @@ #include "application_manager/commands/hmi/dial_number_request.h" #include "application_manager/commands/hmi/dial_number_response.h" +#include "application_manager/commands/hmi/rc_is_ready_request.h" +#include "application_manager/commands/hmi/rc_is_ready_response.h" +#include "application_manager/commands/hmi/rc_get_capabilities_request.h" +#include "application_manager/commands/hmi/rc_get_capabilities_response.h" + CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace application_manager { @@ -2264,6 +2269,26 @@ CommandSharedPtr HMICommandFactory::CreateCommand( message, application_manager)); break; } + case hmi_apis::FunctionID::RC_IsReady: { + if (is_response) { + command.reset( + new commands::RCIsReadyResponse(message, application_manager)); + } else { + command.reset( + new commands::RCIsReadyRequest(message, application_manager)); + } + break; + } + case hmi_apis::FunctionID::RC_GetCapabilities: { + if (is_response) { + command.reset(new commands::RCGetCapabilitiesResponse( + message, application_manager)); + } else { + command.reset(new commands::RCGetCapabilitiesRequest( + message, application_manager)); + } + break; + } } return command; } diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc index 3f05252b02..e961c4e4d0 100644 --- a/src/components/application_manager/src/hmi_interfaces_impl.cc +++ b/src/components/application_manager/src/hmi_interfaces_impl.cc @@ -216,6 +216,8 @@ generate_function_to_interface_convert_map() { convert_map[SDL_OnSystemError] = HmiInterfaces::HMI_INTERFACE_SDL; convert_map[SDL_AddStatisticsInfo] = HmiInterfaces::HMI_INTERFACE_SDL; convert_map[SDL_GetURLS] = HmiInterfaces::HMI_INTERFACE_SDL; + convert_map[RC_IsReady] = HmiInterfaces::HMI_INTERFACE_RC; + convert_map[RC_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_RC; return convert_map; } @@ -237,6 +239,8 @@ HmiInterfacesImpl::HmiInterfacesImpl() { HmiInterfaces::STATE_NOT_RESPONSE; interfaces_states_[HmiInterfaces::HMI_INTERFACE_VR] = HmiInterfaces::STATE_NOT_RESPONSE; + interfaces_states_[HmiInterfaces::HMI_INTERFACE_RC] = + HmiInterfaces::STATE_NOT_RESPONSE; } HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState( diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 7294b4c1a2..f2d5a29746 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -140,6 +140,7 @@ const char* system_capabilities = "systemCapabilities"; const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; const char* video_streaming_capability = "videoStreamingCapability"; +const char* rc_capability = "remoteControlCapability"; const char* device_rank = "deviceRank"; // PutFile diff --git a/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc new file mode 100644 index 0000000000..f851bd644a --- /dev/null +++ b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdint.h> + +#include "gtest/gtest.h" +#include "utils/shared_ptr.h" +#include "smart_objects/smart_object.h" +#include "interfaces/MOBILE_API.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/smart_object_keys.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/hmi/rc_get_capabilities_response.h" + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace rc_get_capabilities_response { + +using ::utils::SharedPtr; +using ::testing::NiceMock; +namespace am = ::application_manager; +namespace strings = am::strings; +namespace hmi_response = am::hmi_response; +using am::commands::RCGetCapabilitiesResponse; +using am::commands::CommandImpl; + +typedef SharedPtr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr; +typedef NiceMock< + ::test::components::application_manager_test::MockHMICapabilities> + MockHMICapabilities; + +namespace { +const uint32_t kConnectionKey = 2u; +} // namespace + +class RCGetCapabilitiesResponseTest + : public CommandsTest<CommandsTestMocks::kIsNice> { + public: + MessageSharedPtr CreateCommandMsg() { + MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); + (*command_msg)[strings::msg_params][strings::number] = "123"; + (*command_msg)[strings::params][strings::connection_key] = kConnectionKey; + (*command_msg)[strings::params][hmi_response::code] = + hmi_apis::Common_Result::SUCCESS; + (*command_msg)[strings::msg_params][strings::rc_capability] = + (capabilities_); + + return command_msg; + } + + MockHMICapabilities mock_hmi_capabilities_; + SmartObject capabilities_; +}; + +TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + + RCGetCapabilitiesResponsePtr command( + CreateCommand<RCGetCapabilitiesResponse>(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + smart_objects::SmartObject rc_capability_so = + (*command_msg)[strings::msg_params][strings::rc_capability]; + + EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so)); + + command->Run(); +} + +} // namespace rc_get_capabilities_response +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc new file mode 100644 index 0000000000..af54321ca7 --- /dev/null +++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/hmi/rc_is_ready_request.h" + +#include "gtest/gtest.h" +#include "utils/shared_ptr.h" +#include "smart_objects/smart_object.h" +#include "application_manager/smart_object_keys.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/event_engine/event.h" + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace rc_is_ready_request { + +using ::testing::_; +using ::testing::ReturnRef; +namespace am = ::application_manager; +using am::commands::MessageSharedPtr; +using am::commands::RCIsReadyRequest; +using am::MockMessageHelper; +using am::event_engine::Event; + +typedef SharedPtr<RCIsReadyRequest> RCIsReadyRequestPtr; + +class RCIsReadyRequestTest + : public CommandRequestTest<CommandsTestMocks::kIsNice> { + public: + RCIsReadyRequestTest() : command_(CreateCommand<RCIsReadyRequest>()) {} + + void SetUpExpectations(bool is_rc_cooperating_available, + bool is_send_message_to_hmi, + bool is_message_contain_param, + am::HmiInterfaces::InterfaceState state) { + if (is_send_message_to_hmi) { + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillRepeatedly(ReturnRef(mock_hmi_capabilities_)); + ExpectSendMessagesToHMI(); + } else { + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + } + EXPECT_CALL(mock_hmi_capabilities_, + set_is_rc_cooperating(is_rc_cooperating_available)); + + if (is_message_contain_param) { + EXPECT_CALL(app_mngr_, hmi_interfaces()) + .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); + EXPECT_CALL( + mock_hmi_interfaces_, + SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC, state)); + } else { + EXPECT_CALL(app_mngr_, hmi_interfaces()) + .WillOnce(ReturnRef(mock_hmi_interfaces_)); + EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0); + } + EXPECT_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC)) + .WillOnce(Return(state)); + } + + void ExpectSendMessagesToHMI() { + smart_objects::SmartObjectSPtr capabilities( + new smart_objects::SmartObject(smart_objects::SmartType_Map)); + EXPECT_CALL(*(MockMessageHelper::message_helper_mock()), + CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _)) + .WillOnce(Return(capabilities)); + EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities)); + } + + void PrepareEvent(bool is_message_contain_param, + Event& event, + bool is_rc_cooperating_available = false) { + MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); + if (is_message_contain_param) { + (*msg)[am::strings::msg_params][am::strings::available] = + is_rc_cooperating_available; + } + event.set_smart_object(*msg); + } + + RCIsReadyRequestPtr command_; + am::MockHmiInterfaces mock_hmi_interfaces_; + application_manager_test::MockHMICapabilities mock_hmi_capabilities_; +}; + +TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) { + const bool is_rc_cooperating_available = false; + const bool is_send_message_to_hmi = true; + const bool is_message_contain_param = false; + Event event(hmi_apis::FunctionID::RC_IsReady); + PrepareEvent(is_message_contain_param, event); + SetUpExpectations(is_rc_cooperating_available, + is_send_message_to_hmi, + is_message_contain_param, + am::HmiInterfaces::STATE_NOT_RESPONSE); + command_->on_event(event); +} + +TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) { + const bool is_rc_cooperating_available = false; + const bool is_send_message_to_hmi = false; + const bool is_message_contain_param = true; + Event event(hmi_apis::FunctionID::RC_IsReady); + PrepareEvent(is_message_contain_param, event); + SetUpExpectations(is_rc_cooperating_available, + is_send_message_to_hmi, + is_message_contain_param, + am::HmiInterfaces::STATE_NOT_AVAILABLE); + command_->on_event(event); +} + +TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) { + const bool is_rc_cooperating_available = true; + const bool is_send_message_to_hmi = true; + const bool is_message_contain_param = true; + Event event(hmi_apis::FunctionID::RC_IsReady); + PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available); + SetUpExpectations(is_rc_cooperating_available, + is_send_message_to_hmi, + is_message_contain_param, + am::HmiInterfaces::STATE_AVAILABLE); + command_->on_event(event); +} + +TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) { + ExpectSendMessagesToHMI(); + command_->onTimeOut(); +} + +} // namespace rc_is_ready_request +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc new file mode 100644 index 0000000000..157dff6216 --- /dev/null +++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdint.h> +#include <string> + +#include "gtest/gtest.h" +#include "utils/shared_ptr.h" +#include "smart_objects/smart_object.h" +#include "commands/commands_test.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/commands/hmi/rc_is_ready_response.h" +#include "application_manager/mock_event_dispatcher.h" + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace rc_is_ready_response { + +using ::testing::Return; +using ::utils::SharedPtr; +using ::testing::NiceMock; +namespace am = ::application_manager; +namespace strings = ::application_manager::strings; +namespace hmi_response = am::hmi_response; +using am::commands::RCIsReadyResponse; +using test::components::event_engine_test::MockEventDispatcher; + +typedef SharedPtr<RCIsReadyResponse> RCIsReadyResponsePtr; + +class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { +}; + +TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) { + RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>()); + + MockEventDispatcher mock_event_dispatcher; + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher)); + EXPECT_CALL(mock_event_dispatcher, raise_event(_)); + + command->Run(); +} + +} // namespace rc_is_ready_response +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 435d03c8bf..5e3c6204ab 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -316,6 +316,150 @@ { "protocol": "RTP", "codec": "Theora" + }]}, + + "remoteControlCapability":{ + "climateControlCapabilities": [{ + "moduleName": "primary_climate", + "fanSpeedAvailable": true, + "desiredTemperatureAvailable": true, + "acEnableAvailable": true, + "acMaxEnableAvailable": true, + "circulateAirEnableAvailable": true, + "autoModeEnableAvailable": true, + "dualModeEnableAvailable": true, + "defrostZoneAvailable": true, + "ventilationModeAvailable": true, + "defrostZone": ["FRONT", + "REAR", + "ALL", + "NONE"], + "ventilationMode": ["UPPER", + "LOWER", + "BOTH", + "NONE"] + }], + + "radioControlCapabilities": [{ + "moduleName": "radio", + "radioEnableAvailable": true, + "radioBandAvailable": true, + "radioFrequencyAvailable": true, + "hdChannelAvailable": true, + "rdsDataAvailable": true, + "availableHDsAvailable": true, + "stateAvailable": true, + "signalStrengthAvailable": true, + "signalChangeThresholdAvailable": true + }], + + "buttonCapabilities": [{ + "name": "AC_MAX", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "AC", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "RECIRCULATE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "FAN_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "FAN_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "TEMP_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "TEMP_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST_MAX", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST_REAR", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "UPPER_VENT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "LOWER_VENT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "VOLUME_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "VOLUME_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "EJECT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "SOURCE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "SHUFFLE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "REPEAT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false }] } } @@ -442,4 +586,4 @@ "majorVersion": 3, "minorVersion": 0 } -}
\ No newline at end of file +} diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index bd3aa3e730..3fd9e730d8 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -419,6 +419,46 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { EXPECT_EQ( 2, vs_capability_so[strings::supported_formats][1][strings::codec].asInt()); + + // Check remote control capabilites + const smart_objects::SmartObject rc_capability_so = + *(hmi_capabilities_test->rc_capability()); + + EXPECT_TRUE(rc_capability_so.keyExists("climateControlCapabilities")); + EXPECT_TRUE(rc_capability_so.keyExists("radioControlCapabilities")); + EXPECT_TRUE(rc_capability_so.keyExists("buttonCapabilities")); + + EXPECT_TRUE( + rc_capability_so["climateControlCapabilities"][0]["fanSpeedAvailable"] + .asBool()); + EXPECT_TRUE(rc_capability_so["climateControlCapabilities"][0] + ["desiredTemperatureAvailable"].asBool()); + EXPECT_TRUE( + rc_capability_so["climateControlCapabilities"][0]["acEnableAvailable"] + .asBool()); + EXPECT_TRUE( + rc_capability_so["climateControlCapabilities"][0]["acMaxEnableAvailable"] + .asBool()); + + EXPECT_TRUE( + rc_capability_so["radioControlCapabilities"][0]["radioBandAvailable"] + .asBool()); + EXPECT_TRUE( + rc_capability_so["radioControlCapabilities"][0]["radioFrequencyAvailable"] + .asBool()); + EXPECT_TRUE( + rc_capability_so["radioControlCapabilities"][0]["hdChannelAvailable"] + .asBool()); + EXPECT_TRUE( + rc_capability_so["radioControlCapabilities"][0]["rdsDataAvailable"] + .asBool()); + + EXPECT_TRUE(rc_capability_so["buttonCapabilities"][0]["shortPressAvailable"] + .asBool()); + EXPECT_TRUE( + rc_capability_so["buttonCapabilities"][0]["longPressAvailable"].asBool()); + EXPECT_FALSE( + rc_capability_so["buttonCapabilities"][0]["upDownAvailable"].asBool()); } TEST_F(HMICapabilitiesTest, VerifyImageType) { diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h index 2f18b1ceb9..dd7ec5f0d5 100644 --- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h +++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h @@ -61,6 +61,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_CONST_METHOD0(is_ivi_cooperating, bool()); MOCK_METHOD1(set_is_ivi_cooperating, void(const bool value)); + MOCK_CONST_METHOD0(is_rc_cooperating, bool()); + MOCK_METHOD1(set_is_rc_cooperating, void(const bool value)); + MOCK_CONST_METHOD0(attenuated_supported, bool()); MOCK_METHOD1(set_attenuated_supported, void(const bool state)); @@ -171,6 +174,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_METHOD1( set_video_streaming_capability, void(const smart_objects::SmartObject& video_streaming_capability)); + MOCK_CONST_METHOD0(rc_capability, const smart_objects::SmartObject*()); + MOCK_METHOD1(set_rc_capability, + void(const smart_objects::SmartObject& rc_capability)); MOCK_METHOD1(Init, void(resumption::LastState* last_state)); diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h index 03c0fdedb8..5856f2aff5 100644 --- a/src/components/include/application_manager/hmi_capabilities.h +++ b/src/components/include/application_manager/hmi_capabilities.h @@ -90,6 +90,9 @@ class HMICapabilities { virtual bool is_ivi_cooperating() const = 0; virtual void set_is_ivi_cooperating(const bool value) = 0; + virtual bool is_rc_cooperating() const = 0; + virtual void set_is_rc_cooperating(const bool value) = 0; + /* * @brief Interface used to store information about software version of the *target @@ -409,6 +412,7 @@ class HMICapabilities { */ virtual bool phone_call_supported() const = 0; +<<<<<<< e8f4b4fef6ccb7106fe0a0c4e2b4e828e20ee926 /* * @brief Interface to store whether HMI supports video streaming * @@ -430,33 +434,19 @@ class HMICapabilities { * @param navigation_capability contains information related * to the navigation system capability. */ +======= +>>>>>>> Implementation of system capabilities virtual void set_navigation_capability( const smart_objects::SmartObject& navigation_capability) = 0; - /* - * @brief Retrieves information regarding the navigation system capability - * - * @return NAVIGATION system capability - */ virtual const smart_objects::SmartObject* navigation_capability() const = 0; - /* - * @brief Interface used to store information regarding - * the phone "System Capability" - * - * @param phone_capability contains information related - * to the phone system capability. - */ virtual void set_phone_capability( const smart_objects::SmartObject& phone_capability) = 0; - /* - * @brief Retrieves information regarding the phone call system capability - * - * @return PHONE_CALL system capability - */ virtual const smart_objects::SmartObject* phone_capability() const = 0; +<<<<<<< e8f4b4fef6ccb7106fe0a0c4e2b4e828e20ee926 /* * @brief Sets HMI's video streaming related capability information * @@ -472,6 +462,12 @@ class HMICapabilities { */ virtual const smart_objects::SmartObject* video_streaming_capability() const = 0; +======= + virtual void set_rc_capability( + const smart_objects::SmartObject& rc_capability) = 0; + + virtual const smart_objects::SmartObject* rc_capability() const = 0; +>>>>>>> Implementation of system capabilities virtual void Init(resumption::LastState* last_state) = 0; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index a361262efa..a1d745bed9 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1426,28 +1426,28 @@ </enum> <struct name="RdsData"> - <param name="PS" type="String" minlength="0" maxlength="8" mandatory="true" > + <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false"> <description>Program Service Name</description> </param> - <param name="RT" type="String" minlength="0" maxlength="64" mandatory="true" > + <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false"> <description>Radio Text</description> </param> <param name="CT" type="String" minlength="22" maxlength="28" mandatory="false"> <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description> </param> - <param name="PI" type="String" minlength="0" maxlength="6" mandatory="true" > + <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false"> <description>Program Identification - the call sign for the radio station</description> </param> - <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="true" > + <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false"> <description>The program type - The region should be used to differentiate between EU and North America program types</description> </param> - <param name="TP" type="Boolean" mandatory="true" > + <param name="TP" type="Boolean" mandatory="false"> <description>Traffic Program Identification - Identifies a station that offers traffic</description> </param> - <param name="TA" type="Boolean" mandatory="true" > + <param name="TA" type="Boolean" mandatory="false"> <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description> </param> - <param name="REG" type="String" mandatory="true" > + <param name="REG" type="String" mandatory="false"> <description>Region</description> </param> </struct> @@ -1586,7 +1586,6 @@ </param> <param name="acEnable" type="Boolean" mandatory="false"> </param> - <param name="circulateAirEnable" type="Boolean" mandatory="false"> </param> <param name="autoModeEnable" type="Boolean" mandatory="false"> @@ -2576,6 +2575,19 @@ </param> </struct> + +<struct name="RemoteControlCapabilities"> + <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true"> + <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description > + </param> + <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true"> + <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description > + </param> + <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" > + <description>If included, the platform supports RC button controls with the included button names.</description > + </param> +</struct> + </interface> <interface name="Buttons" version="1.2.0" date="2017-04-27"> @@ -4787,7 +4799,24 @@ </function> </interface> -<interface name="RC" version="1.0" date="2015-10-13"> +<interface name="RC" version="1.1" date="2017-07-18"> + <function name="IsReady" messagetype="request"> + <description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description> + </function> + <function name="IsReady" messagetype="response"> + <param name="available" type="Boolean" mandatory="true"> + <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description> + </param> + </function> + + <function name="GetCapabilities" messagetype="request"> + <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description> + </function> + <function name="GetCapabilities" messagetype="response"> + <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false"> + <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description> + </param> + </function> <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request"> <param name="moduleData" type="Common.ModuleData" mandatory="true" > @@ -4798,13 +4827,13 @@ </param> </function> - <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response"> + <function name="SetInteriorVehicleData" messagetype="response"> <description>Used to set the values of one zone and one data type within that zone</description> <param name="moduleData" type="Common.ModuleData" mandatory="true" > </param> </function> -<function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request"> +<function name="GetInteriorVehicleData" messagetype="request"> <param name="moduleType" type="Common.ModuleType" mandatory="true" > <description>The module data to retrieve from the vehicle for that type</description> </param> @@ -4816,7 +4845,7 @@ </param> </function> -<function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response"> +<function name="GetInteriorVehicleData" messagetype="response"> <param name="moduleData" type="Common.ModuleData" mandatory="true" > </param> <param name="isSubscribed" type="Boolean" mandatory="false" > @@ -4844,7 +4873,7 @@ </param> </function> -<function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification"> +<function name="OnInteriorVehicleData" messagetype="notification"> <param name="moduleData" type="Common.ModuleData" mandatory="true" > </param> </function> diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index ae8bec3b5b..293c3ca66a 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1445,7 +1445,7 @@ </param>
</struct>
- <enum name="ModuleType">
+ <enum name="ModuleType">
<element name="CLIMATE"/>
<element name="RADIO"/>
</enum>
@@ -1608,7 +1608,7 @@ </param>
</struct>
- <struct name="ClimateControlData">
+ <struct name="ClimateControlData">
<param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
</param>
<param name="currentTemperature" type="Temperature" mandatory="false">
@@ -2255,6 +2255,24 @@ </param>
</struct>
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports RC climate controls.
+ For this baseline version, maxsize=1. i.e. only one climate control module is supported.
+ </description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports RC radio controls.
+ For this baseline version, maxsize=1. i.e. only one radio control module is supported.
+ </description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ </struct>
+
<struct name="SoftButtonCapabilities">
<description>Contains information about a SoftButton's capabilities.</description>
<param name="shortPressAvailable" type="Boolean" mandatory="true">
@@ -2818,6 +2836,7 @@ <element name="PHONE_CALL"/>
<element name="VIDEO_STREAMING"/>
<element name="AUDIO_STREAMING"/>
+ <element name="REMOTE_CONTROL"/>
</enum>
<struct name="NavigationCapability">
@@ -2863,6 +2882,7 @@ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
</param>
<param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
</param>
</struct>
@@ -5520,7 +5540,6 @@ </param>
</function>
-
<!-- Notifications -->
<function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
|