summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPolina Vyshnevska <pvyshnevska@luxoft.com>2013-10-16 18:22:44 +0300
committerPolina Vyshnevska <pvyshnevska@luxoft.com>2013-10-16 18:35:00 +0300
commit4a3dfcbb855ef62970827223915d9bc763372e6b (patch)
tree690dbd96ff860c583076713a59bffa74f36325ac
parent7913966e48cab6aba1512cd16404337415118fc5 (diff)
downloadsmartdevicelink-4a3dfcbb855ef62970827223915d9bc763372e6b.tar.gz
3279_VrCapabilities support added to SDL.
-rw-r--r--src/components/application_manager/CMakeLists.txt2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc56
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc26
-rwxr-xr-xsrc/components/interfaces/HMI_API.xml14
8 files changed, 294 insertions, 8 deletions
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index bacf8eb11..5343fd051 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -190,6 +190,8 @@ set (HMI_COMMANDS_SOURCES
./src/commands/hmi/vr_get_supported_languages_response.cc
./src/commands/hmi/vr_get_language_request.cc
./src/commands/hmi/vr_get_language_response.cc
+./src/commands/hmi/vr_get_capabilities_request.cc
+./src/commands/hmi/vr_get_capabilities_response.cc
./src/commands/hmi/tts_is_ready_request.cc
./src/commands/hmi/tts_is_ready_response.cc
./src/commands/hmi/tts_change_registration_request.cc
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
new file mode 100644
index 000000000..7771bdd14
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * 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_VR_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesRequest command class
+ **/
+class VRGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetCapabilitiesRequest class destructor
+ **/
+ virtual ~VRGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
new file mode 100644
index 000000000..ced60c9d6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * 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_VR_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesResponse command class
+ **/
+class VRGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetCapabilitiesResponse class destructor
+ **/
+ virtual ~VRGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 7342ceec1..d0e694008 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -848,6 +848,10 @@ void ApplicationManagerImpl::set_is_vr_cooperating(bool value) {
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::VR_GetSupportedLanguages));
ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VR_GetCapabilities));
+ ManageHMICommand(get_capabilities);
MessageHelper::SendHelpVrCommand();
}
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
new file mode 100644
index 000000000..8b1d4ae0b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
@@ -0,0 +1,56 @@
+/**
+ * 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/vr_get_capabilities_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetCapabilitiesRequest::VRGetCapabilitiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {
+}
+
+void VRGetCapabilitiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRGetCapabilitiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
new file mode 100644
index 000000000..cfebea77e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
@@ -0,0 +1,56 @@
+/**
+ * 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/vr_get_capabilities_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetCapabilitiesResponse::VRGetCapabilitiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {
+}
+
+void VRGetCapabilitiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRGetCapabilitiesResponse::Run");
+
+ ApplicationManagerImpl::instance()->set_vr_capabilities(
+ (*message_)[strings::msg_params][strings::vr_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
index 56b1bacd0..012f32b72 100644
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ b/src/components/application_manager/src/hmi_command_factory.cc
@@ -109,6 +109,8 @@
#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
#include "application_manager/commands/hmi/vr_get_language_request.h"
#include "application_manager/commands/hmi/vr_get_language_response.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
#include "application_manager/commands/hmi/tts_is_ready_request.h"
#include "application_manager/commands/hmi/tts_is_ready_response.h"
#include "application_manager/commands/hmi/tts_change_registration_request.h"
@@ -165,17 +167,17 @@
namespace application_manager {
log4cxx::LoggerPtr HMICommandFactory::logger_ = log4cxx::LoggerPtr(
- log4cxx::Logger::getLogger("ApplicationManager"));
+ log4cxx::Logger::getLogger("ApplicationManager"));
CommandSharedPtr HMICommandFactory::CreateCommand(
- const MessageSharedPtr& message) {
+ const MessageSharedPtr& message) {
LOG4CXX_INFO(
- logger_,
- "HMICommandFactory::CreateCommand function_id: "
- << (*message)[strings::params][strings::function_id].asInt());
+ logger_,
+ "HMICommandFactory::CreateCommand function_id: "
+ << (*message)[strings::params][strings::function_id].asInt());
CommandSharedPtr command(
- new application_manager::commands::CommandImpl(message));
+ new application_manager::commands::CommandImpl(message));
bool is_response = false;
if ((*message)[strings::params][strings::message_type]
@@ -183,7 +185,7 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
is_response = true;
LOG4CXX_INFO(logger_, "HMICommandFactory::CreateCommand response");
} else if ((*message)[strings::params][strings::message_type]
- == MessageType::kErrorResponse) {
+ == MessageType::kErrorResponse) {
is_response = true;
LOG4CXX_INFO(logger_, "HMICommandFactory::CreateCommand error response");
} else {
@@ -423,6 +425,14 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
}
break;
}
+ case hmi_apis::FunctionID::VR_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::VRGetCapabilitiesResponse(message));
+ } else {
+ command.reset(new commands::VRGetCapabilitiesRequest(message));
+ }
+ break;
+ }
case hmi_apis::FunctionID::TTS_IsReady: {
if (is_response) {
command.reset(new commands::TTSIsReadyResponse(message));
@@ -617,7 +627,7 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
}
case hmi_apis::FunctionID::UI_OnDriverDistraction: {
command.reset(
- new commands::hmi::OnDriverDistractionNotification(message));
+ new commands::hmi::OnDriverDistractionNotification(message));
break;
}
case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: {
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index cb428f556..f301e07ec 100755
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -732,6 +732,12 @@
</element>
</enum>
+<enum name="VrCapabilities">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="TEXT" internal_name="VR_TEXT" />
+</enum>
+
+
<!-- End of IVI part-->
<struct name="ButtonCapabilities">
@@ -1416,6 +1422,14 @@
<function name="GetLanguage" messagetype="response">
<param name="language" type="Common.Language" mandatory="true"/>
</function>
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about VR capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="vrCapabilities" type="Common.VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Types of input recognized by VR module.</description>
+ </param>
+ </function>
</interface>
<interface name="TTS" version="1.0" date="2013-04-18">