diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2018-01-30 15:45:15 -0500 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2018-01-30 16:33:53 -0500 |
commit | ea5d724fe899e65933b5de33e2957c4cd33338e7 (patch) | |
tree | 683d29c1ad59e003291e9fa083e2ad761cbf784b | |
parent | 08fcc026eafab3d8058d16b353be0995258d82dc (diff) | |
download | sdl_core-ea5d724fe899e65933b5de33e2957c4cd33338e7.tar.gz |
Fix DBus Build
16 files changed, 135 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7730b57c2d..bc049a5a28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,6 +374,10 @@ if (HMIADAPTER STREQUAL "dbus") set(HMI_DBUS_API ON) add_definitions(-DDBUS_HMIADAPTER) add_definitions(-DHMI_DBUS_API) + + find_package(DBus REQUIRED) + set(DBUS_LIBS_DIRECTORY ${DBUS_LIBRARY_DIRS} PARENT_SCOPE) + message(${DBUS_INCLUDE_DIRS}) endif() if (HMIADAPTER STREQUAL "messagebroker") set(HMI_JSON_API ON) diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index c5b4640a77..b2ed272416 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -172,18 +172,6 @@ if(ENABLE_LOG) add_subdirectory(apache-log4cxx-cmake) endif() -# --- D-Bus -if(HMI_DBUS_API) - - # --- D-Bus - set(DBUS_INCLUDE_DIR ${3RD_PARTY_INSTALL_PREFIX}/include) - set(DBUS_INCLUDE_DIR_ARCH ${3RD_PARTY_INSTALL_PREFIX_ARCH}/include) - set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_INCLUDE_DIR_ARCH}) - set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIRS} PARENT_SCOPE) - set(DBUS_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) - message(${DBUS_INCLUDE_DIR}) -endif() - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}") set(CMAKE_SOURCE_PREFIX ${CMAKE_SOURCE_PREFIX} "${3RD_PARTY_INSTALL_PREFIX}") find_package (BSON) diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc index 119227ea03..7487052129 100644 --- a/src/appMain/life_cycle.cc +++ b/src/appMain/life_cycle.cc @@ -54,10 +54,12 @@ namespace main_namespace { CREATE_LOGGERPTR_GLOBAL(logger_, "SDLMain") namespace { +#ifdef MESSAGEBROKER_HMIADAPTER void NameMessageBrokerThread(const System::Thread& thread, const std::string& name) { Thread::SetNameForId(thread.GetId(), name); } +#endif // MESSAGEBROKER_HMIADAPTER void StopThread(System::Thread* thread) { if (thread) { diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 7a49ce6b81..6c3a355cfc 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -344,9 +344,6 @@ set (HMI_COMMANDS_SOURCES ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_response.cc ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_request.cc ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_response.cc -) - -set (HMI_COMMANDS_SOURCES_JSON ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_request.cc ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_response.cc ${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_request.cc @@ -356,6 +353,9 @@ set (HMI_COMMANDS_SOURCES_JSON ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vehicle_data_notification.cc ) +set (HMI_COMMANDS_SOURCES_JSON +) + set (HMI_COMMANDS_SOURCES_DBUS ${COMMANDS_SOURCE_DIR}/hmi/on_vi_gps_data_notification.cc ${COMMANDS_SOURCE_DIR}/hmi/on_vi_speed_notification.cc diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt index 07ca2586d0..eb198b620c 100644 --- a/src/components/dbus/CMakeLists.txt +++ b/src/components/dbus/CMakeLists.txt @@ -52,7 +52,7 @@ collect_sources(SOURCES "${PATHS}") set(LIBRARIES HMI_API Utils - dbus-1 -L${DBUS_LIBS_DIRECTORY} + dbus-1 ) add_custom_command( diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt index 1b3df2c0e7..914bd2ca84 100644 --- a/src/components/dbus/test/CMakeLists.txt +++ b/src/components/dbus/test/CMakeLists.txt @@ -33,11 +33,12 @@ include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) include_directories ( ${GMOCK_INCLUDE_DIRECTORY} ${COMPONENTS_DIR}/dbus/include/ + ${COMPONENTS_DIR}/dbus/test/include/ ) #FIXME: exclude some tests set (EXCLUDE_PATHS - test_dbus_message_controller.cc + dbus_message_controller_test.cc ) collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" ${EXCLUDE_PATHS}) diff --git a/src/components/dbus/test/dbus_message_controller_test.cc b/src/components/dbus/test/dbus_message_controller_test.cc index 5c5d4e69d5..c06e144f9b 100644 --- a/src/components/dbus/test/dbus_message_controller_test.cc +++ b/src/components/dbus/test/dbus_message_controller_test.cc @@ -36,14 +36,14 @@ #include <pthread.h> #include <gtest/gtest.h> #include <gmock/gmock.h> -#include "hmi_message_handler/mock_dbus_message_controller.h" -#include "hmi_message_handler/mock_subscriber.h" +#include "dbus/mock_dbus_message_controller.h" +#include "dbus/mock_subscriber.h" using ::testing::_; namespace test { namespace components { -namespace hmi_message_handler { +namespace dbus { ACTION_P(SignalTest, test) { if (test->thread_id != pthread_self()) { @@ -111,6 +111,6 @@ TEST_F(DBusMessageControllerTest, DISABLED_Send) { controller_->Send(kText); } -} // namespace hmi_message_handler +} // namespace dbus } // namespace components } // namespace test diff --git a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h b/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h index 86ebf100bb..2fe4267b35 100644 --- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h +++ b/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h @@ -30,18 +30,18 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_ -#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_ +#ifndef SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_ +#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_ #include <pthread.h> -#include "hmi_message_handler/dbus_message_controller.h" +#include "dbus/dbus_message_controller.h" namespace test { namespace components { -namespace hmi_message_handler_test { +namespace dbus_test { class MockDBusMessageController - : public ::hmi_message_handler::DBusMessageController { + : public ::dbus::DBusMessageController { public: MOCK_METHOD1(Recv, void(std::string&)); @@ -69,8 +69,8 @@ class MockDBusMessageController } }; -} // namespace hmi_message_handler_test +} // namespace dbus_test } // namespace components } // namespace test -#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_DBUS_MESSAGE_CONTROLLER_H_ +#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_ diff --git a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h b/src/components/dbus/test/include/dbus/mock_subscriber.h index 9e9074e70c..b2a369e371 100644 --- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h +++ b/src/components/dbus/test/include/dbus/mock_subscriber.h @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_SUBSCRIBER_H_ -#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_SUBSCRIBER_H_ +#ifndef SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_ +#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_ #include <string> @@ -39,7 +39,7 @@ struct DBusConnection; namespace test { namespace components { -namespace hmi_message_handler_test { +namespace dbus { class MockSubscriber { public: @@ -55,8 +55,8 @@ class MockSubscriber { DBusConnection* conn_; }; -} // namespace hmi_message_handler_test +} // namespace dbus } // namespace components } // namespace test -#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_SUBSCRIBER_H_ +#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_ diff --git a/src/components/hmi_message_handler/test/mock_subscriber.cc b/src/components/dbus/test/mock_subscriber.cc index 0fc9110a1d..2c5dccaa50 100644 --- a/src/components/hmi_message_handler/test/mock_subscriber.cc +++ b/src/components/dbus/test/mock_subscriber.cc @@ -31,14 +31,14 @@ */ #include "dbus/dbus.h" -#include "hmi_message_handler/mock_subscriber.h" +#include "dbus/mock_subscriber.h" namespace test { namespace components { -namespace hmi_message_handler_test { +namespace dbus { -MockSubscriber::MockSubscriber(const std::string& nameService, - const std::string& path) +MockSubscriber::MockSubscriber(const std::string nameService, + const std::string path) : nameService_(nameService), path_(path), conn_(NULL) {} MockSubscriber::~MockSubscriber() {} @@ -66,6 +66,6 @@ bool MockSubscriber::Start() { void MockSubscriber::Send(const std::string& message) {} -} // namespace hmi_message_handler_test +} // namespace dbus } // namespace components } // namespace test diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt index c1dfca5e67..b127d8dcc5 100644 --- a/src/components/hmi_message_handler/CMakeLists.txt +++ b/src/components/hmi_message_handler/CMakeLists.txt @@ -54,7 +54,7 @@ set(PATHS ) if (HMIADAPTER STREQUAL "dbus") - set(EXCLUDE_PATHS) + set(EXCLUDE_PATHS messagebroker_adapter.cc) set(DBUS_ADAPTER DBus) else() set(EXCLUDE_PATHS dbus_message_adapter.cc) diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt index 0d7ccd9ee1..020c5843a5 100644 --- a/src/components/hmi_message_handler/test/CMakeLists.txt +++ b/src/components/hmi_message_handler/test/CMakeLists.txt @@ -42,10 +42,11 @@ if (HMIADAPTER STREQUAL "messagebroker") message_broker_client message_broker_server ) + set(EXCLUDE_PATHS) +else() + set(EXCLUDE_PATHS hmi_message_handler_impl_test.cc) endif() -set(EXCLUDE_PATHS) - set(LIBRARIES gmock ApplicationManager @@ -55,13 +56,6 @@ set(LIBRARIES ConfigProfile ) -if(NOT HMI_DBUS_API}) - list (APPEND EXCLUDE_PATHS - mock_subscriber.cc - dbus_message_adapter_test.cc - ) -endif() - collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}") create_test(hmi_message_handler_test "${SOURCES}" "${LIBRARIES}") diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml index 08451b5461..0e5d765964 100644 --- a/src/components/interfaces/QT_HMI_API.xml +++ b/src/components/interfaces/QT_HMI_API.xml @@ -525,6 +525,44 @@ <!-- TO DO to be removed --> <element name="turnText"/> </enum> + <enum name="MetadataType"> + <element name="mediaTitle"> + <description>The data in this field contains the title of the currently playing audio track.</description> + </element> + <element name="mediaArtist"> + <description>The data in this field contains the artist or creator of the currently playing audio track.</description> + </element> + <element name="mediaAlbum"> + <description>The data in this field contains the album title of the currently playing audio track.</description> + </element> + <element name="mediaYear"> + <description>The data in this field contains the creation year of the currently playing audio track.</description> + </element> + <element name="mediaGenre"> + <description>The data in this field contains the genre of the currently playing audio track.</description> + </element> + <element name="mediaStation"> + <description>The data in this field contains the name of the current source for the media.</description> + </element> + <element name="rating"> + <description>The data in this field is a rating.</description> + </element> + <element name="currentTemperature"> + <description>The data in this field is the current temperature.</description> + </element> + <element name="maximumTemperature"> + <description>The data in this field is the maximum temperature for the day.</description> + </element> + <element name="minimumTemperature"> + <description>The data in this field is the minimum temperature for the day.</description> + </element> + <element name="weatherTerm"> + <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description> + </element> + <element name="humidity"> + <description>The data in this field describes the current humidity value.</description> + </element> + </enum> <enum name="ImageFieldName"> <element name="softButtonImage"> <description>The image field for SoftButton</description> diff --git a/src/components/rpc_base/test/CMakeLists.txt b/src/components/rpc_base/test/CMakeLists.txt index 566f0ddcde..ca4f41fe76 100644 --- a/src/components/rpc_base/test/CMakeLists.txt +++ b/src/components/rpc_base/test/CMakeLists.txt @@ -34,7 +34,6 @@ include_directories( ${COMPONENTS_DIR}/dbus/include ${COMPONENTS_DIR}/dbus/src ${COMPONENTS_DIR}/rpc_base/include - ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8 ${GMOCK_INCLUDE_DIRECTORY} ${JSONCPP_INCLUDE_DIRECTORY} ) diff --git a/tools/cmake/modules/FindDBus.cmake b/tools/cmake/modules/FindDBus.cmake new file mode 100644 index 0000000000..1d0f29dd75 --- /dev/null +++ b/tools/cmake/modules/FindDBus.cmake @@ -0,0 +1,59 @@ +# - Try to find DBus +# Once done, this will define +# +# DBUS_FOUND - system has DBus +# DBUS_INCLUDE_DIRS - the DBus include directories +# DBUS_LIBRARIES - link these to use DBus +# +# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS 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 ITS +# 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. + +FIND_PACKAGE(PkgConfig) +PKG_CHECK_MODULES(PC_DBUS QUIET dbus-1) + +FIND_LIBRARY(DBUS_LIBRARIES + NAMES dbus-1 + HINTS ${PC_DBUS_LIBDIR} + ${PC_DBUS_LIBRARY_DIRS} +) + +FIND_PATH(DBUS_INCLUDE_DIR + NAMES dbus/dbus.h + HINTS ${PC_DBUS_INCLUDEDIR} + ${PC_DBUS_INCLUDE_DIRS} +) + +GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} PATH) +FIND_PATH(DBUS_ARCH_INCLUDE_DIR + NAMES dbus/dbus-arch-deps.h + HINTS ${PC_DBUS_INCLUDEDIR} + ${PC_DBUS_INCLUDE_DIRS} + ${_DBUS_LIBRARY_DIR} + ${DBUS_INCLUDE_DIR} + PATH_SUFFIXES include +) + +SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
\ No newline at end of file diff --git a/tools/intergen/test/CMakeLists.txt b/tools/intergen/test/CMakeLists.txt index 27d506443e..f2973dd71c 100644 --- a/tools/intergen/test/CMakeLists.txt +++ b/tools/intergen/test/CMakeLists.txt @@ -76,7 +76,7 @@ if (${HMI_DBUS_API}) ${CMAKE_SOURCE_DIR}/src/components/dbus/include ${DBUS_INCLUDE_DIRS} ) - set (LIBRARIES ${LIBRARIES} dbus) + set (LIBRARIES ${LIBRARIES} DBus) set (SOURCES ${SOURCES} generated_interface_dbus_tests.cc) endif () |