summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager
diff options
context:
space:
mode:
authorAlexander Kutsan <AKutsan@luxoft.com>2016-08-16 14:43:11 +0300
committerAlexander Kutsan <AKutsan@luxoft.com>2016-08-16 14:43:11 +0300
commitb191a30c38e28ccd601bd07cd94547ad9d7974fd (patch)
treead908f2dcd26ca988fccb3a99c515865b4d4d2f8 /src/components/application_manager/include/application_manager
parent834649fad910ca71f9f2ceba6a851cea0fecf6ed (diff)
downloadsdl_core-b191a30c38e28ccd601bd07cd94547ad9d7974fd.tar.gz
Skeleton of class that will handle avaliabllity if HMI interfaces
Related issue : APPLINK-20920
Diffstat (limited to 'src/components/application_manager/include/application_manager')
-rw-r--r--src/components/application_manager/include/application_manager/application_manager.h8
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h7
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h4
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces.h75
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces_impl.h54
5 files changed, 148 insertions, 0 deletions
diff --git a/src/components/application_manager/include/application_manager/application_manager.h b/src/components/application_manager/include/application_manager/application_manager.h
index 214f101b40..99e152a82b 100644
--- a/src/components/application_manager/include/application_manager/application_manager.h
+++ b/src/components/application_manager/include/application_manager/application_manager.h
@@ -47,6 +47,7 @@
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager_settings.h"
#include "application_manager/state_controller.h"
+#include "application_manager/hmi_interfaces.h"
namespace resumption {
class LastState;
@@ -494,6 +495,13 @@ class ApplicationManager {
virtual resumption::ResumeCtrl& resume_controller() = 0;
+ /**
+ * @brief hmi_interfaces getter for hmi_interfaces component, that handle
+ * hmi_instrfaces state
+ * @return reference to hmi_interfaces component
+ */
+ virtual HmiInterfaces& hmi_interfaces() = 0;
+
virtual app_launch::AppLaunchCtrl& app_launch_ctrl() = 0;
/*
* @brief Converts connection string transport type representation
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index 2775c6ad5d..bb064d8b61 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -53,6 +53,7 @@
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/application_manager_settings.h"
#include "application_manager/event_engine/event_dispatcher_impl.h"
+#include "application_manager/hmi_interfaces_impl.h"
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
@@ -844,6 +845,10 @@ class ApplicationManagerImpl
return *resume_ctrl_.get();
}
+ HmiInterfaces& hmi_interfaces() OVERRIDE {
+ return hmi_interfaces_;
+ }
+
/**
* Generate grammar ID
*
@@ -1424,6 +1429,8 @@ class ApplicationManagerImpl
*/
std::auto_ptr<resumption::ResumeCtrl> resume_ctrl_;
+ HmiInterfacesImpl hmi_interfaces_;
+
NaviServiceStatusMap navi_service_status_;
std::deque<uint32_t> navi_app_to_stop_;
std::deque<uint32_t> navi_app_to_end_stream_;
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
index c5f45e2095..8a00764ca3 100644
--- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -182,6 +182,10 @@ class CommandRequestImpl : public CommandImpl,
*/
void AddDisallowedParametersToInfo(
smart_objects::SmartObject& response) const;
+
+ bool ProcessHMIInterfacesAvailability(
+ const uint32_t hmi_correlation_id,
+ const hmi_apis::FunctionID::eType& function_id);
};
} // namespace commands
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h
new file mode 100644
index 0000000000..d4344dfcf7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h
@@ -0,0 +1,75 @@
+/*
+
+ 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_HMI_INTERFACES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_H_
+
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+class HmiInterfaces {
+ public:
+ enum InterfaceID {
+ HMI_INTERFACE_INVALID_ENUM,
+ HMI_INTERFACE_Buttons,
+ HMI_INTERFACE_BasicCommunication,
+ HMI_INTERFACE_VR,
+ HMI_INTERFACE_TTS,
+ HMI_INTERFACE_UI,
+ HMI_INTERFACE_Navigation,
+ HMI_INTERFACE_VehicleInfo,
+ HMI_INTERFACE_SDL
+ };
+
+ /**
+ * @brief The InterfaceState enum handle possible states of HMI interfaces
+ * STATE_NOT_RESPONSE - HMI didn't not responsed IsReady on Inerface
+ * STATE_AVAILABLE - Hmi responsed IsReady(avaliable = true)
+ * STATE_NOT_AVAILABLE - Hmi responsed IsReady(avaliable = false)
+ */
+ enum InterfaceState {
+ STATE_NOT_RESPONSE,
+ STATE_AVAILABLE,
+ STATE_NOT_AVAILABLE
+ };
+
+ virtual InterfaceState GetInterfaceState(InterfaceID interface) const = 0;
+ virtual InterfaceID GetInterfaceFromFunction(
+ hmi_apis::FunctionID::eType function) const = 0;
+ virtual void SetInterfaceState(InterfaceID interface,
+ InterfaceState state) = 0;
+ virtual ~HmiInterfaces() {}
+};
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
new file mode 100644
index 0000000000..0f5bd0027e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h
@@ -0,0 +1,54 @@
+/*
+ * 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_HMI_INTERFACES_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_
+#include <map>
+#include "application_manager/hmi_interfaces.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+class HmiInterfacesImpl : public HmiInterfaces {
+ public:
+ HmiInterfacesImpl();
+ ~HmiInterfacesImpl() {}
+ InterfaceState GetInterfaceState(InterfaceID interface) const OVERRIDE;
+ InterfaceID GetInterfaceFromFunction(
+ hmi_apis::FunctionID::eType function) const OVERRIDE;
+ void SetInterfaceState(InterfaceID interface, InterfaceState state) OVERRIDE;
+
+ private:
+ typedef std::map<InterfaceID, InterfaceState> InterfaceStatesMap;
+ InterfaceStatesMap interfaces_states_;
+};
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_