summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Leshin <ALeshin@luxoft.com>2014-10-01 15:04:33 +0400
committerAnatoly Leshin <ALeshin@luxoft.com>2014-10-01 15:04:33 +0400
commitc5d4d02a08a2d9d862ee038150df8b4664b987d3 (patch)
tree941353e5516afbb7ca47471fc9ba47450cae78cb
parent03d195743a1825261211cad1946783e8152fe823 (diff)
parenta394ee755b7a1466e08e211d2b22b9f645b0ac7d (diff)
downloadsdl_core-c5d4d02a08a2d9d862ee038150df8b4664b987d3.tar.gz
Not a subject for review
Merge branch 'develop' into APPLINK-9516_qthmi_workability
-rw-r--r--Log.txt0
-rw-r--r--customer-specific/genivi.conf12
-rw-r--r--customer-specific/genivi/CMakeLists.txt4
-rw-r--r--customer-specific/genivi/src/components/application_manager/CMakeLists.txt1
-rw-r--r--customer-specific/genivi/src/components/transport_manager/CMakeLists.txt89
-rw-r--r--customer-specific/genivi/test/tools/policy_table_validator/CMakeLists.txt2
-rwxr-xr-x[-rw-r--r--]customer-specific/pasa/src/appMain/SmartDeviceLinkMainApp.cpp2
-rw-r--r--customer-specific/pasa/src/appMain/makefile2
-rwxr-xr-xcustomer-specific/pasa/src/appMain/smartDeviceLink.ini2
-rw-r--r--customer-specific/pasa/src/makefile2
-rw-r--r--src/3rd_party-static/MessageBroker/include/mb_controller.hpp4
-rw-r--r--src/appMain/smartDeviceLink.ini2
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc8
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc12
-rw-r--r--src/components/application_manager/src/request_controller.cc.autosave508
-rw-r--r--src/components/include/utils/timer_thread.h5
-rw-r--r--src/components/policy/src/policy/include/policy/cache_manager.h1
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct_ext/enums.cc8
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct_ext/enums.h2
-rw-r--r--src/components/policy/src/policy/src/cache_manager.cc16
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc18
-rw-r--r--test/CMakeLists.txt.autosave112
23 files changed, 148 insertions, 666 deletions
diff --git a/Log.txt b/Log.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Log.txt
diff --git a/customer-specific/genivi.conf b/customer-specific/genivi.conf
index b943213fcb..563fcb2d97 100644
--- a/customer-specific/genivi.conf
+++ b/customer-specific/genivi.conf
@@ -2,6 +2,8 @@ include_src="src \
cmake \
Doxyfile \
tools/InterfaceGenerator \
+ tools/intergen \
+ tools/CMakeLists.txt \
test \
FindQt.sh \
CMakeLists.txt \
@@ -10,7 +12,13 @@ include_src="src \
include_bin=""
-exclude_src="src/components/policy/src/policy/policy_table/table_struct_ext"
+exclude_src="src/components/policy/src/policy/policy_table/table_struct_ext \
+ src/components/transport_manager/include/transport_manager/aoa \
+ src/components/transport_manager/include/transport_manager/mme \
+ src/components/transport_manager/include/transport_manager/pasa_bt \
+ src/components/transport_manager/src/aoa \
+ src/components/transport_manager/src/mme \
+ src/components/transport_manager/src/pasa_bt"
exclude_bin=""
@@ -20,4 +28,4 @@ exclude_filenames=".git \
export_dir=/tmp/GENIVI
files_to_filter="*.c|*.cc|*.cpp|*.h|*.hpp"
-filter_command="tools/Utils/define_parser.py -u CUSTOMER_PASA -u CUSTOMER_FORD -u EXTENDED_POLICY -i "
+filter_command="tools/Utils/define_parser.py -u CUSTOMER_PASA -u CUSTOMER_FORD -u EXTENDED_POLICY -u AOA_SUPPORT -u MME_SUPPORT -i "
diff --git a/customer-specific/genivi/CMakeLists.txt b/customer-specific/genivi/CMakeLists.txt
index ba26e3e121..13cf557e9a 100644
--- a/customer-specific/genivi/CMakeLists.txt
+++ b/customer-specific/genivi/CMakeLists.txt
@@ -400,6 +400,10 @@ endif()
# --- 3rd party libs (static)
add_subdirectory(./src/3rd_party-static)
+# --- Tools
+add_subdirectory(./tools)
+
+
# --- Components
add_subdirectory(./src/components)
diff --git a/customer-specific/genivi/src/components/application_manager/CMakeLists.txt b/customer-specific/genivi/src/components/application_manager/CMakeLists.txt
index ed22ddaa4c..14286bb8fe 100644
--- a/customer-specific/genivi/src/components/application_manager/CMakeLists.txt
+++ b/customer-specific/genivi/src/components/application_manager/CMakeLists.txt
@@ -32,6 +32,7 @@ set (SOURCES
./src/hmi_capabilities.cc
./src/application_data_impl.cc
./src/request_controller.cc
+./src/request_info.cc
./src/resume_ctrl.cpp
./src/mobile_message_handler.cc
)
diff --git a/customer-specific/genivi/src/components/transport_manager/CMakeLists.txt b/customer-specific/genivi/src/components/transport_manager/CMakeLists.txt
new file mode 100644
index 0000000000..c1cd310a21
--- /dev/null
+++ b/customer-specific/genivi/src/components/transport_manager/CMakeLists.txt
@@ -0,0 +1,89 @@
+set(target TransportManager)
+
+include_directories (
+ ./include
+ ../utils/include/
+ ../protocol_handler/include
+ ../connection_handler/include
+ ../config_profile/include
+ ../resumption/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${LIBUSB_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+if (BUILD_BT_SUPPORT)
+ include_directories(
+ )
+endif()
+
+set (SOURCES
+ ./src/transport_manager_impl.cc
+ ./src/transport_manager_default.cc
+ ./src/transport_adapter/transport_adapter_listener_impl.cc
+ ./src/transport_adapter/transport_adapter_impl.cc
+ ./src/tcp/tcp_transport_adapter.cc
+ ./src/transport_adapter/threaded_socket_connection.cc
+ ./src/tcp/tcp_client_listener.cc
+ ./src/tcp/tcp_device.cc
+ ./src/tcp/tcp_socket_connection.cc
+ ./src/tcp/tcp_connection_factory.cc
+)
+
+if (BUILD_AVAHI_SUPPORT)
+ list (APPEND SOURCES
+ ./src/tcp/dnssd_service_browser.cc
+ )
+endif()
+if (BUILD_BT_SUPPORT)
+ list (APPEND SOURCES
+ ./src/bluetooth/bluetooth_device_scanner.cc
+ ./src/bluetooth/bluetooth_transport_adapter.cc
+ ./src/bluetooth/bluetooth_connection_factory.cc
+ ./src/bluetooth/bluetooth_socket_connection.cc
+ ./src/bluetooth/bluetooth_device.cc
+ )
+endif()
+
+if (BUILD_USB_SUPPORT)
+ list (APPEND SOURCES
+ ./src/usb/usb_aoa_adapter.cc
+ ./src/usb/usb_connection_factory.cc
+ ./src/usb/usb_device_scanner.cc
+ )
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ list (APPEND SOURCES
+ ./src/usb/libusb/usb_handler.cc
+ ./src/usb/libusb/usb_connection.cc
+ ./src/usb/libusb/platform_usb_device.cc
+ )
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ list(APPEND SOURCES
+ ./src/usb/qnx/usb_handler.cc
+ ./src/usb/qnx/usb_connection.cc
+ ./src/usb/qnx/platform_usb_device.cc
+ )
+ endif()
+endif(BUILD_USB_SUPPORT)
+
+
+add_library(${target} ${SOURCES})
+target_link_libraries(${target} ProtocolLibrary)
+
+if (BUILD_USB_SUPPORT)
+ if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ target_link_libraries(${target} usbdi)
+ endif()
+endif(BUILD_USB_SUPPORT)
+
+
+if (BUILD_AVAHI_SUPPORT)
+ target_link_libraries(${target} avahi-common)
+endif()
+
+if(ENABLE_LOG)
+ target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+if (BUILD_BT_SUPPORT)
+ target_link_libraries(${target} bluetooth)
+endif()
diff --git a/customer-specific/genivi/test/tools/policy_table_validator/CMakeLists.txt b/customer-specific/genivi/test/tools/policy_table_validator/CMakeLists.txt
index ecba4d953b..e62ea1a5ff 100644
--- a/customer-specific/genivi/test/tools/policy_table_validator/CMakeLists.txt
+++ b/customer-specific/genivi/test/tools/policy_table_validator/CMakeLists.txt
@@ -7,8 +7,6 @@ include_directories(
${JSONCPP_INCLUDE_DIRECTORY}
)
-
-else ()
link_directories (
${CMAKE_BINARY_DIR}/src/components/policy/src/policy/policy_table/table_struct/
${CMAKE_BINARY_DIR}/src/components/rpc_base/
diff --git a/customer-specific/pasa/src/appMain/SmartDeviceLinkMainApp.cpp b/customer-specific/pasa/src/appMain/SmartDeviceLinkMainApp.cpp
index 0c6047bb6d..c21e9b11b1 100644..100755
--- a/customer-specific/pasa/src/appMain/SmartDeviceLinkMainApp.cpp
+++ b/customer-specific/pasa/src/appMain/SmartDeviceLinkMainApp.cpp
@@ -178,7 +178,6 @@ void startSmartDeviceLink()
// --------------------------------------------------------------------------
// Components initialization
- profile::Profile::instance()->config_file_name(SDL_INIFILE_PATH);
// TODO: Remove this code when PASA will support SDL_MSG_START_USB_LOGGING
// Start section
@@ -263,6 +262,7 @@ void ApplinkNotificationThreadDelegate::threadMain() {
*/
int main(int argc, char** argv) {
+ profile::Profile::instance()->config_file_name(SDL_INIFILE_PATH);
INIT_LOGGER(profile::Profile::instance()->log4cxx_config_file());
configureLogging();
diff --git a/customer-specific/pasa/src/appMain/makefile b/customer-specific/pasa/src/appMain/makefile
index 60195c9c2a..fcdd83e738 100644
--- a/customer-specific/pasa/src/appMain/makefile
+++ b/customer-specific/pasa/src/appMain/makefile
@@ -36,7 +36,6 @@ INCLUDES = \
$(CC_IFLAG)../components/transport_manager/include \
$(CC_IFLAG)../components/smart_objects/include \
$(CC_IFLAG)../components/formatters/include \
- $(CC_IFLAG)../components/request_watchdog/include \
$(CC_IFLAG)../components/config_profile/include \
$(CC_IFLAG)../components/hmi_message_handler/include \
$(CC_IFLAG)../components/utils/include \
@@ -73,7 +72,6 @@ STATIC_LIBS += \
config_profile$(DEBUG_EXT) \
formatters$(DEBUG_EXT) \
interfaces$(DEBUG_EXT) \
- request_watchdog$(DEBUG_EXT) \
hmi_message_handler$(DEBUG_EXT) \
connection_handler$(DEBUG_EXT) \
protocol_handler$(DEBUG_EXT) \
diff --git a/customer-specific/pasa/src/appMain/smartDeviceLink.ini b/customer-specific/pasa/src/appMain/smartDeviceLink.ini
index 3879df8a0e..dbf12c964d 100755
--- a/customer-specific/pasa/src/appMain/smartDeviceLink.ini
+++ b/customer-specific/pasa/src/appMain/smartDeviceLink.ini
@@ -129,6 +129,6 @@ IAP2HubConnectAttempts = 3
ConnectionWaitTimeout = 10
[ApplicationManager]
-ApplicationListUpdateTimeout = 1
+ApplicationListUpdateTimeout = 2
; Max allowed threads for handling mobile requests. Currently max allowed is 2
ThreadPoolSize = 1
diff --git a/customer-specific/pasa/src/makefile b/customer-specific/pasa/src/makefile
index 975256bf1a..28450ccff3 100644
--- a/customer-specific/pasa/src/makefile
+++ b/customer-specific/pasa/src/makefile
@@ -44,7 +44,7 @@ library:
$(MAKE) -C components/utils/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
$(MAKE) -C components/media_manager/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
$(MAKE) -C components/smart_objects/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
- $(MAKE) -C components/config_profile/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
+ $(MAKE) -C components/config_profile/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
$(MAKE) -C components/hmi_message_handler/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
$(MAKE) -C components/formatters/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
$(MAKE) -C components/connection_handler/src OPTIMIZATION=NONE TARGET_FLG=-Vgcc_ntoarmv7le_gpp $@
diff --git a/src/3rd_party-static/MessageBroker/include/mb_controller.hpp b/src/3rd_party-static/MessageBroker/include/mb_controller.hpp
index a3e6e7df13..52f7743a84 100644
--- a/src/3rd_party-static/MessageBroker/include/mb_controller.hpp
+++ b/src/3rd_party-static/MessageBroker/include/mb_controller.hpp
@@ -199,9 +199,9 @@ namespace NsMessageBroker
void* MethodForReceiverThread(void * arg);
virtual void exitReceivingThread() {
-
+#ifndef CUSTOMER_PASA
Close();
-
+#endif
stop = true;
sync_primitives::AutoLock auto_lock(receiving_thread_lock_);
}
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index 9659456df4..28beae9ed8 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -142,6 +142,6 @@ IAP2SystemConfig = /fs/mp/etc/mm/iap2.cfg
IAP2HubConnectAttempts = 3
[ApplicationManager]
-ApplicationListUpdateTimeout = 1
+ApplicationListUpdateTimeout = 2
; Max allowed threads for handling mobile requests. Currently max allowed is 2
ThreadPoolSize = 1
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
index 0d4212e18c..a1b17f5229 100644
--- a/src/components/application_manager/src/commands/hmi/activate_app_request.cc
+++ b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
@@ -51,9 +51,11 @@ namespace application_manager {
LOG4CXX_TRACE(logger_, "enter " << correlation_id());
uint32_t app_id = RequestToHMI::application_id();
ApplicationManagerImpl::instance()->set_application_id(correlation_id(), app_id);
+#ifdef ENABLE_LOG
mobile_apis::HMILevel::eType requested_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
(*message_)[strings::msg_params][strings::activate_app_hmi_level].asInt());
LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level);
+#endif
SendRequest();
subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
correlation_id());
diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc
index 454983baca..52b0ee44f9 100644
--- a/src/components/application_manager/src/commands/mobile/slider_request.cc
+++ b/src/components/application_manager/src/commands/mobile/slider_request.cc
@@ -133,10 +133,12 @@ void SliderRequest::on_event(const event_engine::Event& event) {
message[strings::params][hmi_response::code].asInt();
smart_objects::SmartObject response_msg_params = message[strings::msg_params];
- if (response_code == hmi_apis::Common_Result::ABORTED)
+ if (response_code == hmi_apis::Common_Result::ABORTED) {
//Copy slider_position info to msg_params section
- response_msg_params[strings::slider_position] =
- message[strings::params][strings::data][strings::slider_position];
+ // TODO(DK) : FIXME
+ /*response_msg_params[strings::slider_position] =
+ message[strings::params][strings::data][strings::slider_position];*/
+ }
const bool is_response_success =
(mobile_apis::Result::SUCCESS == response_code) ||
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 4dd01fc101..a1331e7eef 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -95,9 +95,7 @@ struct SDLAlowedNotification {
void operator()(const application_manager::ApplicationSharedPtr& app) {
if (device_id_ == app->device()) {
- app->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
- application_manager::MessageHelper::SendActivateAppToHMI(
- app->app_id(), hmi_apis::Common_HMILevel::NONE);
+
std::string hmi_level;
hmi_apis::Common_HMILevel::eType default_hmi;
@@ -113,6 +111,7 @@ struct SDLAlowedNotification {
} else {
return ;
}
+ app->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
application_manager::MessageHelper::SendActivateAppToHMI(app->app_id(), default_hmi);
application_manager::MessageHelper::SendHMIStatusNotification(*app);
}
@@ -643,8 +642,8 @@ void PolicyHandler::OnVIIsReady() {
void PolicyHandler::OnVehicleDataUpdated(
const smart_objects::SmartObject& message) {
-#ifdef EXTENDED_POLICY
POLICY_LIB_CHECK_VOID();
+#ifdef EXTENDED_POLICY
if (message[application_manager::strings::msg_params].
keyExists(application_manager::strings::vin)) {
policy_manager_->SetVINValue(
@@ -1039,6 +1038,11 @@ void PolicyHandler::OnActivateApp(uint32_t connection_key,
if (!permissions.isSDLAllowed) {
pending_device_handles_.push_back(permissions.deviceInfo.device_handle);
}
+
+ if (permissions.appPermissionsConsentNeeded) {
+ application_manager::MessageHelper::SendOnAppPermissionsChangedNotification(
+ app->app_id(), permissions);
+ }
#else
permissions.isSDLAllowed = true;
#endif
diff --git a/src/components/application_manager/src/request_controller.cc.autosave b/src/components/application_manager/src/request_controller.cc.autosave
deleted file mode 100644
index 769de83371..0000000000
--- a/src/components/application_manager/src/request_controller.cc.autosave
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 2014, 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 <algorithm>
-#include "utils/logger.h"
-#include "config_profile/profile.h"
-#include "application_manager/request_controller.h"
-#include "application_manager/commands/command_request_impl.h"
-#include "application_manager/commands/hmi/request_to_hmi.h"
-
-namespace application_manager {
-
-namespace request_controller {
-
-using namespace sync_primitives;
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RequestController");
-
-RequestController::RequestController()
- : pool_state_(UNDEFINED),
- pool_size_(profile::Profile::instance()->thread_pool_size()),
- pending_request_set_lock_(true),
- timer_("RequestCtrlTimer", this, &RequestController::onTimer, true)
-{
- LOG4CXX_INFO(logger_, "RequestController::RequestController()");
- InitializeThreadpool();
- timer_.start(dafault_sleep_time_);
- LOG4CXX_DEBUG(logger_," Create timer thread ; timer thread = " << timer_.thread_->thread_handle());
-}
-
-RequestController::~RequestController() {
- LOG4CXX_TRACE_ENTER(logger_);
- if (pool_state_ != TPoolState::STOPPED) {
- DestroyThreadpool();
- }
-
- pool_.clear();
- mobile_request_list_.clear();
- pending_request_set_.clear();
-}
-
-void RequestController::InitializeThreadpool()
-{
- LOG4CXX_TRACE_ENTER(logger_);
- // TODO: Consider lazy loading threads instead of creating all at once
- pool_state_ = TPoolState::STARTED;
- for (uint32_t i = 0; i < pool_size_; i++) {
- char name [50];
- snprintf(name, sizeof(name)/sizeof(name[0]),
- "AM Pool %d", i);
- pool_.push_back(ThreadSharedPtr(new Thread(name, new Worker(this))));
- pool_[i]->start();
- LOG4CXX_INFO(logger_, "Request thread initialized: " << name);
- }
-}
-
-void RequestController::DestroyThreadpool() {
- LOG4CXX_TRACE_ENTER(logger_);
- {
- sync_primitives::AutoLock auto_lock (mobile_request_list_lock_);
- pool_state_ = TPoolState::STOPPED;
- LOG4CXX_INFO(logger_, "Broadcasting STOP signal to all threads...");
- cond_var_.Broadcast(); // notify all threads we are shutting down
- }
- for (uint32_t i = 0; i < pool_size_; i++) {
- pool_[i]->stop();
- }
- LOG4CXX_INFO(logger_, "Threads exited from the thread pool " << pool_size_);
-}
-
-RequestController::TResult RequestController::addMobileRequest(
- const MobileRequestPtr& request,
- const mobile_apis::HMILevel::eType& hmi_level) {
- LOG4CXX_TRACE_ENTER(logger_);
- if (!request.valid()) {
- LOG4CXX_INFO(logger_, "Null Pointer request");
- LOG4CXX_TRACE_EXIT(logger_);
- cond_var_.NotifyOne();
- return INVALID_DATA;
- }
-
- TResult result = SUCCESS;
- const commands::CommandRequestImpl* request_impl =
- static_cast<commands::CommandRequestImpl*>(request.get());
- LOG4CXX_DEBUG(logger_, "addMobileRequest " << request_impl->correlation_id());
- const uint32_t& app_hmi_level_none_time_scale =
- profile::Profile::instance()->app_hmi_level_none_time_scale();
-
- const uint32_t& app_hmi_level_none_max_request_per_time_scale =
- profile::Profile::instance()->app_hmi_level_none_time_scale_max_requests();
-
- const uint32_t& app_time_scale =
- profile::Profile::instance()->app_time_scale();
-
- const uint32_t& max_request_per_time_scale =
- profile::Profile::instance()->app_time_scale_max_requests();
-
- const uint32_t& pending_requests_amount =
- profile::Profile::instance()->pending_requests_amount();
-
- if (!checkHMILevelTimeScaleMaxRequest(mobile_apis::HMILevel::HMI_NONE,
- request_impl->connection_key(), app_hmi_level_none_time_scale,
- app_hmi_level_none_max_request_per_time_scale)) {
- LOG4CXX_ERROR(logger_, "Too many application requests in hmi level NONE");
- result = RequestController::NONE_HMI_LEVEL_MANY_REQUESTS;
- } else if (!checkTimeScaleMaxRequest(
- request_impl->connection_key(),
- app_time_scale, max_request_per_time_scale)) {
- LOG4CXX_ERROR(logger_, "Too many application requests");
- result = RequestController::TOO_MANY_REQUESTS;
- } else if (pending_requests_amount == mobile_request_list_.size()) {
- LOG4CXX_ERROR(logger_, "Too many pending request");
- result = RequestController::TOO_MANY_PENDING_REQUESTS;
- }
- {
- AutoLock auto_lock(mobile_request_list_lock_);
-
- mobile_request_list_.push_back(request);
- LOG4CXX_INFO(logger_, "RequestController size is "
- << mobile_request_list_.size()
- << " Pending request size is "
- << pending_request_set_.size()
- );
- }
-
- // wake up one thread that is waiting for a task to be available
- cond_var_.NotifyOne();
- LOG4CXX_TRACE_EXIT(logger_);
- return result;
-}
-
-RequestController::TResult RequestController::addHMIRequest(
- const RequestPtr& request) {
- LOG4CXX_TRACE_ENTER(logger_);
- DCHECK(request.valid());
- commands::RequestToHMI* raw_ptr = static_cast<commands::RequestToHMI*>(request.get());
- LOG4CXX_DEBUG(logger_, "addHMIRequest " << raw_ptr->correlation_id());
- HMIRequestInfo* request_info = new HMIRequestInfo(request, raw_ptr->default_timeout());
- RequestInfoPtr request_info_ptr(request_info );
-
- //pending_request_list_.Acquire();
- if (0 != raw_ptr->default_timeout()) {
- pending_request_set_lock_.Acquire();
- pending_request_set_.insert(request_info_ptr);
- LOG4CXX_INFO(logger_, "Pending request size is "
- << pending_request_set_.size() );
- UpdateTimer();
- pending_request_set_lock_.Release();
- } else {
- LOG4CXX_INFO(logger_, "Default timeout was set to 0."
- "RequestController will not track timeout of this request.");
- }
- LOG4CXX_TRACE_EXIT(logger_);
- return RequestController::SUCCESS;
-}
-
-void RequestController::addNotification(const RequestPtr ptr) {
- LOG4CXX_TRACE_ENTER(logger_);
- notification_list_.push_back(ptr);
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-void RequestController::removeNotification(const commands::Command* notification) {
- LOG4CXX_TRACE_ENTER(logger_);
- std::list<RequestPtr>::iterator it = notification_list_.begin();
- for (; notification_list_.end() != it; ++it) {
- if (it->get() == notification) {
- notification_list_.erase(it);
- break;
- }
- }
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-void RequestController::terminateMobileRequest(
- const uint32_t& mobile_correlation_id) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- for (; pending_request_set_.end() != it; ++it) {
- MobileRequestInfo* mobile_request_info = dynamic_cast<MobileRequestInfo*>(it->get());
- if (NULL == mobile_request_info) {
- continue;
- }
- if (mobile_correlation_id == mobile_request_info->mobile_correlation_id_) {
- mobile_request_info->request_->CleanUp();
- pending_request_set_.erase(it);
- LOG4CXX_INFO(logger_, "Mobile request terminated: " << mobile_correlation_id);
- UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
- return;
- }
- }
- LOG4CXX_INFO(logger_, "Mobile request NOT terminated: " << mobile_correlation_id <<
- " pending_request_set_ size : " << pending_request_set_.size());
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-void RequestController::terminateHMIRequest(const uint32_t &correlation_id) {
- LOG4CXX_TRACE_ENTER(logger_);
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- for (; pending_request_set_.end() != it; ++it) {
- HMIRequestInfo* hmi_request_info = dynamic_cast<HMIRequestInfo*>(it->get());
- if (NULL == hmi_request_info) {
- continue;
- }
- if (correlation_id == hmi_request_info->requestId()) {
- hmi_request_info->request_->CleanUp();
- pending_request_set_.erase(it);
- LOG4CXX_DEBUG(logger_, "HMI request terminated: " << correlation_id);
- UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
- return;
- }
- }
- LOG4CXX_INFO(logger_, "HMI request NOT terminated: " << correlation_id <<
- " pending_request_set_ size : " << pending_request_set_.size());
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-void RequestController::terminateAppRequests(
- const uint32_t& app_id) {
- LOG4CXX_TRACE_ENTER(logger_);
-
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- while (pending_request_set_.end() != it) {
- MobileRequestInfo* mobile_request_info = dynamic_cast<MobileRequestInfo*>(it->get());
- if (NULL == mobile_request_info) {
- ++it;
- continue;
- }
-
- if (mobile_request_info->app_id_ == app_id) {
- mobile_request_info->request_->CleanUp();
- pending_request_set_.erase(it++);
- LOG4CXX_INFO(logger_, "terminated all app requests : " << app_id);
- } else {
- ++it;
- }
- }
- UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-void RequestController::terminateAllHMIRequests() {
- LOG4CXX_TRACE_ENTER(logger_);
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- while (pending_request_set_.end() != it) {
- HMIRequestInfo* hmi_request_info = dynamic_cast<HMIRequestInfo*>(it->get());
- if (NULL == hmi_request_info) {
- ++it;
- continue;
- }
- hmi_request_info->request_->CleanUp();
- pending_request_set_.erase(it++);
- LOG4CXX_INFO(logger_, "HMI request terminated: ");
- }
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-void RequestController::updateRequestTimeout(
- const uint32_t& app_id,
- const uint32_t& mobile_correlation_id,
- const uint32_t& new_timeout) {
-
- LOG4CXX_TRACE_ENTER(logger_);
-
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator it = pending_request_set_.begin();
- MobileRequestInfo* mobile_request_info = NULL;
- RequestInfoPtr request_info;
- for (; pending_request_set_.end() != it; ++it) {
- request_info = *it;
- if (false == request_info.valid()) {
- LOG4CXX_ERROR(logger_, "Invalid request, can't update timeout");
- continue;
- }
- mobile_request_info = dynamic_cast<MobileRequestInfo*>(request_info.get());
- if (NULL == mobile_request_info) {
- continue;
- }
- if (app_id == mobile_request_info->app_id_ &&
- mobile_correlation_id == mobile_request_info->mobile_correlation_id_) {
- break;
- }
- }
-
- if (it != pending_request_set_.end()) {
- DCHECK(mobile_request_info);
- DCHECK(request_info.valid());
-
- mobile_request_info->updateTimeOut(new_timeout);
- pending_request_set_.erase(it);
- pending_request_set_.insert(request_info);
- // erase and insert need to update ordering of set
- UpdateTimer();
- LOG4CXX_ERROR(logger_, "Timeout updated for "
- << " app_id " << app_id
- << " mobile_correlation_id " << mobile_correlation_id
- << " new_timeout " << new_timeout);
- } else {
- LOG4CXX_ERROR(logger_, "Cant find request with "
- << " app_id " << app_id
- << " mobile_correlation_id " << mobile_correlation_id );
- }
-}
-
-void RequestController::onTimer() {
- LOG4CXX_TRACE_ENTER(logger_);
- AutoLock auto_lock(pending_request_set_lock_);
- RequestInfoSet::iterator probably_expired = pending_request_set_.begin();
- while (pending_request_set_.end() != probably_expired) {
- RequestInfoPtr request = *probably_expired;
- if (request->timeout_sec() == 0) {
- LOG4CXX_INFO(logger_, "Ignore " << request->requestId());
- ++probably_expired;
- // This request should not be observed for TIME_OUT
- continue;
- }
- if (request->isExpired()) {
- pending_request_set_.erase(probably_expired);
- commands::CommandRequestImpl* mobile_expired_request =
- dynamic_cast<commands::CommandRequestImpl*>(request->request());
- if (mobile_expired_request) {
- mobile_expired_request->onTimeOut();
- }
- request->request()->CleanUp();
- LOG4CXX_INFO(logger_, "Timeout for request id " << request->requestId() << " expired");
- probably_expired = pending_request_set_.begin();
- break;
- }
- }
- UpdateTimer();
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-RequestController::Worker::Worker(RequestController* requestController)
- : request_controller_(requestController)
- , stop_flag_(false) {
-}
-
-RequestController::Worker::~Worker() {
-}
-
-void RequestController::Worker::threadMain() {
- LOG4CXX_TRACE_ENTER(logger_);
- sync_primitives::AutoLock auto_lock(thread_lock_);
- while (!stop_flag_) {
- // Try to pick a request
- sync_primitives::AutoLock auto_lock(request_controller_->mobile_request_list_lock_);
-
- while ((request_controller_->pool_state_ != TPoolState::STOPPED) &&
- (request_controller_->mobile_request_list_.empty())) {
- // Wait until there is a task in the queue
- // Unlock mutex while wait, then lock it back when signaled
- LOG4CXX_INFO(logger_, "Unlocking and waiting");
- request_controller_->cond_var_.Wait(auto_lock);
- LOG4CXX_INFO(logger_, "Signaled and locking");
- }
-
- // If the thread was shutdown, return from here
- if (request_controller_->pool_state_ == TPoolState::STOPPED) {
- break;
- }
-
- MobileRequestPtr request(request_controller_->mobile_request_list_.front());
-
- request_controller_->mobile_request_list_.pop_front();
- bool init_res = request->Init(); // to setup specific default timeout
- RequestInfoPtr request_info_ptr(new MobileRequestInfo(request, request->default_timeout()));
-
- request_controller_->pending_request_set_lock_.Acquire();
- request_controller_->pending_request_set_.insert(request_info_ptr);
- //pending_request_list_.Acquire();
- if (0 != request->default_timeout()) {
- LOG4CXX_INFO(logger_, "Add Request " << request_info_ptr->requestId() <<
- "with timeout: " << request->default_timeout());
- request_controller_->UpdateTimer();
- } else {
- LOG4CXX_INFO(logger_, "Default timeout was set to 0."
- "RequestController will not track timeout of this request.");
- }
- request_controller_->pending_request_set_lock_.Release();
- AutoUnlock unlock(auto_lock);
-
- // execute
- if (request->CheckPermissions() && init_res) {
- request->Run();
- }
- }
-
-}
-
-bool RequestController::Worker::exitThreadMain() {
- stop_flag_ = true;
- sync_primitives::AutoLock auto_lock(thread_lock_);
- return true;
-}
-
-bool RequestController::checkTimeScaleMaxRequest(
- const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale) {
- LOG4CXX_TRACE_ENTER(logger_);
- {
- AutoLock auto_lock(pending_request_set_lock_);
- TimevalStruct end = date_time::DateTime::getCurrentTime();
- TimevalStruct start;
- start.tv_sec = end.tv_sec - app_time_scale;
-
- TimeScale scale(start, end, app_id);
- uint32_t count = 0;
-
- count = count_if (pending_request_set_.begin(), pending_request_set_.end(), scale);
- if (count == max_request_per_time_scale ) {
- LOG4CXX_ERROR(logger_, "Requests count " << count <<
- " exceed application limit " << max_request_per_time_scale);
- return true;
- }
- }
- return true;
-}
-
-bool RequestController::checkHMILevelTimeScaleMaxRequest(
- const mobile_apis::HMILevel::eType& hmi_level,
- const uint32_t& app_id,
- const uint32_t& app_time_scale,
- const uint32_t& max_request_per_time_scale) {
- LOG4CXX_TRACE_ENTER(logger_);
- {
- AutoLock auto_lock(pending_request_set_lock_);
- TimevalStruct end = date_time::DateTime::getCurrentTime();
- TimevalStruct start;
- start.tv_sec = end.tv_sec - app_time_scale;
-
- HMILevelTimeScale scale(start, end, app_id, hmi_level);
- uint32_t count = 0;
-
- count = count_if (pending_request_set_.begin(), pending_request_set_.end(), scale);
- if (count == max_request_per_time_scale ) {
- LOG4CXX_ERROR(logger_, "Requests count " << count
- << " exceed application limit " << max_request_per_time_scale
- << " in hmi level " << hmi_level);
- return false;
- }
- }
- return true;
-}
-
-void RequestController::UpdateTimer() {
- LOG4CXX_TRACE_ENTER(logger_);
- uint32_t sleep_time = dafault_sleep_time_;
- RequestInfoSet::iterator it = pending_request_set_.begin();
-
- while (it != pending_request_set_.end()) {
- RequestInfoPtr request = *it;
- DCHECK(request.valid());
- if (0 == request->timeout_sec()) {
- ++it;
- // This request should not be observed for TIME_OUT
- continue;
- }
- sleep_time = request->end_time().tv_sec -
- date_time::DateTime::getCurrentTime().tv_sec;
- break;
- }
- timer_.updateTimeOut(sleep_time);
- LOG4CXX_INFO(logger_, "Sleep for: " << sleep_time);
- LOG4CXX_TRACE_EXIT(logger_);
-}
-
-
-} // namespace request_controller
-
-} // namespace application_manager
diff --git a/src/components/include/utils/timer_thread.h b/src/components/include/utils/timer_thread.h
index 899aa9968d..d2d4374f75 100644
--- a/src/components/include/utils/timer_thread.h
+++ b/src/components/include/utils/timer_thread.h
@@ -329,7 +329,7 @@ void TimerThread<T>::TimerLooperDelegate::threadMain() {
end_time = static_cast<time_t>(cur_time) + TimerDelegate::timeout_seconds_;
}
- int32_t wait_seconds_left = static_cast<int32_t>(difftime(end_time, cur_time));
+ int64_t wait_seconds_left = static_cast<int64_t>(difftime(end_time, cur_time));
int32_t wait_milliseconds_left = std::numeric_limits<int32_t>::max();
const int32_t millisecconds_in_second = 1000;
if (wait_seconds_left < std::numeric_limits<int32_t>::max() / millisecconds_in_second) {
@@ -340,7 +340,8 @@ void TimerThread<T>::TimerLooperDelegate::threadMain() {
TimerDelegate::termination_condition_.WaitFor(auto_lock, wait_milliseconds_left);
// Quit sleeping or continue sleeping in case of spurious wake up
if (ConditionalVariable::kTimeout == wait_status ||
- wait_seconds_left <= 0) {
+ wait_milliseconds_left <= 0) {
+ LOG4CXX_TRACE(logger_, "Timer timeout " << wait_milliseconds_left);
TimerDelegate::timer_thread_->onTimeOut();
} else {
LOG4CXX_DEBUG(logger_, "Timeout reset force: " << TimerDelegate::timeout_seconds_);
diff --git a/src/components/policy/src/policy/include/policy/cache_manager.h b/src/components/policy/src/policy/include/policy/cache_manager.h
index 7b2220025c..320732c64b 100644
--- a/src/components/policy/src/policy/include/policy/cache_manager.h
+++ b/src/components/policy/src/policy/include/policy/cache_manager.h
@@ -569,6 +569,7 @@ private:
private:
utils::SharedPtr<policy_table::Table> pt_;
+ utils::SharedPtr<policy_table::Table> snapshot_;
utils::SharedPtr<PTRepresentation> backup_;
utils::SharedPtr<PTExtRepresentation> ex_backup_;
bool update_required;
diff --git a/src/components/policy/src/policy/policy_table/table_struct_ext/enums.cc b/src/components/policy/src/policy/policy_table/table_struct_ext/enums.cc
index ad51f7599f..d40fee4501 100644
--- a/src/components/policy/src/policy/policy_table/table_struct_ext/enums.cc
+++ b/src/components/policy/src/policy/policy_table/table_struct_ext/enums.cc
@@ -7,7 +7,7 @@ bool IsValidEnum(Priority val) {
switch (val) {
case P_EMERGENCY: return true;
case P_NAVIGATION: return true;
- case P_VOICECOM: return true;
+ case P_VOICECOMM: return true;
case P_COMMUNICATION: return true;
case P_NORMAL: return true;
case P_NONE: return true;
@@ -18,7 +18,7 @@ const char* EnumToJsonString(Priority val) {
switch (val) {
case P_EMERGENCY: return "EMERGENCY";
case P_NAVIGATION: return "NAVIGATION";
- case P_VOICECOM: return "VOICECOM";
+ case P_VOICECOMM: return "VOICECOMM";
case P_COMMUNICATION: return "COMMUNICATION";
case P_NORMAL: return "NORMAL";
case P_NONE: return "NONE";
@@ -32,8 +32,8 @@ bool EnumFromJsonString(const std::string& literal, Priority* result) {
} else if ("NAVIGATION" == literal) {
*result = P_NAVIGATION;
return true;
- } else if ("VOICECOM" == literal) {
- *result = P_VOICECOM;
+ } else if ("VOICECOMM" == literal) {
+ *result = P_VOICECOMM;
return true;
} else if ("COMMUNICATION" == literal) {
*result = P_COMMUNICATION;
diff --git a/src/components/policy/src/policy/policy_table/table_struct_ext/enums.h b/src/components/policy/src/policy/policy_table/table_struct_ext/enums.h
index 5137477aa2..5be102b042 100644
--- a/src/components/policy/src/policy/policy_table/table_struct_ext/enums.h
+++ b/src/components/policy/src/policy/policy_table/table_struct_ext/enums.h
@@ -9,7 +9,7 @@ namespace policy_table_interface_base {
enum Priority {
P_EMERGENCY,
P_NAVIGATION,
- P_VOICECOM,
+ P_VOICECOMM,
P_COMMUNICATION,
P_NORMAL,
P_NONE,
diff --git a/src/components/policy/src/policy/src/cache_manager.cc b/src/components/policy/src/policy/src/cache_manager.cc
index 8b749dab88..b59c551b50 100644
--- a/src/components/policy/src/policy/src/cache_manager.cc
+++ b/src/components/policy/src/policy/src/cache_manager.cc
@@ -245,7 +245,7 @@ void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
LOG4CXX_TRACE_ENTER(logger_);
-#ifdef EXTENDED_POLICY
+
pt_->policy_table.functional_groupings =
update_pt.policy_table.functional_groupings;
@@ -256,7 +256,7 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
pt_->policy_table.consumer_friendly_messages =
update_pt.policy_table.consumer_friendly_messages;
}
-#endif // EXTENDED_POLICY
+
LOG4CXX_TRACE_EXIT(logger_);
return true;
}
@@ -780,11 +780,14 @@ bool CacheManager::GetPriority(const std::string &policy_app_id,
}
void CacheManager::CheckSnapshotInitialization() {
- *(pt_->policy_table.module_config.preloaded_pt) = false;
+ *(snapshot_->policy_table.module_config.preloaded_pt) = false;
#ifdef EXTENDED_POLICY
+ snapshot_->policy_table.consumer_friendly_messages->messages =
+ rpc::Optional<policy_table::Messages>();
+
rpc::Optional<policy_table::ModuleMeta>& module_meta =
- pt_->policy_table.module_meta;
+ snapshot_->policy_table.module_meta;
if (!module_meta->pt_exchanged_at_odometer_x->is_initialized()) {
*(module_meta->pt_exchanged_at_odometer_x) = 0;
}
@@ -794,7 +797,7 @@ void CacheManager::CheckSnapshotInitialization() {
}
rpc::Optional<policy_table::UsageAndErrorCounts>& usage_and_error_counts =
- pt_->policy_table.usage_and_error_counts;
+ snapshot_->policy_table.usage_and_error_counts;
if (!usage_and_error_counts->count_of_iap_buffer_full->is_initialized()) {
*(usage_and_error_counts->count_of_iap_buffer_full) = 0;
}
@@ -875,8 +878,9 @@ void CacheManager::CheckSnapshotInitialization() {
utils::SharedPtr<policy_table::Table>
CacheManager::GenerateSnapshot() {
+ snapshot_ = utils::SharedPtr<policy_table::Table>(new policy_table::Table(pt_->policy_table));
CheckSnapshotInitialization();
- return pt_;
+ return snapshot_;
}
bool CacheManager::GetInitialAppData(const std::string& app_id,
diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc
index 1ebbb27eb1..a78d61dde8 100644
--- a/src/components/transport_manager/src/transport_manager_default.cc
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -55,11 +55,9 @@
#else // CUSTOMER_PASA
-#if defined(AOA_SUPPORT) && defined(__QNXNTO__)
-#include "transport_manager/aoa/aoa_transport_adapter.h"
-#elif defined(USB_SUPPORT)
+#if defined(USB_SUPPORT)
#include "transport_manager/usb/usb_aoa_adapter.h"
-#endif // AOA_SUPPORT
+#endif // USB_SUPPORT
#endif // CUSTOMER_PASA
@@ -115,15 +113,7 @@ int TransportManagerDefault::Init() {
#else // CUSTOMER_PASA
-#if defined(AOA_SUPPORT) && defined(__QNXNTO__)
- ta = new transport_adapter::AOATransportAdapter();
-#ifdef TIME_TESTER
- if (metric_observer_) {
- ta->SetTimeMetricObserver(metric_observer_);
- }
-#endif // TIME_TESTER
- AddTransportAdapter(ta);
-#elif defined(USB_SUPPORT)
+#if defined(USB_SUPPORT)
ta = new transport_adapter::UsbAoaAdapter();
#ifdef TIME_TESTER
if (metric_observer_) {
@@ -131,7 +121,7 @@ int TransportManagerDefault::Init() {
}
#endif // TIME_TESTER
AddTransportAdapter(ta);
-#endif // AOA_SUPPORT
+#endif // USB_SUPPORT
#endif // CUSTOMER_PASA
diff --git a/test/CMakeLists.txt.autosave b/test/CMakeLists.txt.autosave
deleted file mode 100644
index 1289969b92..0000000000
--- a/test/CMakeLists.txt.autosave
+++ /dev/null
@@ -1,112 +0,0 @@
-find_package(Gstreamer-1.0 REQUIRED)
-find_package(Glib-2.0 REQUIRED)
-
-# --- GoogleTest example
-#add_subdirectory(./gtest-example)
-
-include_directories(
- ${CMAKE_SOURCE_DIR}/test/components/include)
-
-# --- components tests
-add_subdirectory(./components)
-add_subdirectory(./thirdPartyLibs)
-add_subdirectory(${CMAKE_SOURCE_DIR}/src/components/policy/test/policy ./policy)
-add_subdirectory(./tools)
-
-set (INCLUDE_DIR
- ${GMOCK_INCLUDE_DIRECTORY}
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ../src/appMain
- ../src/components/application_manager/include
- ../src/components/hmi_message_handler/include
- ../src/components/media_manager/include
- ../src/components/config_profile/include
- ../src/components/policy/src/policy/include
- ../src/components/policy/src/policy/usage_statistics/include
- ../src/components/protocol_handler/include
- ../src/components/transport_manager/include
- ../src/components/connection_handler/include
- ${SecurityManagerIncludeDir}
- ../src/components/formatters/include
- ../src/components/smart_objects/include
- ../src/components/formatters/include
- ../src/components/utils/include/
- ../src/components/resumption/include/
- ../test/components/mobile_message_handler/include/
- ../test/components/protocol_handler/include/
- ../test/components/utils/include
- ../test/components/json_handler/include
- ../test/components/smart_objects
- ../test/components/smart_objects/SchemaItem
- ../test/components/transport_manager
- ../test/components/connection_handler/include
- ../test/components/security_manager/include
- ../test/components/
- ../test/thirdPartyLibs/jsoncpp/include
- ../test/components/application_manager
- ../test/components/application_manager/rpc/include
- ${CMAKE_BINARY_DIR}/src/components/
- ${CMAKE_BINARY_DIR}
-# /usr/lib/i386-linux-gnu/glib-2.0/include
-# /usr/lib/x86_64-linux-gnu/glib-2.0/include/
-# ${GSTREAMER_gst_INCLUDE_DIR}
-# ${GLIB_glib_2_INCLUDE_DIR}
-)
-
-set(LIBRARIES
- MediaManager
- ApplicationManager
- gtest
- gtest_main
- gmock
- gmock_main
- formatters
- HMI_API
- v4_protocol_v1_2_no_extra
- SmartObjects
- ProtocolHandler
- Utils
- ConfigProfile
- #test_JSONHandler_v4_protocol_v2_0_revP
- #test_json_handler
- #test_SmartObjectTest
- #test_FormattersCommandsTest
- #test_UtilsTest
- #test_ProtocolHandlerTest
- #test_JSONCPPTest
- #test_MobileMessageHandlerTest
- connectionHandler
- MOBILE_API
- jsoncpp
- TransportManager
- HMIMessageHandler
- MessageBroker
- MessageBrokerClient
- MessageBrokerServer
- encryption
- ${RTLIB}
- # ${GSTREAMER_gstreamer_LIBRARY}
- Resumption
- Policy
- ${SecurityManagerLibrary}
-)
-if(ENABLE_SECURITY)
- LIST(APPEND LIBRARIES test_SecurityManager)
-endif()
-
-if (BUILD_USB_SUPPORT)
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- list(APPEND LIBRARIES Libusb-1.0.16)
-endif()
-endif()
-
-add_executable("test_suit" "./test_suit.cc")
-file(COPY ${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem DESTINATION ${CMAKE_BINARY_DIR}/test/)
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
-include_directories(${INCLUDE_DIR})
-target_link_libraries("test_suit" ${LIBRARIES})
-
-# vim: set ts=2 sw=2 et: