From 472d0762b68ce0f2a755b4215515a3e031831495 Mon Sep 17 00:00:00 2001 From: christian mueller Date: Tue, 10 Jan 2012 15:58:38 +0100 Subject: * recreated the header files out of the model. Added versioning support in the headerfiles generated * ensured compatibility with 64 bit systems while compiling dbus [ changed FindDBUS.cmake] * updated the README to better support building * updated typo in introspectable string of DBusWrapper * reworked including strategie * added getInterfafeVersion method on all interfaces * added Interface Versioning support * added version as part of .so ending * it is no possible to set a vector of source and sink sound properties at a time * added interface to ask for all loaded plugins on RoutingSender * added first version of telnet server (not yet productive) - set to not active in CMakeLists.txt * added changelog (created out of git commit log) * added default values for all enum types to be save even on other if communication is on other domain --- PluginCommandInterfaceDbus/CMakeLists.txt | 11 +++++++++++ PluginCommandInterfaceDbus/include/DBusCommandSender.h | 3 ++- PluginCommandInterfaceDbus/src/DBusCommandSender.cpp | 17 ++++++++++++----- PluginCommandInterfaceDbus/test/MockInterfaces.h | 4 +++- 4 files changed, 28 insertions(+), 7 deletions(-) (limited to 'PluginCommandInterfaceDbus') diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt index 732fd34..2b78169 100644 --- a/PluginCommandInterfaceDbus/CMakeLists.txt +++ b/PluginCommandInterfaceDbus/CMakeLists.txt @@ -8,6 +8,11 @@ set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command) set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandDBusPlugin) set(INCLUDES_FOLDER "include") +FILE(READ "${AUDIO_INCLUDES_FOLDER}/command/CommandSendInterface.h" VERSION_BUFFER LIMIT 6000) +STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER}) +STRING(REGEX REPLACE "[^0-9]" "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING}) +MESSAGE(STATUS "Building against command interface version ${LIB_INTERFACE_VERSION}") + FIND_PACKAGE(DBUS REQUIRED) INCLUDE_DIRECTORIES( @@ -16,6 +21,7 @@ INCLUDE_DIRECTORIES( ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR} ${AUDIO_INCLUDES_FOLDER} + ${DLT_INCLUDE_DIRS} ${INCLUDES_FOLDER} ) @@ -24,6 +30,11 @@ file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp") add_library(PluginCommandInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX}) +SET_TARGET_PROPERTIES(PluginCommandInterfaceDbus PROPERTIES + SOVERSION "${LIB_INTERFACE_VERSION}" +) + + TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus ${DLT_LIBRARIES} ${DBUS_LIBRARY} diff --git a/PluginCommandInterfaceDbus/include/DBusCommandSender.h b/PluginCommandInterfaceDbus/include/DBusCommandSender.h index bcbeade..4e73c66 100644 --- a/PluginCommandInterfaceDbus/include/DBusCommandSender.h +++ b/PluginCommandInterfaceDbus/include/DBusCommandSender.h @@ -66,7 +66,8 @@ public: void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) ; void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) ; void cbSystemPropertyChanged(const am_SystemProperty_s& SystemProperty) ; - void cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) ; + void cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID) ; + uint16_t getInterfaceVersion() const; #ifdef UNIT_TEST friend class DbusCommandInterfaceBackdoor; diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp index fde72c0..1387779 100644 --- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp +++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp @@ -302,20 +302,27 @@ void DbusCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s & Syst mDBUSMessageHandler.sendMessage(); } - - -void DbusCommandSender::cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) +void am::DbusCommandSender::cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID) { - DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"),DLT_INT16(mainConnection),DLT_STRING("time"),DLT_INT16(time)); + DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"),DLT_INT16(mainConnectionID),DLT_STRING("time"),DLT_INT16(time)); mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("TimingInformationChanged")); - mDBUSMessageHandler.append((dbus_uint16_t)mainConnection); + mDBUSMessageHandler.append((dbus_uint16_t)mainConnectionID); mDBUSMessageHandler.append((dbus_int16_t)time); mDBUSMessageHandler.sendMessage(); } +uint16_t DbusCommandSender::getInterfaceVersion() const +{ + return (CommandSendVersion); +} + + + + + diff --git a/PluginCommandInterfaceDbus/test/MockInterfaces.h b/PluginCommandInterfaceDbus/test/MockInterfaces.h index 0a1004c..509ee5c 100644 --- a/PluginCommandInterfaceDbus/test/MockInterfaces.h +++ b/PluginCommandInterfaceDbus/test/MockInterfaces.h @@ -68,8 +68,10 @@ class MockCommandReceiveInterface : public CommandReceiveInterface { am_Error_e(DBusWrapper*& dbusConnectionWrapper)); MOCK_CONST_METHOD1(getSocketHandler, am_Error_e(SocketHandler*& socketHandler)); - + MOCK_CONST_METHOD0(getInterfaceVersion, + uint16_t()); }; + } // namespace am -- cgit v1.2.1